@inno_user/inno_clouds_lib 9.2.0 → 9.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- (function(L,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("vue-router"),require("pinia"),require("vue"),require("@vueuse/core"),require("motion-v")):typeof define=="function"&&define.amd?define(["exports","vue-router","pinia","vue","@vueuse/core","motion-v"],K):(L=typeof globalThis<"u"?globalThis:L||self,K(L.InnoCloudsLib={},L.VueRouter,L.Pinia,L.Vue,L.VueuseCore,L.motionV))})(this,function(L,K,F,e,we,_e){"use strict";var nm=Object.defineProperty;var Io=L=>{throw TypeError(L)};var rm=(L,K,F)=>K in L?nm(L,K,{enumerable:!0,configurable:!0,writable:!0,value:F}):L[K]=F;var te=(L,K,F)=>rm(L,typeof K!="symbol"?K+"":K,F),Bo=(L,K,F)=>K.has(L)||Io("Cannot "+F);var $e=(L,K,F)=>(Bo(L,K,"read from private field"),F?F.call(L):K.get(L)),tn=(L,K,F)=>K.has(L)?Io("Cannot add the same private member more than once"):K instanceof WeakSet?K.add(L):K.set(L,F),We=(L,K,F,e)=>(Bo(L,K,"write to private field"),e?e.call(L,F):K.set(L,F),F);var jn=(L,K,F,e)=>({set _(we){We(L,K,we,F)},get _(){return $e(L,K,e)}});var Ne,Je,st;function Ao(t){return t}const Mo=[];function Po(){return K.createRouter({history:K.createWebHistory(),routes:Mo})}const nn=(t,n)=>n.some(r=>t instanceof r);let Wn,Gn;function To(){return Wn||(Wn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ro(){return Gn||(Gn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const rn=new WeakMap,on=new WeakMap,Tt=new WeakMap;function $o(t){const n=new Promise((r,o)=>{const a=()=>{t.removeEventListener("success",i),t.removeEventListener("error",s)},i=()=>{r(Qe(t.result)),a()},s=()=>{o(t.error),a()};t.addEventListener("success",i),t.addEventListener("error",s)});return Tt.set(n,t),n}function Vo(t){if(rn.has(t))return;const n=new Promise((r,o)=>{const a=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",s),t.removeEventListener("abort",s)},i=()=>{r(),a()},s=()=>{o(t.error||new DOMException("AbortError","AbortError")),a()};t.addEventListener("complete",i),t.addEventListener("error",s),t.addEventListener("abort",s)});rn.set(t,n)}let an={get(t,n,r){if(t instanceof IDBTransaction){if(n==="done")return rn.get(t);if(n==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Qe(t[n])},set(t,n,r){return t[n]=r,!0},has(t,n){return t instanceof IDBTransaction&&(n==="done"||n==="store")?!0:n in t}};function Kn(t){an=t(an)}function Do(t){return Ro().includes(t)?function(...n){return t.apply(sn(this),n),Qe(this.request)}:function(...n){return Qe(t.apply(sn(this),n))}}function Oo(t){return typeof t=="function"?Do(t):(t instanceof IDBTransaction&&Vo(t),nn(t,To())?new Proxy(t,an):t)}function Qe(t){if(t instanceof IDBRequest)return $o(t);if(on.has(t))return on.get(t);const n=Oo(t);return n!==t&&(on.set(t,n),Tt.set(n,t)),n}const sn=t=>Tt.get(t);function zo(t,n,{blocked:r,upgrade:o,blocking:a,terminated:i}={}){const s=indexedDB.open(t,n),l=Qe(s);return o&&s.addEventListener("upgradeneeded",c=>{o(Qe(s.result),c.oldVersion,c.newVersion,Qe(s.transaction),c)}),r&&s.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),l.then(c=>{i&&c.addEventListener("close",()=>i()),a&&c.addEventListener("versionchange",d=>a(d.oldVersion,d.newVersion,d))}).catch(()=>{}),l}function Lo(t,{blocked:n}={}){const r=indexedDB.deleteDatabase(t);return n&&r.addEventListener("blocked",o=>n(o.oldVersion,o)),Qe(r).then(()=>{})}const Fo=["get","getKey","getAll","getAllKeys","count"],Ho=["put","add","delete","clear"],ln=new Map;function Zn(t,n){if(!(t instanceof IDBDatabase&&!(n in t)&&typeof n=="string"))return;if(ln.get(n))return ln.get(n);const r=n.replace(/FromIndex$/,""),o=n!==r,a=Ho.includes(r);if(!(r in(o?IDBIndex:IDBObjectStore).prototype)||!(a||Fo.includes(r)))return;const i=async function(s,...l){const c=this.transaction(s,a?"readwrite":"readonly");let d=c.store;return o&&(d=d.index(l.shift())),(await Promise.all([d[r](...l),a&&c.done]))[0]};return ln.set(n,i),i}Kn(t=>({...t,get:(n,r,o)=>Zn(n,r)||t.get(n,r,o),has:(n,r)=>!!Zn(n,r)||t.has(n,r)}));const Uo=["continue","continuePrimaryKey","advance"],Qn={},cn=new WeakMap,Jn=new WeakMap,qo={get(t,n){if(!Uo.includes(n))return t[n];let r=Qn[n];return r||(r=Qn[n]=function(...o){cn.set(this,Jn.get(this)[n](...o))}),r}};async function*jo(...t){let n=this;if(n instanceof IDBCursor||(n=await n.openCursor(...t)),!n)return;n=n;const r=new Proxy(n,qo);for(Jn.set(r,n),Tt.set(r,sn(n));n;)yield r,n=await(cn.get(r)||n.continue()),cn.delete(r)}function Yn(t,n){return n===Symbol.asyncIterator&&nn(t,[IDBIndex,IDBObjectStore,IDBCursor])||n==="iterate"&&nn(t,[IDBIndex,IDBObjectStore])}Kn(t=>({...t,get(n,r,o){return Yn(n,r)?jo:t.get(n,r,o)},has(n,r){return Yn(n,r)||t.has(n,r)}}));let it;async function et(){return it||(it=zo("data",1,{upgrade(t){t.objectStoreNames.contains("groups")||t.createObjectStore("groups",{keyPath:"id"}),t.objectStoreNames.contains("media")||t.createObjectStore("media",{keyPath:"id"}),t.objectStoreNames.contains("products")||t.createObjectStore("products",{keyPath:"id"})}})),it}async function dn(t){return(await et()).transaction("groups","readonly").objectStore("groups").get(t)}async function _t(t,n){const o=(await et()).transaction("groups","readwrite");await o.objectStore("groups").put({id:t,data:n,timestamp:Date.now()}),await o.done}async function Wo(t,n){const r=JSON.parse(JSON.stringify(e.toRaw(n.value)));await _t(t,r)}async function un(t,n){const o=(await et()).transaction("media","readwrite");await o.objectStore("media").put({id:t,blob:n,timestamp:Date.now()}),await o.done}async function lt(t){const a=await(await et()).transaction("media","readonly").objectStore("media").get(t);return a==null?void 0:a.blob}async function Go(t){const r=(await et()).transaction("products","readwrite"),o=r.objectStore("products"),a=t.id;await o.put({id:a,product:t,timestamp:Date.now()}),await r.done}async function Xn(t){const a=await(await et()).transaction("products","readonly").objectStore("products").get(t);return a==null?void 0:a.product}async function Ko(){if(it){const t=await it.catch(()=>null);t&&t.close(),it=void 0}try{await Lo("data",{blocked(){console.warn("Удаление заблокировано. открыты другие вкладки с сайтом.")}})}catch(t){console.error("Не удалось удалить базу: [lib, indexedDB]",t)}}function Rt(t){"@babel/helpers - typeof";return Rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Rt(t)}var Zo=/^\s+/,Qo=/\s+$/;function q(t,n){if(t=t||"",n=n||{},t instanceof q)return t;if(!(this instanceof q))return new q(t,n);var r=Jo(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}q.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),r,o,a,i,s,l;return r=n.r/255,o=n.g/255,a=n.b/255,r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),a<=.03928?l=a/12.92:l=Math.pow((a+.055)/1.055,2.4),.2126*i+.7152*s+.0722*l},setAlpha:function(n){return this._a=ar(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=tr(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=tr(this._r,this._g,this._b),r=Math.round(n.h*360),o=Math.round(n.s*100),a=Math.round(n.v*100);return this._a==1?"hsv("+r+", "+o+"%, "+a+"%)":"hsva("+r+", "+o+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var n=er(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=er(this._r,this._g,this._b),r=Math.round(n.h*360),o=Math.round(n.s*100),a=Math.round(n.l*100);return this._a==1?"hsl("+r+", "+o+"%, "+a+"%)":"hsla("+r+", "+o+"%, "+a+"%, "+this._roundA+")"},toHex:function(n){return nr(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return ta(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ce(this._r,255)*100)+"%",g:Math.round(ce(this._g,255)*100)+"%",b:Math.round(ce(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ce(this._r,255)*100)+"%, "+Math.round(ce(this._g,255)*100)+"%, "+Math.round(ce(this._b,255)*100)+"%)":"rgba("+Math.round(ce(this._r,255)*100)+"%, "+Math.round(ce(this._g,255)*100)+"%, "+Math.round(ce(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:ma[nr(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+rr(this._r,this._g,this._b,this._a),o=r,a=this._gradientType?"GradientType = 1, ":"";if(n){var i=q(n);o="#"+rr(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+r+",endColorstr="+o+")"},toString:function(n){var r=!!n;n=n||this._format;var o=!1,a=this._a<1&&this._a>=0,i=!r&&a&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return i?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(o=this.toRgbString()),n==="prgb"&&(o=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(o=this.toHexString()),n==="hex3"&&(o=this.toHexString(!0)),n==="hex4"&&(o=this.toHex8String(!0)),n==="hex8"&&(o=this.toHex8String()),n==="name"&&(o=this.toName()),n==="hsl"&&(o=this.toHslString()),n==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(n,r){var o=n.apply(null,[this].concat([].slice.call(r)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(aa,arguments)},brighten:function(){return this._applyModification(sa,arguments)},darken:function(){return this._applyModification(ia,arguments)},desaturate:function(){return this._applyModification(na,arguments)},saturate:function(){return this._applyModification(ra,arguments)},greyscale:function(){return this._applyModification(oa,arguments)},spin:function(){return this._applyModification(la,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(ua,arguments)},complement:function(){return this._applyCombination(ca,arguments)},monochromatic:function(){return this._applyCombination(fa,arguments)},splitcomplement:function(){return this._applyCombination(da,arguments)},triad:function(){return this._applyCombination(or,[3])},tetrad:function(){return this._applyCombination(or,[4])}},q.fromRatio=function(t,n){if(Rt(t)=="object"){var r={};for(var o in t)t.hasOwnProperty(o)&&(o==="a"?r[o]=t[o]:r[o]=gt(t[o]));t=r}return q(t,n)};function Jo(t){var n={r:0,g:0,b:0},r=1,o=null,a=null,i=null,s=!1,l=!1;return typeof t=="string"&&(t=ga(t)),Rt(t)=="object"&&(Ge(t.r)&&Ge(t.g)&&Ge(t.b)?(n=Yo(t.r,t.g,t.b),s=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Ge(t.h)&&Ge(t.s)&&Ge(t.v)?(o=gt(t.s),a=gt(t.v),n=ea(t.h,o,a),s=!0,l="hsv"):Ge(t.h)&&Ge(t.s)&&Ge(t.l)&&(o=gt(t.s),i=gt(t.l),n=Xo(t.h,o,i),s=!0,l="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=ar(r),{ok:s,format:t.format||l,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function Yo(t,n,r){return{r:ce(t,255)*255,g:ce(n,255)*255,b:ce(r,255)*255}}function er(t,n,r){t=ce(t,255),n=ce(n,255),r=ce(r,255);var o=Math.max(t,n,r),a=Math.min(t,n,r),i,s,l=(o+a)/2;if(o==a)i=s=0;else{var c=o-a;switch(s=l>.5?c/(2-o-a):c/(o+a),o){case t:i=(n-r)/c+(n<r?6:0);break;case n:i=(r-t)/c+2;break;case r:i=(t-n)/c+4;break}i/=6}return{h:i,s,l}}function Xo(t,n,r){var o,a,i;t=ce(t,360),n=ce(n,100),r=ce(r,100);function s(d,u,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?d+(u-d)*6*f:f<1/2?u:f<2/3?d+(u-d)*(2/3-f)*6:d}if(n===0)o=a=i=r;else{var l=r<.5?r*(1+n):r+n-r*n,c=2*r-l;o=s(c,l,t+1/3),a=s(c,l,t),i=s(c,l,t-1/3)}return{r:o*255,g:a*255,b:i*255}}function tr(t,n,r){t=ce(t,255),n=ce(n,255),r=ce(r,255);var o=Math.max(t,n,r),a=Math.min(t,n,r),i,s,l=o,c=o-a;if(s=o===0?0:c/o,o==a)i=0;else{switch(o){case t:i=(n-r)/c+(n<r?6:0);break;case n:i=(r-t)/c+2;break;case r:i=(t-n)/c+4;break}i/=6}return{h:i,s,v:l}}function ea(t,n,r){t=ce(t,360)*6,n=ce(n,100),r=ce(r,100);var o=Math.floor(t),a=t-o,i=r*(1-n),s=r*(1-a*n),l=r*(1-(1-a)*n),c=o%6,d=[r,s,i,i,l,r][c],u=[l,r,r,s,i,i][c],f=[i,i,l,r,r,s][c];return{r:d*255,g:u*255,b:f*255}}function nr(t,n,r,o){var a=[Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16)),Ve(Math.round(r).toString(16))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function ta(t,n,r,o,a){var i=[Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16)),Ve(Math.round(r).toString(16)),Ve(sr(o))];return a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function rr(t,n,r,o){var a=[Ve(sr(o)),Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16)),Ve(Math.round(r).toString(16))];return a.join("")}q.equals=function(t,n){return!t||!n?!1:q(t).toRgbString()==q(n).toRgbString()},q.random=function(){return q.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function na(t,n){n=n===0?0:n||10;var r=q(t).toHsl();return r.s-=n/100,r.s=$t(r.s),q(r)}function ra(t,n){n=n===0?0:n||10;var r=q(t).toHsl();return r.s+=n/100,r.s=$t(r.s),q(r)}function oa(t){return q(t).desaturate(100)}function aa(t,n){n=n===0?0:n||10;var r=q(t).toHsl();return r.l+=n/100,r.l=$t(r.l),q(r)}function sa(t,n){n=n===0?0:n||10;var r=q(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),q(r)}function ia(t,n){n=n===0?0:n||10;var r=q(t).toHsl();return r.l-=n/100,r.l=$t(r.l),q(r)}function la(t,n){var r=q(t).toHsl(),o=(r.h+n)%360;return r.h=o<0?360+o:o,q(r)}function ca(t){var n=q(t).toHsl();return n.h=(n.h+180)%360,q(n)}function or(t,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var r=q(t).toHsl(),o=[q(t)],a=360/n,i=1;i<n;i++)o.push(q({h:(r.h+i*a)%360,s:r.s,l:r.l}));return o}function da(t){var n=q(t).toHsl(),r=n.h;return[q(t),q({h:(r+72)%360,s:n.s,l:n.l}),q({h:(r+216)%360,s:n.s,l:n.l})]}function ua(t,n,r){n=n||6,r=r||30;var o=q(t).toHsl(),a=360/r,i=[q(t)];for(o.h=(o.h-(a*n>>1)+720)%360;--n;)o.h=(o.h+a)%360,i.push(q(o));return i}function fa(t,n){n=n||6;for(var r=q(t).toHsv(),o=r.h,a=r.s,i=r.v,s=[],l=1/n;n--;)s.push(q({h:o,s:a,v:i})),i=(i+l)%1;return s}q.mix=function(t,n,r){r=r===0?0:r||50;var o=q(t).toRgb(),a=q(n).toRgb(),i=r/100,s={r:(a.r-o.r)*i+o.r,g:(a.g-o.g)*i+o.g,b:(a.b-o.b)*i+o.b,a:(a.a-o.a)*i+o.a};return q(s)},q.readability=function(t,n){var r=q(t),o=q(n);return(Math.max(r.getLuminance(),o.getLuminance())+.05)/(Math.min(r.getLuminance(),o.getLuminance())+.05)},q.isReadable=function(t,n,r){var o=q.readability(t,n),a,i;switch(i=!1,a=ya(r),a.level+a.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7;break}return i},q.mostReadable=function(t,n,r){var o=null,a=0,i,s,l,c;r=r||{},s=r.includeFallbackColors,l=r.level,c=r.size;for(var d=0;d<n.length;d++)i=q.readability(t,n[d]),i>a&&(a=i,o=q(n[d]));return q.isReadable(t,o,{level:l,size:c})||!s?o:(r.includeFallbackColors=!1,q.mostReadable(t,["#fff","#000"],r))};var fn=q.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ma=q.hexNames=pa(fn);function pa(t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[t[r]]=r);return n}function ar(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ce(t,n){ha(t)&&(t="100%");var r=_a(t);return t=Math.min(n,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*n,10)/100),Math.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function $t(t){return Math.min(1,Math.max(0,t))}function xe(t){return parseInt(t,16)}function ha(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function _a(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Ve(t){return t.length==1?"0"+t:""+t}function gt(t){return t<=1&&(t=t*100+"%"),t}function sr(t){return Math.round(parseFloat(t)*255).toString(16)}function ir(t){return xe(t)/255}var De=function(){var t="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+t+")",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",a="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ge(t){return!!De.CSS_UNIT.exec(t)}function ga(t){t=t.replace(Zo,"").replace(Qo,"").toLowerCase();var n=!1;if(fn[t])t=fn[t],n=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=De.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=De.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=De.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=De.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=De.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=De.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=De.hex8.exec(t))?{r:xe(r[1]),g:xe(r[2]),b:xe(r[3]),a:ir(r[4]),format:n?"name":"hex8"}:(r=De.hex6.exec(t))?{r:xe(r[1]),g:xe(r[2]),b:xe(r[3]),format:n?"name":"hex"}:(r=De.hex4.exec(t))?{r:xe(r[1]+""+r[1]),g:xe(r[2]+""+r[2]),b:xe(r[3]+""+r[3]),a:ir(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=De.hex3.exec(t))?{r:xe(r[1]+""+r[1]),g:xe(r[2]+""+r[2]),b:xe(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function ya(t){var n,r;return t=t||{level:"AA",size:"small"},n=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}const Vt=F.defineStore("imageCache",()=>{const t=e.ref({});let n=!1;function r(c,d){const u=String(c);t.value[u]&&URL.revokeObjectURL(t.value[u]);const f=URL.createObjectURL(d);t.value[u]=f}async function o(c){if(!c){console.warn("initCacheSingle called with null/undefined id");return}const d=String(c);if(t.value[d])return;const u=await lt(d);u&&(await scheduler.yield(),r(d,u),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:d,blob:u}})))}function a(c){const{id:d,blob:u}=c.detail;d&&u&&r(d,u)}function i(){typeof window>"u"||n||(window.addEventListener("image-cached",a),n=!0)}function s(){typeof window>"u"||!n||(window.removeEventListener("image-cached",a),n=!1)}function l(){Object.values(t.value).forEach(URL.revokeObjectURL),t.value={}}return typeof window<"u"&&i(),{cache:t,initCacheSingle:o,updateCacheFromBlob:r,cleanup:l,setupEventListener:i,removeEventListener:s}}),ge=F.defineStore("themeLib",()=>{const t=Vt(),{initCacheSingle:n}=t,r=e.ref({id:"",created_at:null,logo:null,primary_color:null,accent_color:null,accent_light_color:null,accent_dark_color:null,bg_button_color:null,inactive_button_color:null,cards_color:null,text_color:null,nonworking_bg_color:null,retail_mode:null,splash_image_url:null,splash_video:null,splash_duration:0,splash_type:null,fallback_image:null,adult_disclaimer_text:null,adult_disclaimer_image:null,kiosk_banner:null,kiosk_preloader:null,organization:"",kiosk_qr_payment_timeout:null,gradientStyle:null,kiosk_inactivity_timeout:null,kiosk_show_loyalty_card_button:null,kiosk_show_loyalty_phone_input_button:null,cart_loyalty_button:{cart_loyalty_button_sticker:null,cart_loyalty_button_text:null},comments:null,show_nutrition_in_cart:null,apply_custom_size_picker_fonts:null,size_picker_unselected_font_size:null,size_picker_selected_font_size:null,hide_discounts_calculate_button:!1}),o=async i=>{if(!i)return;r.value={...i};const s=await lt("banner"),l=await lt("preloader"),c=await lt("defaultImage");s||a(i.kiosk_banner,"banner"),l||a(i.kiosk_preloader,"preloader"),c||a(i.fallback_image,"defaultImage"),document.documentElement.style.setProperty("--primaryColor",i.primary_color),document.documentElement.style.setProperty("--accentColor",i.accent_color),document.documentElement.style.setProperty("--accentLightColor",i.accent_light_color),document.documentElement.style.setProperty("--accentDarkColor",i.accent_dark_color),document.documentElement.style.setProperty("--bgButtonColor",i.bg_button_color),document.documentElement.style.setProperty("--inactiveButtonColor",i.inactive_button_color),document.documentElement.style.setProperty("--cardsColor",i.cards_color),document.documentElement.style.setProperty("--textColor",i.text_color),document.documentElement.style.setProperty("--nonworkingBgColor",i.nonworking_bg_color),i.apply_custom_size_picker_fonts&&i.size_picker_unselected_font_size&&i.size_picker_unselected_font_size>0&&document.documentElement.style.setProperty("--sizePickerUnselectedFontSize",`${i.size_picker_unselected_font_size}rem`),i.apply_custom_size_picker_fonts&&i.size_picker_selected_font_size&&i.size_picker_selected_font_size>0&&document.documentElement.style.setProperty("--sizePickerSelectedFontSize",`${i.size_picker_selected_font_size}rem`);const d=r.value.primary_color||"#F2F7FF",u=q(d).setAlpha(.7).toRgbString(),f=`linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`,m=`-webkit-linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`;return r.value.gradientStyle={background:f,backgroundColor:m},r.value},a=async(i,s)=>{if(i){const l=await fetch(i);if(!l.ok)throw new Error("Network error");const c=await l.blob();un(s,c),n(s)}};return{itemThemes:r,updateColor:o}}),ct=t=>{if(!t)return 0;if((t.price===0||t.price===null)&&t.sizes&&t.sizes.length>0){const n=t.sizes.find(r=>r.is_default===!0);return n?n.price:t.sizes.length>1&&t.sizes[1].price||t.sizes[0].price}return t.price};class yt extends Error{}yt.prototype.name="InvalidTokenError";function ba(t){return decodeURIComponent(atob(t).replace(/(.)/g,(n,r)=>{let o=r.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function wa(t){let n=t.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ba(n)}catch{return atob(n)}}function lr(t,n){if(typeof t!="string")throw new yt("Invalid token specified: must be a string");n||(n={});const r=n.header===!0?0:1,o=t.split(".")[r];if(typeof o!="string")throw new yt(`Invalid token specified: missing part #${r+1}`);let a;try{a=wa(o)}catch(i){throw new yt(`Invalid token specified: invalid base64 for part #${r+1} (${i.message})`)}try{return JSON.parse(a)}catch(i){throw new yt(`Invalid token specified: invalid json for part #${r+1} (${i.message})`)}}const Ca=(t,n)=>{if(typeof window<"u"){const r=localStorage.getItem(t);return r?JSON.parse(r):n}return n},ka=(t,n)=>{if(typeof window<"u"){const r=localStorage.getItem(t);if(r)try{return lr(JSON.parse(r))}catch(o){return console.error("Failed to decode JWT:",o),n}}return n},cr=(t,n,r="normal")=>{const o=e.ref(r==="jwt"?ka(t,n):Ca(t,n));return e.watchEffect(()=>{o.value===null||o.value===void 0?localStorage.removeItem(t):r!=="jwt"&&localStorage.setItem(t,JSON.stringify(o.value))}),o},dt=t=>{t.forEach(n=>{try{localStorage.removeItem(n)}catch(r){console.error(`Ошибка при удалении ключа "${n}":`,r)}})};class Sa{constructor(n,r={}){te(this,"url");te(this,"options");te(this,"ws");te(this,"reconnectInterval");te(this,"listeners");te(this,"isConnected");te(this,"heartbeat");te(this,"pingTimeout");te(this,"pingResponseTimeout");te(this,"signal");te(this,"_shouldReconnect",!0);this.url=n,this.options=r,this.ws=null,this.reconnectInterval=5e3,this.pingResponseTimeout=5e3,this.listeners=new Map,this.isConnected=e.ref(!1)}connect(){var r,o;if(this.ws&&this.ws.readyState===WebSocket.OPEN){console.warn("WebSocket already open");return}if(!this._shouldReconnect){console.warn("Reconnection disabled");return}const n=`${this.url}`;this.ws=new WebSocket(n),(r=this.options.signal)!=null&&r.aborted&&this.ws.close(),(o=this.options.signal)==null||o.addEventListener("abort",()=>this.close()),this.ws.onopen=()=>{console.warn("WebSocket connected"),this.isConnected.value=!0,this.emit("open"),this.heartbeat=setInterval(()=>this.sendPing(),3e5)},this.ws.onmessage=a=>{try{const i=JSON.parse(a.data);this.emit("message",i),i!=null&&i.type&&i.type!=="ping"&&clearTimeout(this.pingTimeout)}catch(i){console.error("Error parsing WebSocket message:",i)}},this.ws.onerror=a=>{console.error("WebSocket error:",a),this.emit("error",a),this.close(!0)},this.ws.onclose=()=>{this.isConnected.value=!1,console.warn("WebSocket closed"),this.emit("close"),clearInterval(this.heartbeat),clearTimeout(this.pingTimeout),this._shouldReconnect&&(console.log(`Reconnecting in ${this.reconnectInterval}ms...`),setTimeout(()=>this.connect(),this.reconnectInterval))}}sendPing(){var n;this.isConnected.value&&((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN?(this.ws.send(JSON.stringify({type:"ping"})),this.pingTimeout=setTimeout(()=>{console.warn("No pong received, reconnecting..."),this.close(!0),this.connect()},this.pingResponseTimeout)):console.warn("WebSocket not connected, cannot send ping")}send(n){var r;this.isConnected.value&&((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN?this.ws.send(JSON.stringify(n)):console.warn("WebSocket not connected")}close(n=!1){this.ws&&(this._shouldReconnect=!n,this.ws.close(),clearInterval(this.heartbeat),clearTimeout(this.pingTimeout),this.ws=null,this.listeners.clear())}on(n,r){this.listeners.has(n)||this.listeners.set(n,[]),this.listeners.get(n).push(r)}off(n,r){const o=this.listeners.get(n);o&&this.listeners.set(n,o.filter(a=>a!==r))}emit(n,r=null){const o=this.listeners.get(n);o&&o.forEach(a=>a(r))}getConnectionStatus(){return this.isConnected}}let Dt=new Map;function Ot(t,n={}){var o;if(Dt.has(t)){const a=Dt.get(t);if(a.isConnected.value&&((o=a.ws)==null?void 0:o.readyState)===WebSocket.OPEN)return a.listeners.clear(),a;a.close(!0),Dt.delete(t)}const r=new Sa(t,n);return Dt.set(t,r),r}const se=F.defineStore("mainLib",()=>{const t=e.ref(),n=e.ref(!1),r=e.ref(localStorage.getItem("kiosk_timeout")),o=e.ref(0),a=e.ref(!1),i=e.ref(sessionStorage.getItem("is_adult")==="true"),s=e.ref([]),l=e.ref([]),c=e.ref(),d=e.ref(""),u=e.ref(0),f=e.ref(!1),m=e.ref(!1),h=e.ref(!0),p=e.ref(localStorage.getItem("apiKey")===null),y=e.ref(!1),b=e.ref({textNotification:""}),w=e.ref([]);let g=null;const _=k=>{const I=`wss://${c.value.area}/ws/device/${k}/`;g=Ot(I);function O(){console.log("WebSocket connection opened")}function H(j){if(j.error)y.value=!0,b.value.textNotification=j.error,g==null||g.close(!0);else{if(!(j!=null&&j.params))return;typeof j.params.components.shift.is_ok!==null?h.value=j.params.components.shift.is_ok:h.value=!0}}function W(j){console.error("WebSocket error:",j),g.close(!0)}g.on("open",O),g.on("message",H),g.on("error",W),g.connect()},S=k=>{o.value=k,localStorage.setItem("kiosk_timeout",k)},M=k=>{n.value=k},V=e.ref(null),$=e.computed(()=>s.value.reduce((k,I)=>{let O=0,H=0;return I.group_modifiers&&(O=I.group_modifiers.reduce((W,j)=>j.modifiers?W+j.modifiers.reduce((G,ee)=>G+ee.old_price*ee.amount,0):0,0)*I.amount),I.modifiers&&(H=I.modifiers.reduce((W,j)=>W+j.old_price*j.amount,0)*I.amount),k+I.old_price*I.amount+O+H},0)),D=e.computed({get:()=>s.value.length===0?0:V.value&&V.value!==0?V.value:s.value.reduce((k,I)=>{const O=ct(I)*I.amount;let H=0,W=0;return I.group_modifiers&&(H=I.group_modifiers.reduce((j,G)=>G.modifiers?j+G.modifiers.reduce((ee,Y)=>ee+Y.price*Y.amount,0):0,0)*I.amount),I.modifiers&&(W=I.modifiers.reduce((j,G)=>j+G.price*G.amount,0)*I.amount),k+O+H+W},0),set(k){V.value=k}}),E=k=>{u.value=k,localStorage.removeItem("bonus"),cr("bonus",u.value)},N=k=>{dt(k)},P=k=>{k={...k,idSystem:crypto.randomUUID()};const I=T(k);s.value.push(I),R()},R=()=>{try{if(!s.value||s.value.length===0){localStorage.removeItem("cart");return}localStorage.setItem("cart",JSON.stringify(e.toRaw(s.value)))}catch(k){console.error("Failed to update cart in localStorage:",k)}},T=k=>e.reactive({...k,amount:k.amount??1,price:k.old_price,new_price:null,total_new_price:null,discounts:[],modifiers:(k.modifiers||[]).map(I=>e.reactive({...I,price:I.old_price,new_price:null,total_new_price:null})),group_modifiers:(k.group_modifiers||[]).map(I=>e.reactive({...I,modifiers:(I.modifiers||[]).map(O=>e.reactive({...O,price:O.old_price,new_price:null,total_new_price:null}))}))}),x=k=>{const I=s.value.find(O=>O.idSystem===k);I&&(I.amount+=1),R()},C=k=>{const I=s.value.find(O=>O.idSystem===k);I&&(I.amount>=1&&(I.amount-=1),R())},B=()=>{try{const k=localStorage.getItem("cart");if(k){const I=JSON.parse(k);s.value.splice(0,s.value.length,...I.map(T)),V.value=null}}catch(k){console.error("Failed to load cart from localStorage:",k)}};return B(),{cartProducts_lib:s,activeScrolling_lib:l,config_lib:c,totalPrice_lib:D,initialCartPrice_lib:$,is_notification_lib:y,notificationData_lib:b,xApiKey_lib:d,countBonus:u,toggleDrum:n,is_showApiKey:p,openApiKey:f,kiosk_timeout:r,kiosk_FirstTimeout:o,is_OpenLoyal:m,profile:t,is_18_above_content:a,is18Allowed:i,healthState:h,displayCards:w,removeFromLocalStorage:N,setKioskTimeout:S,setBonus:E,setStateDrum:M,addToCart:P,plusAmount:x,minusAmount:C,loadCart:B,deleteItemFromCart:k=>{if(k){const I=s.value.findIndex(O=>O.idSystem===k);if(I===-1)return;s.value.splice(I,1),R(),V.value=null}else s.value=[],R()},updateCartInLocalStorage:R,makeProductFullyReactive:T,checkHeartbeatApp:_}});function dr(t,n){return function(){return t.apply(n,arguments)}}const{toString:Ea}=Object.prototype,{getPrototypeOf:mn}=Object,{iterator:zt,toStringTag:ur}=Symbol,Lt=(t=>n=>{const r=Ea.call(n);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Oe=t=>(t=t.toLowerCase(),n=>Lt(n)===t),Ft=t=>n=>typeof n===t,{isArray:ut}=Array,ft=Ft("undefined");function bt(t){return t!==null&&!ft(t)&&t.constructor!==null&&!ft(t.constructor)&&ke(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const fr=Oe("ArrayBuffer");function Na(t){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(t):n=t&&t.buffer&&fr(t.buffer),n}const va=Ft("string"),ke=Ft("function"),mr=Ft("number"),wt=t=>t!==null&&typeof t=="object",Ia=t=>t===!0||t===!1,Ht=t=>{if(Lt(t)!=="object")return!1;const n=mn(t);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(ur in t)&&!(zt in t)},Ba=t=>{if(!wt(t)||bt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},xa=Oe("Date"),Aa=Oe("File"),Ma=Oe("Blob"),Pa=Oe("FileList"),Ta=t=>wt(t)&&ke(t.pipe),Ra=t=>{let n;return t&&(typeof FormData=="function"&&t instanceof FormData||ke(t.append)&&((n=Lt(t))==="formdata"||n==="object"&&ke(t.toString)&&t.toString()==="[object FormData]"))},$a=Oe("URLSearchParams"),[Va,Da,Oa,za]=["ReadableStream","Request","Response","Headers"].map(Oe),La=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ct(t,n,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let o,a;if(typeof t!="object"&&(t=[t]),ut(t))for(o=0,a=t.length;o<a;o++)n.call(null,t[o],o,t);else{if(bt(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let l;for(o=0;o<s;o++)l=i[o],n.call(null,t[l],l,t)}}function pr(t,n){if(bt(t))return null;n=n.toLowerCase();const r=Object.keys(t);let o=r.length,a;for(;o-- >0;)if(a=r[o],n===a.toLowerCase())return a;return null}const tt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hr=t=>!ft(t)&&t!==tt;function pn(){const{caseless:t,skipUndefined:n}=hr(this)&&this||{},r={},o=(a,i)=>{const s=t&&pr(r,i)||i;Ht(r[s])&&Ht(a)?r[s]=pn(r[s],a):Ht(a)?r[s]=pn({},a):ut(a)?r[s]=a.slice():(!n||!ft(a))&&(r[s]=a)};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&Ct(arguments[a],o);return r}const Fa=(t,n,r,{allOwnKeys:o}={})=>(Ct(n,(a,i)=>{r&&ke(a)?t[i]=dr(a,r):t[i]=a},{allOwnKeys:o}),t),Ha=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Ua=(t,n,r,o)=>{t.prototype=Object.create(n.prototype,o),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:n.prototype}),r&&Object.assign(t.prototype,r)},qa=(t,n,r,o)=>{let a,i,s;const l={};if(n=n||{},t==null)return n;do{for(a=Object.getOwnPropertyNames(t),i=a.length;i-- >0;)s=a[i],(!o||o(s,t,n))&&!l[s]&&(n[s]=t[s],l[s]=!0);t=r!==!1&&mn(t)}while(t&&(!r||r(t,n))&&t!==Object.prototype);return n},ja=(t,n,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=n.length;const o=t.indexOf(n,r);return o!==-1&&o===r},Wa=t=>{if(!t)return null;if(ut(t))return t;let n=t.length;if(!mr(n))return null;const r=new Array(n);for(;n-- >0;)r[n]=t[n];return r},Ga=(t=>n=>t&&n instanceof t)(typeof Uint8Array<"u"&&mn(Uint8Array)),Ka=(t,n)=>{const o=(t&&t[zt]).call(t);let a;for(;(a=o.next())&&!a.done;){const i=a.value;n.call(t,i[0],i[1])}},Za=(t,n)=>{let r;const o=[];for(;(r=t.exec(n))!==null;)o.push(r);return o},Qa=Oe("HTMLFormElement"),Ja=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,o,a){return o.toUpperCase()+a}),_r=(({hasOwnProperty:t})=>(n,r)=>t.call(n,r))(Object.prototype),Ya=Oe("RegExp"),gr=(t,n)=>{const r=Object.getOwnPropertyDescriptors(t),o={};Ct(r,(a,i)=>{let s;(s=n(a,i,t))!==!1&&(o[i]=s||a)}),Object.defineProperties(t,o)},Xa=t=>{gr(t,(n,r)=>{if(ke(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const o=t[r];if(ke(o)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},es=(t,n)=>{const r={},o=a=>{a.forEach(i=>{r[i]=!0})};return ut(t)?o(t):o(String(t).split(n)),r},ts=()=>{},ns=(t,n)=>t!=null&&Number.isFinite(t=+t)?t:n;function rs(t){return!!(t&&ke(t.append)&&t[ur]==="FormData"&&t[zt])}const os=t=>{const n=new Array(10),r=(o,a)=>{if(wt(o)){if(n.indexOf(o)>=0)return;if(bt(o))return o;if(!("toJSON"in o)){n[a]=o;const i=ut(o)?[]:{};return Ct(o,(s,l)=>{const c=r(s,a+1);!ft(c)&&(i[l]=c)}),n[a]=void 0,i}}return o};return r(t,0)},as=Oe("AsyncFunction"),ss=t=>t&&(wt(t)||ke(t))&&ke(t.then)&&ke(t.catch),yr=((t,n)=>t?setImmediate:n?((r,o)=>(tt.addEventListener("message",({source:a,data:i})=>{a===tt&&i===r&&o.length&&o.shift()()},!1),a=>{o.push(a),tt.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",ke(tt.postMessage)),is=typeof queueMicrotask<"u"?queueMicrotask.bind(tt):typeof process<"u"&&process.nextTick||yr,v={isArray:ut,isArrayBuffer:fr,isBuffer:bt,isFormData:Ra,isArrayBufferView:Na,isString:va,isNumber:mr,isBoolean:Ia,isObject:wt,isPlainObject:Ht,isEmptyObject:Ba,isReadableStream:Va,isRequest:Da,isResponse:Oa,isHeaders:za,isUndefined:ft,isDate:xa,isFile:Aa,isBlob:Ma,isRegExp:Ya,isFunction:ke,isStream:Ta,isURLSearchParams:$a,isTypedArray:Ga,isFileList:Pa,forEach:Ct,merge:pn,extend:Fa,trim:La,stripBOM:Ha,inherits:Ua,toFlatObject:qa,kindOf:Lt,kindOfTest:Oe,endsWith:ja,toArray:Wa,forEachEntry:Ka,matchAll:Za,isHTMLForm:Qa,hasOwnProperty:_r,hasOwnProp:_r,reduceDescriptors:gr,freezeMethods:Xa,toObjectSet:es,toCamelCase:Ja,noop:ts,toFiniteNumber:ns,findKey:pr,global:tt,isContextDefined:hr,isSpecCompliantForm:rs,toJSONObject:os,isAsyncFn:as,isThenable:ss,setImmediate:yr,asap:is,isIterable:t=>t!=null&&ke(t[zt])};function Q(t,n,r,o,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),a&&(this.response=a,this.status=a.status?a.status:null)}v.inherits(Q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:v.toJSONObject(this.config),code:this.code,status:this.status}}});const br=Q.prototype,wr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{wr[t]={value:t}}),Object.defineProperties(Q,wr),Object.defineProperty(br,"isAxiosError",{value:!0}),Q.from=(t,n,r,o,a,i)=>{const s=Object.create(br);v.toFlatObject(t,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=t&&t.message?t.message:"Error",c=n==null&&t?t.code:n;return Q.call(s,l,c,r,o,a),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",i&&Object.assign(s,i),s};const ls=null;function hn(t){return v.isPlainObject(t)||v.isArray(t)}function Cr(t){return v.endsWith(t,"[]")?t.slice(0,-2):t}function kr(t,n,r){return t?t.concat(n).map(function(a,i){return a=Cr(a),!r&&i?"["+a+"]":a}).join(r?".":""):n}function cs(t){return v.isArray(t)&&!t.some(hn)}const ds=v.toFlatObject(v,{},null,function(n){return/^is[A-Z]/.test(n)});function Ut(t,n,r){if(!v.isObject(t))throw new TypeError("target must be an object");n=n||new FormData,r=v.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!v.isUndefined(b[y])});const o=r.metaTokens,a=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&v.isSpecCompliantForm(n);if(!v.isFunction(a))throw new TypeError("visitor must be a function");function d(p){if(p===null)return"";if(v.isDate(p))return p.toISOString();if(v.isBoolean(p))return p.toString();if(!c&&v.isBlob(p))throw new Q("Blob is not supported. Use a Buffer instead.");return v.isArrayBuffer(p)||v.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,y,b){let w=p;if(p&&!b&&typeof p=="object"){if(v.endsWith(y,"{}"))y=o?y:y.slice(0,-2),p=JSON.stringify(p);else if(v.isArray(p)&&cs(p)||(v.isFileList(p)||v.endsWith(y,"[]"))&&(w=v.toArray(p)))return y=Cr(y),w.forEach(function(_,S){!(v.isUndefined(_)||_===null)&&n.append(s===!0?kr([y],S,i):s===null?y:y+"[]",d(_))}),!1}return hn(p)?!0:(n.append(kr(b,y,i),d(p)),!1)}const f=[],m=Object.assign(ds,{defaultVisitor:u,convertValue:d,isVisitable:hn});function h(p,y){if(!v.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(p),v.forEach(p,function(w,g){(!(v.isUndefined(w)||w===null)&&a.call(n,w,v.isString(g)?g.trim():g,y,m))===!0&&h(w,y?y.concat(g):[g])}),f.pop()}}if(!v.isObject(t))throw new TypeError("data must be an object");return h(t),n}function Sr(t){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(o){return n[o]})}function _n(t,n){this._pairs=[],t&&Ut(t,this,n)}const Er=_n.prototype;Er.append=function(n,r){this._pairs.push([n,r])},Er.toString=function(n){const r=n?function(o){return n.call(this,o,Sr)}:Sr;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function us(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Nr(t,n,r){if(!n)return t;const o=r&&r.encode||us;v.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let i;if(a?i=a(n,r):i=v.isURLSearchParams(n)?n.toString():new _n(n,r).toString(o),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class vr{constructor(){this.handlers=[]}use(n,r,o){return this.handlers.push({fulfilled:n,rejected:r,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){v.forEach(this.handlers,function(o){o!==null&&n(o)})}}const Ir={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fs={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:_n,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},gn=typeof window<"u"&&typeof document<"u",yn=typeof navigator=="object"&&navigator||void 0,ms=gn&&(!yn||["ReactNative","NativeScript","NS"].indexOf(yn.product)<0),ps=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hs=gn&&window.location.href||"http://localhost",ye={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:gn,hasStandardBrowserEnv:ms,hasStandardBrowserWebWorkerEnv:ps,navigator:yn,origin:hs},Symbol.toStringTag,{value:"Module"})),...fs};function _s(t,n){return Ut(t,new ye.classes.URLSearchParams,{visitor:function(r,o,a,i){return ye.isNode&&v.isBuffer(r)?(this.append(o,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...n})}function gs(t){return v.matchAll(/\w+|\[(\w*)]/g,t).map(n=>n[0]==="[]"?"":n[1]||n[0])}function ys(t){const n={},r=Object.keys(t);let o;const a=r.length;let i;for(o=0;o<a;o++)i=r[o],n[i]=t[i];return n}function Br(t){function n(r,o,a,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&v.isArray(a)?a.length:s,c?(v.hasOwnProp(a,s)?a[s]=[a[s],o]:a[s]=o,!l):((!a[s]||!v.isObject(a[s]))&&(a[s]=[]),n(r,o,a[s],i)&&v.isArray(a[s])&&(a[s]=ys(a[s])),!l)}if(v.isFormData(t)&&v.isFunction(t.entries)){const r={};return v.forEachEntry(t,(o,a)=>{n(gs(o),a,r,0)}),r}return null}function bs(t,n,r){if(v.isString(t))try{return(n||JSON.parse)(t),v.trim(t)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(t)}const kt={transitional:Ir,adapter:["xhr","http","fetch"],transformRequest:[function(n,r){const o=r.getContentType()||"",a=o.indexOf("application/json")>-1,i=v.isObject(n);if(i&&v.isHTMLForm(n)&&(n=new FormData(n)),v.isFormData(n))return a?JSON.stringify(Br(n)):n;if(v.isArrayBuffer(n)||v.isBuffer(n)||v.isStream(n)||v.isFile(n)||v.isBlob(n)||v.isReadableStream(n))return n;if(v.isArrayBufferView(n))return n.buffer;if(v.isURLSearchParams(n))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let l;if(i){if(o.indexOf("application/x-www-form-urlencoded")>-1)return _s(n,this.formSerializer).toString();if((l=v.isFileList(n))||o.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ut(l?{"files[]":n}:n,c&&new c,this.formSerializer)}}return i||a?(r.setContentType("application/json",!1),bs(n)):n}],transformResponse:[function(n){const r=this.transitional||kt.transitional,o=r&&r.forcedJSONParsing,a=this.responseType==="json";if(v.isResponse(n)||v.isReadableStream(n))return n;if(n&&v.isString(n)&&(o&&!this.responseType||a)){const s=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(n,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?Q.from(l,Q.ERR_BAD_RESPONSE,this,null,this.response):l}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};v.forEach(["delete","get","head","post","put","patch"],t=>{kt.headers[t]={}});const ws=v.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Cs=t=>{const n={};let r,o,a;return t&&t.split(`
1
+ (function(L,Z){typeof exports=="object"&&typeof module<"u"?Z(exports,require("vue-router"),require("pinia"),require("vue"),require("@vueuse/core"),require("motion-v")):typeof define=="function"&&define.amd?define(["exports","vue-router","pinia","vue","@vueuse/core","motion-v"],Z):(L=typeof globalThis<"u"?globalThis:L||self,Z(L.InnoCloudsLib={},L.VueRouter,L.Pinia,L.Vue,L.VueuseCore,L.motionV))})(this,function(L,Z,F,e,we,pe){"use strict";var om=Object.defineProperty;var Io=L=>{throw TypeError(L)};var am=(L,Z,F)=>Z in L?om(L,Z,{enumerable:!0,configurable:!0,writable:!0,value:F}):L[Z]=F;var te=(L,Z,F)=>am(L,typeof Z!="symbol"?Z+"":Z,F),Bo=(L,Z,F)=>Z.has(L)||Io("Cannot "+F);var $e=(L,Z,F)=>(Bo(L,Z,"read from private field"),F?F.call(L):Z.get(L)),tn=(L,Z,F)=>Z.has(L)?Io("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(L):Z.set(L,F),We=(L,Z,F,e)=>(Bo(L,Z,"write to private field"),e?e.call(L,F):Z.set(L,F),F);var jn=(L,Z,F,e)=>({set _(we){We(L,Z,we,F)},get _(){return $e(L,Z,e)}});var Ne,Je,st;function Ao(t){return t}const Mo=[];function Po(){return Z.createRouter({history:Z.createWebHistory(),routes:Mo})}const nn=(t,n)=>n.some(r=>t instanceof r);let Wn,Gn;function To(){return Wn||(Wn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ro(){return Gn||(Gn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const rn=new WeakMap,on=new WeakMap,Tt=new WeakMap;function $o(t){const n=new Promise((r,o)=>{const a=()=>{t.removeEventListener("success",i),t.removeEventListener("error",s)},i=()=>{r(Qe(t.result)),a()},s=()=>{o(t.error),a()};t.addEventListener("success",i),t.addEventListener("error",s)});return Tt.set(n,t),n}function Vo(t){if(rn.has(t))return;const n=new Promise((r,o)=>{const a=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",s),t.removeEventListener("abort",s)},i=()=>{r(),a()},s=()=>{o(t.error||new DOMException("AbortError","AbortError")),a()};t.addEventListener("complete",i),t.addEventListener("error",s),t.addEventListener("abort",s)});rn.set(t,n)}let an={get(t,n,r){if(t instanceof IDBTransaction){if(n==="done")return rn.get(t);if(n==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Qe(t[n])},set(t,n,r){return t[n]=r,!0},has(t,n){return t instanceof IDBTransaction&&(n==="done"||n==="store")?!0:n in t}};function Kn(t){an=t(an)}function Do(t){return Ro().includes(t)?function(...n){return t.apply(sn(this),n),Qe(this.request)}:function(...n){return Qe(t.apply(sn(this),n))}}function Oo(t){return typeof t=="function"?Do(t):(t instanceof IDBTransaction&&Vo(t),nn(t,To())?new Proxy(t,an):t)}function Qe(t){if(t instanceof IDBRequest)return $o(t);if(on.has(t))return on.get(t);const n=Oo(t);return n!==t&&(on.set(t,n),Tt.set(n,t)),n}const sn=t=>Tt.get(t);function zo(t,n,{blocked:r,upgrade:o,blocking:a,terminated:i}={}){const s=indexedDB.open(t,n),l=Qe(s);return o&&s.addEventListener("upgradeneeded",c=>{o(Qe(s.result),c.oldVersion,c.newVersion,Qe(s.transaction),c)}),r&&s.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),l.then(c=>{i&&c.addEventListener("close",()=>i()),a&&c.addEventListener("versionchange",d=>a(d.oldVersion,d.newVersion,d))}).catch(()=>{}),l}function Lo(t,{blocked:n}={}){const r=indexedDB.deleteDatabase(t);return n&&r.addEventListener("blocked",o=>n(o.oldVersion,o)),Qe(r).then(()=>{})}const Fo=["get","getKey","getAll","getAllKeys","count"],Ho=["put","add","delete","clear"],ln=new Map;function Zn(t,n){if(!(t instanceof IDBDatabase&&!(n in t)&&typeof n=="string"))return;if(ln.get(n))return ln.get(n);const r=n.replace(/FromIndex$/,""),o=n!==r,a=Ho.includes(r);if(!(r in(o?IDBIndex:IDBObjectStore).prototype)||!(a||Fo.includes(r)))return;const i=async function(s,...l){const c=this.transaction(s,a?"readwrite":"readonly");let d=c.store;return o&&(d=d.index(l.shift())),(await Promise.all([d[r](...l),a&&c.done]))[0]};return ln.set(n,i),i}Kn(t=>({...t,get:(n,r,o)=>Zn(n,r)||t.get(n,r,o),has:(n,r)=>!!Zn(n,r)||t.has(n,r)}));const Uo=["continue","continuePrimaryKey","advance"],Qn={},cn=new WeakMap,Jn=new WeakMap,qo={get(t,n){if(!Uo.includes(n))return t[n];let r=Qn[n];return r||(r=Qn[n]=function(...o){cn.set(this,Jn.get(this)[n](...o))}),r}};async function*jo(...t){let n=this;if(n instanceof IDBCursor||(n=await n.openCursor(...t)),!n)return;n=n;const r=new Proxy(n,qo);for(Jn.set(r,n),Tt.set(r,sn(n));n;)yield r,n=await(cn.get(r)||n.continue()),cn.delete(r)}function Yn(t,n){return n===Symbol.asyncIterator&&nn(t,[IDBIndex,IDBObjectStore,IDBCursor])||n==="iterate"&&nn(t,[IDBIndex,IDBObjectStore])}Kn(t=>({...t,get(n,r,o){return Yn(n,r)?jo:t.get(n,r,o)},has(n,r){return Yn(n,r)||t.has(n,r)}}));let it;async function et(){return it||(it=zo("data",1,{upgrade(t){t.objectStoreNames.contains("groups")||t.createObjectStore("groups",{keyPath:"id"}),t.objectStoreNames.contains("media")||t.createObjectStore("media",{keyPath:"id"}),t.objectStoreNames.contains("products")||t.createObjectStore("products",{keyPath:"id"})}})),it}async function dn(t){return(await et()).transaction("groups","readonly").objectStore("groups").get(t)}async function _t(t,n){const o=(await et()).transaction("groups","readwrite");await o.objectStore("groups").put({id:t,data:n,timestamp:Date.now()}),await o.done}async function Wo(t,n){const r=JSON.parse(JSON.stringify(e.toRaw(n.value)));await _t(t,r)}async function un(t,n){const o=(await et()).transaction("media","readwrite");await o.objectStore("media").put({id:t,blob:n,timestamp:Date.now()}),await o.done}async function lt(t){const a=await(await et()).transaction("media","readonly").objectStore("media").get(t);return a==null?void 0:a.blob}async function Go(t){const r=(await et()).transaction("products","readwrite"),o=r.objectStore("products"),a=t.id;await o.put({id:a,product:t,timestamp:Date.now()}),await r.done}async function Xn(t){const a=await(await et()).transaction("products","readonly").objectStore("products").get(t);return a==null?void 0:a.product}async function Ko(){if(it){const t=await it.catch(()=>null);t&&t.close(),it=void 0}try{await Lo("data",{blocked(){console.warn("Удаление заблокировано. открыты другие вкладки с сайтом.")}})}catch(t){console.error("Не удалось удалить базу: [lib, indexedDB]",t)}}function Rt(t){"@babel/helpers - typeof";return Rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Rt(t)}var Zo=/^\s+/,Qo=/\s+$/;function q(t,n){if(t=t||"",n=n||{},t instanceof q)return t;if(!(this instanceof q))return new q(t,n);var r=Jo(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}q.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),r,o,a,i,s,l;return r=n.r/255,o=n.g/255,a=n.b/255,r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),a<=.03928?l=a/12.92:l=Math.pow((a+.055)/1.055,2.4),.2126*i+.7152*s+.0722*l},setAlpha:function(n){return this._a=ar(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=tr(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=tr(this._r,this._g,this._b),r=Math.round(n.h*360),o=Math.round(n.s*100),a=Math.round(n.v*100);return this._a==1?"hsv("+r+", "+o+"%, "+a+"%)":"hsva("+r+", "+o+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var n=er(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=er(this._r,this._g,this._b),r=Math.round(n.h*360),o=Math.round(n.s*100),a=Math.round(n.l*100);return this._a==1?"hsl("+r+", "+o+"%, "+a+"%)":"hsla("+r+", "+o+"%, "+a+"%, "+this._roundA+")"},toHex:function(n){return nr(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return ta(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ce(this._r,255)*100)+"%",g:Math.round(ce(this._g,255)*100)+"%",b:Math.round(ce(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ce(this._r,255)*100)+"%, "+Math.round(ce(this._g,255)*100)+"%, "+Math.round(ce(this._b,255)*100)+"%)":"rgba("+Math.round(ce(this._r,255)*100)+"%, "+Math.round(ce(this._g,255)*100)+"%, "+Math.round(ce(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:ma[nr(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+rr(this._r,this._g,this._b,this._a),o=r,a=this._gradientType?"GradientType = 1, ":"";if(n){var i=q(n);o="#"+rr(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+r+",endColorstr="+o+")"},toString:function(n){var r=!!n;n=n||this._format;var o=!1,a=this._a<1&&this._a>=0,i=!r&&a&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return i?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(o=this.toRgbString()),n==="prgb"&&(o=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(o=this.toHexString()),n==="hex3"&&(o=this.toHexString(!0)),n==="hex4"&&(o=this.toHex8String(!0)),n==="hex8"&&(o=this.toHex8String()),n==="name"&&(o=this.toName()),n==="hsl"&&(o=this.toHslString()),n==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(n,r){var o=n.apply(null,[this].concat([].slice.call(r)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(aa,arguments)},brighten:function(){return this._applyModification(sa,arguments)},darken:function(){return this._applyModification(ia,arguments)},desaturate:function(){return this._applyModification(na,arguments)},saturate:function(){return this._applyModification(ra,arguments)},greyscale:function(){return this._applyModification(oa,arguments)},spin:function(){return this._applyModification(la,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(ua,arguments)},complement:function(){return this._applyCombination(ca,arguments)},monochromatic:function(){return this._applyCombination(fa,arguments)},splitcomplement:function(){return this._applyCombination(da,arguments)},triad:function(){return this._applyCombination(or,[3])},tetrad:function(){return this._applyCombination(or,[4])}},q.fromRatio=function(t,n){if(Rt(t)=="object"){var r={};for(var o in t)t.hasOwnProperty(o)&&(o==="a"?r[o]=t[o]:r[o]=gt(t[o]));t=r}return q(t,n)};function Jo(t){var n={r:0,g:0,b:0},r=1,o=null,a=null,i=null,s=!1,l=!1;return typeof t=="string"&&(t=ga(t)),Rt(t)=="object"&&(Ge(t.r)&&Ge(t.g)&&Ge(t.b)?(n=Yo(t.r,t.g,t.b),s=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Ge(t.h)&&Ge(t.s)&&Ge(t.v)?(o=gt(t.s),a=gt(t.v),n=ea(t.h,o,a),s=!0,l="hsv"):Ge(t.h)&&Ge(t.s)&&Ge(t.l)&&(o=gt(t.s),i=gt(t.l),n=Xo(t.h,o,i),s=!0,l="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=ar(r),{ok:s,format:t.format||l,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function Yo(t,n,r){return{r:ce(t,255)*255,g:ce(n,255)*255,b:ce(r,255)*255}}function er(t,n,r){t=ce(t,255),n=ce(n,255),r=ce(r,255);var o=Math.max(t,n,r),a=Math.min(t,n,r),i,s,l=(o+a)/2;if(o==a)i=s=0;else{var c=o-a;switch(s=l>.5?c/(2-o-a):c/(o+a),o){case t:i=(n-r)/c+(n<r?6:0);break;case n:i=(r-t)/c+2;break;case r:i=(t-n)/c+4;break}i/=6}return{h:i,s,l}}function Xo(t,n,r){var o,a,i;t=ce(t,360),n=ce(n,100),r=ce(r,100);function s(d,u,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?d+(u-d)*6*f:f<1/2?u:f<2/3?d+(u-d)*(2/3-f)*6:d}if(n===0)o=a=i=r;else{var l=r<.5?r*(1+n):r+n-r*n,c=2*r-l;o=s(c,l,t+1/3),a=s(c,l,t),i=s(c,l,t-1/3)}return{r:o*255,g:a*255,b:i*255}}function tr(t,n,r){t=ce(t,255),n=ce(n,255),r=ce(r,255);var o=Math.max(t,n,r),a=Math.min(t,n,r),i,s,l=o,c=o-a;if(s=o===0?0:c/o,o==a)i=0;else{switch(o){case t:i=(n-r)/c+(n<r?6:0);break;case n:i=(r-t)/c+2;break;case r:i=(t-n)/c+4;break}i/=6}return{h:i,s,v:l}}function ea(t,n,r){t=ce(t,360)*6,n=ce(n,100),r=ce(r,100);var o=Math.floor(t),a=t-o,i=r*(1-n),s=r*(1-a*n),l=r*(1-(1-a)*n),c=o%6,d=[r,s,i,i,l,r][c],u=[l,r,r,s,i,i][c],f=[i,i,l,r,r,s][c];return{r:d*255,g:u*255,b:f*255}}function nr(t,n,r,o){var a=[Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16)),Ve(Math.round(r).toString(16))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function ta(t,n,r,o,a){var i=[Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16)),Ve(Math.round(r).toString(16)),Ve(sr(o))];return a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function rr(t,n,r,o){var a=[Ve(sr(o)),Ve(Math.round(t).toString(16)),Ve(Math.round(n).toString(16)),Ve(Math.round(r).toString(16))];return a.join("")}q.equals=function(t,n){return!t||!n?!1:q(t).toRgbString()==q(n).toRgbString()},q.random=function(){return q.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function na(t,n){n=n===0?0:n||10;var r=q(t).toHsl();return r.s-=n/100,r.s=$t(r.s),q(r)}function ra(t,n){n=n===0?0:n||10;var r=q(t).toHsl();return r.s+=n/100,r.s=$t(r.s),q(r)}function oa(t){return q(t).desaturate(100)}function aa(t,n){n=n===0?0:n||10;var r=q(t).toHsl();return r.l+=n/100,r.l=$t(r.l),q(r)}function sa(t,n){n=n===0?0:n||10;var r=q(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),q(r)}function ia(t,n){n=n===0?0:n||10;var r=q(t).toHsl();return r.l-=n/100,r.l=$t(r.l),q(r)}function la(t,n){var r=q(t).toHsl(),o=(r.h+n)%360;return r.h=o<0?360+o:o,q(r)}function ca(t){var n=q(t).toHsl();return n.h=(n.h+180)%360,q(n)}function or(t,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var r=q(t).toHsl(),o=[q(t)],a=360/n,i=1;i<n;i++)o.push(q({h:(r.h+i*a)%360,s:r.s,l:r.l}));return o}function da(t){var n=q(t).toHsl(),r=n.h;return[q(t),q({h:(r+72)%360,s:n.s,l:n.l}),q({h:(r+216)%360,s:n.s,l:n.l})]}function ua(t,n,r){n=n||6,r=r||30;var o=q(t).toHsl(),a=360/r,i=[q(t)];for(o.h=(o.h-(a*n>>1)+720)%360;--n;)o.h=(o.h+a)%360,i.push(q(o));return i}function fa(t,n){n=n||6;for(var r=q(t).toHsv(),o=r.h,a=r.s,i=r.v,s=[],l=1/n;n--;)s.push(q({h:o,s:a,v:i})),i=(i+l)%1;return s}q.mix=function(t,n,r){r=r===0?0:r||50;var o=q(t).toRgb(),a=q(n).toRgb(),i=r/100,s={r:(a.r-o.r)*i+o.r,g:(a.g-o.g)*i+o.g,b:(a.b-o.b)*i+o.b,a:(a.a-o.a)*i+o.a};return q(s)},q.readability=function(t,n){var r=q(t),o=q(n);return(Math.max(r.getLuminance(),o.getLuminance())+.05)/(Math.min(r.getLuminance(),o.getLuminance())+.05)},q.isReadable=function(t,n,r){var o=q.readability(t,n),a,i;switch(i=!1,a=ya(r),a.level+a.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7;break}return i},q.mostReadable=function(t,n,r){var o=null,a=0,i,s,l,c;r=r||{},s=r.includeFallbackColors,l=r.level,c=r.size;for(var d=0;d<n.length;d++)i=q.readability(t,n[d]),i>a&&(a=i,o=q(n[d]));return q.isReadable(t,o,{level:l,size:c})||!s?o:(r.includeFallbackColors=!1,q.mostReadable(t,["#fff","#000"],r))};var fn=q.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ma=q.hexNames=pa(fn);function pa(t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[t[r]]=r);return n}function ar(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ce(t,n){ha(t)&&(t="100%");var r=_a(t);return t=Math.min(n,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*n,10)/100),Math.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function $t(t){return Math.min(1,Math.max(0,t))}function xe(t){return parseInt(t,16)}function ha(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function _a(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Ve(t){return t.length==1?"0"+t:""+t}function gt(t){return t<=1&&(t=t*100+"%"),t}function sr(t){return Math.round(parseFloat(t)*255).toString(16)}function ir(t){return xe(t)/255}var De=function(){var t="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+t+")",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",a="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ge(t){return!!De.CSS_UNIT.exec(t)}function ga(t){t=t.replace(Zo,"").replace(Qo,"").toLowerCase();var n=!1;if(fn[t])t=fn[t],n=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=De.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=De.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=De.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=De.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=De.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=De.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=De.hex8.exec(t))?{r:xe(r[1]),g:xe(r[2]),b:xe(r[3]),a:ir(r[4]),format:n?"name":"hex8"}:(r=De.hex6.exec(t))?{r:xe(r[1]),g:xe(r[2]),b:xe(r[3]),format:n?"name":"hex"}:(r=De.hex4.exec(t))?{r:xe(r[1]+""+r[1]),g:xe(r[2]+""+r[2]),b:xe(r[3]+""+r[3]),a:ir(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=De.hex3.exec(t))?{r:xe(r[1]+""+r[1]),g:xe(r[2]+""+r[2]),b:xe(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function ya(t){var n,r;return t=t||{level:"AA",size:"small"},n=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}const Vt=F.defineStore("imageCache",()=>{const t=e.ref({});let n=!1;function r(c,d){const u=String(c);t.value[u]&&URL.revokeObjectURL(t.value[u]);const f=URL.createObjectURL(d);t.value[u]=f}async function o(c){if(!c){console.warn("initCacheSingle called with null/undefined id");return}const d=String(c);if(t.value[d])return;const u=await lt(d);u&&(await scheduler.yield(),r(d,u),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:d,blob:u}})))}function a(c){const{id:d,blob:u}=c.detail;d&&u&&r(d,u)}function i(){typeof window>"u"||n||(window.addEventListener("image-cached",a),n=!0)}function s(){typeof window>"u"||!n||(window.removeEventListener("image-cached",a),n=!1)}function l(){Object.values(t.value).forEach(URL.revokeObjectURL),t.value={}}return typeof window<"u"&&i(),{cache:t,initCacheSingle:o,updateCacheFromBlob:r,cleanup:l,setupEventListener:i,removeEventListener:s}}),ge=F.defineStore("themeLib",()=>{const t=Vt(),{initCacheSingle:n}=t,r=e.ref({id:"",created_at:null,logo:null,primary_color:null,accent_color:null,accent_light_color:null,accent_dark_color:null,bg_button_color:null,bonuses_button_name:void 0,inactive_button_color:null,cards_color:null,text_color:null,nonworking_bg_color:null,retail_mode:null,splash_image_url:null,splash_video:null,splash_duration:0,splash_type:null,fallback_image:null,adult_disclaimer_text:null,adult_disclaimer_image:null,kiosk_banner:null,kiosk_preloader:null,organization:"",kiosk_qr_payment_timeout:null,gradientStyle:null,kiosk_inactivity_timeout:null,kiosk_show_loyalty_card_button:null,kiosk_show_loyalty_phone_input_button:null,cart_loyalty_button:{cart_loyalty_button_sticker:null,cart_loyalty_button_text:null},comments:null,show_nutrition_in_cart:null,apply_custom_size_picker_fonts:null,size_picker_unselected_font_size:null,size_picker_selected_font_size:null,hide_discounts_calculate_button:!1,kiosk_hide_manual_input_loyalty_card:null}),o=async i=>{if(!i)return;r.value={...i};const s=await lt("banner"),l=await lt("preloader"),c=await lt("defaultImage");s||a(i.kiosk_banner,"banner"),l||a(i.kiosk_preloader,"preloader"),c||a(i.fallback_image,"defaultImage"),document.documentElement.style.setProperty("--primaryColor",i.primary_color),document.documentElement.style.setProperty("--accentColor",i.accent_color),document.documentElement.style.setProperty("--accentLightColor",i.accent_light_color),document.documentElement.style.setProperty("--accentDarkColor",i.accent_dark_color),document.documentElement.style.setProperty("--bgButtonColor",i.bg_button_color),document.documentElement.style.setProperty("--inactiveButtonColor",i.inactive_button_color),document.documentElement.style.setProperty("--cardsColor",i.cards_color),document.documentElement.style.setProperty("--textColor",i.text_color),document.documentElement.style.setProperty("--nonworkingBgColor",i.nonworking_bg_color),i.apply_custom_size_picker_fonts&&i.size_picker_unselected_font_size&&i.size_picker_unselected_font_size>0&&document.documentElement.style.setProperty("--sizePickerUnselectedFontSize",`${i.size_picker_unselected_font_size}rem`),i.apply_custom_size_picker_fonts&&i.size_picker_selected_font_size&&i.size_picker_selected_font_size>0&&document.documentElement.style.setProperty("--sizePickerSelectedFontSize",`${i.size_picker_selected_font_size}rem`);const d=r.value.primary_color||"#F2F7FF",u=q(d).setAlpha(.7).toRgbString(),f=`linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`,m=`-webkit-linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`;return r.value.gradientStyle={background:f,backgroundColor:m},r.value},a=async(i,s)=>{if(i){const l=await fetch(i);if(!l.ok)throw new Error("Network error");const c=await l.blob();un(s,c),n(s)}};return{itemThemes:r,updateColor:o}}),ct=t=>{if(!t)return 0;if((t.price===0||t.price===null)&&t.sizes&&t.sizes.length>0){const n=t.sizes.find(r=>r.is_default===!0);return n?n.price:t.sizes.length>1&&t.sizes[1].price||t.sizes[0].price}return t.price};class yt extends Error{}yt.prototype.name="InvalidTokenError";function ba(t){return decodeURIComponent(atob(t).replace(/(.)/g,(n,r)=>{let o=r.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function wa(t){let n=t.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ba(n)}catch{return atob(n)}}function lr(t,n){if(typeof t!="string")throw new yt("Invalid token specified: must be a string");n||(n={});const r=n.header===!0?0:1,o=t.split(".")[r];if(typeof o!="string")throw new yt(`Invalid token specified: missing part #${r+1}`);let a;try{a=wa(o)}catch(i){throw new yt(`Invalid token specified: invalid base64 for part #${r+1} (${i.message})`)}try{return JSON.parse(a)}catch(i){throw new yt(`Invalid token specified: invalid json for part #${r+1} (${i.message})`)}}const Ca=(t,n)=>{if(typeof window<"u"){const r=localStorage.getItem(t);return r?JSON.parse(r):n}return n},ka=(t,n)=>{if(typeof window<"u"){const r=localStorage.getItem(t);if(r)try{return lr(JSON.parse(r))}catch(o){return console.error("Failed to decode JWT:",o),n}}return n},cr=(t,n,r="normal")=>{const o=e.ref(r==="jwt"?ka(t,n):Ca(t,n));return e.watchEffect(()=>{o.value===null||o.value===void 0?localStorage.removeItem(t):r!=="jwt"&&localStorage.setItem(t,JSON.stringify(o.value))}),o},dt=t=>{t.forEach(n=>{try{localStorage.removeItem(n)}catch(r){console.error(`Ошибка при удалении ключа "${n}":`,r)}})};class Sa{constructor(n,r={}){te(this,"url");te(this,"options");te(this,"ws");te(this,"reconnectInterval");te(this,"listeners");te(this,"isConnected");te(this,"heartbeat");te(this,"pingTimeout");te(this,"pingResponseTimeout");te(this,"signal");te(this,"_shouldReconnect",!0);this.url=n,this.options=r,this.ws=null,this.reconnectInterval=5e3,this.pingResponseTimeout=5e3,this.listeners=new Map,this.isConnected=e.ref(!1)}connect(){var r,o;if(this.ws&&this.ws.readyState===WebSocket.OPEN){console.warn("WebSocket already open");return}if(!this._shouldReconnect){console.warn("Reconnection disabled");return}const n=`${this.url}`;this.ws=new WebSocket(n),(r=this.options.signal)!=null&&r.aborted&&this.ws.close(),(o=this.options.signal)==null||o.addEventListener("abort",()=>this.close()),this.ws.onopen=()=>{console.warn("WebSocket connected"),this.isConnected.value=!0,this.emit("open"),this.heartbeat=setInterval(()=>this.sendPing(),3e5)},this.ws.onmessage=a=>{try{const i=JSON.parse(a.data);this.emit("message",i),i!=null&&i.type&&i.type!=="ping"&&clearTimeout(this.pingTimeout)}catch(i){console.error("Error parsing WebSocket message:",i)}},this.ws.onerror=a=>{console.error("WebSocket error:",a),this.emit("error",a),this.close(!0)},this.ws.onclose=()=>{this.isConnected.value=!1,console.warn("WebSocket closed"),this.emit("close"),clearInterval(this.heartbeat),clearTimeout(this.pingTimeout),this._shouldReconnect&&(console.log(`Reconnecting in ${this.reconnectInterval}ms...`),setTimeout(()=>this.connect(),this.reconnectInterval))}}sendPing(){var n;this.isConnected.value&&((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN?(this.ws.send(JSON.stringify({type:"ping"})),this.pingTimeout=setTimeout(()=>{console.warn("No pong received, reconnecting..."),this.close(!0),this.connect()},this.pingResponseTimeout)):console.warn("WebSocket not connected, cannot send ping")}send(n){var r;this.isConnected.value&&((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN?this.ws.send(JSON.stringify(n)):console.warn("WebSocket not connected")}close(n=!1){this.ws&&(this._shouldReconnect=!n,this.ws.close(),clearInterval(this.heartbeat),clearTimeout(this.pingTimeout),this.ws=null,this.listeners.clear())}on(n,r){this.listeners.has(n)||this.listeners.set(n,[]),this.listeners.get(n).push(r)}off(n,r){const o=this.listeners.get(n);o&&this.listeners.set(n,o.filter(a=>a!==r))}emit(n,r=null){const o=this.listeners.get(n);o&&o.forEach(a=>a(r))}getConnectionStatus(){return this.isConnected}}let Dt=new Map;function Ot(t,n={}){var o;if(Dt.has(t)){const a=Dt.get(t);if(a.isConnected.value&&((o=a.ws)==null?void 0:o.readyState)===WebSocket.OPEN)return a.listeners.clear(),a;a.close(!0),Dt.delete(t)}const r=new Sa(t,n);return Dt.set(t,r),r}const se=F.defineStore("mainLib",()=>{const t=e.ref(),n=e.ref(!1),r=e.ref(localStorage.getItem("kiosk_timeout")),o=e.ref(0),a=e.ref(!1),i=e.ref(sessionStorage.getItem("is_adult")==="true"),s=e.ref([]),l=e.ref([]),c=e.ref(),d=e.ref(""),u=e.ref(0),f=e.ref(!1),m=e.ref(!1),h=e.ref(!0),p=e.ref(localStorage.getItem("apiKey")===null),y=e.ref(!1),b=e.ref({textNotification:""}),w=e.ref([]);let g=null;const _=C=>{const I=`wss://${c.value.area}/ws/device/${C}/`;g=Ot(I);function O(){console.log("WebSocket connection opened")}function H(j){if(j.error)y.value=!0,b.value.textNotification=j.error,g==null||g.close(!0);else{if(!(j!=null&&j.params))return;typeof j.params.components.shift.is_ok!==null?h.value=j.params.components.shift.is_ok:h.value=!0}}function G(j){console.error("WebSocket error:",j),g.close(!0)}g.on("open",O),g.on("message",H),g.on("error",G),g.connect()},S=C=>{o.value=C,localStorage.setItem("kiosk_timeout",C)},P=C=>{n.value=C},V=e.ref(null),$=e.computed(()=>s.value.reduce((C,I)=>{let O=0,H=0;return I.group_modifiers&&(O=I.group_modifiers.reduce((G,j)=>j.modifiers?G+j.modifiers.reduce((K,ee)=>K+ee.old_price*ee.amount,0):0,0)*I.amount),I.modifiers&&(H=I.modifiers.reduce((G,j)=>G+j.old_price*j.amount,0)*I.amount),C+I.old_price*I.amount+O+H},0)),D=e.computed({get:()=>s.value.length===0?0:V.value&&V.value!==0?V.value:s.value.reduce((C,I)=>{const O=ct(I)*I.amount;let H=0,G=0;return I.group_modifiers&&(H=I.group_modifiers.reduce((j,K)=>K.modifiers?j+K.modifiers.reduce((ee,Y)=>ee+Y.price*Y.amount,0):0,0)*I.amount),I.modifiers&&(G=I.modifiers.reduce((j,K)=>j+K.price*K.amount,0)*I.amount),C+O+H+G},0),set(C){V.value=C}}),E=C=>{u.value=C,localStorage.removeItem("bonus"),cr("bonus",u.value)},N=C=>{dt(C)},M=C=>{C={...C,idSystem:crypto.randomUUID()};const I=T(C);s.value.push(I),R()},R=()=>{try{if(!s.value||s.value.length===0){localStorage.removeItem("cart");return}localStorage.setItem("cart",JSON.stringify(e.toRaw(s.value)))}catch(C){console.error("Failed to update cart in localStorage:",C)}},T=C=>e.reactive({...C,amount:C.amount??1,price:C.old_price,new_price:null,total_new_price:null,discounts:[],modifiers:(C.modifiers||[]).map(I=>e.reactive({...I,price:I.old_price,new_price:null,total_new_price:null})),group_modifiers:(C.group_modifiers||[]).map(I=>e.reactive({...I,modifiers:(I.modifiers||[]).map(O=>e.reactive({...O,price:O.old_price,new_price:null,total_new_price:null}))}))}),x=C=>{const I=s.value.find(O=>O.idSystem===C);I&&(I.amount+=1),R()},k=C=>{const I=s.value.find(O=>O.idSystem===C);I&&(I.amount>=1&&(I.amount-=1),R())},B=()=>{try{const C=localStorage.getItem("cart");if(C){const I=JSON.parse(C);s.value.splice(0,s.value.length,...I.map(T)),V.value=null}}catch(C){console.error("Failed to load cart from localStorage:",C)}};return B(),{cartProducts_lib:s,activeScrolling_lib:l,config_lib:c,totalPrice_lib:D,initialCartPrice_lib:$,is_notification_lib:y,notificationData_lib:b,xApiKey_lib:d,countBonus:u,toggleDrum:n,is_showApiKey:p,openApiKey:f,kiosk_timeout:r,kiosk_FirstTimeout:o,is_OpenLoyal:m,profile:t,is_18_above_content:a,is18Allowed:i,healthState:h,displayCards:w,removeFromLocalStorage:N,setKioskTimeout:S,setBonus:E,setStateDrum:P,addToCart:M,plusAmount:x,minusAmount:k,loadCart:B,deleteItemFromCart:C=>{if(C){const I=s.value.findIndex(O=>O.idSystem===C);if(I===-1)return;s.value.splice(I,1),R(),V.value=null}else s.value=[],R()},updateCartInLocalStorage:R,makeProductFullyReactive:T,checkHeartbeatApp:_}});function dr(t,n){return function(){return t.apply(n,arguments)}}const{toString:Ea}=Object.prototype,{getPrototypeOf:mn}=Object,{iterator:zt,toStringTag:ur}=Symbol,Lt=(t=>n=>{const r=Ea.call(n);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Oe=t=>(t=t.toLowerCase(),n=>Lt(n)===t),Ft=t=>n=>typeof n===t,{isArray:ut}=Array,ft=Ft("undefined");function bt(t){return t!==null&&!ft(t)&&t.constructor!==null&&!ft(t.constructor)&&ke(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const fr=Oe("ArrayBuffer");function Na(t){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(t):n=t&&t.buffer&&fr(t.buffer),n}const va=Ft("string"),ke=Ft("function"),mr=Ft("number"),wt=t=>t!==null&&typeof t=="object",Ia=t=>t===!0||t===!1,Ht=t=>{if(Lt(t)!=="object")return!1;const n=mn(t);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(ur in t)&&!(zt in t)},Ba=t=>{if(!wt(t)||bt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},xa=Oe("Date"),Aa=Oe("File"),Ma=Oe("Blob"),Pa=Oe("FileList"),Ta=t=>wt(t)&&ke(t.pipe),Ra=t=>{let n;return t&&(typeof FormData=="function"&&t instanceof FormData||ke(t.append)&&((n=Lt(t))==="formdata"||n==="object"&&ke(t.toString)&&t.toString()==="[object FormData]"))},$a=Oe("URLSearchParams"),[Va,Da,Oa,za]=["ReadableStream","Request","Response","Headers"].map(Oe),La=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ct(t,n,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let o,a;if(typeof t!="object"&&(t=[t]),ut(t))for(o=0,a=t.length;o<a;o++)n.call(null,t[o],o,t);else{if(bt(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let l;for(o=0;o<s;o++)l=i[o],n.call(null,t[l],l,t)}}function pr(t,n){if(bt(t))return null;n=n.toLowerCase();const r=Object.keys(t);let o=r.length,a;for(;o-- >0;)if(a=r[o],n===a.toLowerCase())return a;return null}const tt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hr=t=>!ft(t)&&t!==tt;function pn(){const{caseless:t,skipUndefined:n}=hr(this)&&this||{},r={},o=(a,i)=>{const s=t&&pr(r,i)||i;Ht(r[s])&&Ht(a)?r[s]=pn(r[s],a):Ht(a)?r[s]=pn({},a):ut(a)?r[s]=a.slice():(!n||!ft(a))&&(r[s]=a)};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&Ct(arguments[a],o);return r}const Fa=(t,n,r,{allOwnKeys:o}={})=>(Ct(n,(a,i)=>{r&&ke(a)?t[i]=dr(a,r):t[i]=a},{allOwnKeys:o}),t),Ha=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Ua=(t,n,r,o)=>{t.prototype=Object.create(n.prototype,o),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:n.prototype}),r&&Object.assign(t.prototype,r)},qa=(t,n,r,o)=>{let a,i,s;const l={};if(n=n||{},t==null)return n;do{for(a=Object.getOwnPropertyNames(t),i=a.length;i-- >0;)s=a[i],(!o||o(s,t,n))&&!l[s]&&(n[s]=t[s],l[s]=!0);t=r!==!1&&mn(t)}while(t&&(!r||r(t,n))&&t!==Object.prototype);return n},ja=(t,n,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=n.length;const o=t.indexOf(n,r);return o!==-1&&o===r},Wa=t=>{if(!t)return null;if(ut(t))return t;let n=t.length;if(!mr(n))return null;const r=new Array(n);for(;n-- >0;)r[n]=t[n];return r},Ga=(t=>n=>t&&n instanceof t)(typeof Uint8Array<"u"&&mn(Uint8Array)),Ka=(t,n)=>{const o=(t&&t[zt]).call(t);let a;for(;(a=o.next())&&!a.done;){const i=a.value;n.call(t,i[0],i[1])}},Za=(t,n)=>{let r;const o=[];for(;(r=t.exec(n))!==null;)o.push(r);return o},Qa=Oe("HTMLFormElement"),Ja=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,o,a){return o.toUpperCase()+a}),_r=(({hasOwnProperty:t})=>(n,r)=>t.call(n,r))(Object.prototype),Ya=Oe("RegExp"),gr=(t,n)=>{const r=Object.getOwnPropertyDescriptors(t),o={};Ct(r,(a,i)=>{let s;(s=n(a,i,t))!==!1&&(o[i]=s||a)}),Object.defineProperties(t,o)},Xa=t=>{gr(t,(n,r)=>{if(ke(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const o=t[r];if(ke(o)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},es=(t,n)=>{const r={},o=a=>{a.forEach(i=>{r[i]=!0})};return ut(t)?o(t):o(String(t).split(n)),r},ts=()=>{},ns=(t,n)=>t!=null&&Number.isFinite(t=+t)?t:n;function rs(t){return!!(t&&ke(t.append)&&t[ur]==="FormData"&&t[zt])}const os=t=>{const n=new Array(10),r=(o,a)=>{if(wt(o)){if(n.indexOf(o)>=0)return;if(bt(o))return o;if(!("toJSON"in o)){n[a]=o;const i=ut(o)?[]:{};return Ct(o,(s,l)=>{const c=r(s,a+1);!ft(c)&&(i[l]=c)}),n[a]=void 0,i}}return o};return r(t,0)},as=Oe("AsyncFunction"),ss=t=>t&&(wt(t)||ke(t))&&ke(t.then)&&ke(t.catch),yr=((t,n)=>t?setImmediate:n?((r,o)=>(tt.addEventListener("message",({source:a,data:i})=>{a===tt&&i===r&&o.length&&o.shift()()},!1),a=>{o.push(a),tt.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",ke(tt.postMessage)),is=typeof queueMicrotask<"u"?queueMicrotask.bind(tt):typeof process<"u"&&process.nextTick||yr,v={isArray:ut,isArrayBuffer:fr,isBuffer:bt,isFormData:Ra,isArrayBufferView:Na,isString:va,isNumber:mr,isBoolean:Ia,isObject:wt,isPlainObject:Ht,isEmptyObject:Ba,isReadableStream:Va,isRequest:Da,isResponse:Oa,isHeaders:za,isUndefined:ft,isDate:xa,isFile:Aa,isBlob:Ma,isRegExp:Ya,isFunction:ke,isStream:Ta,isURLSearchParams:$a,isTypedArray:Ga,isFileList:Pa,forEach:Ct,merge:pn,extend:Fa,trim:La,stripBOM:Ha,inherits:Ua,toFlatObject:qa,kindOf:Lt,kindOfTest:Oe,endsWith:ja,toArray:Wa,forEachEntry:Ka,matchAll:Za,isHTMLForm:Qa,hasOwnProperty:_r,hasOwnProp:_r,reduceDescriptors:gr,freezeMethods:Xa,toObjectSet:es,toCamelCase:Ja,noop:ts,toFiniteNumber:ns,findKey:pr,global:tt,isContextDefined:hr,isSpecCompliantForm:rs,toJSONObject:os,isAsyncFn:as,isThenable:ss,setImmediate:yr,asap:is,isIterable:t=>t!=null&&ke(t[zt])};function Q(t,n,r,o,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),a&&(this.response=a,this.status=a.status?a.status:null)}v.inherits(Q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:v.toJSONObject(this.config),code:this.code,status:this.status}}});const br=Q.prototype,wr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{wr[t]={value:t}}),Object.defineProperties(Q,wr),Object.defineProperty(br,"isAxiosError",{value:!0}),Q.from=(t,n,r,o,a,i)=>{const s=Object.create(br);v.toFlatObject(t,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=t&&t.message?t.message:"Error",c=n==null&&t?t.code:n;return Q.call(s,l,c,r,o,a),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",i&&Object.assign(s,i),s};const ls=null;function hn(t){return v.isPlainObject(t)||v.isArray(t)}function Cr(t){return v.endsWith(t,"[]")?t.slice(0,-2):t}function kr(t,n,r){return t?t.concat(n).map(function(a,i){return a=Cr(a),!r&&i?"["+a+"]":a}).join(r?".":""):n}function cs(t){return v.isArray(t)&&!t.some(hn)}const ds=v.toFlatObject(v,{},null,function(n){return/^is[A-Z]/.test(n)});function Ut(t,n,r){if(!v.isObject(t))throw new TypeError("target must be an object");n=n||new FormData,r=v.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!v.isUndefined(b[y])});const o=r.metaTokens,a=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&v.isSpecCompliantForm(n);if(!v.isFunction(a))throw new TypeError("visitor must be a function");function d(p){if(p===null)return"";if(v.isDate(p))return p.toISOString();if(v.isBoolean(p))return p.toString();if(!c&&v.isBlob(p))throw new Q("Blob is not supported. Use a Buffer instead.");return v.isArrayBuffer(p)||v.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,y,b){let w=p;if(p&&!b&&typeof p=="object"){if(v.endsWith(y,"{}"))y=o?y:y.slice(0,-2),p=JSON.stringify(p);else if(v.isArray(p)&&cs(p)||(v.isFileList(p)||v.endsWith(y,"[]"))&&(w=v.toArray(p)))return y=Cr(y),w.forEach(function(_,S){!(v.isUndefined(_)||_===null)&&n.append(s===!0?kr([y],S,i):s===null?y:y+"[]",d(_))}),!1}return hn(p)?!0:(n.append(kr(b,y,i),d(p)),!1)}const f=[],m=Object.assign(ds,{defaultVisitor:u,convertValue:d,isVisitable:hn});function h(p,y){if(!v.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(p),v.forEach(p,function(w,g){(!(v.isUndefined(w)||w===null)&&a.call(n,w,v.isString(g)?g.trim():g,y,m))===!0&&h(w,y?y.concat(g):[g])}),f.pop()}}if(!v.isObject(t))throw new TypeError("data must be an object");return h(t),n}function Sr(t){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(o){return n[o]})}function _n(t,n){this._pairs=[],t&&Ut(t,this,n)}const Er=_n.prototype;Er.append=function(n,r){this._pairs.push([n,r])},Er.toString=function(n){const r=n?function(o){return n.call(this,o,Sr)}:Sr;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function us(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Nr(t,n,r){if(!n)return t;const o=r&&r.encode||us;v.isFunction(r)&&(r={serialize:r});const a=r&&r.serialize;let i;if(a?i=a(n,r):i=v.isURLSearchParams(n)?n.toString():new _n(n,r).toString(o),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class vr{constructor(){this.handlers=[]}use(n,r,o){return this.handlers.push({fulfilled:n,rejected:r,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){v.forEach(this.handlers,function(o){o!==null&&n(o)})}}const Ir={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fs={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:_n,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},gn=typeof window<"u"&&typeof document<"u",yn=typeof navigator=="object"&&navigator||void 0,ms=gn&&(!yn||["ReactNative","NativeScript","NS"].indexOf(yn.product)<0),ps=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hs=gn&&window.location.href||"http://localhost",ye={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:gn,hasStandardBrowserEnv:ms,hasStandardBrowserWebWorkerEnv:ps,navigator:yn,origin:hs},Symbol.toStringTag,{value:"Module"})),...fs};function _s(t,n){return Ut(t,new ye.classes.URLSearchParams,{visitor:function(r,o,a,i){return ye.isNode&&v.isBuffer(r)?(this.append(o,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...n})}function gs(t){return v.matchAll(/\w+|\[(\w*)]/g,t).map(n=>n[0]==="[]"?"":n[1]||n[0])}function ys(t){const n={},r=Object.keys(t);let o;const a=r.length;let i;for(o=0;o<a;o++)i=r[o],n[i]=t[i];return n}function Br(t){function n(r,o,a,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&v.isArray(a)?a.length:s,c?(v.hasOwnProp(a,s)?a[s]=[a[s],o]:a[s]=o,!l):((!a[s]||!v.isObject(a[s]))&&(a[s]=[]),n(r,o,a[s],i)&&v.isArray(a[s])&&(a[s]=ys(a[s])),!l)}if(v.isFormData(t)&&v.isFunction(t.entries)){const r={};return v.forEachEntry(t,(o,a)=>{n(gs(o),a,r,0)}),r}return null}function bs(t,n,r){if(v.isString(t))try{return(n||JSON.parse)(t),v.trim(t)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(t)}const kt={transitional:Ir,adapter:["xhr","http","fetch"],transformRequest:[function(n,r){const o=r.getContentType()||"",a=o.indexOf("application/json")>-1,i=v.isObject(n);if(i&&v.isHTMLForm(n)&&(n=new FormData(n)),v.isFormData(n))return a?JSON.stringify(Br(n)):n;if(v.isArrayBuffer(n)||v.isBuffer(n)||v.isStream(n)||v.isFile(n)||v.isBlob(n)||v.isReadableStream(n))return n;if(v.isArrayBufferView(n))return n.buffer;if(v.isURLSearchParams(n))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let l;if(i){if(o.indexOf("application/x-www-form-urlencoded")>-1)return _s(n,this.formSerializer).toString();if((l=v.isFileList(n))||o.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ut(l?{"files[]":n}:n,c&&new c,this.formSerializer)}}return i||a?(r.setContentType("application/json",!1),bs(n)):n}],transformResponse:[function(n){const r=this.transitional||kt.transitional,o=r&&r.forcedJSONParsing,a=this.responseType==="json";if(v.isResponse(n)||v.isReadableStream(n))return n;if(n&&v.isString(n)&&(o&&!this.responseType||a)){const s=!(r&&r.silentJSONParsing)&&a;try{return JSON.parse(n,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?Q.from(l,Q.ERR_BAD_RESPONSE,this,null,this.response):l}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};v.forEach(["delete","get","head","post","put","patch"],t=>{kt.headers[t]={}});const ws=v.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Cs=t=>{const n={};let r,o,a;return t&&t.split(`
2
2
  `).forEach(function(s){a=s.indexOf(":"),r=s.substring(0,a).trim().toLowerCase(),o=s.substring(a+1).trim(),!(!r||n[r]&&ws[r])&&(r==="set-cookie"?n[r]?n[r].push(o):n[r]=[o]:n[r]=n[r]?n[r]+", "+o:o)}),n},xr=Symbol("internals");function St(t){return t&&String(t).trim().toLowerCase()}function qt(t){return t===!1||t==null?t:v.isArray(t)?t.map(qt):String(t)}function ks(t){const n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=r.exec(t);)n[o[1]]=o[2];return n}const Ss=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function bn(t,n,r,o,a){if(v.isFunction(o))return o.call(this,n,r);if(a&&(n=r),!!v.isString(n)){if(v.isString(o))return n.indexOf(o)!==-1;if(v.isRegExp(o))return o.test(n)}}function Es(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,r,o)=>r.toUpperCase()+o)}function Ns(t,n){const r=v.toCamelCase(" "+n);["get","set","has"].forEach(o=>{Object.defineProperty(t,o+r,{value:function(a,i,s){return this[o].call(this,n,a,i,s)},configurable:!0})})}let Se=class{constructor(n){n&&this.set(n)}set(n,r,o){const a=this;function i(l,c,d){const u=St(c);if(!u)throw new Error("header name must be a non-empty string");const f=v.findKey(a,u);(!f||a[f]===void 0||d===!0||d===void 0&&a[f]!==!1)&&(a[f||c]=qt(l))}const s=(l,c)=>v.forEach(l,(d,u)=>i(d,u,c));if(v.isPlainObject(n)||n instanceof this.constructor)s(n,r);else if(v.isString(n)&&(n=n.trim())&&!Ss(n))s(Cs(n),r);else if(v.isObject(n)&&v.isIterable(n)){let l={},c,d;for(const u of n){if(!v.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?v.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else n!=null&&i(r,n,o);return this}get(n,r){if(n=St(n),n){const o=v.findKey(this,n);if(o){const a=this[o];if(!r)return a;if(r===!0)return ks(a);if(v.isFunction(r))return r.call(this,a,o);if(v.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,r){if(n=St(n),n){const o=v.findKey(this,n);return!!(o&&this[o]!==void 0&&(!r||bn(this,this[o],o,r)))}return!1}delete(n,r){const o=this;let a=!1;function i(s){if(s=St(s),s){const l=v.findKey(o,s);l&&(!r||bn(o,o[l],l,r))&&(delete o[l],a=!0)}}return v.isArray(n)?n.forEach(i):i(n),a}clear(n){const r=Object.keys(this);let o=r.length,a=!1;for(;o--;){const i=r[o];(!n||bn(this,this[i],i,n,!0))&&(delete this[i],a=!0)}return a}normalize(n){const r=this,o={};return v.forEach(this,(a,i)=>{const s=v.findKey(o,i);if(s){r[s]=qt(a),delete r[i];return}const l=n?Es(i):String(i).trim();l!==i&&delete r[i],r[l]=qt(a),o[l]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const r=Object.create(null);return v.forEach(this,(o,a)=>{o!=null&&o!==!1&&(r[a]=n&&v.isArray(o)?o.join(", "):o)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,r])=>n+": "+r).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...r){const o=new this(n);return r.forEach(a=>o.set(a)),o}static accessor(n){const o=(this[xr]=this[xr]={accessors:{}}).accessors,a=this.prototype;function i(s){const l=St(s);o[l]||(Ns(a,s),o[l]=!0)}return v.isArray(n)?n.forEach(i):i(n),this}};Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),v.reduceDescriptors(Se.prototype,({value:t},n)=>{let r=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(o){this[r]=o}}}),v.freezeMethods(Se);function wn(t,n){const r=this||kt,o=n||r,a=Se.from(o.headers);let i=o.data;return v.forEach(t,function(l){i=l.call(r,i,a.normalize(),n?n.status:void 0)}),a.normalize(),i}function Ar(t){return!!(t&&t.__CANCEL__)}function mt(t,n,r){Q.call(this,t??"canceled",Q.ERR_CANCELED,n,r),this.name="CanceledError"}v.inherits(mt,Q,{__CANCEL__:!0});function Mr(t,n,r){const o=r.config.validateStatus;!r.status||!o||o(r.status)?t(r):n(new Q("Request failed with status code "+r.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function vs(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function Is(t,n){t=t||10;const r=new Array(t),o=new Array(t);let a=0,i=0,s;return n=n!==void 0?n:1e3,function(c){const d=Date.now(),u=o[i];s||(s=d),r[a]=c,o[a]=d;let f=i,m=0;for(;f!==a;)m+=r[f++],f=f%t;if(a=(a+1)%t,a===i&&(i=(i+1)%t),d-s<n)return;const h=u&&d-u;return h?Math.round(m*1e3/h):void 0}}function Bs(t,n){let r=0,o=1e3/n,a,i;const s=(d,u=Date.now())=>{r=u,a=null,i&&(clearTimeout(i),i=null),t(...d)};return[(...d)=>{const u=Date.now(),f=u-r;f>=o?s(d,u):(a=d,i||(i=setTimeout(()=>{i=null,s(a)},o-f)))},()=>a&&s(a)]}const jt=(t,n,r=3)=>{let o=0;const a=Is(50,250);return Bs(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-o,d=a(c),u=s<=l;o=s;const f={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[n?"download":"upload"]:!0};t(f)},r)},Pr=(t,n)=>{const r=t!=null;return[o=>n[0]({lengthComputable:r,total:t,loaded:o}),n[1]]},Tr=t=>(...n)=>v.asap(()=>t(...n)),xs=ye.hasStandardBrowserEnv?((t,n)=>r=>(r=new URL(r,ye.origin),t.protocol===r.protocol&&t.host===r.host&&(n||t.port===r.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,As=ye.hasStandardBrowserEnv?{write(t,n,r,o,a,i,s){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(n)}`];v.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),v.isString(o)&&l.push(`path=${o}`),v.isString(a)&&l.push(`domain=${a}`),i===!0&&l.push("secure"),v.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if(typeof document>"u")return null;const n=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return n?decodeURIComponent(n[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ms(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ps(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function Rr(t,n,r){let o=!Ms(n);return t&&(o||r==!1)?Ps(t,n):n}const $r=t=>t instanceof Se?{...t}:t;function nt(t,n){n=n||{};const r={};function o(d,u,f,m){return v.isPlainObject(d)&&v.isPlainObject(u)?v.merge.call({caseless:m},d,u):v.isPlainObject(u)?v.merge({},u):v.isArray(u)?u.slice():u}function a(d,u,f,m){if(v.isUndefined(u)){if(!v.isUndefined(d))return o(void 0,d,f,m)}else return o(d,u,f,m)}function i(d,u){if(!v.isUndefined(u))return o(void 0,u)}function s(d,u){if(v.isUndefined(u)){if(!v.isUndefined(d))return o(void 0,d)}else return o(void 0,u)}function l(d,u,f){if(f in n)return o(d,u);if(f in t)return o(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,f)=>a($r(d),$r(u),f,!0)};return v.forEach(Object.keys({...t,...n}),function(u){const f=c[u]||a,m=f(t[u],n[u],u);v.isUndefined(m)&&f!==l||(r[u]=m)}),r}const Vr=t=>{const n=nt({},t);let{data:r,withXSRFToken:o,xsrfHeaderName:a,xsrfCookieName:i,headers:s,auth:l}=n;if(n.headers=s=Se.from(s),n.url=Nr(Rr(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),v.isFormData(r)){if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(v.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,f])=>{d.includes(u.toLowerCase())&&s.set(u,f)})}}if(ye.hasStandardBrowserEnv&&(o&&v.isFunction(o)&&(o=o(n)),o||o!==!1&&xs(n.url))){const c=a&&i&&As.read(i);c&&s.set(a,c)}return n},Ts=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,o){const a=Vr(t);let i=a.data;const s=Se.from(a.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=a,u,f,m,h,p;function y(){h&&h(),p&&p(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(a.method.toUpperCase(),a.url,!0),b.timeout=a.timeout;function w(){if(!b)return;const _=Se.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),M={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:_,config:t,request:b};Mr(function($){r($),y()},function($){o($),y()},M),b=null}"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(w)},b.onabort=function(){b&&(o(new Q("Request aborted",Q.ECONNABORTED,t,b)),b=null)},b.onerror=function(S){const M=S&&S.message?S.message:"Network Error",V=new Q(M,Q.ERR_NETWORK,t,b);V.event=S||null,o(V),b=null},b.ontimeout=function(){let S=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const M=a.transitional||Ir;a.timeoutErrorMessage&&(S=a.timeoutErrorMessage),o(new Q(S,M.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,t,b)),b=null},i===void 0&&s.setContentType(null),"setRequestHeader"in b&&v.forEach(s.toJSON(),function(S,M){b.setRequestHeader(M,S)}),v.isUndefined(a.withCredentials)||(b.withCredentials=!!a.withCredentials),l&&l!=="json"&&(b.responseType=a.responseType),d&&([m,p]=jt(d,!0),b.addEventListener("progress",m)),c&&b.upload&&([f,h]=jt(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",h)),(a.cancelToken||a.signal)&&(u=_=>{b&&(o(!_||_.type?new mt(null,t,b):_),b.abort(),b=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const g=vs(a.url);if(g&&ye.protocols.indexOf(g)===-1){o(new Q("Unsupported protocol "+g+":",Q.ERR_BAD_REQUEST,t));return}b.send(i||null)})},Rs=(t,n)=>{const{length:r}=t=t?t.filter(Boolean):[];if(n||r){let o=new AbortController,a;const i=function(d){if(!a){a=!0,l();const u=d instanceof Error?d:this.reason;o.abort(u instanceof Q?u:new mt(u instanceof Error?u.message:u))}};let s=n&&setTimeout(()=>{s=null,i(new Q(`timeout ${n} of ms exceeded`,Q.ETIMEDOUT))},n);const l=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),t=null)};t.forEach(d=>d.addEventListener("abort",i));const{signal:c}=o;return c.unsubscribe=()=>v.asap(l),c}},$s=function*(t,n){let r=t.byteLength;if(r<n){yield t;return}let o=0,a;for(;o<r;)a=o+n,yield t.slice(o,a),o=a},Vs=async function*(t,n){for await(const r of Ds(t))yield*$s(r,n)},Ds=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const n=t.getReader();try{for(;;){const{done:r,value:o}=await n.read();if(r)break;yield o}}finally{await n.cancel()}},Dr=(t,n,r,o)=>{const a=Vs(t,n);let i=0,s,l=c=>{s||(s=!0,o&&o(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await a.next();if(d){l(),c.close();return}let f=u.byteLength;if(r){let m=i+=f;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),a.return()}},{highWaterMark:2})},Or=64*1024,{isFunction:Wt}=v,Os=(({Request:t,Response:n})=>({Request:t,Response:n}))(v.global),{ReadableStream:zr,TextEncoder:Lr}=v.global,Fr=(t,...n)=>{try{return!!t(...n)}catch{return!1}},zs=t=>{t=v.merge.call({skipUndefined:!0},Os,t);const{fetch:n,Request:r,Response:o}=t,a=n?Wt(n):typeof fetch=="function",i=Wt(r),s=Wt(o);if(!a)return!1;const l=a&&Wt(zr),c=a&&(typeof Lr=="function"?(p=>y=>p.encode(y))(new Lr):async p=>new Uint8Array(await new r(p).arrayBuffer())),d=i&&l&&Fr(()=>{let p=!1;const y=new r(ye.origin,{body:new zr,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!y}),u=s&&l&&Fr(()=>v.isReadableStream(new o("").body)),f={stream:u&&(p=>p.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!f[p]&&(f[p]=(y,b)=>{let w=y&&y[p];if(w)return w.call(y);throw new Q(`Response type '${p}' is not supported`,Q.ERR_NOT_SUPPORT,b)})});const m=async p=>{if(p==null)return 0;if(v.isBlob(p))return p.size;if(v.isSpecCompliantForm(p))return(await new r(ye.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(v.isArrayBufferView(p)||v.isArrayBuffer(p))return p.byteLength;if(v.isURLSearchParams(p)&&(p=p+""),v.isString(p))return(await c(p)).byteLength},h=async(p,y)=>{const b=v.toFiniteNumber(p.getContentLength());return b??m(y)};return async p=>{let{url:y,method:b,data:w,signal:g,cancelToken:_,timeout:S,onDownloadProgress:M,onUploadProgress:V,responseType:$,headers:D,withCredentials:E="same-origin",fetchOptions:N}=Vr(p),P=n||fetch;$=$?($+"").toLowerCase():"text";let R=Rs([g,_&&_.toAbortSignal()],S),T=null;const x=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let C;try{if(V&&d&&b!=="get"&&b!=="head"&&(C=await h(D,w))!==0){let H=new r(y,{method:"POST",body:w,duplex:"half"}),W;if(v.isFormData(w)&&(W=H.headers.get("content-type"))&&D.setContentType(W),H.body){const[j,G]=Pr(C,jt(Tr(V)));w=Dr(H.body,Or,j,G)}}v.isString(E)||(E=E?"include":"omit");const B=i&&"credentials"in r.prototype,A={...N,signal:R,method:b.toUpperCase(),headers:D.normalize().toJSON(),body:w,duplex:"half",credentials:B?E:void 0};T=i&&new r(y,A);let k=await(i?P(T,N):P(y,A));const I=u&&($==="stream"||$==="response");if(u&&(M||I&&x)){const H={};["status","statusText","headers"].forEach(ee=>{H[ee]=k[ee]});const W=v.toFiniteNumber(k.headers.get("content-length")),[j,G]=M&&Pr(W,jt(Tr(M),!0))||[];k=new o(Dr(k.body,Or,j,()=>{G&&G(),x&&x()}),H)}$=$||"text";let O=await f[v.findKey(f,$)||"text"](k,p);return!I&&x&&x(),await new Promise((H,W)=>{Mr(H,W,{data:O,headers:Se.from(k.headers),status:k.status,statusText:k.statusText,config:p,request:T})})}catch(B){throw x&&x(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new Q("Network Error",Q.ERR_NETWORK,p,T),{cause:B.cause||B}):Q.from(B,B&&B.code,p,T)}}},Ls=new Map,Hr=t=>{let n=t&&t.env||{};const{fetch:r,Request:o,Response:a}=n,i=[o,a,r];let s=i.length,l=s,c,d,u=Ls;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:zs(n)),u=d;return d};Hr();const Cn={http:ls,xhr:Ts,fetch:{get:Hr}};v.forEach(Cn,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const Ur=t=>`- ${t}`,Fs=t=>v.isFunction(t)||t===null||t===!1;function Hs(t,n){t=v.isArray(t)?t:[t];const{length:r}=t;let o,a;const i={};for(let s=0;s<r;s++){o=t[s];let l;if(a=o,!Fs(o)&&(a=Cn[(l=String(o)).toLowerCase()],a===void 0))throw new Q(`Unknown adapter '${l}'`);if(a&&(v.isFunction(a)||(a=a.get(n))))break;i[l||"#"+s]=a}if(!a){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...r){const o=new this(n);return r.forEach(a=>o.set(a)),o}static accessor(n){const o=(this[xr]=this[xr]={accessors:{}}).accessors,a=this.prototype;function i(s){const l=St(s);o[l]||(Ns(a,s),o[l]=!0)}return v.isArray(n)?n.forEach(i):i(n),this}};Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),v.reduceDescriptors(Se.prototype,({value:t},n)=>{let r=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(o){this[r]=o}}}),v.freezeMethods(Se);function wn(t,n){const r=this||kt,o=n||r,a=Se.from(o.headers);let i=o.data;return v.forEach(t,function(l){i=l.call(r,i,a.normalize(),n?n.status:void 0)}),a.normalize(),i}function Ar(t){return!!(t&&t.__CANCEL__)}function mt(t,n,r){Q.call(this,t??"canceled",Q.ERR_CANCELED,n,r),this.name="CanceledError"}v.inherits(mt,Q,{__CANCEL__:!0});function Mr(t,n,r){const o=r.config.validateStatus;!r.status||!o||o(r.status)?t(r):n(new Q("Request failed with status code "+r.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function vs(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function Is(t,n){t=t||10;const r=new Array(t),o=new Array(t);let a=0,i=0,s;return n=n!==void 0?n:1e3,function(c){const d=Date.now(),u=o[i];s||(s=d),r[a]=c,o[a]=d;let f=i,m=0;for(;f!==a;)m+=r[f++],f=f%t;if(a=(a+1)%t,a===i&&(i=(i+1)%t),d-s<n)return;const h=u&&d-u;return h?Math.round(m*1e3/h):void 0}}function Bs(t,n){let r=0,o=1e3/n,a,i;const s=(d,u=Date.now())=>{r=u,a=null,i&&(clearTimeout(i),i=null),t(...d)};return[(...d)=>{const u=Date.now(),f=u-r;f>=o?s(d,u):(a=d,i||(i=setTimeout(()=>{i=null,s(a)},o-f)))},()=>a&&s(a)]}const jt=(t,n,r=3)=>{let o=0;const a=Is(50,250);return Bs(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-o,d=a(c),u=s<=l;o=s;const f={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[n?"download":"upload"]:!0};t(f)},r)},Pr=(t,n)=>{const r=t!=null;return[o=>n[0]({lengthComputable:r,total:t,loaded:o}),n[1]]},Tr=t=>(...n)=>v.asap(()=>t(...n)),xs=ye.hasStandardBrowserEnv?((t,n)=>r=>(r=new URL(r,ye.origin),t.protocol===r.protocol&&t.host===r.host&&(n||t.port===r.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,As=ye.hasStandardBrowserEnv?{write(t,n,r,o,a,i,s){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(n)}`];v.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),v.isString(o)&&l.push(`path=${o}`),v.isString(a)&&l.push(`domain=${a}`),i===!0&&l.push("secure"),v.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if(typeof document>"u")return null;const n=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return n?decodeURIComponent(n[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ms(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ps(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function Rr(t,n,r){let o=!Ms(n);return t&&(o||r==!1)?Ps(t,n):n}const $r=t=>t instanceof Se?{...t}:t;function nt(t,n){n=n||{};const r={};function o(d,u,f,m){return v.isPlainObject(d)&&v.isPlainObject(u)?v.merge.call({caseless:m},d,u):v.isPlainObject(u)?v.merge({},u):v.isArray(u)?u.slice():u}function a(d,u,f,m){if(v.isUndefined(u)){if(!v.isUndefined(d))return o(void 0,d,f,m)}else return o(d,u,f,m)}function i(d,u){if(!v.isUndefined(u))return o(void 0,u)}function s(d,u){if(v.isUndefined(u)){if(!v.isUndefined(d))return o(void 0,d)}else return o(void 0,u)}function l(d,u,f){if(f in n)return o(d,u);if(f in t)return o(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,f)=>a($r(d),$r(u),f,!0)};return v.forEach(Object.keys({...t,...n}),function(u){const f=c[u]||a,m=f(t[u],n[u],u);v.isUndefined(m)&&f!==l||(r[u]=m)}),r}const Vr=t=>{const n=nt({},t);let{data:r,withXSRFToken:o,xsrfHeaderName:a,xsrfCookieName:i,headers:s,auth:l}=n;if(n.headers=s=Se.from(s),n.url=Nr(Rr(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),v.isFormData(r)){if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(v.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,f])=>{d.includes(u.toLowerCase())&&s.set(u,f)})}}if(ye.hasStandardBrowserEnv&&(o&&v.isFunction(o)&&(o=o(n)),o||o!==!1&&xs(n.url))){const c=a&&i&&As.read(i);c&&s.set(a,c)}return n},Ts=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,o){const a=Vr(t);let i=a.data;const s=Se.from(a.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=a,u,f,m,h,p;function y(){h&&h(),p&&p(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(a.method.toUpperCase(),a.url,!0),b.timeout=a.timeout;function w(){if(!b)return;const _=Se.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),P={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:_,config:t,request:b};Mr(function($){r($),y()},function($){o($),y()},P),b=null}"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(w)},b.onabort=function(){b&&(o(new Q("Request aborted",Q.ECONNABORTED,t,b)),b=null)},b.onerror=function(S){const P=S&&S.message?S.message:"Network Error",V=new Q(P,Q.ERR_NETWORK,t,b);V.event=S||null,o(V),b=null},b.ontimeout=function(){let S=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const P=a.transitional||Ir;a.timeoutErrorMessage&&(S=a.timeoutErrorMessage),o(new Q(S,P.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,t,b)),b=null},i===void 0&&s.setContentType(null),"setRequestHeader"in b&&v.forEach(s.toJSON(),function(S,P){b.setRequestHeader(P,S)}),v.isUndefined(a.withCredentials)||(b.withCredentials=!!a.withCredentials),l&&l!=="json"&&(b.responseType=a.responseType),d&&([m,p]=jt(d,!0),b.addEventListener("progress",m)),c&&b.upload&&([f,h]=jt(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",h)),(a.cancelToken||a.signal)&&(u=_=>{b&&(o(!_||_.type?new mt(null,t,b):_),b.abort(),b=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const g=vs(a.url);if(g&&ye.protocols.indexOf(g)===-1){o(new Q("Unsupported protocol "+g+":",Q.ERR_BAD_REQUEST,t));return}b.send(i||null)})},Rs=(t,n)=>{const{length:r}=t=t?t.filter(Boolean):[];if(n||r){let o=new AbortController,a;const i=function(d){if(!a){a=!0,l();const u=d instanceof Error?d:this.reason;o.abort(u instanceof Q?u:new mt(u instanceof Error?u.message:u))}};let s=n&&setTimeout(()=>{s=null,i(new Q(`timeout ${n} of ms exceeded`,Q.ETIMEDOUT))},n);const l=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),t=null)};t.forEach(d=>d.addEventListener("abort",i));const{signal:c}=o;return c.unsubscribe=()=>v.asap(l),c}},$s=function*(t,n){let r=t.byteLength;if(r<n){yield t;return}let o=0,a;for(;o<r;)a=o+n,yield t.slice(o,a),o=a},Vs=async function*(t,n){for await(const r of Ds(t))yield*$s(r,n)},Ds=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const n=t.getReader();try{for(;;){const{done:r,value:o}=await n.read();if(r)break;yield o}}finally{await n.cancel()}},Dr=(t,n,r,o)=>{const a=Vs(t,n);let i=0,s,l=c=>{s||(s=!0,o&&o(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await a.next();if(d){l(),c.close();return}let f=u.byteLength;if(r){let m=i+=f;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),a.return()}},{highWaterMark:2})},Or=64*1024,{isFunction:Wt}=v,Os=(({Request:t,Response:n})=>({Request:t,Response:n}))(v.global),{ReadableStream:zr,TextEncoder:Lr}=v.global,Fr=(t,...n)=>{try{return!!t(...n)}catch{return!1}},zs=t=>{t=v.merge.call({skipUndefined:!0},Os,t);const{fetch:n,Request:r,Response:o}=t,a=n?Wt(n):typeof fetch=="function",i=Wt(r),s=Wt(o);if(!a)return!1;const l=a&&Wt(zr),c=a&&(typeof Lr=="function"?(p=>y=>p.encode(y))(new Lr):async p=>new Uint8Array(await new r(p).arrayBuffer())),d=i&&l&&Fr(()=>{let p=!1;const y=new r(ye.origin,{body:new zr,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!y}),u=s&&l&&Fr(()=>v.isReadableStream(new o("").body)),f={stream:u&&(p=>p.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!f[p]&&(f[p]=(y,b)=>{let w=y&&y[p];if(w)return w.call(y);throw new Q(`Response type '${p}' is not supported`,Q.ERR_NOT_SUPPORT,b)})});const m=async p=>{if(p==null)return 0;if(v.isBlob(p))return p.size;if(v.isSpecCompliantForm(p))return(await new r(ye.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(v.isArrayBufferView(p)||v.isArrayBuffer(p))return p.byteLength;if(v.isURLSearchParams(p)&&(p=p+""),v.isString(p))return(await c(p)).byteLength},h=async(p,y)=>{const b=v.toFiniteNumber(p.getContentLength());return b??m(y)};return async p=>{let{url:y,method:b,data:w,signal:g,cancelToken:_,timeout:S,onDownloadProgress:P,onUploadProgress:V,responseType:$,headers:D,withCredentials:E="same-origin",fetchOptions:N}=Vr(p),M=n||fetch;$=$?($+"").toLowerCase():"text";let R=Rs([g,_&&_.toAbortSignal()],S),T=null;const x=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let k;try{if(V&&d&&b!=="get"&&b!=="head"&&(k=await h(D,w))!==0){let H=new r(y,{method:"POST",body:w,duplex:"half"}),G;if(v.isFormData(w)&&(G=H.headers.get("content-type"))&&D.setContentType(G),H.body){const[j,K]=Pr(k,jt(Tr(V)));w=Dr(H.body,Or,j,K)}}v.isString(E)||(E=E?"include":"omit");const B=i&&"credentials"in r.prototype,A={...N,signal:R,method:b.toUpperCase(),headers:D.normalize().toJSON(),body:w,duplex:"half",credentials:B?E:void 0};T=i&&new r(y,A);let C=await(i?M(T,N):M(y,A));const I=u&&($==="stream"||$==="response");if(u&&(P||I&&x)){const H={};["status","statusText","headers"].forEach(ee=>{H[ee]=C[ee]});const G=v.toFiniteNumber(C.headers.get("content-length")),[j,K]=P&&Pr(G,jt(Tr(P),!0))||[];C=new o(Dr(C.body,Or,j,()=>{K&&K(),x&&x()}),H)}$=$||"text";let O=await f[v.findKey(f,$)||"text"](C,p);return!I&&x&&x(),await new Promise((H,G)=>{Mr(H,G,{data:O,headers:Se.from(C.headers),status:C.status,statusText:C.statusText,config:p,request:T})})}catch(B){throw x&&x(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new Q("Network Error",Q.ERR_NETWORK,p,T),{cause:B.cause||B}):Q.from(B,B&&B.code,p,T)}}},Ls=new Map,Hr=t=>{let n=t&&t.env||{};const{fetch:r,Request:o,Response:a}=n,i=[o,a,r];let s=i.length,l=s,c,d,u=Ls;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:zs(n)),u=d;return d};Hr();const Cn={http:ls,xhr:Ts,fetch:{get:Hr}};v.forEach(Cn,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const Ur=t=>`- ${t}`,Fs=t=>v.isFunction(t)||t===null||t===!1;function Hs(t,n){t=v.isArray(t)?t:[t];const{length:r}=t;let o,a;const i={};for(let s=0;s<r;s++){o=t[s];let l;if(a=o,!Fs(o)&&(a=Cn[(l=String(o)).toLowerCase()],a===void 0))throw new Q(`Unknown adapter '${l}'`);if(a&&(v.isFunction(a)||(a=a.get(n))))break;i[l||"#"+s]=a}if(!a){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
4
4
  `+s.map(Ur).join(`
5
5
  `):" "+Ur(s[0]):"as no adapter specified";throw new Q("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a}const qr={getAdapter:Hs,adapters:Cn};function kn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new mt(null,t)}function jr(t){return kn(t),t.headers=Se.from(t.headers),t.data=wn.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),qr.getAdapter(t.adapter||kt.adapter,t)(t).then(function(o){return kn(t),o.data=wn.call(t,t.transformResponse,o),o.headers=Se.from(o.headers),o},function(o){return Ar(o)||(kn(t),o&&o.response&&(o.response.data=wn.call(t,t.transformResponse,o.response),o.response.headers=Se.from(o.response.headers))),Promise.reject(o)})}const Wr="1.13.2",Gt={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{Gt[t]=function(o){return typeof o===t||"a"+(n<1?"n ":" ")+t}});const Gr={};Gt.transitional=function(n,r,o){function a(i,s){return"[Axios v"+Wr+"] Transitional option '"+i+"'"+s+(o?". "+o:"")}return(i,s,l)=>{if(n===!1)throw new Q(a(s," has been removed"+(r?" in "+r:"")),Q.ERR_DEPRECATED);return r&&!Gr[s]&&(Gr[s]=!0,console.warn(a(s," has been deprecated since v"+r+" and will be removed in the near future"))),n?n(i,s,l):!0}},Gt.spelling=function(n){return(r,o)=>(console.warn(`${o} is likely a misspelling of ${n}`),!0)};function Us(t,n,r){if(typeof t!="object")throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const o=Object.keys(t);let a=o.length;for(;a-- >0;){const i=o[a],s=n[i];if(s){const l=t[i],c=l===void 0||s(l,i,t);if(c!==!0)throw new Q("option "+i+" must be "+c,Q.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Q("Unknown option "+i,Q.ERR_BAD_OPTION)}}const Kt={assertOptions:Us,validators:Gt},He=Kt.validators;let rt=class{constructor(n){this.defaults=n||{},this.interceptors={request:new vr,response:new vr}}async request(n,r){try{return await this._request(n,r)}catch(o){if(o instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{o.stack?i&&!String(o.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(o.stack+=`
6
- `+i):o.stack=i}catch{}}throw o}}_request(n,r){typeof n=="string"?(r=r||{},r.url=n):r=n||{},r=nt(this.defaults,r);const{transitional:o,paramsSerializer:a,headers:i}=r;o!==void 0&&Kt.assertOptions(o,{silentJSONParsing:He.transitional(He.boolean),forcedJSONParsing:He.transitional(He.boolean),clarifyTimeoutError:He.transitional(He.boolean)},!1),a!=null&&(v.isFunction(a)?r.paramsSerializer={serialize:a}:Kt.assertOptions(a,{encode:He.function,serialize:He.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Kt.assertOptions(r,{baseUrl:He.spelling("baseURL"),withXsrfToken:He.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&v.merge(i.common,i[r.method]);i&&v.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=Se.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(c=c&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const d=[];this.interceptors.response.forEach(function(y){d.push(y.fulfilled,y.rejected)});let u,f=0,m;if(!c){const p=[jr.bind(this),void 0];for(p.unshift(...l),p.push(...d),m=p.length,u=Promise.resolve(r);f<m;)u=u.then(p[f++],p[f++]);return u}m=l.length;let h=r;for(;f<m;){const p=l[f++],y=l[f++];try{h=p(h)}catch(b){y.call(this,b);break}}try{u=jr.call(this,h)}catch(p){return Promise.reject(p)}for(f=0,m=d.length;f<m;)u=u.then(d[f++],d[f++]);return u}getUri(n){n=nt(this.defaults,n);const r=Rr(n.baseURL,n.url,n.allowAbsoluteUrls);return Nr(r,n.params,n.paramsSerializer)}};v.forEach(["delete","get","head","options"],function(n){rt.prototype[n]=function(r,o){return this.request(nt(o||{},{method:n,url:r,data:(o||{}).data}))}}),v.forEach(["post","put","patch"],function(n){function r(o){return function(i,s,l){return this.request(nt(l||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}rt.prototype[n]=r(),rt.prototype[n+"Form"]=r(!0)});let qs=class xo{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const o=this;this.promise.then(a=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](a);o._listeners=null}),this.promise.then=a=>{let i;const s=new Promise(l=>{o.subscribe(l),i=l}).then(a);return s.cancel=function(){o.unsubscribe(i)},s},n(function(i,s,l){o.reason||(o.reason=new mt(i,s,l),r(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const r=this._listeners.indexOf(n);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const n=new AbortController,r=o=>{n.abort(o)};return this.subscribe(r),n.signal.unsubscribe=()=>this.unsubscribe(r),n.signal}static source(){let n;return{token:new xo(function(a){n=a}),cancel:n}}};function js(t){return function(r){return t.apply(null,r)}}function Ws(t){return v.isObject(t)&&t.isAxiosError===!0}const Sn={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(Sn).forEach(([t,n])=>{Sn[n]=t});function Kr(t){const n=new rt(t),r=dr(rt.prototype.request,n);return v.extend(r,rt.prototype,n,{allOwnKeys:!0}),v.extend(r,n,null,{allOwnKeys:!0}),r.create=function(a){return Kr(nt(t,a))},r}const re=Kr(kt);re.Axios=rt,re.CanceledError=mt,re.CancelToken=qs,re.isCancel=Ar,re.VERSION=Wr,re.toFormData=Ut,re.AxiosError=Q,re.Cancel=re.CanceledError,re.all=function(n){return Promise.all(n)},re.spread=js,re.isAxiosError=Ws,re.mergeConfig=nt,re.AxiosHeaders=Se,re.formToJSON=t=>Br(v.isHTMLForm(t)?new FormData(t):t),re.getAdapter=qr.getAdapter,re.HttpStatusCode=Sn,re.default=re;const{Axios:dm,AxiosError:um,CanceledError:fm,isCancel:mm,CancelToken:pm,VERSION:hm,all:_m,Cancel:gm,isAxiosError:ym,spread:bm,toFormData:wm,AxiosHeaders:Cm,HttpStatusCode:km,formToJSON:Sm,getAdapter:Em,mergeConfig:Nm}=re;let Ue=null,be=null;function ze(t){t&&t.close(!0)}async function Et(t,n){const r=ue(),o=se(),a=qe.create();try{const i=await a.initPaymentLink(t,n);return r.paymentCostQR=o.totalPrice_lib-o.countBonus,r.linkQR=i.url,be==null||be.deleteCart(null,be==null?void 0:be.is_requestKiosk),i}catch(i){throw r.isButtonDisabled=!1,r.showNotification(i==null?void 0:i.response.data.user_friendly_message),i}}function Gs(t,n,r){if(t!=null&&t.params){if(t.error){n.showNotification(t.error),Te(n,null),Nn(n);return}r(t,n)}}function En(t,n){const r=ue(),o=se();return n.has_rms_discount?(t.params.new_discounts&&(r.extraDiscount=Number(t.params.new_total_cost)-n.initialCartPrice,o.totalPrice_lib=Number(t.params.new_total_cost),n.showNotification("К заказу были добавлены скидки")),!0):!1}const Te=(t,n)=>{t.updateOrderStatus&&t.updateOrderStatus(n)},Ks=t=>{t.loadCart&&t.loadCart()},Zt=t=>{t.resetBonuses&&t.resetBonuses()},Nn=t=>{t.closeWebSocket&&t.closeWebSocket()},Zr=(t,n)=>{t.is_tableservice&&(ze(n),t.resetStores(),t.deleteCart(null,t.is_requestKiosk),t.cartCleanup?t.cartCleanup.cleanupAndNavigate("profile",t.is_requestKiosk):t.deleteCart("profile",t.is_requestKiosk))},Qr=(t,n,r,o)=>{const a=n.ws||r;qe.create().orderPay(t.params.order_id||"").then(s=>{n.setOrderNumber&&n.setOrderNumber(s.data.order_number)}).catch(s=>{(n.errorHandler||o).handleOrderPayError(s,{...n,closeWebSocket:()=>ze(a)})})},vn=(t,n,r)=>{const o=t.ws||n;(t.errorHandler||r).handleOrderError({...t,closeWebSocket:()=>ze(o)})},Zs=(t,n,r)=>{const o=ue(),a=o.getCurrentPaymentMethodId();if(!a||!Ke.getConfig(a)||!Ke.isMethodAvailable(a,t))return null;const s=Ke.createHandler(a);if(!s)return null;const l=o.createPaymentHandler(t,n,r,a);return l?{handler:s,config:l.config}:null},Qs=t=>{if(!be)return;const n=be.context,r=be.is_requestKiosk,o=be.is_tableservice,a=Zs(n,r,o);if(!a){console.warn("handleWebSocketMessageWithDynamicHandler: не удалось получить handler");return}const{handler:i,config:s}=a,l={...s,...be};Gs(t,l,i.handleWebSocketStatus)};async function Js(t,n,r,o){var u,f;const{is_requestKiosk:a,is_tableservice:i}=r,{comment:s,is_authorized:l,signal:c}=o;r.setButtonDisabled(!0);const d=qe.create();try{const m=await d.createOrder(t,n,a,s,l,i,c);if((m==null?void 0:m.status)===201&&((u=m==null?void 0:m.data)!=null&&u.id)){const h=m.data.id,p={...r,signal:c};be=p;const b=`wss://${p.area||""}/ws/order/${h}/`;Ue=Ot(b,{signal:c});const w=()=>{console.warn("WebSocket connection opened (centralized mode)")},g=S=>{var M;console.error("WebSocket error (centralized mode):",S),ze(Ue),Ue=null,be=null,r.setButtonDisabled(!1),(M=r.errorHandler)==null||M.handlePaymentError(S,p)},_=S=>{Qs(S)};Ue.on("open",w),Ue.on("message",_),Ue.on("error",g),Ue.connect(),be.ws=Ue,be.closeWebSocket=()=>{ze(Ue),Ue=null,be=null}}return m}catch(m){throw re.isCancel(m)||((f=r.errorHandler)==null||f.handleCreateOrderError(m,r),r.setButtonDisabled(!1)),m}}const Jr=t=>{var n,r;return((r=(n=t==null?void 0:t.response)==null?void 0:n.data)==null?void 0:r.user_friendly_message)||null};function Qt(){const t=ue();return{handlePaymentError(n,r){var a,i,s,l,c,d;const o=Jr(n);Te(r,null),Ks(r),o?(r.showNotification(o),Nn(r),r.is_requestKiosk&&((i=r.orderErrors)!=null&&i.includes((a=n.response)==null?void 0:a.status))&&(r.cartCleanup?r.cartCleanup.cleanupAndNavigate("retryPage",r.is_requestKiosk):r.deleteCart("retryPage",r.is_requestKiosk)),r.is_tableservice?r.resetStores():(Zt(r),r.context==="qr"&&r.navigation?r.navigation.redirectToError():r.context==="qr"&&r.redirect&&(t.isButtonDisabled=!1,r.redirect(`/${((l=(s=r.route)==null?void 0:s.params)==null?void 0:l.orgId)||""}/errorPayment`)))):r.context==="qr"&&(Zt(r),r.navigation?r.navigation.redirectToError():r.redirect&&r.redirect(`/${((d=(c=r.route)==null?void 0:c.params)==null?void 0:d.orgId)||""}/errorPayment`)),t.isButtonDisabled=!1},handleOrderPayError(n,r){var a,i,s,l;const o=Jr(n);o&&(r.showNotification(o),Nn(r),r.is_requestKiosk?((i=r.orderErrors)!=null&&i.includes((a=n.response)==null?void 0:a.status)&&(r.cartCleanup.cleanupAndNavigate("retryPage",r.is_requestKiosk),r.deleteCart("retryPage",r.is_requestKiosk)),Te(r,null)):(Zt(r),r.navigation?r.navigation.redirectToError():r.redirect&&r.redirect(`/${((l=(s=r.route)==null?void 0:s.params)==null?void 0:l.orgId)||""}/errorPayment`),Te(r,null)))},handleOrderError(n){var r,o;n.is_requestKiosk?n.cartCleanup?n.cartCleanup.cleanupAndNavigate("retryPage",n.is_requestKiosk):n.deleteCart("retryPage",n.is_requestKiosk):n.is_tableservice?n.showNotification("Ошибка создания заказа. Пожалуйста, попробуйте еще раз"):(Zt(n),n.navigation?n.navigation.redirectToError():n.redirect&&(t.isButtonDisabled=!1,n.redirect(`/${((o=(r=n.route)==null?void 0:r.params)==null?void 0:o.orgId)||""}/errorPayment`)))},handleCreateOrderError(n,r){var s,l,c,d,u,f;const{is_requestKiosk:o,is_tableservice:a}=r,i=r.route.params.orgId;o?(((s=n==null?void 0:n.response)==null?void 0:s.status)===403&&((l=r.on403Kiosk)==null||l.call(r),(c=r.redirect)==null||c.call(r,`/${i}/retryPage`)),r.deleteCart("retryPage",o)):a?r.showNotification(((u=(d=n==null?void 0:n.response)==null?void 0:d.data)==null?void 0:u.user_friendly_message)||"Ошибка создания заказа"):(f=r.redirect)==null||f.call(r,`/${i}/errorPayment`)}}}const Ys=()=>{const t=ue();let n=null;const r=Qt(),o=(a,i)=>{var l,c;const s=(l=a.params)==null?void 0:l.status;if(s==="sent"){if(En(a,i)){t.isButtonDisabled=!1;return}Et(a.params.order_id||"",i.method).catch(d=>{const u=i.errorHandler||r,f=i.ws||n;u.handlePaymentError(d,{...i,closeWebSocket:()=>ze(f)})})}else if(s==="waiting_for_fiscalization")Te(i,1);else if(s==="payment_initiation_retry"||s==="fiscalized")Qr(a,i,n,r);else if(s==="payment_initiation")Te(i,2);else if(s==="paid"){Te(i,3);const d=i.ws||n;ze(d),localStorage.removeItem("cart")}else(c=i.orderErrors)!=null&&c.includes(s)&&vn(i,n,r)};return{handleWebSocketStatus(a,i){o(a,i)}}};function Xs(){const t=ue();let n=null;const r=Qt(),o=(a,i)=>{var l,c,d,u;const s=(l=a.params)==null?void 0:l.status;if((c=a.params)!=null&&c.number&&(t.orderNumber=(d=a.params)==null?void 0:d.number),s==="sent"){if(En(a,i)){t.isButtonDisabled=!1;return}Et(a.params.order_id||"",i.method).catch(f=>{const m=i.errorHandler||r,h=i.ws||n;m.handlePaymentError(f,{...i,closeWebSocket:()=>ze(h)})})}else if(s==="sent_fiscalization")Te(i,1);else if(s==="waiting_payment")Te(i,4);else if(s==="paid"){Te(i,3);const f=i.ws||n;ze(f),localStorage.removeItem("cart")}else(u=i.orderErrors)!=null&&u.includes(s)&&(t.isButtonDisabled=!1,vn(i,n,r))};return{handleWebSocketStatus(a,i){o(a,i)}}}const ei=()=>{const t=ue();let n=null;const r=Qt(),o=(a,i)=>{var l,c;const s=(l=a.params)==null?void 0:l.status;if(s==="sent"){if(En(a,i)){t.isButtonDisabled=!1;return}Et(a.params.order_id||"",i.method).then(d=>{if(i.is_tableservice){const u=i.ws||n;Zr(i,u)}else d.url&&window.location.replace(d.url)}).catch(d=>{const u=i.errorHandler||r,f=i.ws||n;u.handlePaymentError(d,{...i,closeWebSocket:()=>ze(f)})})}else if(s==="payment_initiation_retry"||s==="fiscalized")Qr(a,i,n,r);else if(s==="payment_initiation")Te(i,2);else if(s==="paid"){Te(i,3);const d=i.ws||n;ze(d),localStorage.removeItem("cart")}else(c=i.orderErrors)!=null&&c.includes(s)&&(t.isButtonDisabled=!1,vn(i,n,r))};return{handleWebSocketStatus(a,i){o(a,i)}}};class Ke{static initialize(){this.register({id:"TERMINAL_BASE",method:"TERMINAL",handlerFactory:Ys,availableContexts:["kiosk"]}),this.register({id:"YOOKASSA_BASE",method:"YOOKASSA",handlerFactory:ei,availableContexts:["qr","tableservice"]}),this.register({id:"SBP",method:"YOOKASSA",handlerFactory:Xs,availableContexts:["kiosk"]})}static register(n){this.methods.set(n.id,n)}static getConfig(n){return this.methods.get(n)??null}static getAvailableMethods(n){return Array.from(this.methods.entries()).filter(([r,o])=>o.availableContexts.includes(n)).map(([r])=>r)}static isMethodAvailable(n,r){const o=this.getConfig(n);return o?o.availableContexts.includes(r):!1}static createHandler(n){const r=this.getConfig(n);return r?r.handlerFactory():(console.warn(`PaymentMethodRegistry: метод оплаты ${n} не зарегистрирован`),null)}}te(Ke,"methods",new Map),Ke.initialize();function ti(t){return{cleanupAndNavigate(n,r){t.deleteCart(n,r)},cleanup(n){t.deleteCart(null,n)},clearTokens(){t.deleteCart(null,!0)},resetStores(){t.resetStores()}}}function ni(t){var r,o;const n=((o=(r=t.route)==null?void 0:r.params)==null?void 0:o.orgId)||"";return{redirectToError(){const a=`/${n}/errorPayment`;t.redirect?t.redirect(a):t.router&&t.router.push(a)},redirectToSuccess(a){const i=a?`/${n}/${a}`:`/${n}/profile`;t.redirect?t.redirect(i):t.router&&t.router.push(i)},redirect(a){t.redirect?t.redirect(a):t.router&&t.router.push(a)},getErrorPath(){return`/${n}/errorPayment`},getSuccessPath(){return`/${n}/profile`}}}const ue=F.defineStore("cartLib",()=>{const t=K.useRouter(),n=K.useRoute(),r=ge(),o=se(),{config_lib:a,countBonus:i,totalPrice_lib:s,initialCartPrice_lib:l,is18Allowed:c}=F.storeToRefs(o),{itemThemes:d}=F.storeToRefs(r),u=e.ref(!1),f=e.ref(""),m=e.ref(null),h=e.ref("wait"),p=e.ref(!1),y=e.ref(0),b=e.ref(""),w=e.ref([]),g=e.ref(),_=e.ref(0),S=e.ref(!1),M=e.ref(),V=e.ref(null),$=e.ref(["failed_payment","failed_after_paid","failed","failed_after_sent","failed_after_sent_fiscalization","payment_initiation_retry"]),D=e.ref("Оплатить"),E=e.ref(!1),N=e.ref(null),P=e.ref(0),R=e.ref(!1),T=e.ref({textNotification:""}),x=Y=>{R.value=!0,T.value.textNotification=Y},C=()=>{var Y,de;return(Y=g.value)!=null&&Y.front_type?g.value.front_type:((de=w.value[0])==null?void 0:de.front_type)||null},B=(Y,de,pe,he)=>{var ie;const ae=he??((ie=w.value[0])==null?void 0:ie.front_type);if(!ae)return console.warn("Не удалось определить метод оплаты"),null;const U=Ke.getConfig(ae);if(!U||!Ke.isMethodAvailable(ae,Y))return console.warn(`Метод ${ae} недоступен для контекста ${Y}`),null;const ne=Ke.createHandler(ae);return ne?(M.value=A(U.method,Y,de,pe),{handler:ne,config:M.value}):(console.warn(`Не удалось создать обработчик для метода ${ae}`),null)},A=(Y,de,pe,he)=>{const ae={method:Y,context:de,is_requestKiosk:pe,is_tableservice:he,router:t,route:n,orderErrors:$.value,area:a.value.area,has_rms_discount:a.value.has_rms_discount,totalPrice:s,initialCartPrice:l,showNotification:x,deleteCart:ee,resetStores:G,redirect:me=>t.push(me),updateOrderStatus:me=>{N.value=me},setOrderNumber:me=>{V.value=me},loadCart:()=>o.loadCart(),resetBonuses:()=>{i.value=0}},U=Qt(),ne=ti(ae),ie=ni(ae);return{...ae,errorHandler:U,cartCleanup:ne,navigation:ie}},k=e.computed(()=>!!m.value),I=Y=>{h.value=Y},O=Y=>{m.value=Y},H=()=>{d.value.kiosk_show_loyalty_card_button&&d.value.kiosk_show_loyalty_phone_input_button?u.value=!0:!d.value.kiosk_show_loyalty_card_button&&d.value.kiosk_show_loyalty_phone_input_button?o.is_OpenLoyal=!0:u.value=!0,h.value="wait",f.value=""},W=()=>{u.value=!1,h.value="wait",f.value=""},j=()=>{m.value=null,f.value="",h.value="wait",W()},G=()=>{E.value=!1,N.value=null},ee=(Y=null,de=!1)=>{o.cartProducts_lib=[],dt(["cart"]),de&&(dt(["authTokensAccess","authTokensRefresh","user"]),o.profile=null,sessionStorage.removeItem("is_adult"),c.value=!1),Y&&t.push(`/${n.params.orgId}/${Y}`)};return{isButtonDisabled:E,orderCompleted_lib:N,extraDiscount:y,orderNumber:V,is_notification_lib:R,notificationData_lib:T,textPaymentBtn_lib:D,count:P,guestInfo:m,error:f,isDrawerOpen:u,currentState:h,isAuthorized:k,discountBtn:p,linkQR:b,providerTypes:w,is_paymentCart:S,selectedProvider:g,configPayment:M,paymentCostQR:_,deleteCart:ee,setGuestInfo:O,setState:I,openDrawer:H,closeDrawer:W,clearCard:j,showNotification:x,createPaymentHandler:B,getCurrentPaymentMethodId:C,getAvailablePaymentMethods:Y=>Ke.getAvailableMethods(Y)}}),fe=F.defineStore("cardLib",()=>{const t=()=>({openCard:null,currentModifier:null,groupModifiers:[],groupModifiersSelected:[],groupCurrentOpen:null,isModifiedAmount:!1,selectedSize:{},productSizes:[],addedProducts:[],plusButtonsRefs:[],modalCount:1,isSectionModifier:!1,isAnimationFly:!0,textErrorRequaired:""}),n=e.ref(t()),r=()=>n.value=t(),o=e.ref(!1),a=e.ref(!1),i=e.ref(!1),s=e.ref(),l=e.ref([]),c=e.ref({id:null,visible:!1}),d=e.ref(!0),u=e.computed(()=>{const E=n.value.groupModifiersSelected.findIndex(N=>N.group===n.value.groupCurrentOpen.id);return f(E)}),f=E=>E===-1?0:(n.value.groupModifiersSelected[E].modifiers||[]).reduce((P,R)=>P+(R.amount||0),0),m=e.computed(()=>{var N;const E=(N=n.value.openCard)==null?void 0:N.group_modifiers.findIndex(P=>P.id===n.value.groupCurrentOpen.id);return E===-1||!n.value.openCard?0:n.value.openCard.modifiers.length>0&&E===0?n.value.openCard.modifiers.reduce((P,R)=>P+R.max_amount,0):n.value.groupModifiers[E].max_amount}),h=e.computed(()=>{var N;const E=(n.value.addedProducts??[]).reduce((P,R)=>P+R.price,0);if(n.value.openCard){const P=n.value.openCard,R=ct(P)||0,T=P.amount||1;return(n.value.groupModifiersSelected.reduce((C,B)=>(B.modifiers.forEach(A=>{var k,I;A.sizes&&(A.price=((I=(k=A.sizes)==null?void 0:k.find(O=>O.id===n.value.selectedSize.id))==null?void 0:I.price)??A.price),C+=A.price*A.amount}),C),0)+R)*T+E}return(N=n.value.addedProducts)!=null&&N.length?E:0}),p=e.computed(()=>{const E=n.value.groupModifiers,N=n.value.groupModifiersSelected;for(let P=0;P<E.length;P++){const R=E[P],T=N[P];if(R.min_amount>0&&f(P)<R.min_amount)return n.value.textErrorRequaired=`В группе "${R.name}" должно содержаться не меньше ${R.min_amount} модификатора(ов)`,{haveRequaire:!0,group:R};for(const x of R.group_modifiers)if(x.min_amount>0){const C=T.modifiers.find(B=>B.id===x.id);if(!C||C.amount<x.min_amount)return n.value.textErrorRequaired=`В группе "${R.name}" выберите все обязательные модификаторы`,{haveRequaire:!0,group:R}}}return{haveRequaire:!1,group:E[0]}}),y=()=>{n.value.groupModifiers.forEach((E,N)=>{n.value.groupCurrentOpen={...E,index:N},E.group_modifiers.forEach(P=>{P.default_amount>0&&(P.amount=P.default_amount,$(P,!0))})})},b=E=>{n.value.addedProducts.push(E)},w=E=>{n.value.openCard=E},g=E=>{l.value=[...E]},_=(E,N)=>{var R,T;const P=E.id!==((R=n.value.groupCurrentOpen)==null?void 0:R.id);n.value.groupCurrentOpen={...E,index:N},P?n.value.isSectionModifier=!0:n.value.isSectionModifier=!n.value.isSectionModifier,(T=n.value.plusButtonsRefs[N])==null||T.scrollIntoView({behavior:"smooth",block:"start"})},S=()=>{n.value.modalCount>n.value.currentModifier.min_amount&&n.value.modalCount>=2&&(n.value.modalCount-=1)},M=()=>{n.value.groupCurrentOpen&&n.value.modalCount+u.value<m.value&&(n.value.currentModifier.max_amount===0||n.value.currentModifier.max_amount>n.value.modalCount)&&(n.value.modalCount+=1)},V=(E,N)=>{var R;const P=(R=n.value.groupCurrentOpen)==null?void 0:R.id.toUpperCase();if(!E&&!n.value.isModifiedAmount&&N.max_amount!==1){if(P==="Добавки2000"&&N.max_amount>1)return!0;if(Math.abs(m.value-u.value)>1&&P!=="Добавки2000")return!0}return!1},$=(E,N=!1)=>{n.value.modalCount=1,n.value.currentModifier=E;const P=n.value.groupModifiersSelected.findIndex(R=>R.group===n.value.groupCurrentOpen.id);D(P,E,N)},D=(E,N,P)=>{let R=n.value.groupModifiersSelected;if(N.sizes.length>0&&N.sizes.find(T=>{var x;return T.id===((x=n.value.selectedSize)==null?void 0:x.id)}),E===-1)V(P,N)?n.value.isModifiedAmount=!0:R[n.value.groupCurrentOpen.index]={group:n.value.groupCurrentOpen.id,modifier_count:0,modifiers:[{...N,amount:(N==null?void 0:N.amount)??1}]};else{const T=n.value.groupModifiers[E].group_modifiers.findIndex(C=>C.id===N.id);if(R[E].modifiers.findIndex(C=>C.id===N.id)===-1){if(m.value===1)R[E].modifiers=[];else if(u.value>=m.value)return;V(P,N)?n.value.isModifiedAmount=!0:(R[E].modifiers.push({...N,amount:(N==null?void 0:N.amount)??1}),R[E].modifier_count=R[E].modifiers.reduce((C,B)=>C+=B.amount,0),n.value.isAnimationFly=!0)}else R[E].modifiers=R[E].modifiers.filter(C=>C.id!==N.id),R[E].modifier_count=R[E].modifiers.reduce((C,B)=>C+=B.amount,0),n.value.groupModifiers[E].group_modifiers[T].amount=1,n.value.groupModifiers[E].group_modifiers[T].default_amount=0,n.value.isAnimationFly=!1}n.value.groupModifiersSelected=R};return{stateCard:n,totalPrice_libCard:h,recountGroupTotalAmount:u,groupTotalAmount:m,isOpenWindow:o,isUpSale:a,checkedRequiredBtn:p,dataUpSale:s,productCards:l,isAddToCard:i,openProduct:c,is_startPage:d,setProduct:g,summModifierAmount:f,setAddedProducts:b,setCurrentCard:w,minusAmount:S,plusAmount:M,toggleNotRequire:_,modifierSelect:$,defaultAmountModifiers:y,reset:r}});var ri=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yr={exports:{}};(function(t,n){(function(r,o){t.exports=o()})(ri,function(){var r=1e3,o=6e4,a=36e5,i="millisecond",s="second",l="minute",c="hour",d="day",u="week",f="month",m="quarter",h="year",p="date",y="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(x){var C=["th","st","nd","rd"],B=x%100;return"["+x+(C[(B-20)%10]||C[B]||C[0])+"]"}},_=function(x,C,B){var A=String(x);return!A||A.length>=C?x:""+Array(C+1-A.length).join(B)+x},S={s:_,z:function(x){var C=-x.utcOffset(),B=Math.abs(C),A=Math.floor(B/60),k=B%60;return(C<=0?"+":"-")+_(A,2,"0")+":"+_(k,2,"0")},m:function x(C,B){if(C.date()<B.date())return-x(B,C);var A=12*(B.year()-C.year())+(B.month()-C.month()),k=C.clone().add(A,f),I=B-k<0,O=C.clone().add(A+(I?-1:1),f);return+(-(A+(B-k)/(I?k-O:O-k))||0)},a:function(x){return x<0?Math.ceil(x)||0:Math.floor(x)},p:function(x){return{M:f,y:h,w:u,d,D:p,h:c,m:l,s,ms:i,Q:m}[x]||String(x||"").toLowerCase().replace(/s$/,"")},u:function(x){return x===void 0}},M="en",V={};V[M]=g;var $="$isDayjsObject",D=function(x){return x instanceof R||!(!x||!x[$])},E=function x(C,B,A){var k;if(!C)return M;if(typeof C=="string"){var I=C.toLowerCase();V[I]&&(k=I),B&&(V[I]=B,k=I);var O=C.split("-");if(!k&&O.length>1)return x(O[0])}else{var H=C.name;V[H]=C,k=H}return!A&&k&&(M=k),k||!A&&M},N=function(x,C){if(D(x))return x.clone();var B=typeof C=="object"?C:{};return B.date=x,B.args=arguments,new R(B)},P=S;P.l=E,P.i=D,P.w=function(x,C){return N(x,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var R=function(){function x(B){this.$L=E(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[$]=!0}var C=x.prototype;return C.parse=function(B){this.$d=function(A){var k=A.date,I=A.utc;if(k===null)return new Date(NaN);if(P.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var O=k.match(b);if(O){var H=O[2]-1||0,W=(O[7]||"0").substring(0,3);return I?new Date(Date.UTC(O[1],H,O[3]||1,O[4]||0,O[5]||0,O[6]||0,W)):new Date(O[1],H,O[3]||1,O[4]||0,O[5]||0,O[6]||0,W)}}return new Date(k)}(B),this.init()},C.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},C.$utils=function(){return P},C.isValid=function(){return this.$d.toString()!==y},C.isSame=function(B,A){var k=N(B);return this.startOf(A)<=k&&k<=this.endOf(A)},C.isAfter=function(B,A){return N(B)<this.startOf(A)},C.isBefore=function(B,A){return this.endOf(A)<N(B)},C.$g=function(B,A,k){return P.u(B)?this[A]:this.set(k,B)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(B,A){var k=this,I=!!P.u(A)||A,O=P.p(B),H=function(he,ae){var U=P.w(k.$u?Date.UTC(k.$y,ae,he):new Date(k.$y,ae,he),k);return I?U:U.endOf(d)},W=function(he,ae){return P.w(k.toDate()[he].apply(k.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(ae)),k)},j=this.$W,G=this.$M,ee=this.$D,Y="set"+(this.$u?"UTC":"");switch(O){case h:return I?H(1,0):H(31,11);case f:return I?H(1,G):H(0,G+1);case u:var de=this.$locale().weekStart||0,pe=(j<de?j+7:j)-de;return H(I?ee-pe:ee+(6-pe),G);case d:case p:return W(Y+"Hours",0);case c:return W(Y+"Minutes",1);case l:return W(Y+"Seconds",2);case s:return W(Y+"Milliseconds",3);default:return this.clone()}},C.endOf=function(B){return this.startOf(B,!1)},C.$set=function(B,A){var k,I=P.p(B),O="set"+(this.$u?"UTC":""),H=(k={},k[d]=O+"Date",k[p]=O+"Date",k[f]=O+"Month",k[h]=O+"FullYear",k[c]=O+"Hours",k[l]=O+"Minutes",k[s]=O+"Seconds",k[i]=O+"Milliseconds",k)[I],W=I===d?this.$D+(A-this.$W):A;if(I===f||I===h){var j=this.clone().set(p,1);j.$d[H](W),j.init(),this.$d=j.set(p,Math.min(this.$D,j.daysInMonth())).$d}else H&&this.$d[H](W);return this.init(),this},C.set=function(B,A){return this.clone().$set(B,A)},C.get=function(B){return this[P.p(B)]()},C.add=function(B,A){var k,I=this;B=Number(B);var O=P.p(A),H=function(G){var ee=N(I);return P.w(ee.date(ee.date()+Math.round(G*B)),I)};if(O===f)return this.set(f,this.$M+B);if(O===h)return this.set(h,this.$y+B);if(O===d)return H(1);if(O===u)return H(7);var W=(k={},k[l]=o,k[c]=a,k[s]=r,k)[O]||1,j=this.$d.getTime()+B*W;return P.w(j,this)},C.subtract=function(B,A){return this.add(-1*B,A)},C.format=function(B){var A=this,k=this.$locale();if(!this.isValid())return k.invalidDate||y;var I=B||"YYYY-MM-DDTHH:mm:ssZ",O=P.z(this),H=this.$H,W=this.$m,j=this.$M,G=k.weekdays,ee=k.months,Y=k.meridiem,de=function(ae,U,ne,ie){return ae&&(ae[U]||ae(A,I))||ne[U].slice(0,ie)},pe=function(ae){return P.s(H%12||12,ae,"0")},he=Y||function(ae,U,ne){var ie=ae<12?"AM":"PM";return ne?ie.toLowerCase():ie};return I.replace(w,function(ae,U){return U||function(ne){switch(ne){case"YY":return String(A.$y).slice(-2);case"YYYY":return P.s(A.$y,4,"0");case"M":return j+1;case"MM":return P.s(j+1,2,"0");case"MMM":return de(k.monthsShort,j,ee,3);case"MMMM":return de(ee,j);case"D":return A.$D;case"DD":return P.s(A.$D,2,"0");case"d":return String(A.$W);case"dd":return de(k.weekdaysMin,A.$W,G,2);case"ddd":return de(k.weekdaysShort,A.$W,G,3);case"dddd":return G[A.$W];case"H":return String(H);case"HH":return P.s(H,2,"0");case"h":return pe(1);case"hh":return pe(2);case"a":return he(H,W,!0);case"A":return he(H,W,!1);case"m":return String(W);case"mm":return P.s(W,2,"0");case"s":return String(A.$s);case"ss":return P.s(A.$s,2,"0");case"SSS":return P.s(A.$ms,3,"0");case"Z":return O}return null}(ae)||O.replace(":","")})},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(B,A,k){var I,O=this,H=P.p(A),W=N(B),j=(W.utcOffset()-this.utcOffset())*o,G=this-W,ee=function(){return P.m(O,W)};switch(H){case h:I=ee()/12;break;case f:I=ee();break;case m:I=ee()/3;break;case u:I=(G-j)/6048e5;break;case d:I=(G-j)/864e5;break;case c:I=G/a;break;case l:I=G/o;break;case s:I=G/r;break;default:I=G}return k?I:P.a(I)},C.daysInMonth=function(){return this.endOf(f).$D},C.$locale=function(){return V[this.$L]},C.locale=function(B,A){if(!B)return this.$L;var k=this.clone(),I=E(B,A,!0);return I&&(k.$L=I),k},C.clone=function(){return P.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},x}(),T=R.prototype;return N.prototype=T,[["$ms",i],["$s",s],["$m",l],["$H",c],["$W",d],["$M",f],["$y",h],["$D",p]].forEach(function(x){T[x[1]]=function(C){return this.$g(C,x[0],x[1])}}),N.extend=function(x,C){return x.$i||(x(C,R,N),x.$i=!0),N},N.locale=E,N.isDayjs=D,N.unix=function(x){return N(1e3*x)},N.en=V[M],N.Ls=V,N.p={},N})})(Yr);var ai=Yr.exports;const Xr=oi(ai),si=t=>{const n=K.useRouter(),r=K.useRoute(),o=`${t.domain}/api/`,a=re.create({baseURL:o}),i=re.create({baseURL:o}),s=re.create({baseURL:o}),l=re.create({baseURL:o}),c=re.create({baseURL:o}),d=re.create({baseURL:o}),u=re.create({baseURL:o}),f=_=>{try{const S=JSON.parse(localStorage.getItem("authTokensAccess")||"");S.length>0&&(_.headers.Authorization=`Bearer ${S}`)}catch{console.warn("accessToken is undefined [useAxios]")}return _},m=_=>{const S=localStorage.getItem("apiKey"),M=(S==null?void 0:S.replace(/^.(.*).$/,"$1"))||"";return _.headers={"Content-Type":"application/json","x-api-key":M},_},h=async _=>{if(!t.user)return _;const S=t.user.exp??0;if(!(Xr.unix(S).diff(Xr())<3e3))return _;const V=cr("authTokensRefresh",null,"string");try{const $=await re.post(`${o}user/token/refresh/`,{refresh:V.value});if(!$.data.access)return g(),_;localStorage.setItem("authTokensAccess",JSON.stringify($.data.access)),b($.data),w(lr($.data.access)),_.headers={..._.headers,Authorization:`Bearer ${$.data.access}`}}catch($){console.error("Failed to refresh token:",$),g()}return _},p=_=>{_.interceptors.request.use(S=>h(f(S)),S=>Promise.reject(S))};p(s),p(c),p(u);const y=_=>{_.interceptors.request.use(S=>m(S))};y(d),y(i),y(u);const b=(_,S=!1)=>{localStorage.setItem("authTokensAccess",JSON.stringify(_.access)),S&&localStorage.setItem("authTokensRefresh",JSON.stringify(_.refresh))},w=_=>{t.user=_,localStorage.setItem("user",JSON.stringify(_))},g=()=>{t.user=null,dt(["authTokensAccess","authTokensRefresh","user","cart","bonus"]),sessionStorage.removeItem("is_adult"),n.push(`/${r.params.orgId}/`),window.location.reload()};return{axiosInstanceAuthenticationGet:s,axiosInstanceAuthenticationPost:c,axiosInstanceAuthenticationPostApiKey:u,axiosInstancePost:l,axiosInstanceGet:a,axiosInstanceGetApiKey:i,axiosInstancePostApiKey:d}},J=class J{constructor(){te(this,"axiosInstanceGet");te(this,"axiosInstancePost");te(this,"axiosInstanceAuthenticationGet");te(this,"axiosInstanceAuthenticationPost");te(this,"axiosInstanceGetApiKey");te(this,"axiosInstancePostApiKey");te(this,"axiosInstanceAuthenticationPostApiKey");te(this,"currentUpsaleController",null);te(this,"controller",new AbortController);this.axiosInstanceGet=J._axiosGet,this.axiosInstancePost=J._axiosPost,this.axiosInstanceGetApiKey=J._axiosPostApiKey,this.axiosInstancePostApiKey=J._axiosPostApiKey,this.axiosInstanceAuthenticationPostApiKey=J._axiosAuthPostApiKey,this.axiosInstanceAuthenticationGet=J._axiosAuthGet,this.axiosInstanceAuthenticationPost=J._axiosAuthPost}static create(n){return n&&!J._config&&J._initialize(n),J._config||console.warn("InitConnection не инициализирован"),new J}static _initialize(n,r=null){const o=se(),a=fe(),{config_lib:i}=F.storeToRefs(o),{stateCard:s,recountGroupTotalAmount:l}=F.storeToRefs(a);J._config=n,J._cardStore=a,J._stateCard=s,J._recountGroupTotalAmount=l,i.value=n;const c=si(n);J._axiosPostApiKey=c.axiosInstanceGetApiKey,J._axiosPostApiKey=c.axiosInstancePostApiKey,J._axiosAuthPostApiKey=c.axiosInstanceAuthenticationPostApiKey,J._axiosGet=c.axiosInstanceGet,J._axiosPost=c.axiosInstancePost,J._axiosAuthGet=c.axiosInstanceAuthenticationGet,J._axiosAuthPost=c.axiosInstanceAuthenticationPost}get config(){return J._config}get cardStore(){return J._cardStore}get stateCard(){return J._stateCard}get recountGroupTotalAmount(){return J._recountGroupTotalAmount}async updateTheme(){var i,s;const n=JSON.parse(localStorage.getItem("themeConfig"))??null,r=ge();if(n!==null){r.updateColor(n);return}const o=se(),a=await((s=this.axiosInstanceGet)==null?void 0:s.get(`org/organizations/${(i=this.config)==null?void 0:i.orgId}/design/`));o.setStateDrum(a==null?void 0:a.data.hide_barban),o.setKioskTimeout(a==null?void 0:a.data.kiosk_timeout),localStorage.setItem("themeConfig",JSON.stringify(a.data)),r.updateColor(a.data)}async getGroupByID(n){var r,o;try{const a=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${(r=this.config)==null?void 0:r.pointId}/group/${n}`));return a==null?void 0:a.data}catch(a){throw console.error("Ошибка в request.ts[getGroupByID]",a),a}}async loadGroupProducts(n){var r,o;try{const a=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${(r=this.config)==null?void 0:r.pointId}/products/?group=${n}`)),i=(a==null?void 0:a.data)||[];for(const s of i)s&&await Go(s);return await this.cacheImagesInBackground(i),i}catch(a){return console.error("Ошибка загрузки группы:",a),[]}}async getGroup(){var n,r;try{const o=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(n=this.config)==null?void 0:n.pointId}/groups/`));return o==null?void 0:o.data}catch(o){return console.error("Error fetching products:",o),[]}}async fetchAndCacheAllPages(){var n,r;try{const o=((n=this.config)==null?void 0:n.pointId)||"",a=await dn(o);if(a)return a.data;const i=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${o}/group/`)),s=(i==null?void 0:i.data)||[],l=[];for(const c of s){c.products=c.products||[],await _t(c.id,c),l.push(c);const d=await this.loadGroupProducts(c.id);c.products=d}return await this.cacheImagesInBackground(s),await _t(o,s),l}catch(o){return console.error("fetchAndCacheAllPages error:",o),[]}}cacheImagesInBackground(n){n.forEach(r=>{var o;r.video_link&&this.loadAndCacheMedia(r.video_link,r.id+"_video"),r.image_link&&this.loadAndCacheMedia(r.image_link,r.id+"_image"),(o=r.products)==null||o.forEach(a=>{a.video_link&&this.loadAndCacheMedia(a.video_link,a.id+"_video"),a.image_link&&this.loadAndCacheMedia(a.image_link,a.id+"_image")})})}async loadAndCacheMedia(n,r){const o=await lt(r);if(o){this.dispatchImageCachedEvent(r,o);return}try{const a=await fetch(n);if(!a.ok)throw new Error("Network error");const i=await a.blob();if(i.size===0)throw new Error("Empty blob");await un(r,i),this.dispatchImageCachedEvent(r,i)}catch(a){console.warn(`[ImageCache] Failed for ${r}:`,a)}}dispatchImageCachedEvent(n,r){window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:r}}))}async getProduct(n=null){var r,o;if(!n)return[];try{const a=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${(r=this.config)==null?void 0:r.pointId}/products/${n}`));return a==null?void 0:a.data}catch(a){return console.error("Error fetching cardProducts:",a),[]}}async getSingleProduct(n){var a;const r=se(),{config_lib:o}=F.storeToRefs(r);try{let i=await Xn(n);if(i)this._fullCardProduct(i);else{const s=await((a=this.axiosInstanceGet)==null?void 0:a.get(`${o.value.pointId}/products/${n}`));(s==null?void 0:s.status)===200&&this._fullCardProduct(s.data)}}catch(i){throw console.warn("store card[getFetchProducts]:",i),i}}_fullCardProduct(n){const r=fe();r.stateCard.openCard={...n,amount:1},r.stateCard.groupModifiers=n.group_modifiers,n.modifiers.length>0&&r.stateCard.groupModifiers.unshift({default_amount:0,description:"",group_modifiers:n.modifiers,id:"Добавки2000",image_link:null,max_amount:1,min_amount:n.modifiers.reduce((o,a)=>o+=a.min_amount,0),name:"Добавки",required:!1}),r.stateCard.groupModifiersSelected=new Array(r.stateCard.groupModifiers.length).fill({group:"",modifiers:[],modifier_count:0}),r.stateCard.productSizes=n.sizes,r.defaultAmountModifiers(),n.show_recommendations&&this.productUpsale(n.id)}async getTheme(){try{this.updateTheme()}catch(n){return console.error("Error fetching products:",n),[]}}async authorizeByCard(n){var r,o;try{const a=await((o=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:o.post(`${(r=this.config)==null?void 0:r.domain}/api/user/validate-card/`,{card_number:n}));return localStorage.setItem("authTokensAccess",JSON.stringify(a==null?void 0:a.data.access)),localStorage.setItem("authTokensRefresh",JSON.stringify(a==null?void 0:a.data.refresh)),a==null?void 0:a.data}catch(a){throw console.error("Ошибка авторизации:",a),a}}async getLoyalSmsCode(n){var r,o;try{const a=await((o=this.axiosInstancePostApiKey)==null?void 0:o.post(`${(r=this.config)==null?void 0:r.domain}/api/device/auth/request-otp/`,{phone:n}));return a==null?void 0:a.data}catch(a){throw console.error("Ошибка получения sms-code:",a),a}}async sendSmsCodeForAuth(n,r){var o,a;try{const i=await((a=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:a.post(`${(o=this.config)==null?void 0:o.domain}/api/device/auth/`,{code:n,phone:r}));return i==null?void 0:i.data}catch(i){throw console.error("Ошибка отправки sms-code:",i),i}}async callStaff(n,r,o){var a,i,s,l;try{const c=await((s=this.axiosInstancePost)==null?void 0:s.post(`${(a=this.config)==null?void 0:a.domain}/api/org_unit/${(i=this.config)==null?void 0:i.pointId}/table/${n}/call-staff/`,{...r},o));return(l=c==null?void 0:c.data)==null?void 0:l.response_text}catch(c){throw console.error("Ошибка[callStaff]",c),c}}async createOrder(n,r,o=!0,a,i=!1,s=!1,l){var h,p,y;const c=i?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,d=o?c:this.axiosInstanceAuthenticationPost,u=o?"/device/order/create":"/order/create",f=o?(h=this.config)==null?void 0:h.pointId:(p=this.config)==null?void 0:p.pointId;return await(d==null?void 0:d.post(`${(y=this.config)==null?void 0:y.domain}/api/org_unit/${f}${u}`,{items:n,table:r||null,comment:a},{signal:l}))}async initPaymentLink(n,r){const o=r!=="YOOKASSA"?this.axiosInstancePost:this.axiosInstanceAuthenticationPost,a=se(),i=await(o==null?void 0:o.post("payment/init",{by_bonuses:a.countBonus,order:n,provider_type:r}));return i==null?void 0:i.data}async orderPay(n){var r;return(r=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:r.post(`order/${n}/pay/`,{order_id:n})}async getProfile(){var r,o;const n=await((o=this.axiosInstanceAuthenticationGet)==null?void 0:o.get(`user/current?organization=${(r=this.config)==null?void 0:r.orgId}`));if((n==null?void 0:n.status)===200){const a=se();return a.profile=n.data,a.is18Allowed=sessionStorage.getItem("is_adult")==="true",n.data}else return n}async calculateDiscount(n,r=!0,o=!1,a){var d,u;const i=o?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,s=r?i:this.axiosInstanceAuthenticationPost,l=r?(d=this.config)==null?void 0:d.pointId:(u=this.config)==null?void 0:u.pointId,c=await(s==null?void 0:s.post(`/org_unit/${l}/cart/calculate-discount/`,n,{signal:a}));return(c==null?void 0:c.status)===200?c.data:c}async maxPayByBonuses(n,r=!0,o=!1,a){const i=se(),s=o?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,l=r?s:this.axiosInstanceAuthenticationPost,c=await(l==null?void 0:l.post("/cart/max-pay-by-bonuses/",{total_cart_price:n},{signal:a})),d=c==null?void 0:c.data;return i.profile&&d&&"balance"in d&&(i.profile.balance=d.balance),d}async getDeviceInfo(){var o;const n=ue(),r=await((o=this.axiosInstanceGetApiKey)==null?void 0:o.get("/device/current/"));return(r==null?void 0:r.status)===200?(n.providerTypes=r.data.payment_provider_type,r.data):r}async productUpsale(n){var i,s,l;const r=fe(),{dataUpSale:o}=F.storeToRefs(r);(i=this.currentUpsaleController)==null||i.abort();const a=new AbortController;this.currentUpsaleController=a;try{const c=await((l=this.axiosInstanceGet)==null?void 0:l.get(`/${(s=this.config)==null?void 0:s.pointId}/products/${n}/recommendation/`,{signal:a.signal}));a.signal.aborted||(o.value=c==null?void 0:c.data)}catch(c){if(c.name==="AbortError"||c.name==="CanceledError"){console.warn("Upsale отменён — пришёл новый запрос");return}throw console.error("Ошибка upsale:",c),c}finally{this.currentUpsaleController===a&&(this.currentUpsaleController=null)}}};te(J,"_config",null),te(J,"_axiosGet"),te(J,"_axiosGetApiKey"),te(J,"_axiosPostApiKey"),te(J,"_axiosAuthPostApiKey"),te(J,"_axiosPost"),te(J,"_axiosAuthGet"),te(J,"_axiosAuthPost"),te(J,"_cardStore",null),te(J,"_stateCard",null),te(J,"_recountGroupTotalAmount",null);let qe=J;const ii=e.defineComponent({__name:"UseScrollCenter",props:{axis:{},behavior:{},autoScroll:{type:Boolean},container:{},idActive:{},clearContainer:{type:Boolean}},setup(t,{expose:n}){const r=t,o=se(),a=e.ref(null),i=async l=>{if(!a.value||!l)return;let c=window;r.container&&(c=typeof r.container=="string"?document.querySelector(r.container)||window:r.container);const d={behavior:r.behavior};if(r.axis==="x"){const u=c===window?window.innerWidth:c.clientWidth,f=l.offsetWidth;let m=l.offsetLeft;if(c!==window){const h=c.getBoundingClientRect();m=l.getBoundingClientRect().left-h.left+c.scrollLeft}m-=(u-f)/2,d.left=Math.max(0,m)}else{const u=c===window?window.innerHeight:c.clientHeight,f=l.offsetHeight;let m=l.offsetTop;if(c!==window){const h=c.getBoundingClientRect();m=l.getBoundingClientRect().top-h.top+c.scrollTop}m-=(u-f)/2,d.top=Math.max(0,m)}try{c===window?window.scrollTo(d):c.scrollTo(d)}catch(u){console.error("Scroll error:",u)}};e.onMounted(async()=>{if(r.autoScroll){let l=null;if(await e.nextTick(),o.activeScrolling_lib){const c=o.activeScrolling_lib.findIndex(d=>d.id===r.idActive);r.idActive?(l=document.getElementById(`scrolling${r.idActive}`),l&&c!==-1&&(o.activeScrolling_lib[c]=l)):o.activeScrolling_lib[c]&&(l=o.activeScrolling_lib[c]),i(l)}}});const s=async l=>{r.clearContainer&&(o.activeScrolling_lib=[]);const c=l.currentTarget;await e.nextTick(),o.activeScrolling_lib.includes(c)||o.activeScrolling_lib.push(c),i(c)};return n({scrollToElement:i}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:a,class:"scroll-to-wrapper"},[e.renderSlot(l.$slots,"default",{handleTargetClick:s},void 0,!0)],512))}}),X=(t,n)=>{const r=t.__vccOpts||t;for(const[o,a]of n)r[o]=a;return r},In=X(ii,[["__scopeId","data-v-b510c3f1"]]),li={},ci={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 di(t,n){return e.openBlock(),e.createElementBlock("svg",ci,[...n[0]||(n[0]=[e.createElementVNode("defs",null,null,-1),e.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 Bn=X(li,[["render",di]]),ui=["id","onClick"],fi={class:"modified_plus_btn"},mi=["src"],pi={key:2,class:"wrapper_modifier_item"},hi={key:0,class:"modifier_item_n_wrapper"},_i=["src"],gi={key:1,class:"modifier_plus_item"},yi=["src"],bi=["src"],eo=X(e.defineComponent({__name:"PlusModifier",props:{isSectionModifier:{type:Boolean},toggleNotRequire:{type:Function}},setup(t){const n=fe(),r=ge(),{stateCard:o}=F.storeToRefs(n),{itemThemes:a}=F.storeToRefs(r),i=e.ref([]),s=e.ref([]),l=e.ref(null),c=e.ref(null),d=f=>{f instanceof HTMLElement&&!i.value.includes(f)&&i.value.push(f)},u=f=>{c.value=f};return e.onMounted(async()=>{await e.nextTick(),o.value.plusButtonsRefs=i.value}),e.watchEffect(()=>{s.value=o.value.groupModifiersSelected,document.body.style.overflow=""}),e.onBeforeUnmount(()=>{i.value=[],o.value.plusButtonsRefs=[]}),(f,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({card_modified_wrapper_many:e.unref(o).groupModifiers.length>=5})},[e.unref(o).groupModifiersSelected?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["card_modified_wrapper",[e.unref(o).groupModifiers.length<=4?"card_modified_wrapper_center":""]]),ref_key:"scrollPlusContainer",ref:l},[e.createVNode(In,{axis:"x",behavior:"smooth",container:l.value,autoScroll:!0,idActive:c.value,clearContainer:!0},{default:e.withCtx(({handleTargetClick:h})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).groupModifiers,(p,y)=>{var b,w;return e.openBlock(),e.createElementBlock("div",{class:"button_modified",key:p.id,ref_for:!0,ref:d,id:"scrolling"+p.id,"data-clickable":"true",onClick:g=>{t.toggleNotRequire&&t.toggleNotRequire(p,y),u(p.id),h(g)}},[e.createElementVNode("div",fi,[s.value[y].modifiers.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{modified_plus_btn_active:p.id===((b=e.unref(o).groupCurrentOpen)==null?void 0:b.id)&&t.isSectionModifier},"modified_plus_active"])},[e.createVNode(Bn,{"aria-label":`Открыть группу модификаторов ${p.name}`},null,8,["aria-label"])],2)):s.value[y].modifiers.length===1?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["modified_plus_btn modified_plus_btn_solo",{modified_plus_btn_active:p.id===((w=e.unref(o).groupCurrentOpen)==null?void 0:w.id)&&t.isSectionModifier}])},[e.createElementVNode("img",{src:s.value[y].modifiers[0].image_link||e.unref(a).fallback_image||"",alt:"Модификатор"},null,8,mi)],2)):(e.openBlock(),e.createElementBlock("div",pi,[s.value[y].modifiers.length>2?(e.openBlock(),e.createElementBlock("div",hi,[s.value[y].modifiers.length===3?(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_plus_item modifier_item_three",src:s.value[y].modifiers[2].image_link||e.unref(a).fallback_image||""},null,8,_i)):(e.openBlock(),e.createElementBlock("p",gi," + "+e.toDisplayString(s.value[y].modifiers.length-2),1))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[s.value[y].modifiers.length>0?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.value[y].modifiers[0].image_link||e.unref(a).fallback_image||"",class:"modifier_plus_item modifier_item_first"},null,8,yi)):e.createCommentVNode("",!0),s.value[y].modifiers.length>1?(e.openBlock(),e.createElementBlock("img",{key:1,src:s.value[y].modifiers[1].image_link||e.unref(a).fallback_image||"",class:"modifier_plus_item modifier_item_second"},null,8,bi)):e.createCommentVNode("",!0)])]))]),e.createElementVNode("p",null,e.toDisplayString(p.name),1)],8,ui)}),128))]),_:1},8,["container","idActive"])],2)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-589e71ca"]]),wi={},Ci={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 ki(t,n){return e.openBlock(),e.createElementBlock("svg",Ci,[...n[0]||(n[0]=[e.createElementVNode("desc",null," Created with Pixso. ",-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("circle",{id:"Ellipse 1",cx:"10.923828",cy:"10.923462",r:"10.923489",fill:"#FF6D2E","fill-opacity":"1.000000"},null,-1),e.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 Nt=X(wi,[["render",ki]]),vt={mounted(t){t.muted=!0,t.setAttribute("muted","")}},Si={class:"wrapper_modifiers"},Ei={class:"wrapper_nutritional_value"},Ni={class:"nutritional_scheme"},vi={key:0,class:"nutritional_parameters"},Ii={key:1,class:"nutritional_parameters"},Bi={key:2,class:"nutritional_parameters"},xi={key:3,class:"nutritional_parameters"},Ai={ref:"modifierBody",class:"modifier_shadow"},Mi={class:"wrapper_modifiers_title"},Pi={class:"wrapper_text_count_modifiers"},Ti=["id","aria-label","onClick","onKeydown"],Ri={key:0,class:"counter_modifier"},$i={class:"hide_image_corners"},Vi=["src","alt"],Di={key:1,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},Oi=["src"],zi={class:"modifier_title"},Li=X(e.defineComponent({__name:"SectionModifiers",emits:["close"],setup(t,{emit:n}){const r=n,o=ge(),a=fe(),{itemThemes:i}=F.storeToRefs(o),{stateCard:s,recountGroupTotalAmount:l,groupTotalAmount:c}=F.storeToRefs(a),d=e.ref(null),u=we.useTemplateRefsList(),f=m=>{if(!m)return;const h=s.value.groupModifiers.findIndex(g=>g.id===s.value.groupCurrentOpen.id),p=s.value.plusButtonsRefs[h]||s.value.plusButtonsRefs[0];if(!p)return;const y=m.getBoundingClientRect(),b=p.getBoundingClientRect(),w=m.cloneNode(!0);w.classList.add("flyer"),Object.assign(w.style,{width:`${y.width}px`,height:`${y.height}px`,left:`${y.left}px`,top:`${y.top}px`,position:"fixed",zIndex:"1000"}),document.body.appendChild(w),d.value=w,requestAnimationFrame(()=>{const g=b.left+b.width/3-(y.left+y.width/2),_=b.top+b.height/4-(y.top+y.height/2),S=b.width/y.width*.2;w.style.transform=`translate(${g}px, ${_}px) scale(${S})`,w.style.opacity="0.4",w.style.transition="transform 0.5s ease, opacity 0.5s ease"}),w.addEventListener("transitionend",()=>{w.remove(),d.value=null,p.classList.add("bump"),setTimeout(()=>p.classList.remove("bump"),300)},{once:!0})};return e.watch(()=>s.value.isAnimationFly,m=>{m===!0&&s.value.currentModifier&&(f(u.value.find(h=>h.id===s.value.currentModifier.id)),s.value.isAnimationFly=!1)}),(m,h)=>{var p,y,b,w,g,_,S,M,V,$,D,E;return e.openBlock(),e.createElementBlock("div",Si,[e.createElementVNode("div",Ei,[e.createElementVNode("div",{class:e.normalizeClass(["card_header_inner_back",[(p=e.unref(s).openCard)!=null&&p.proteins_amount?"card_header_inner_back_nutrients":""]]),"aria-label":"Закрыть выбор модификаторов",onClick:h[0]||(h[0]=N=>r("close"))},[e.createVNode(Nt,{class:"arrow_bottom"})],2),e.createElementVNode("div",Ni,[(y=e.unref(s).openCard)!=null&&y.energy_amount?(e.openBlock(),e.createElementBlock("div",vi,[e.createElementVNode("b",null,e.toDisplayString((b=e.unref(s).openCard)==null?void 0:b.energy_amount),1),h[1]||(h[1]=e.createElementVNode("p",null,"Килокалории",-1))])):e.createCommentVNode("",!0),(w=e.unref(s).openCard)!=null&&w.proteins_amount?(e.openBlock(),e.createElementBlock("div",Ii,[e.createElementVNode("b",null,e.toDisplayString((g=e.unref(s).openCard)==null?void 0:g.proteins_amount),1),h[2]||(h[2]=e.createElementVNode("p",null,"Белки",-1))])):e.createCommentVNode("",!0),(_=e.unref(s).openCard)!=null&&_.fat_amount?(e.openBlock(),e.createElementBlock("div",Bi,[e.createElementVNode("b",null,e.toDisplayString((S=e.unref(s).openCard)==null?void 0:S.fat_amount),1),h[3]||(h[3]=e.createElementVNode("p",null,"Жиры",-1))])):e.createCommentVNode("",!0),(M=e.unref(s).openCard)!=null&&M.carbohydrates_amount?(e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("b",null,e.toDisplayString((V=e.unref(s).openCard)==null?void 0:V.carbohydrates_amount),1),h[4]||(h[4]=e.createElementVNode("p",null,"Углеводы",-1))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ai,[e.createElementVNode("p",Mi,e.toDisplayString(($=e.unref(s).groupCurrentOpen)==null?void 0:$.name),1),e.createElementVNode("p",Pi,"Выбрано "+e.toDisplayString(e.unref(l))+" из "+e.toDisplayString(e.unref(c)),1),e.createElementVNode("div",{class:e.normalizeClass((D=e.unref(s).groupModifiers.find(N=>{var P;return N.id===((P=e.unref(s).groupCurrentOpen)==null?void 0:P.id)}))!=null&&D.group_modifiers.length?"wrapper_modifiers_card":"wrapper_modifiers_card_column")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((E=e.unref(s).groupCurrentOpen)==null?void 0:E.group_modifiers)||[],N=>{var P,R,T;return e.openBlock(),e.createElementBlock("div",{key:N.id,ref_for:!0,ref:e.unref(u).set,id:N.id,class:e.normalizeClass(["modifier_card",{hidden_modifier_card:N.default_amount===0&&((P=e.unref(s).groupCurrentOpen)==null?void 0:P.id)==="Добавки2000"&&N.min_amount===0&&N.max_amount===0}]),tabindex:"0",role:"button","data-clickable":"true","aria-label":`Выбрать модификатор группы ${N.name}`,onClick:x=>e.unref(a).modifierSelect(N),onKeydown:e.withKeys(x=>e.unref(a).modifierSelect(N),["enter"])},[e.createElementVNode("div",{class:e.normalizeClass([{modifier_card_active:e.unref(s).groupModifiersSelected.some(x=>{var C;return x.group===((C=e.unref(s).groupCurrentOpen)==null?void 0:C.id)&&x.modifiers.some(B=>B.id===N.id)})},"wrapper_image_corners"])},[N.amount>1?(e.openBlock(),e.createElementBlock("div",Ri,e.toDisplayString(N.amount),1)):e.createCommentVNode("",!0),e.createElementVNode("div",$i,[N.video_link?e.withDirectives((e.openBlock(),e.createElementBlock("video",Di,[e.createElementVNode("source",{src:N.video_link||"",type:"video/webm"},null,8,Oi)])),[[e.unref(vt)]]):(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_image",src:N.image_link||e.unref(i).fallback_image||"",alt:N.name},null,8,Vi)),e.createElementVNode("div",{class:e.normalizeClass(["wrapper_modifier_title",{wrapper_modifier_title_required:N.min_amount>0||N.required}])},[e.createElementVNode("h3",zi,e.toDisplayString(N.name),1),e.createElementVNode("p",null,"+"+e.toDisplayString(((T=(R=N.sizes)==null?void 0:R.find(x=>x.id===e.unref(s).selectedSize.id))==null?void 0:T.price)||N.price||0)+"₽",1)],2)])],2)],42,Ti)}),128))],2)],512)])}}}),[["__scopeId","data-v-b4140cab"]]),Fi={key:0,class:"card_size_place"},Hi=["onClick","onKeydown","aria-label"],Ui={key:1,class:"card_size static"},qi=["onClick","onKeydown","aria-label"],xn=3,ji=X(e.defineComponent({__name:"SizeModifier",setup(t){const n=fe(),{stateCard:r}=F.storeToRefs(n),o=e.ref(null),a=e.ref(50),i=e.ref(),s=e.ref(0),l=e.ref(0),c=e.ref(null),d=e.computed(()=>{var _;if(r.value.productSizes.length<=3)return r.value.productSizes[i.value.index]||r.value.productSizes[0];const w=s.value+1,g=((_=f.value[w])==null?void 0:_.originalIndex)??1;return r.value.productSizes[g]}),u=()=>{c.value&&r.value.productSizes.length>=3&&(l.value=c.value.offsetWidth/xn)},f=e.computed(()=>{if(r.value.productSizes.length<=3)return r.value.productSizes;const w=r.value.productSizes;return[...w.map((g,_)=>({...g,originalIndex:_})),...w.map((g,_)=>({...g,originalIndex:_})),...w.map((g,_)=>({...g,originalIndex:_}))]}),m=(w,g)=>{if(i.value={id:w.id,title:w.name,index:g,is_default:w.is_default},w.price!==null&&r.value.openCard&&(r.value.openCard={...r.value.openCard,price:w.price}),r.value.selectedSize=w,r.value.productSizes.length>3){u();const _=s.value+1;g<_?h():g>_&&p()}else{const _=r.value.productSizes.length,S=(g+.5)*(100/_);a.value=S}},h=()=>{var w;if(!(r.value.productSizes.length<=3)){if(s.value--,s.value<r.value.productSizes.length-xn+1){s.value+=r.value.productSizes.length;const g=(w=c.value)==null?void 0:w.querySelector(".card_size");g&&(g.style.transition="none",g.style.transform=`translateX(-${s.value*l.value}px)`,g.offsetHeight,g.style.transition="transform 0.2s ease-in-out")}y()}},p=()=>{var w;if(!(r.value.productSizes.length<=3)){if(s.value++,s.value>=r.value.productSizes.length*2){s.value-=r.value.productSizes.length;const g=(w=c.value)==null?void 0:w.querySelector(".card_size");g&&(g.style.transition="none",g.style.transform=`translateX(-${s.value*l.value}px)`,g.offsetHeight,g.style.transition="transform 0.2s ease-in-out")}y()}},y=()=>{var S;if(r.value.productSizes.length<=3)return;const w=s.value+1,g=((S=f.value[w])==null?void 0:S.originalIndex)??0,_=r.value.productSizes[g];i.value={id:_.id,title:_.name,index:g,is_default:_.is_default}};e.watch(()=>[r.value.productSizes,c.value],([w=[],g])=>{if(Array.isArray(w)&&w.length>0&&g!==null){let _=w.findIndex(S=>S.is_default===!0);w.length<3&&o.value&&parseInt(o.value.style.minWidth)<767&&(o.value.style.width="100px"),_>-1?(s.value=_,m(w[_],_),l.value=120/xn):w.length===2||w.length===1?(m(w[0],0),a.value=(0+.5)*(100/2)):(m(w[1],1),a.value=(1+.5)*(100/3))}}),e.watch(()=>{var w;return[(w=r.value.selectedSize)==null?void 0:w.id,r.value.groupModifiersSelected]},([w,g])=>{if(!w||!Array.isArray(g))return;const _=g.map(S=>({...S,modifiers:S.modifiers.map(M=>{if(!M.sizes||M.sizes.length===0)return M;const V=M.sizes.find($=>$.id===w);return V?{...M,size:V,price:V.price??M.price}:M})}));JSON.stringify(_)!==JSON.stringify(r.value.groupModifiersSelected)&&(r.value.groupModifiersSelected=_)},{deep:!0});const b={mounted:u};return e.onBeforeUnmount(()=>{window.removeEventListener("resize",u)}),(w,g)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"slider_container",ref_key:"slider_container",ref:o},[e.createElementVNode("div",{class:"card_size_place_wrapper",ref_key:"sliderWrapper",ref:c},[e.unref(r).productSizes.length>1&&i.value?(e.openBlock(),e.createElementBlock("div",Fi,[e.unref(r).productSizes.length>3?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"card_size",style:e.normalizeStyle({transform:`translateX(-${s.value*l.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(_,S)=>(e.openBlock(),e.createElementBlock("li",{key:`${_.id}-${S}`,onClick:M=>m(_,S),onKeydown:e.withKeys(M=>m(_,S),["enter"]),class:e.normalizeClass({active:i.value.id===_.id&&i.value.index===_.originalIndex}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${_.name}`},e.toDisplayString(_.alt_name?_.alt_name:_.name),43,Hi))),128))],4)):(e.openBlock(),e.createElementBlock("ul",Ui,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).productSizes,(_,S)=>(e.openBlock(),e.createElementBlock("li",{key:`${_.id}-${S}`,onClick:M=>m(_,S),onKeydown:e.withKeys(M=>m(_,S),["enter"]),class:e.normalizeClass({active:i.value.id===_.id&&i.value.index===S}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${_.name}`},e.toDisplayString(_.alt_name?_.alt_name:_.name),43,qi))),128))])),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:2,class:"size_active",style:e.normalizeStyle(e.unref(r).productSizes.length<=3?{left:`${a.value}%`}:{})},[e.createElementVNode("p",null,e.toDisplayString(d.value.alt_name?d.value.alt_name:d.value.name),1)],4)),[[b]]):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)],512)),[[e.vShow,e.unref(r).productSizes.length>1&&i.value]])}}),[["__scopeId","data-v-bc00f0e8"]]),Wi="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",Gi={class:"counter_container"},Ki={class:"card_size_place_wrapper",ref:"sliderWrapper"},Zi={class:"cart_amount_counter"},Qi={class:"button_circle_number"},Ji=X(e.defineComponent({__name:"NumberModifier",setup(t){const n=fe(),{stateCard:r}=F.storeToRefs(n),o=()=>{var i,s;(i=r.value.openCard)!=null&&i.amount&&((s=r.value.openCard)==null?void 0:s.amount)>1&&(r.value.openCard.amount-=1)},a=()=>{var i;(i=r.value.openCard)!=null&&i.amount&&(r.value.openCard.amount+=1)};return(i,s)=>{var l,c;return e.openBlock(),e.createElementBlock("div",Gi,[e.createElementVNode("div",Ki,[e.createElementVNode("div",Zi,[e.createElementVNode("p",{class:e.normalizeClass(["cart_circle_minus",[((l=e.unref(r).openCard)==null?void 0:l.amount)===1?"card_circle_minus_alone":""]]),"aria-label":"Уменьшить количество продукта","data-clickable":"true",onClick:e.withModifiers(o,["stop","prevent"])},[...s[0]||(s[0]=[e.createElementVNode("span",null,null,-1)])],2),e.createElementVNode("p",Qi,e.toDisplayString((c=e.unref(r).openCard)==null?void 0:c.amount),1),e.createElementVNode("p",{class:"cart_circle_plus","aria-label":"Увеличить количество продукта","data-clickable":"true",onClick:e.withModifiers(a,["stop","prevent"])},"+")])],512)])}}}),[["__scopeId","data-v-c3d45434"]]);function to(t,n=800){const r=e.ref(t),o=e.ref(t);let a=null,i=null,s=t;const l=c=>{i||(i=c);const d=c-i,u=Math.min(d/n,1),f=u<.5?4*u*u*u:1-Math.pow(-2*u+2,3)/2;r.value=Math.round(s+(o.value-s)*f),u<1?a=requestAnimationFrame(l):(r.value=o.value,a=null)};return e.watch(o,()=>{a&&cancelAnimationFrame(a),s=r.value,i=null,a=requestAnimationFrame(l)},{immediate:!0}),e.onUnmounted(()=>{a&&cancelAnimationFrame(a)}),{displayNumber:r,targetNumber:o,update:c=>{o.value=c}}}const Ce=e.defineComponent({__name:"RecountNumber",props:{price:{type:Number,required:!0},duration:{type:Number},fixedFloat:{type:Number,require:!1}},setup(t){const n=t,{displayNumber:r,update:o}=to(n.price||0,n.duration||800);return e.watchEffect(()=>{o(n.price)}),(a,i)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(e.unref(r).toFixed(t.fixedFloat)),1))}}),Yi=["disabled","id"],Re=e.defineComponent({__name:"ButtonDefault",props:{textButtonDefault:{type:String,required:!0},disabled:{type:Boolean,default:!1},onClick:{type:Function,required:!0}},setup(t){const n=t,r=()=>{n.onClick()};return(o,a)=>(e.openBlock(),e.createElementBlock("button",{class:"buttonDefaultWrapper",disabled:t.disabled,onClick:r,id:t.disabled?"buttonDefaultDisabled":""},e.toDisplayString(t.textButtonDefault),9,Yi))}}),Xi={class:"notification_info"},el={key:0,class:"notification_18plus"},tl={class:"notification_18plus_image"},nl=["src"],rl={class:"notification_18plus_text"},ol={class:"notification_18plus_accept"},al={key:1,class:"notification_text"},sl={key:0,class:"wrapper_button_accept"},An=e.defineComponent({__name:"NotificationWindow",props:e.mergeModels({textNotificationDefault:{},backgroundColor:{},buttonAccept:{},type:{type:Boolean},is_qr:{type:Boolean}},{visible:{default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(t){const n=t,r=ge(),o=se(),{is18Allowed:a,notificationData_lib:i}=F.storeToRefs(o),{itemThemes:s}=F.storeToRefs(r),l=e.computed(()=>n.backgroundColor||"rgba(50, 50, 50, 0.9)"),c=e.useModel(t,"visible"),d=()=>{i.value.fastAdd&&(o.addToCart(i.value.fastAdd),i.value.fastAdd=null),sessionStorage.setItem("is_adult","true"),a.value=!0,c.value=!1,i.value.callback&&(i.value.callback(),i.value.callback=null)},u=()=>{c.value=!1};return(f,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"notificationBlack",appear:""},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"notification_background_black",onClick:u})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"notification",appear:""},{default:e.withCtx(()=>{var h;return[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"notification_overlay",onClick:u},[e.createElementVNode("div",{class:"notification_wrapper",style:e.normalizeStyle({"background-color":l.value,border:`2px solid ${l.value}`})},[e.createElementVNode("div",Xi,[t.type?(e.openBlock(),e.createElementBlock("div",el,[e.createElementVNode("div",tl,[e.createElementVNode("img",{src:e.unref(s).adult_disclaimer_image||e.unref(s).fallback_image,alt:"Дисклеймер"},null,8,nl)]),e.createElementVNode("div",rl,e.toDisplayString(e.unref(s).adult_disclaimer_text),1),e.createElementVNode("div",ol,[m[0]||(m[0]=e.createElementVNode("label",{for:"plus18"},"Содержащиеся в настоящем разделе материалы предназначены для лиц старше 18 лет, носят информационный характер об ассортименте товаров и не являются рекламой. ",-1)),e.createVNode(Re,{textButtonDefault:"Мне есть 18",onClick:d,style:{fontSize:"1rem",padding:"6px 24px",marginLeft:"10px"}})])])):(e.openBlock(),e.createElementBlock("div",al,[e.createTextVNode(e.toDisplayString(t.textNotificationDefault)+" ",1),(h=t.buttonAccept)!=null&&h.state?(e.openBlock(),e.createElementBlock("div",sl,[e.createVNode(Re,{class:"button_accept",textButtonDefault:t.buttonAccept.text,onClick:t.buttonAccept.acceptBtn,disabled:t.buttonAccept.disabled},null,8,["textButtonDefault","onClick","disabled"])])):e.createCommentVNode("",!0)]))])],4)])):e.createCommentVNode("",!0)]}),_:1})],64))}}),il={class:"button_price button_price_modifiers"},ll=["src"],cl={class:"button_text_container"},dl={class:"button_text_price"},ul=X(e.defineComponent({__name:"ButtonPriceCount",props:{qr_menu:{type:Boolean,default:!1},closeProduct:{}},setup(t){const n=K.useRouter(),r=K.useRoute(),o=fe(),a=se(),i=ge(),s=e.ref([]),l=e.ref([]),c=t,{stateCard:d,totalPrice_libCard:u,isOpenWindow:f,isAddToCard:m}=F.storeToRefs(o),{itemThemes:h}=F.storeToRefs(i),p=e.ref(!0),y=e.ref(!1),b=()=>{var g,_,S;if(p.value){o.setCurrentCard(d.value.openCard),y.value=!0;const M=d.value.groupModifiers.findIndex(V=>o.checkedRequiredBtn.group.id===V.id);o.checkedRequiredBtn.haveRequaire&&o.toggleNotRequire(o.checkedRequiredBtn.group,M);return}const w=d.value.groupModifiersSelected||[];if(s.value=[],l.value=[],Array.isArray(w)&&w.length>0&&w.forEach(M=>{const V=M.group,$=M.modifiers||[];V==="Добавки2000"?s.value=$.map(D=>{var E;return{...D,old_price:D.price,size:Array.isArray(D.size)?D.size.map(N=>N.id).filter(Boolean):(E=D.size)!=null&&E.id?D.size.id:void 0}}):$.length>0&&l.value.push({group:V,modifiers:$.map(D=>{var E;return{...D,old_price:D.price,size:Array.isArray(D.size)?D.size.map(N=>N.id).filter(Boolean):(E=D.size)!=null&&E.id?D.size.id:void 0}})})}),document.body.style.overflow="",d.value.openCard){const M={id:d.value.openCard.id,is_fake:d.value.openCard.is_fake||!1,amount:d.value.openCard.amount,name:d.value.openCard.name,image_link:d.value.openCard.image_link,price:d.value.openCard.price,old_price:d.value.openCard.price,size:((g=d.value.selectedSize)==null?void 0:g.id)??((S=(_=d.value.openCard.sizes)==null?void 0:_.find(V=>V.is_default))==null?void 0:S.id),sizes:d.value.openCard.sizes||[],modifiers:s.value,groups:d.value.openCard.groups,group_modifiers:l.value,energy_amount:d.value.openCard.energy_amount??0,proteins_amount:d.value.openCard.proteins_amount??0,fat_amount:d.value.openCard.fat_amount??0,carbohydrates_amount:d.value.openCard.carbohydrates_amount??0};c.closeProduct&&c.closeProduct(),a.addToCart(M),m.value=!0}f.value=!1,c.qr_menu&&n.push(`/${r.params.orgId}/`)};return e.watch(()=>d.value.productSizes,w=>{!w||w.length===0||!d.value.selectedSize||(d.value.selectedSize={...d.value.selectedSize})},{immediate:!0}),e.watchEffect(()=>{o.checkedRequiredBtn.haveRequaire?p.value=!0:p.value=!1}),e.onMounted(()=>{m.value=!1}),(w,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(An,{visible:y.value,textNotificationDefault:e.unref(d).textErrorRequaired,backgroundColor:e.unref(h).accent_color?e.unref(h).accent_color:"#FF6D2E",buttonAccept:null,"onUpdate:visible":g[0]||(g[0]=_=>y.value=_)},null,8,["visible","textNotificationDefault","backgroundColor"]),e.createElementVNode("div",{class:"button_price_bg_product",onTouchstart:g[3]||(g[3]=e.withModifiers(()=>{},["stop"])),onPointerdown:g[4]||(g[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",il,[e.createVNode(Ji),e.createElementVNode("div",{class:e.normalizeClass(["card_product_button_buy",{buy_active:!p.value}]),"data-clickable":"true",onClick:b,onTouchstart:g[1]||(g[1]=e.withModifiers(()=>{},["stop"])),onPointerdown:g[2]||(g[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{src:e.unref(Wi),class:"card_product_button_icon"},null,8,ll),e.createElementVNode("div",cl,[e.createElementVNode("p",dl,[e.createVNode(Ce,{price:+e.unref(u),fixedFloat:2},null,8,["price"]),g[5]||(g[5]=e.createTextVNode(" ₽ ",-1))])])],34)])],32)],64))}}),[["__scopeId","data-v-e93283e7"]]),fl={class:"modified_amount"},ml={class:"hide_image_corners"},pl=["src"],hl={class:"wrapper_modifier_title"},_l={class:"amount_title"},gl={class:"wrapper_amount_counter"},yl={class:"amount_count"},bl={class:"amount_wrapper"},wl={class:"add_counter_amount"},Cl=X(e.defineComponent({__name:"ModalAmount",setup(t){const n=fe(),r=ge(),{itemThemes:o}=F.storeToRefs(r),{stateCard:a}=F.storeToRefs(n),i=e.computed(()=>{var c,d,u;return((u=(d=(c=a.value.currentModifier)==null?void 0:c.sizes)==null?void 0:d.find(f=>f.id===a.value.selectedSize.id))==null?void 0:u.price)??ct(a.value.currentModifier)}),s=()=>{a.value.currentModifier&&(a.value.currentModifier.amount=a.value.modalCount),n.modifierSelect(a.value.currentModifier),a.value.isModifiedAmount=!1},l=()=>{a.value.modalCount=1,a.value.currentModifier.amount=1};return(c,d)=>{var u,f;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",fl,[e.createElementVNode("div",ml,[e.createElementVNode("img",{class:"modifier_image",src:((u=e.unref(a).currentModifier)==null?void 0:u.image_link)||e.unref(o).fallback_image||""},null,8,pl),e.createElementVNode("div",hl,[e.createElementVNode("p",_l,e.toDisplayString((f=e.unref(a).currentModifier)==null?void 0:f.name),1),e.createElementVNode("p",null,"+ "+e.toDisplayString(i.value)+"₽",1)])])]),e.createElementVNode("div",gl,[e.createElementVNode("div",{class:"amount_mines",onClick:d[0]||(d[0]=e.withModifiers((...m)=>e.unref(n).minusAmount&&e.unref(n).minusAmount(...m),["stop"]))},[...d[1]||(d[1]=[e.createElementVNode("div",null,null,-1)])]),e.createElementVNode("p",yl,e.toDisplayString(e.unref(a).modalCount),1),e.createElementVNode("div",bl,[e.createVNode(Bn,{onClick:e.withModifiers(e.unref(n).plusAmount,["stop"])},null,8,["onClick"])])]),e.createElementVNode("p",{class:"clear_count",onClick:e.withModifiers(l,["stop"])},"Убрать все"),e.createElementVNode("div",wl,[e.createVNode(Re,{textButtonDefault:"Добавить",onClick:s,class:"button_add_group_modifiers"})])],64)}}}),[["__scopeId","data-v-84debd5d"]]),kl=(t,n,r)=>Math.max(n,Math.min(t,r)),Sl=(t,n)=>Math.pow(t,n*5),no=(t,n,r)=>n===0||Math.abs(n)===1/0?Sl(t,r):t*n*r/(n+r*t),Jt=(t,n)=>n*parseFloat(t)/100,Mn=(t,n,r,o=.15)=>o===0?kl(t,n,r):t<n?-no(n-t,r-n,o)+n:t>r?+no(t-r,r-n,o)+r:t,Ae=(t,{min:n,max:r})=>n!==void 0&&t<n?n:r!==void 0&&t>r?r:t;function El(t,n,r){const o=e.ref(0),a=e.computed(()=>t.value.map(c=>typeof c=="string"?Jt(c,r.value):c)),i=e.computed(()=>Math.min(...a.value)),s=e.computed(()=>Math.max(...a.value)),l=e.computed(()=>{const c=a.value.reduce((d,u)=>Math.abs(u-n.value)<Math.abs(d-n.value)?u:d);return a.value.indexOf(c)});return{currentSnapPointIndex:o,flattenedSnapPoints:a,minSnapPoint:i,maxSnapPoint:s,closestSnapPointIndex:l}}const Pn=X(e.defineComponent({__name:"BottomSheet",props:{duration:{default:250},snapPoints:{},initialSnapPoint:{},blocking:{type:Boolean,default:!0},canSwipeClose:{type:Boolean,default:!0},swipeCloseThreshold:{},canBackdropClose:{type:Boolean,default:!0},expandOnContentDrag:{type:Boolean,default:!0},modelValue:{type:Boolean},teleportTo:{default:"body"},teleportDefer:{type:Boolean,default:!1},headerClass:{},contentClass:{},footerClass:{}},emits:["opened","opening-started","closed","closing-started","ready","dragging-up","dragging-down","snapped","instinctHeight","update:modelValue"],setup(t,{expose:n,emit:r}){const o=t,a=r,i=we.useVModel(o,"modelValue",a,{passive:!0});e.watch(i,U=>{U&&I()}),e.onMounted(()=>{i.value&&I()});const s=e.ref(),l=e.ref(null),c=e.ref(null),d=e.ref(null),u=e.ref(null),f=e.ref(o.expandOnContentDrag),{height:m}=we.useWindowSize(),{height:h}=we.useElementBounding(s),{height:p}=we.useElementBounding(l),{height:y}=we.useElementBounding(u),{height:b}=we.useElementBounding(c),w=e.computed({get(){return Ae(Math.ceil(y.value+p.value+b.value),{max:m.value})},set(U){[p.value,y.value,b.value]=U}}),g=e.ref(0),_=e.ref(0),S=_e.useMotionValue(0),M=_e.useMotionValue(0),{snapPoints:V}=e.toRefs(o),$=e.computed(()=>V.value??[w.value]),{flattenedSnapPoints:D,currentSnapPointIndex:E,closestSnapPointIndex:N,minSnapPoint:P,maxSnapPoint:R}=El($,g,m);let T;function x(U){f.value=!0,C(U)}function C(U){f.value&&U.preventDefault()}const B=U=>{U.key==="Escape"&&H()},A=()=>{o.canBackdropClose&&H()};let k=!1;const I=async()=>{if(k)return;i.value=!0,k=!0,a("opening-started"),await e.nextTick();const U=s.value.$el;h.value=U.getBoundingClientRect().height;const ne=U.querySelector("[data-vsbs-content]"),ie=U.querySelector("[data-vsbs-header]"),me=U.querySelector("[data-vsbs-footer]");if(w.value=[ie.getBoundingClientRect().height,ne.getBoundingClientRect().height,me.getBoundingClientRect().height],await e.nextTick(),E.value=D.value.findIndex(Me=>Me===P.value),o.initialSnapPoint){const Me=o.initialSnapPoint;if(Me<0||Me>=$.value.length)return console.warn("Index out of bounds");g.value=typeof $.value[Me]=="number"?Ae($.value[Me],{max:m.value}):Jt($.value[Me],m.value)}else g.value=Ae(P.value,{max:m.value});_.value=g.value,S.jump(g.value),M.jump(g.value),requestAnimationFrame(()=>{T=_e.animate(S,g.value,{duration:o.duration/1e3,ease:"easeInOut"}),T=_e.animate(M,0,{duration:o.duration/1e3,ease:"easeInOut",onComplete:()=>{o.blocking&&a("opened")}})}),window.addEventListener("keydown",B),k=!1};let O=!1;const H=()=>{O||(i.value=!1,O=!0,a("closing-started"),window.removeEventListener("keydown",B),setTimeout(()=>{a("closed"),O=!1},o.duration))},W=U=>{if($.value){if(U<0||U>=$.value.length){console.warn("Index out of bounds");return}E.value=U,g.value=typeof $.value[U]=="number"?Ae($.value[U],{max:m.value}):Jt($.value[U],m.value),T=_e.animate(S,g.value,{duration:o.duration/1e3,ease:"easeInOut",onComplete:()=>a("snapped",$.value.indexOf($.value[U]))})}};function j(U){U>0?a("dragging-down"):U<0&&a("dragging-up")}const G=()=>{g.value=h.value,_.value=M.get(),S.jump(g.value),M.jump(_.value)},ee=async(U,ne)=>{await e.nextTick(),s.value&&(_.value<=0&&(g.value-=ne.delta.y),g.value<=P.value&&(g.value=P.value,_.value+=ne.delta.y,M.set(o.canSwipeClose?Ae(_.value,{min:0}):Ae(Mn(_.value,-h.value,0,.5),{min:0}))),S.set(Ae(Mn(g.value,0,R.value,.25),{min:0,max:m.value})),j(ne.delta.y))},Y=()=>{if(o.canSwipeClose){let U=g.value/2;o.swipeCloseThreshold&&typeof o.swipeCloseThreshold=="number"&&(U=o.swipeCloseThreshold),o.swipeCloseThreshold&&typeof o.swipeCloseThreshold=="string"&&o.swipeCloseThreshold.includes("%")&&(U=g.value*(Number(o.swipeCloseThreshold.replace("%",""))/100)),Math.abs(_.value)>U&&(_.value=g.value)}else _.value=0;T=_e.animate(M,_.value,{duration:o.duration/1e3,ease:"easeInOut"}),_.value===g.value&&(_.value=0,H()),E.value=N.value,g.value=typeof $.value[N.value]=="number"?Ae($.value[N.value],{max:m.value}):Jt($.value[N.value],m.value),T=_e.animate(S,g.value,{duration:o.duration/1e3,ease:"easeInOut",onComplete:()=>a("snapped",$.value.indexOf($.value[N.value]))}),T=_e.animate(M,0,{duration:o.duration/1e3,ease:"easeInOut"})},de=(U,ne)=>{if(g.value=h.value,_.value=M.get(),T&&T.stop(),!d.value)return;const ie=d.value.scrollTop===0,me=ne.delta.y>0,Me=D.value.length===1,Hn=.5>Math.abs(g.value-R.value);if(Me){if(!o.expandOnContentDrag)return f.value=!1;M.get()===0&&ie&&me&&(f.value=!0),M.get()===0&&ie&&!me&&(f.value=!1)}else{if(!o.expandOnContentDrag)return f.value=!1;f.value=!0,Hn&&(me&&ie&&(f.value=!0),!me&&ie&&(f.value=!1),ie||(f.value=!1))}},pe=async(U,ne)=>{if(await e.nextTick(),!o.expandOnContentDrag)return f.value=!1;if(!s.value)return;_.value===0&&f.value&&o.expandOnContentDrag&&(g.value-=ne.delta.y),g.value<=P.value&&(g.value=P.value,f.value&&o.expandOnContentDrag&&(_.value+=ne.delta.y),_.value=Ae(_.value,{min:0,max:P.value}),M.set(o.canSwipeClose?Ae(_.value,{min:0}):Ae(Mn(_.value,-h.value,0,.5),{min:0}))),g.value>R.value&&(g.value=R.value),g.value=Ae(g.value,{max:m.value}),!(D.value.length===1)&&g.value===R.value&&(f.value=!1),S.set(g.value),j(ne.delta.y)},he=()=>{if(!d.value)return;const U=d.value.scrollTop===0;f.value=U},ae=we.useDebounceFn(U=>W(U),o.duration);return e.watch($,(U,ne)=>{if(i.value===!1||!U||!ne)return;const ie=U[E.value],me=ne[E.value];typeof ie!="string"&&typeof me!="string"&&(g.value=Ae(ie,{max:m.value}),ie!==me&&(T=_e.animate(S,g.value,{duration:o.duration/1e3,ease:"easeInOut"})))}),e.watch(m,()=>ae(E.value)),e.watch(w,U=>a("instinctHeight",U)),n({open:I,close:H,snapToPoint:W}),(U,ne)=>(e.openBlock(),e.createBlock(e.Teleport,{to:t.teleportTo,defer:t.teleportDefer},[e.createElementVNode("div",e.mergeProps(U.$attrs,{"data-vsbs-container":""}),[e.createVNode(e.unref(_e.AnimatePresence),null,{default:e.withCtx(()=>[e.unref(i)&&t.blocking?(e.openBlock(),e.createBlock(e.unref(_e.Motion),{key:0,ref:"backdrop","data-vsbs-backdrop":"",onClick:ne[0]||(ne[0]=ie=>A()),transition:{ease:"easeInOut",duration:t.duration/1e3},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},null,8,["transition"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(_e.AnimatePresence),null,{default:e.withCtx(()=>[e.unref(i)?(e.openBlock(),e.createBlock(e.unref(_e.Motion),{key:0,ref_key:"sheet",ref:s,exit:{y:"100%",height:e.unref(h),opacity:0},initial:!1,style:e.normalizeStyle({y:e.unref(M),z:1,height:e.unref(S)}),"data-vsbs-shadow":!t.blocking,"data-vsbs-sheet-show":e.unref(i),"aria-modal":"true","data-vsbs-sheet":"",tabindex:"-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(_e.Motion),{ref_key:"sheetHeader",ref:l,"data-vsbs-header":"",onPanStart:G,onPan:ee,onPanEnd:Y,onTouchmove:x,class:e.normalizeClass(t.headerClass)},{default:e.withCtx(()=>[e.renderSlot(U.$slots,"header",{},void 0,!0)]),_:3},8,["class"]),e.createElementVNode("div",{ref_key:"sheetScroll",ref:d,"data-vsbs-scroll":"",onScrollend:he},[e.createVNode(e.unref(_e.Motion),{ref:"sheetContentWrapper","data-vsbs-content-wrapper":"",onPanStart:de,onPan:pe,onPanEnd:Y,onTouchmove:C},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"sheetContent",ref:u,"data-vsbs-content":"",class:e.normalizeClass(t.contentClass)},[e.renderSlot(U.$slots,"default",{},void 0,!0)],2)]),_:3},512)],544),e.createVNode(e.unref(_e.Motion),{ref_key:"sheetFooter",ref:c,"data-vsbs-footer":"",onPanStart:G,onPan:ee,onPanEnd:Y,onTouchmove:x,class:e.normalizeClass(t.footerClass)},{default:e.withCtx(()=>[e.renderSlot(U.$slots,"footer",{},void 0,!0)]),_:3},8,["class"])]),_:3},8,["exit","style","data-vsbs-shadow","data-vsbs-sheet-show"])):e.createCommentVNode("",!0)]),_:3})],16)],8,["to","defer"]))}}),[["__scopeId","data-v-8bf4388d"]]);function Ze(t,n=null){const r=Vt();r.initCacheSingle("defaultImage");const o=e.computed(()=>r.cache.defaultImage||null),a=e.shallowRef(!1),i=e.computed(()=>{var d;return((d=e.toValue(t))==null?void 0:d.toString())||null}),s=we.computedAsync(async()=>{const d=i.value;return d?(await r.initCacheSingle(d),r.cache[d]||null):null},null,{evaluating:a}),l=e.computed(()=>a.value&&i.value!==null);return{mediaUrl:e.computed(()=>s.value||e.toValue(n)||o.value||null),isLoading:l}}const Nl={class:"card_product_wrapper"},vl={class:"card_product_modifiers_sheet_body"},Il={class:"card__pictures"},Bl=["src"],xl=["src"],Al={class:"card_header_wrapper"},Ml={key:0,class:"card_fire_kkal_wrapper"},Pl={class:"card_content"},Tl={class:"wrapper_size"},Rl={key:0,class:"description"},$l={key:1},Vl=X(e.defineComponent({__name:"CardProductPage",props:{configPage:{}},setup(t){const n=ge(),r=fe(),{stateCard:o,isOpenWindow:a}=F.storeToRefs(r),{itemThemes:i}=F.storeToRefs(n),s=K.useRouter(),l=K.useRoute(),c=t,{mediaUrl:d}=Ze(()=>{var m,h;return(m=o.value.openCard)!=null&&m.video_link?`${o.value.openCard.id}_video`:(h=o.value.openCard)!=null&&h.image_link?`${o.value.openCard.id}_image`:null},()=>{var m,h;return((m=o.value.openCard)==null?void 0:m.video_link)||((h=o.value.openCard)==null?void 0:h.image_link)||null}),u=()=>{c.configPage.qr_menu?s.push(`/${l.params.orgId}`):c.configPage.closeProduct()},f=()=>{o.value.isModifiedAmount=!1};return e.watch(()=>c.configPage.data,r.setCurrentCard),e.watchEffect(()=>{a.value||(a.value=c.configPage.is_closeProduct)}),e.onBeforeUnmount(()=>r.reset()),(m,h)=>{var p,y,b,w,g,_;return e.openBlock(),e.createElementBlock("div",Nl,[e.createVNode(e.unref(Pn),{modelValue:e.unref(o).isSectionModifier,"onUpdate:modelValue":h[1]||(h[1]=S=>e.unref(o).isSectionModifier=S),class:"card_product_modifiers_sheet"},{default:e.withCtx(()=>[e.createElementVNode("div",vl,[e.createVNode(Li,{onClose:h[0]||(h[0]=S=>e.unref(o).isSectionModifier=!1)}),e.createVNode(eo,{isSectionModifier:e.unref(o).isSectionModifier,toggleNotRequire:e.unref(r).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])]),_:1},8,["modelValue"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(o).isModifiedAmount?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wrapper_modified_amount",onClick:e.withModifiers(f,["stop"])},[e.createVNode(Cl)])):e.createCommentVNode("",!0)])),e.createElementVNode("div",Il,[(p=e.unref(o).openCard)!=null&&p.video_link&&e.unref(d)?e.withDirectives((e.openBlock(),e.createElementBlock("video",{key:e.unref(d),loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},[e.createElementVNode("source",{src:e.unref(d)||"",type:"video/webm"},null,8,Bl)])),[[e.unref(vt)]]):(e.openBlock(),e.createElementBlock("img",{key:1,class:"card__pictures_images",src:e.unref(d)||"",alt:"Product image"},null,8,xl)),e.createElementVNode("div",Al,[e.createVNode(Nt,{class:"card_header_back",onClick:u,"aria-label":"Вернуться назад"}),(y=e.unref(o).openCard)!=null&&y.energy_amount?(e.openBlock(),e.createElementBlock("div",Ml,[h[3]||(h[3]=e.createElementVNode("div",{class:"card_fire_kkal"},null,-1)),e.createElementVNode("p",null,[e.createElementVNode("b",null,e.toDisplayString((b=e.unref(o).openCard)==null?void 0:b.energy_amount),1),h[2]||(h[2]=e.createTextVNode(" Ккал ",-1))])])):e.createCommentVNode("",!0)]),e.createElementVNode("h4",null,e.toDisplayString((w=e.unref(o).openCard)==null?void 0:w.name),1),e.createElementVNode("div",{class:"card__pictures__gradient",style:e.normalizeStyle(e.unref(i).gradientStyle)},null,4)]),e.createElementVNode("div",Pl,[e.createElementVNode("div",Tl,[e.createVNode(ji)]),(g=e.unref(o).openCard)!=null&&g.description?(e.openBlock(),e.createElementBlock("p",Rl,e.toDisplayString((_=e.unref(o).openCard)==null?void 0:_.description),1)):e.createCommentVNode("",!0),e.unref(o).groupModifiers.length?(e.openBlock(),e.createElementBlock("div",$l,[h[4]||(h[4]=e.createElementVNode("p",{class:"title_info_modifiers"},"Настрой, как ты любишь",-1)),e.createVNode(eo,{isSectionModifier:e.unref(o).isSectionModifier,toggleNotRequire:e.unref(r).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])):e.createCommentVNode("",!0),e.createVNode(ul,{qr_menu:t.configPage.qr_menu,closeProduct:t.configPage.closeProduct},null,8,["qr_menu","closeProduct"])])])}}}),[["__scopeId","data-v-a9fa8db1"]]),Dl={key:0,class:"popupWindowDefault_overlay"},ro=X(e.defineComponent({__name:"PopupWindowDefault",props:{visible:{type:Boolean}},emits:["update:visible"],setup(t,{emit:n}){const r=t,o=n,a=()=>{o("update:visible",!1)};return e.watch(()=>r.visible,async i=>{i&&await e.nextTick(),r.isVisible=i}),(i,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"popupWindowDefaultBlack",appear:"",onAfterLeave:s[0]||(s[0]=()=>{o("update:visible",!1)})},{default:e.withCtx(()=>[r.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"background_black",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"popupWindowDefault",appear:"",onAfterLeave:s[1]||(s[1]=()=>{o("update:visible",!1)})},{default:e.withCtx(()=>[r.visible?(e.openBlock(),e.createElementBlock("div",Dl,[e.renderSlot(i.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]),_:3})],64))}}),[["__scopeId","data-v-08e0e008"]]),Ol={},zl={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ll(t,n){return e.openBlock(),e.createElementBlock("svg",zl,[...n[0]||(n[0]=[e.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 Fl=X(Ol,[["render",Ll]]),Tn=F.defineStore("modals",()=>{const t=new Map,n=(a,i)=>{const s=o(a).value;s.visible=!0,s.context=i},r=a=>{const i=o(a).value;i.visible=!1},o=a=>(t.has(a)||t.set(a,e.ref({visible:!1})),t.get(a));return{state:o,open:n,close:r}}),Hl=["src"],Ul={class:"cart_box_content_wrapper"},ql={class:"cart_box_content_info"},jl={class:"cart_amount"},Wl={class:"cart_amount_count"},Gl={class:"cart_box_info_more"},Kl={key:1,class:"cart_modifier_info"},Zl={class:"cart_modifier_content"},Ql={class:"wrapper_price_count_cart"},Jl={class:"count_cart_box"},Yl={class:"wrapper_modifiers_discount"},oo=X(e.defineComponent({__name:"CartBox",props:{index:Number,cardItem:Object},emits:["delete"],setup(t,{emit:n}){const r=t,o=se(),a=ge(),i=Tn(),{itemThemes:s}=F.storeToRefs(a),l=e.ref(0),c=e.ref(0),d=e.ref(!1),u=e.ref(!1),f=e.ref(!1),{displayNumber:m,update:h}=to(0,800),p=e.computed(()=>{var P,R;const E=((P=r.cardItem)==null?void 0:P.modifiers)??[],N=(((R=r.cardItem)==null?void 0:R.group_modifiers)??[]).flatMap(T=>T.modifiers??[]);return[...E,...N]}),{mediaUrl:y}=Ze(()=>{var E;return((E=r.cardItem)==null?void 0:E.id)+"_image"},()=>{var E;return(E=r.cardItem)==null?void 0:E.image_link}),b=e.computed(()=>{var E,N;return((E=r.cardItem)==null?void 0:E.total_new_price)||ct(r.cardItem)*((N=r.cardItem)==null?void 0:N.amount)}),w=()=>i.open("cart-delete-confirm",r.cardItem),g=()=>{f.value=!f.value},_=()=>{o.plusAmount(r.cardItem.idSystem)},S=()=>{r.cardItem.amount>1?o.minusAmount(r.cardItem.idSystem):w()},M=E=>{l.value=E.touches[0].clientX,d.value=!0},V=E=>{d.value&&(c.value=E.touches[0].clientX-l.value,c.value>0&&(c.value=0))},$=()=>{d.value=!1,c.value<-115&&w(),c.value=0};e.onMounted(()=>{r.index===0&&(u.value=!0,setTimeout(()=>{c.value=-90,setTimeout(()=>{c.value=0,u.value=!1},700)},0))});const D=e.computed(()=>{const E=r.index===0&&u.value?1:`${1-Math.abs(c.value)/200}`;return{transform:`translateX(${c.value}px)`,opacity:E,transition:d.value?"none":"transform 0.7s, opacity 0.7s"}});return e.watch(b,h,{immediate:!0}),(E,N)=>{var P,R,T,x;return e.openBlock(),e.createElementBlock("div",{class:"cart_box_wrapper",onTouchstart:M,onTouchmove:V,onTouchend:$,style:e.normalizeStyle(D.value)},[N[2]||(N[2]=e.createElementVNode("div",{class:"wrapper_cart_delete"},[e.createElementVNode("div",{class:"cart_delete"})],-1)),e.createElementVNode("img",{src:e.unref(y)||"",class:"cart_box_image"},null,8,Hl),e.createElementVNode("div",Ul,[e.createElementVNode("div",ql,[e.createElementVNode("p",null,e.toDisplayString((P=t.cardItem)==null?void 0:P.name),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((R=r.cardItem)==null?void 0:R.discounts)||[],(C,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:"discount_banner"},[e.createElementVNode("p",null,e.toDisplayString(C.name),1),e.createElementVNode("p",null,e.toDisplayString(C.discount)+"₽",1)]))),128)),e.createElementVNode("div",jl,[e.createElementVNode("button",{onClick:S},"-"),e.createElementVNode("p",Wl,e.toDisplayString(r.cardItem.amount),1),e.createElementVNode("button",{onClick:_},"+")])]),e.createElementVNode("div",Gl,[e.createElementVNode("div",{class:"cart_box_remove_item",onClick:w},[e.createVNode(Fl)]),(T=r.cardItem)!=null&&T.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(x=r.cardItem)==null?void 0:x.new_price})},e.toDisplayString((r.cardItem.new_price*r.cardItem.amount).toFixed(2)+"₽"),3)):e.createCommentVNode("",!0),e.createElementVNode("p",null,e.toDisplayString(e.unref(m).toFixed(2)+"₽"),1)])]),!f.value&&p.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_modifier_toggle",onTouchstart:e.withModifiers(g,["stop"])},[...N[0]||(N[0]=[e.createElementVNode("p",{class:"cart_info_more"},"Посмотреть модификаторы",-1),e.createElementVNode("p",{class:"cart_arrow"},null,-1)])],32)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("div",Kl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,C=>{var B;return e.openBlock(),e.createElementBlock("div",{class:"cart_modifier_item",key:C.id},[e.createElementVNode("div",Zl,[e.createVNode(Bn,{id:"plus_orange"}),e.createElementVNode("p",null,e.toDisplayString(C.name),1)]),e.createElementVNode("div",Ql,[e.createElementVNode("p",Jl,e.toDisplayString(`x${C.amount}`),1),e.createElementVNode("div",Yl,[C!=null&&C.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(B=C==null?void 0:C.new_price)==null?void 0:B.toFixed(2)})},e.toDisplayString((C.new_price*C.amount).toFixed(2)+"₽"),3)):e.createCommentVNode("",!0),e.createElementVNode("p",null,e.toDisplayString((C.total_new_price||C.price*C.amount).toFixed(2)+"₽"),1)])])])}),128)),e.createElementVNode("div",{class:"cart_modifier_arrow",onTouchstart:e.withModifiers(g,["stop"])},[...N[1]||(N[1]=[e.createElementVNode("p",{class:"cart_info_more"},"Скрыть",-1),e.createElementVNode("p",{class:"cart_arrow_top"},null,-1)])],32)])):e.createCommentVNode("",!0)],36)}}}),[["__scopeId","data-v-868411fd"]]),Xl={},ec={class:"nfc_x",viewBox:"0 0 48 48"};function tc(t,n){return e.openBlock(),e.createElementBlock("svg",ec,[...n[0]||(n[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#B00020","stroke-width":"2.4",fill:"none"},null,-1),e.createElementVNode("path",{d:"M14 16L34 30M34 16L14 30",stroke:"#B00020","stroke-width":"3","stroke-linecap":"round"},null,-1)])])}const nc=X(Xl,[["render",tc]]),rc={},oc={style:{},"aria-hidden":"true",viewBox:"0 0 48 48",class:"nfc_ok"};function ac(t,n){return e.openBlock(),e.createElementBlock("svg",oc,[...n[0]||(n[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#5D534B","stroke-width":"none",fill:"none"},null,-1),e.createElementVNode("path",{d:"M16 22h16m-10 6h6",stroke:"#5D534B","stroke-width":"2.4","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M14 28l6 6l14-14",fill:"none",stroke:"#2ECC71","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const sc=X(rc,[["render",ac]]),ic={key:0,class:"nfc_ok",viewBox:"0 0 48 48","aria-hidden":"true"},lc=e.defineComponent({__name:"CardReaderRetry",props:{styleRetry:{type:Boolean}},setup(t){return(n,r)=>t.styleRetry?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",ic,[...r[0]||(r[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4"},null,-1),e.createElementVNode("path",{d:"M16 22h16m-10 6h6"},null,-1)])]))}}),cc={class:"sheet_header"},dc={class:"sheet_title",id:"sheetTitle"},uc={class:"sheet_body"},fc={class:"sheet_card"},mc={class:"nfc_title"},pc={class:"lead"},hc={class:"wrapper_input_accept"},_c={key:0,class:"card_phone_auth_wrapper"},gc={class:"sr_only","aria-live":"polite"},ao=e.defineComponent({__name:"CardReader",setup(t){const n=se(),r=ge(),{is_OpenLoyal:o}=F.storeToRefs(n),{itemThemes:a}=F.storeToRefs(r),i=ue(),s=e.ref(),l=e.ref(),c=e.ref(null),d=e.ref(""),u={wait:{text:"Лояльность",title:""},success:{text:"Стикер распознан",title:"Стикер распознан"},not_found:{text:"Стикер не распознан",title:"Стикер не распознали"}},f=e.computed({get:()=>d.value,set:A=>{d.value=A.replace(/\s/g,"")}}),m=e.computed(()=>i.currentState),h=e.computed(()=>i.isDrawerOpen),p=e.computed(()=>{var A;return((A=u[m.value])==null?void 0:A.text)||""}),y=e.computed(()=>{var A;(A=u[m.value])!=null&&A.title}),b=e.computed(()=>m.value==="success"?"Добро пожаловать!":a.value.kiosk_show_loyalty_phone_input_button?"Поднесите стикер к считывателю или войдите по номеру телефона":"Поднесите стикер к считывателю или введите номер карты вручную"),w=e.computed(()=>({ok:m.value==="success",warn:m.value==="not_found"})),g=e.computed(()=>{const A=[];return m.value==="wait"&&A.push("pulse","show-x"),m.value==="not_found"&&A.push("pulse","show-x"),m.value==="success"&&A.push("pulse","show-ok"),A}),_=e.computed(()=>m.value==="not_found"),S=e.computed(()=>m.value==="success"),M=e.computed(()=>m.value==="not_found"),V=e.computed(()=>["not_found"].includes(m.value)),$=e.computed(()=>({wait:"Стикер не распознан. Нажмите «Повторить».",success:"Стикер распознан. Нажмите «Продолжить».",not_found:"Стикер не распознан. Нажмите «Повторить»."})[m.value]||""),D=()=>{i.closeDrawer(),o.value=!0},E=async A=>{var k,I;i.error="",c.value=null;try{const O=new qe;await O.authorizeByCard(A.trim()),await O.getProfile(),n.loadCart(),i.setState("success"),i.isDrawerOpen=!1,i.showNotification("Вы успешно авторизовались в программе лояльности!")}catch(O){i.error=((I=(k=O.response)==null?void 0:k.data)==null?void 0:I.user_friendly_message)||"Ошибка",i.setState("not_found"),c.value=f.value,f.value=""}},N=()=>{var A;i.setState("wait"),i.error="",f.value="",c.value=null,(A=s.value)==null||A.focus()},P=()=>{i.closeDrawer(),c.value=null,f.value=""},R=()=>{var A,k;i.setState("wait"),(k=(A=f.value)==null?void 0:A.trim())!=null&&k.length&&E(f.value.trim())},T=A=>{A.stopPropagation(),document.activeElement!==l.value&&x()},x=()=>{e.nextTick(()=>{l.value&&(l.value.focus(),d.value&&l.value.select())})},C=A=>{const k=document.activeElement===l.value;if(!h.value||k)return;const I=A.key.toLowerCase();if(I==="backspace")return f.value=f.value.slice(0,-1);if(I==="escape")return P();if(I==="r"&&M.value)return N();if(I==="c"&&m.value==="success")return P();if(I==="enter")return R();f.value+=I},B={mounted(A){A==null||A.focus()}};return e.onMounted(()=>{document==null||document.addEventListener("keydown",C)}),e.onBeforeUnmount(()=>{document==null||document.removeEventListener("keydown",C)}),e.watchEffect(()=>{h.value&&(i.error="")}),(A,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"backdrop show",onClick:P,"aria-hidden":"true"})):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(["sheet show",{sheet_retry:M.value}]),"aria-modal":"true","aria-labelledby":"sheetTitle",onClick:T},[e.createElementVNode("header",cc,[e.createElementVNode("div",dc,e.toDisplayString(p.value),1),M.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sheet_status",w.value])},e.toDisplayString(c.value),3)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"sheet_close",onClick:P,"aria-label":"Закрыть"}," Закрыть ")]),e.createElementVNode("div",uc,[e.createElementVNode("div",fc,[e.createElementVNode("div",{class:e.normalizeClass(["nfc",g.value])},[e.createVNode(lc,{styleRetry:V.value},null,8,["styleRetry"]),_.value?(e.openBlock(),e.createBlock(nc,{key:0})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"overlay check",style:e.normalizeStyle({display:S.value?"grid":"none"}),"aria-hidden":"true"},[e.createVNode(sc)],4)],2),e.createElementVNode("h2",mc,e.toDisplayString(y.value),1),e.createElementVNode("p",pc,e.toDisplayString(b.value),1),e.createElementVNode("div",hc,[e.withDirectives(e.createElementVNode("input",{ref_key:"cardInputManualRef",ref:l,"onUpdate:modelValue":k[0]||(k[0]=I=>f.value=I),class:"nfc_title_read_input",type:"text",placeholder:"Введите трек карты","aria-live":"polite",onKeydown:e.withKeys(R,["enter"])},null,544),[[e.vModelText,f.value],[B]]),M.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:N},"Повторить")):(e.openBlock(),e.createElementBlock("button",{key:1,class:"btn btn_ghost",onClick:k[1]||(k[1]=I=>M.value?P:R())},"Отправить"))]),m.value==="wait"&&e.unref(a).kiosk_show_loyalty_phone_input_button?(e.openBlock(),e.createElementBlock("div",_c,[e.createElementVNode("button",{class:"card_phone_auth_button",onClick:D},"Войти по номеру телефона")])):e.createCommentVNode("",!0)])]),e.createElementVNode("input",{ref_key:"cardInputRef",ref:s,type:"text",class:"sr_only","aria-live":"polite"},null,512),e.createElementVNode("div",gc,e.toDisplayString($.value),1)],2)):e.createCommentVNode("",!0)],64))}});function so(){const t=K.useRoute(),n=ue(),r=se(),{isButtonDisabled:o}=F.storeToRefs(n),a=(s,l)=>{const c=s.is_tableservice?"tableservice":s.kiosk_menu?"kiosk":"qr",d=n.createPaymentHandler(c,s.kiosk_menu,s.is_tableservice,l);return d?{...d.config,route:{params:{orgId:String(t.params.orgId)}},handler:d.handler,setButtonDisabled:u=>{o.value=u},on403Kiosk:()=>{localStorage.removeItem("apiKey"),r.is_showApiKey=!0}}:null};return{getCreateOrderConfig:a,makeCreateOrderRequest:async(s,l)=>{const c=a(s,l.paymentMethodId);if(c)return Js(l.items,l.tableDataId,c,{comment:l.comment,is_authorized:l.isAuthorized,signal:l.signal})}}}const yc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJJTk5PIGJhbmsgY2FyZCBpY29uIj4NCiAgPGRlZnM+DQogICAgPGxpbmVhckdyYWRpZW50IGlkPSJibGFja0dyYWQiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4NCiAgICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMxQTFBMUEiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPg0KICAgIDwvbGluZWFyR3JhZGllbnQ+DQoNCiAgICA8bGluZWFyR3JhZGllbnQgaWQ9InNoaW5lIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMCI+DQogICAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjRkZGRkZGIiBzdG9wLW9wYWNpdHk9IjAiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iNTAlIiBzdG9wLWNvbG9yPSIjRkZGRkZGIiBzdG9wLW9wYWNpdHk9IjAuMTgiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI0ZGRkZGRiIgc3RvcC1vcGFjaXR5PSIwIi8+DQogICAgPC9saW5lYXJHcmFkaWVudD4NCg0KICAgIDxmaWx0ZXIgaWQ9InNoYWRvdyIgeD0iLTMwJSIgeT0iLTMwJSIgd2lkdGg9IjE2MCUiIGhlaWdodD0iMTYwJSI+DQogICAgICA8ZmVEcm9wU2hhZG93IGR4PSIwIiBkeT0iNiIgc3RkRGV2aWF0aW9uPSI2IiBmbG9vZC1jb2xvcj0iIzAwMCIgZmxvb2Qtb3BhY2l0eT0iMC4yNSIvPg0KICAgIDwvZmlsdGVyPg0KICA8L2RlZnM+DQoNCiAgPCEtLSBDZW50ZXJlZCBjYXJkIC0tPg0KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg3LjUgMjMpIHJvdGF0ZSgtMTIpIiBmaWx0ZXI9InVybCgjc2hhZG93KSI+DQogICAgPCEtLSBjYXJkIGJvZHkgLS0+DQogICAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijg1IiBoZWlnaHQ9IjU0IiByeD0iMTAiIGZpbGw9InVybCgjYmxhY2tHcmFkKSIvPg0KDQogICAgPCEtLSB0b3Agc3RyaXBlIC0tPg0KICAgIDxyZWN0IHg9IjAiIHk9IjgiIHdpZHRoPSI4NSIgaGVpZ2h0PSI4IiByeD0iNCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wNSIvPg0KDQogICAgPCEtLSBjaGlwIC0tPg0KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwIDI3KSI+DQogICAgICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTUiIHJ4PSIzIiBmaWxsPSIjQ0ZBRTcwIi8+DQogICAgICA8cmVjdCB4PSIyLjUiIHk9IjMuNSIgd2lkdGg9IjEzIiBoZWlnaHQ9IjEuMiIgZmlsbD0iIzlFODM0RSIvPg0KICAgICAgPHJlY3QgeD0iMi41IiB5PSI2LjUiIHdpZHRoPSIxMyIgaGVpZ2h0PSIxLjIiIGZpbGw9IiM5RTgzNEUiLz4NCiAgICAgIDxyZWN0IHg9IjIuNSIgeT0iOS41IiB3aWR0aD0iMTMiIGhlaWdodD0iMS4yIiBmaWxsPSIjOUU4MzRFIi8+DQogICAgICA8cmVjdCB4PSI4LjUiIHk9IjAiIHdpZHRoPSIxLjUiIGhlaWdodD0iMTUiIGZpbGw9IiM5RTgzNEUiIG9wYWNpdHk9IjAuNiIvPg0KICAgIDwvZz4NCg0KICAgIDwhLS0gSU5OTyBsb2dvIC0tPg0KICAgIDx0ZXh0IHg9IjYxIiB5PSIzOSINCiAgICAgICAgICBmb250LWZhbWlseT0ic3lzdGVtLXVpLCAtYXBwbGUtc3lzdGVtLCBTZWdvZSBVSSwgUm9ib3RvLCBBcmlhbCwgc2Fucy1zZXJpZiINCiAgICAgICAgICBmb250LXNpemU9IjEzIg0KICAgICAgICAgIGZvbnQtd2VpZ2h0PSI4MDAiDQogICAgICAgICAgbGV0dGVyLXNwYWNpbmc9IjEuMiINCiAgICAgICAgICBmaWxsPSIjRkZGRkZGIg0KICAgICAgICAgIG9wYWNpdHk9IjAuOTUiDQogICAgICAgICAgdGV4dC1hbmNob3I9Im1pZGRsZSI+DQogICAgICBpbm5vDQogICAgPC90ZXh0Pg0KDQogICAgPCEtLSBzaGluZSAtLT4NCiAgICA8cGF0aCBkPSJNLTggNiBMMjUgLTMgTDk0IDQ3IEw2MCA2MiBMLTggMjUgWiIgZmlsbD0idXJsKCNzaGluZSkiLz4NCiAgPC9nPg0KPC9zdmc+",io="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20width='100'%20height='100'%20fill='none'%3e%3c!--%20Big%20QR%20corners%20(outer%20shape%20with%20inner%20cutout)%20--%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M72%200H163C202.765%200%20235%2032.235%20235%2072V163C235%20202.765%20202.765%20235%20163%20235H72C32.235%20235%200%20202.765%200%20163V72C0%2032.235%2032.235%200%2072%200Z%20M102%2086H133C141.837%2086%20149%2093.163%20149%20102V133C149%20141.837%20141.837%20149%20133%20149H102C93.163%20149%2086%20141.837%2086%20133V102C86%2093.163%2093.163%2086%20102%2086Z%20'/%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M349%200H440C479.765%200%20512%2032.235%20512%2072V163C512%20202.765%20479.765%20235%20440%20235H349C309.235%20235%20277%20202.765%20277%20163V72C277%2032.235%20309.235%200%20349%200Z%20M379%2086H410C418.837%2086%20426%2093.163%20426%20102V133C426%20141.837%20418.837%20149%20410%20149H379C370.163%20149%20363%20141.837%20363%20133V102C363%2093.163%20370.163%2086%20379%2086Z%20'/%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M72%20277H163C202.765%20277%20235%20309.235%20235%20349V440C235%20479.765%20202.765%20512%20163%20512H72C32.235%20512%200%20479.765%200%20440V349C0%20309.235%2032.235%20277%2072%20277Z%20M102%20363H133C141.837%20363%20149%20370.163%20149%20379V410C149%20418.837%20141.837%20426%20133%20426H102C93.163%20426%2086%20418.837%2086%20410V379C86%20370.163%2093.163%20363%20102%20363Z%20'/%3e%3c!--%20Small%20modules%20--%3e%3crect%20x='277'%20y='277'%20width='86'%20height='86'%20rx='26'%20fill='currentColor'/%3e%3crect%20x='426'%20y='277'%20width='86'%20height='86'%20rx='28'%20fill='currentColor'/%3e%3crect%20x='277'%20y='426'%20width='86'%20height='86'%20rx='26'%20fill='currentColor'/%3e%3c!--%20Center%20dot%20--%3e%3ccircle%20cx='394.17'%20cy='394.17'%20r='33'%20fill='currentColor'/%3e%3c/svg%3e",bc=["src"],wc={class:"header_description"},Cc=X(e.defineComponent({__name:"PaymentBoxes",props:{configPage:{},comment:{},cartItems:{},isAuthorized:{type:Boolean},hasRmsDiscount:{type:Boolean,default:!1},hideDiscountsButton:{type:Boolean,default:!1},orderId:{default:null},signal:{},provider:{}},emits:["select"],setup(t,{emit:n}){const r=t,o=n,a=ue(),i=fe(),{selectedProvider:s,isButtonDisabled:l}=F.storeToRefs(a),{isAddToCard:c}=F.storeToRefs(i),{makeCreateOrderRequest:d}=so(),u={default:yc,SBP:io},f=async()=>{s.value=r.provider;const h=r.provider.front_type;h&&(c.value=!1,l.value=!0,o("select",h),r.hasRmsDiscount&&!r.hideDiscountsButton&&r.orderId!=null?Et(r.orderId,r.provider.type):await d(r.configPage,{paymentMethodId:h,items:r.cartItems,tableDataId:r.configPage.tableDataId,comment:r.comment,isAuthorized:r.isAuthorized,signal:r.signal}))},m=e.computed(()=>u[r.provider.front_type]||u.default);return(h,p)=>(e.openBlock(),e.createElementBlock("div",{class:"payment_boxes_wrapper",onClick:f},[e.createElementVNode("img",{class:"picture",src:m.value},null,8,bc),e.createElementVNode("div",wc,[e.createElementVNode("b",null,e.toDisplayString(t.provider.name),1),e.createElementVNode("p",null,e.toDisplayString(t.provider.description),1)]),e.createVNode(Nt)]))}}),[["__scopeId","data-v-7e25de77"]]),kc={key:0,class:"wrapper_cart_payment"},Sc={class:"wrapper_paid"},Ec={class:"to_be_paid"},Nc=X(e.defineComponent({__name:"CartPayment",props:{configPage:{},comment:{},cartItems:{},isAuthorized:{type:Boolean},hasRmsDiscount:{type:Boolean},hideDiscountsButton:{type:Boolean},orderId:{},signal:{}},emits:["selectPayment"],setup(t,{emit:n}){const r=ue(),o=se(),a=t,{totalPrice_lib:i,countBonus:s}=F.storeToRefs(o),l=n,c=u=>{l("selectPayment",u)},d=()=>{l("selectPayment","")};return(u,f)=>e.unref(r).providerTypes.length>1?(e.openBlock(),e.createElementBlock("div",kc,[f[2]||(f[2]=e.createElementVNode("h2",null,"Выберите способ оплаты",-1)),f[3]||(f[3]=e.createElementVNode("p",{class:"description_payment"},"Можно изменить позже до оплаты",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).providerTypes,(m,h)=>(e.openBlock(),e.createElementBlock("div",{key:h},[e.createVNode(Cc,{provider:m,"config-page":a.configPage,comment:a.comment,"cart-items":a.cartItems,"is-authorized":a.isAuthorized,"has-rms-discount":a.hasRmsDiscount,"hide-discounts-button":a.hideDiscountsButton,"order-id":a.orderId,signal:a.signal,onSelect:c},null,8,["provider","config-page","comment","cart-items","is-authorized","has-rms-discount","hide-discounts-button","order-id","signal"])]))),128)),e.createElementVNode("div",Sc,[e.createElementVNode("p",Ec,[f[0]||(f[0]=e.createTextVNode("К оплате ",-1)),e.createVNode(Ce,{price:e.unref(i)-e.unref(s),fixedFloat:2},null,8,["price"]),f[1]||(f[1]=e.createTextVNode(" ₽",-1))]),e.createVNode(Re,{textButtonDefault:"Назад",onClick:d,class:"btn_payment"})])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-93970a62"]]),vc={class:"start_page"},Ic=["src"],Bc={class:"wrap"},xc={class:"wrap_box"},Ac={class:"title_fiscal_order"},Mc={class:"wrapper_accept"},Pc={ref:"barRef",class:"bar_complete","aria-hidden":"true"},Tc=X(e.defineComponent({__name:"CartCompleteKioskSuccess",props:{mediaUrl:{},orderNumber:{}},setup(t){const n=se(),r=ue(),o=fe(),a=ge(),{cartProducts_lib:i}=F.storeToRefs(n),{orderNumber:s,orderCompleted_lib:l}=F.storeToRefs(r),{is_startPage:c}=F.storeToRefs(o),{mediaUrl:d}=Ze(()=>a.itemThemes.kiosk_preloader?"preloader":null),u=K.useRouter(),f=K.useRoute();let m=null;e.onMounted(()=>{m=setTimeout(()=>{c.value=!0,u.replace(`/${f.params.orgId}`)},1e4)});const h=()=>{dt(["cart","authTokensAccess","authTokensRefresh"]),i.value=[],l.value=null,r.clearCard(),n.profile=null,u.replace(`/${f.params.orgId}`)};return e.onUnmounted(()=>{m&&clearInterval(m)}),(p,y)=>(e.openBlock(),e.createElementBlock("div",vc,[e.withDirectives((e.openBlock(),e.createElementBlock("video",{loop:"",autoplay:"",muted:"",playsinline:"",key:e.unref(d)},[e.createElementVNode("source",{src:e.unref(d)||"",type:"video/webm"},null,8,Ic)])),[[e.unref(vt)]]),y[4]||(y[4]=e.createElementVNode("div",{class:"start_img_black"},null,-1)),e.createElementVNode("div",Bc,[e.createElementVNode("div",xc,[y[1]||(y[1]=e.createElementVNode("div",{class:"icon","aria-hidden":"true"},[e.createElementVNode("svg",{viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M20 6L9 17l-5-5"})])],-1)),y[2]||(y[2]=e.createElementVNode("h1",null," Заказ успешно оплачен ",-1)),e.createElementVNode("p",Ac,"№ "+e.toDisplayString(e.unref(s)),1),y[3]||(y[3]=e.createElementVNode("p",{class:"title_fiscal_completed"},"Спасибо! Заказ передан в работу.",-1)),e.createElementVNode("div",Mc,[e.createElementVNode("button",{class:"btn","aria-label":"Новый заказ",onClick:h},[y[0]||(y[0]=e.createElementVNode("span",{class:"label"},"Новый заказ",-1)),e.createElementVNode("span",Pc,null,512)])])])])]))}}),[["__scopeId","data-v-c8561550"]]),Rc={};function $c(t,n){return n[0]||(n[0]=e.createStaticVNode('<div class="topProgress" aria-hidden="true" data-v-3e03a6dc><i data-v-3e03a6dc></i></div><h1 class="title_fiscal" data-v-3e03a6dc>Сейчас будет распечатан фискальный чек</h1><p class="reminder" data-v-3e03a6dc>Не забудьте <b data-v-3e03a6dc>оплатить заказ</b> после печати.</p><div class="stage" aria-hidden="true" data-v-3e03a6dc><div class="printer" data-v-3e03a6dc><div class="led" data-v-3e03a6dc></div><div class="slot" data-v-3e03a6dc></div><div class="receipt" data-v-3e03a6dc><div class="tear" data-v-3e03a6dc></div><div class="line accent" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div></div></div></div>',4))}const Vc=X(Rc,[["render",$c],["__scopeId","data-v-3e03a6dc"]]),Dc={},Oc={class:"center"};function zc(t,n){return e.openBlock(),e.createElementBlock("div",Oc,[...n[0]||(n[0]=[e.createStaticVNode('<div class="stack" data-v-f0859fd1><h1 class="title_fiscal" data-v-f0859fd1>Приложите карту для оплаты</h1><p class="reminder" data-v-f0859fd1>Держите карту у терминала, пока операция не завершится.</p><div class="stageCard" aria-hidden="true" data-v-f0859fd1><div class="waves" data-v-f0859fd1><span data-v-f0859fd1></span><span data-v-f0859fd1></span><span data-v-f0859fd1></span></div><div class="nfc" data-v-f0859fd1><svg viewBox="0 0 24 24" data-v-f0859fd1><path d="M6 8c2.5 2.5 2.5 5.5 0 8" data-v-f0859fd1></path><path d="M10 6c4 4 4 8 0 12" data-v-f0859fd1></path><path d="M14 4c5.5 5.5 5.5 11 0 16" data-v-f0859fd1></path></svg></div><div class="card" data-v-f0859fd1><div class="logo" data-v-f0859fd1>inno.</div><div class="chip" data-v-f0859fd1></div><div class="digits" data-v-f0859fd1>4815 1623 4200 0900</div><div class="holder" data-v-f0859fd1>Гость</div></div></div></div>',1)])])}const Lc=X(Dc,[["render",zc],["__scopeId","data-v-f0859fd1"]]);/*!
6
+ `+i):o.stack=i}catch{}}throw o}}_request(n,r){typeof n=="string"?(r=r||{},r.url=n):r=n||{},r=nt(this.defaults,r);const{transitional:o,paramsSerializer:a,headers:i}=r;o!==void 0&&Kt.assertOptions(o,{silentJSONParsing:He.transitional(He.boolean),forcedJSONParsing:He.transitional(He.boolean),clarifyTimeoutError:He.transitional(He.boolean)},!1),a!=null&&(v.isFunction(a)?r.paramsSerializer={serialize:a}:Kt.assertOptions(a,{encode:He.function,serialize:He.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Kt.assertOptions(r,{baseUrl:He.spelling("baseURL"),withXsrfToken:He.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&v.merge(i.common,i[r.method]);i&&v.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=Se.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(c=c&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const d=[];this.interceptors.response.forEach(function(y){d.push(y.fulfilled,y.rejected)});let u,f=0,m;if(!c){const p=[jr.bind(this),void 0];for(p.unshift(...l),p.push(...d),m=p.length,u=Promise.resolve(r);f<m;)u=u.then(p[f++],p[f++]);return u}m=l.length;let h=r;for(;f<m;){const p=l[f++],y=l[f++];try{h=p(h)}catch(b){y.call(this,b);break}}try{u=jr.call(this,h)}catch(p){return Promise.reject(p)}for(f=0,m=d.length;f<m;)u=u.then(d[f++],d[f++]);return u}getUri(n){n=nt(this.defaults,n);const r=Rr(n.baseURL,n.url,n.allowAbsoluteUrls);return Nr(r,n.params,n.paramsSerializer)}};v.forEach(["delete","get","head","options"],function(n){rt.prototype[n]=function(r,o){return this.request(nt(o||{},{method:n,url:r,data:(o||{}).data}))}}),v.forEach(["post","put","patch"],function(n){function r(o){return function(i,s,l){return this.request(nt(l||{},{method:n,headers:o?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}rt.prototype[n]=r(),rt.prototype[n+"Form"]=r(!0)});let qs=class xo{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const o=this;this.promise.then(a=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](a);o._listeners=null}),this.promise.then=a=>{let i;const s=new Promise(l=>{o.subscribe(l),i=l}).then(a);return s.cancel=function(){o.unsubscribe(i)},s},n(function(i,s,l){o.reason||(o.reason=new mt(i,s,l),r(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const r=this._listeners.indexOf(n);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const n=new AbortController,r=o=>{n.abort(o)};return this.subscribe(r),n.signal.unsubscribe=()=>this.unsubscribe(r),n.signal}static source(){let n;return{token:new xo(function(a){n=a}),cancel:n}}};function js(t){return function(r){return t.apply(null,r)}}function Ws(t){return v.isObject(t)&&t.isAxiosError===!0}const Sn={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(Sn).forEach(([t,n])=>{Sn[n]=t});function Kr(t){const n=new rt(t),r=dr(rt.prototype.request,n);return v.extend(r,rt.prototype,n,{allOwnKeys:!0}),v.extend(r,n,null,{allOwnKeys:!0}),r.create=function(a){return Kr(nt(t,a))},r}const re=Kr(kt);re.Axios=rt,re.CanceledError=mt,re.CancelToken=qs,re.isCancel=Ar,re.VERSION=Wr,re.toFormData=Ut,re.AxiosError=Q,re.Cancel=re.CanceledError,re.all=function(n){return Promise.all(n)},re.spread=js,re.isAxiosError=Ws,re.mergeConfig=nt,re.AxiosHeaders=Se,re.formToJSON=t=>Br(v.isHTMLForm(t)?new FormData(t):t),re.getAdapter=qr.getAdapter,re.HttpStatusCode=Sn,re.default=re;const{Axios:fm,AxiosError:mm,CanceledError:pm,isCancel:hm,CancelToken:_m,VERSION:gm,all:ym,Cancel:bm,isAxiosError:wm,spread:Cm,toFormData:km,AxiosHeaders:Sm,HttpStatusCode:Em,formToJSON:Nm,getAdapter:vm,mergeConfig:Im}=re;let Ue=null,be=null;function ze(t){t&&t.close(!0)}async function Et(t,n){const r=ue(),o=se(),a=qe.create();try{const i=await a.initPaymentLink(t,n);return r.paymentCostQR=o.totalPrice_lib-o.countBonus,r.linkQR=i.url,be==null||be.deleteCart(null,be==null?void 0:be.is_requestKiosk),i}catch(i){throw r.isButtonDisabled=!1,r.showNotification(i==null?void 0:i.response.data.user_friendly_message),i}}function Gs(t,n,r){if(t!=null&&t.params){if(t.error){n.showNotification(t.error),Te(n,null),Nn(n);return}r(t,n)}}function En(t,n){const r=ue(),o=se();return n.has_rms_discount?(t.params.new_discounts&&(r.extraDiscount=Number(t.params.new_total_cost)-n.initialCartPrice,o.totalPrice_lib=Number(t.params.new_total_cost),n.showNotification("К заказу были добавлены скидки")),!0):!1}const Te=(t,n)=>{t.updateOrderStatus&&t.updateOrderStatus(n)},Ks=t=>{t.loadCart&&t.loadCart()},Zt=t=>{t.resetBonuses&&t.resetBonuses()},Nn=t=>{t.closeWebSocket&&t.closeWebSocket()},Zr=(t,n)=>{t.is_tableservice&&(ze(n),t.resetStores(),t.deleteCart(null,t.is_requestKiosk),t.cartCleanup?t.cartCleanup.cleanupAndNavigate("profile",t.is_requestKiosk):t.deleteCart("profile",t.is_requestKiosk))},Qr=(t,n,r,o)=>{const a=n.ws||r;qe.create().orderPay(t.params.order_id||"").then(s=>{n.setOrderNumber&&n.setOrderNumber(s.data.order_number)}).catch(s=>{(n.errorHandler||o).handleOrderPayError(s,{...n,closeWebSocket:()=>ze(a)})})},vn=(t,n,r)=>{const o=t.ws||n;(t.errorHandler||r).handleOrderError({...t,closeWebSocket:()=>ze(o)})},Zs=(t,n,r)=>{const o=ue(),a=o.getCurrentPaymentMethodId();if(!a||!Ke.getConfig(a)||!Ke.isMethodAvailable(a,t))return null;const s=Ke.createHandler(a);if(!s)return null;const l=o.createPaymentHandler(t,n,r,a);return l?{handler:s,config:l.config}:null},Qs=t=>{if(!be)return;const n=be.context,r=be.is_requestKiosk,o=be.is_tableservice,a=Zs(n,r,o);if(!a){console.warn("handleWebSocketMessageWithDynamicHandler: не удалось получить handler");return}const{handler:i,config:s}=a,l={...s,...be};Gs(t,l,i.handleWebSocketStatus)};async function Js(t,n,r,o){var u,f;const{is_requestKiosk:a,is_tableservice:i}=r,{comment:s,is_authorized:l,signal:c}=o;r.setButtonDisabled(!0);const d=qe.create();try{const m=await d.createOrder(t,n,a,s,l,i,c);if((m==null?void 0:m.status)===201&&((u=m==null?void 0:m.data)!=null&&u.id)){const h=m.data.id,p={...r,signal:c};be=p;const b=`wss://${p.area||""}/ws/order/${h}/`;Ue=Ot(b,{signal:c});const w=()=>{console.warn("WebSocket connection opened (centralized mode)")},g=S=>{var P;console.error("WebSocket error (centralized mode):",S),ze(Ue),Ue=null,be=null,r.setButtonDisabled(!1),(P=r.errorHandler)==null||P.handlePaymentError(S,p)},_=S=>{Qs(S)};Ue.on("open",w),Ue.on("message",_),Ue.on("error",g),Ue.connect(),be.ws=Ue,be.closeWebSocket=()=>{ze(Ue),Ue=null,be=null}}return m}catch(m){throw re.isCancel(m)||((f=r.errorHandler)==null||f.handleCreateOrderError(m,r),r.setButtonDisabled(!1)),m}}const Jr=t=>{var n,r;return((r=(n=t==null?void 0:t.response)==null?void 0:n.data)==null?void 0:r.user_friendly_message)||null};function Qt(){const t=ue();return{handlePaymentError(n,r){var a,i,s,l,c,d;const o=Jr(n);Te(r,null),Ks(r),o?(r.showNotification(o),Nn(r),r.is_requestKiosk&&((i=r.orderErrors)!=null&&i.includes((a=n.response)==null?void 0:a.status))&&(r.cartCleanup?r.cartCleanup.cleanupAndNavigate("retryPage",r.is_requestKiosk):r.deleteCart("retryPage",r.is_requestKiosk)),r.is_tableservice?r.resetStores():(Zt(r),r.context==="qr"&&r.navigation?r.navigation.redirectToError():r.context==="qr"&&r.redirect&&(t.isButtonDisabled=!1,r.redirect(`/${((l=(s=r.route)==null?void 0:s.params)==null?void 0:l.orgId)||""}/errorPayment`)))):r.context==="qr"&&(Zt(r),r.navigation?r.navigation.redirectToError():r.redirect&&r.redirect(`/${((d=(c=r.route)==null?void 0:c.params)==null?void 0:d.orgId)||""}/errorPayment`)),t.isButtonDisabled=!1},handleOrderPayError(n,r){var a,i,s,l;const o=Jr(n);o&&(r.showNotification(o),Nn(r),r.is_requestKiosk?((i=r.orderErrors)!=null&&i.includes((a=n.response)==null?void 0:a.status)&&(r.cartCleanup.cleanupAndNavigate("retryPage",r.is_requestKiosk),r.deleteCart("retryPage",r.is_requestKiosk)),Te(r,null)):(Zt(r),r.navigation?r.navigation.redirectToError():r.redirect&&r.redirect(`/${((l=(s=r.route)==null?void 0:s.params)==null?void 0:l.orgId)||""}/errorPayment`),Te(r,null)))},handleOrderError(n){var r,o;n.is_requestKiosk?n.cartCleanup?n.cartCleanup.cleanupAndNavigate("retryPage",n.is_requestKiosk):n.deleteCart("retryPage",n.is_requestKiosk):n.is_tableservice?n.showNotification("Ошибка создания заказа. Пожалуйста, попробуйте еще раз"):(Zt(n),n.navigation?n.navigation.redirectToError():n.redirect&&(t.isButtonDisabled=!1,n.redirect(`/${((o=(r=n.route)==null?void 0:r.params)==null?void 0:o.orgId)||""}/errorPayment`)))},handleCreateOrderError(n,r){var s,l,c,d,u,f;const{is_requestKiosk:o,is_tableservice:a}=r,i=r.route.params.orgId;o?(((s=n==null?void 0:n.response)==null?void 0:s.status)===403&&((l=r.on403Kiosk)==null||l.call(r),(c=r.redirect)==null||c.call(r,`/${i}/retryPage`)),r.deleteCart("retryPage",o)):a?r.showNotification(((u=(d=n==null?void 0:n.response)==null?void 0:d.data)==null?void 0:u.user_friendly_message)||"Ошибка создания заказа"):(f=r.redirect)==null||f.call(r,`/${i}/errorPayment`)}}}const Ys=()=>{const t=ue();let n=null;const r=Qt(),o=(a,i)=>{var l,c;const s=(l=a.params)==null?void 0:l.status;if(s==="sent"){if(En(a,i)){t.isButtonDisabled=!1;return}Et(a.params.order_id||"",i.method).catch(d=>{const u=i.errorHandler||r,f=i.ws||n;u.handlePaymentError(d,{...i,closeWebSocket:()=>ze(f)})})}else if(s==="waiting_for_fiscalization")Te(i,1);else if(s==="payment_initiation_retry"||s==="fiscalized")Qr(a,i,n,r);else if(s==="payment_initiation")Te(i,2);else if(s==="paid"){Te(i,3);const d=i.ws||n;ze(d),localStorage.removeItem("cart")}else(c=i.orderErrors)!=null&&c.includes(s)&&vn(i,n,r)};return{handleWebSocketStatus(a,i){o(a,i)}}};function Xs(){const t=ue();let n=null;const r=Qt(),o=(a,i)=>{var l,c,d,u;const s=(l=a.params)==null?void 0:l.status;if((c=a.params)!=null&&c.number&&(t.orderNumber=(d=a.params)==null?void 0:d.number),s==="sent"){if(En(a,i)){t.isButtonDisabled=!1;return}Et(a.params.order_id||"",i.method).catch(f=>{const m=i.errorHandler||r,h=i.ws||n;m.handlePaymentError(f,{...i,closeWebSocket:()=>ze(h)})})}else if(s==="sent_fiscalization")Te(i,1);else if(s==="waiting_payment")Te(i,4);else if(s==="paid"){Te(i,3);const f=i.ws||n;ze(f),localStorage.removeItem("cart")}else(u=i.orderErrors)!=null&&u.includes(s)&&(t.isButtonDisabled=!1,vn(i,n,r))};return{handleWebSocketStatus(a,i){o(a,i)}}}const ei=()=>{const t=ue();let n=null;const r=Qt(),o=(a,i)=>{var l,c;const s=(l=a.params)==null?void 0:l.status;if(s==="sent"){if(En(a,i)){t.isButtonDisabled=!1;return}Et(a.params.order_id||"",i.method).then(d=>{if(i.is_tableservice){const u=i.ws||n;Zr(i,u)}else d.url&&window.location.replace(d.url)}).catch(d=>{const u=i.errorHandler||r,f=i.ws||n;u.handlePaymentError(d,{...i,closeWebSocket:()=>ze(f)})})}else if(s==="payment_initiation_retry"||s==="fiscalized")Qr(a,i,n,r);else if(s==="payment_initiation")Te(i,2);else if(s==="paid"){Te(i,3);const d=i.ws||n;ze(d),localStorage.removeItem("cart")}else(c=i.orderErrors)!=null&&c.includes(s)&&(t.isButtonDisabled=!1,vn(i,n,r))};return{handleWebSocketStatus(a,i){o(a,i)}}};class Ke{static initialize(){this.register({id:"TERMINAL_BASE",method:"TERMINAL",handlerFactory:Ys,availableContexts:["kiosk"]}),this.register({id:"YOOKASSA_BASE",method:"YOOKASSA",handlerFactory:ei,availableContexts:["qr","tableservice"]}),this.register({id:"SBP",method:"YOOKASSA",handlerFactory:Xs,availableContexts:["kiosk"]})}static register(n){this.methods.set(n.id,n)}static getConfig(n){return this.methods.get(n)??null}static getAvailableMethods(n){return Array.from(this.methods.entries()).filter(([r,o])=>o.availableContexts.includes(n)).map(([r])=>r)}static isMethodAvailable(n,r){const o=this.getConfig(n);return o?o.availableContexts.includes(r):!1}static createHandler(n){const r=this.getConfig(n);return r?r.handlerFactory():(console.warn(`PaymentMethodRegistry: метод оплаты ${n} не зарегистрирован`),null)}}te(Ke,"methods",new Map),Ke.initialize();function ti(t){return{cleanupAndNavigate(n,r){t.deleteCart(n,r)},cleanup(n){t.deleteCart(null,n)},clearTokens(){t.deleteCart(null,!0)},resetStores(){t.resetStores()}}}function ni(t){var r,o;const n=((o=(r=t.route)==null?void 0:r.params)==null?void 0:o.orgId)||"";return{redirectToError(){const a=`/${n}/errorPayment`;t.redirect?t.redirect(a):t.router&&t.router.push(a)},redirectToSuccess(a){const i=a?`/${n}/${a}`:`/${n}/profile`;t.redirect?t.redirect(i):t.router&&t.router.push(i)},redirect(a){t.redirect?t.redirect(a):t.router&&t.router.push(a)},getErrorPath(){return`/${n}/errorPayment`},getSuccessPath(){return`/${n}/profile`}}}const ue=F.defineStore("cartLib",()=>{const t=Z.useRouter(),n=Z.useRoute(),r=ge(),o=se(),{config_lib:a,countBonus:i,totalPrice_lib:s,initialCartPrice_lib:l,is18Allowed:c}=F.storeToRefs(o),{itemThemes:d}=F.storeToRefs(r),u=e.ref(!1),f=e.ref(""),m=e.ref(null),h=e.ref("wait"),p=e.ref(!1),y=e.ref(0),b=e.ref(""),w=e.ref([]),g=e.ref(),_=e.ref(0),S=e.ref(!1),P=e.ref(),V=e.ref(null),$=e.ref(["failed_payment","failed_after_paid","failed","failed_after_sent","failed_after_sent_fiscalization","payment_initiation_retry"]),D=e.ref("Оплатить"),E=e.ref(!1),N=e.ref(null),M=e.ref(0),R=e.ref(!1),T=e.ref({textNotification:""}),x=Y=>{R.value=!0,T.value.textNotification=Y},k=()=>{var Y,de;return(Y=g.value)!=null&&Y.front_type?g.value.front_type:((de=w.value[0])==null?void 0:de.front_type)||null},B=(Y,de,he,_e)=>{var ie;const ae=_e??((ie=w.value[0])==null?void 0:ie.front_type);if(!ae)return console.warn("Не удалось определить метод оплаты"),null;const U=Ke.getConfig(ae);if(!U||!Ke.isMethodAvailable(ae,Y))return console.warn(`Метод ${ae} недоступен для контекста ${Y}`),null;const ne=Ke.createHandler(ae);return ne?(P.value=A(U.method,Y,de,he),{handler:ne,config:P.value}):(console.warn(`Не удалось создать обработчик для метода ${ae}`),null)},A=(Y,de,he,_e)=>{const ae={method:Y,context:de,is_requestKiosk:he,is_tableservice:_e,router:t,route:n,orderErrors:$.value,area:a.value.area,has_rms_discount:a.value.has_rms_discount,totalPrice:s,initialCartPrice:l,showNotification:x,deleteCart:ee,resetStores:K,redirect:me=>t.push(me),updateOrderStatus:me=>{N.value=me},setOrderNumber:me=>{V.value=me},loadCart:()=>o.loadCart(),resetBonuses:()=>{i.value=0}},U=Qt(),ne=ti(ae),ie=ni(ae);return{...ae,errorHandler:U,cartCleanup:ne,navigation:ie}},C=e.computed(()=>!!m.value),I=Y=>{h.value=Y},O=Y=>{m.value=Y},H=()=>{d.value.kiosk_show_loyalty_card_button&&d.value.kiosk_show_loyalty_phone_input_button?u.value=!0:!d.value.kiosk_show_loyalty_card_button&&d.value.kiosk_show_loyalty_phone_input_button?o.is_OpenLoyal=!0:u.value=!0,h.value="wait",f.value=""},G=()=>{u.value=!1,h.value="wait",f.value=""},j=()=>{m.value=null,f.value="",h.value="wait",G()},K=()=>{E.value=!1,N.value=null},ee=(Y=null,de=!1)=>{o.cartProducts_lib=[],dt(["cart"]),de&&(dt(["authTokensAccess","authTokensRefresh","user"]),o.profile=null,sessionStorage.removeItem("is_adult"),c.value=!1),Y&&t.push(`/${n.params.orgId}/${Y}`)};return{isButtonDisabled:E,orderCompleted_lib:N,extraDiscount:y,orderNumber:V,is_notification_lib:R,notificationData_lib:T,textPaymentBtn_lib:D,count:M,guestInfo:m,error:f,isDrawerOpen:u,currentState:h,isAuthorized:C,discountBtn:p,linkQR:b,providerTypes:w,is_paymentCart:S,selectedProvider:g,configPayment:P,paymentCostQR:_,deleteCart:ee,setGuestInfo:O,setState:I,openDrawer:H,closeDrawer:G,clearCard:j,showNotification:x,createPaymentHandler:B,getCurrentPaymentMethodId:k,getAvailablePaymentMethods:Y=>Ke.getAvailableMethods(Y)}}),fe=F.defineStore("cardLib",()=>{const t=()=>({openCard:null,currentModifier:null,groupModifiers:[],groupModifiersSelected:[],groupCurrentOpen:null,isModifiedAmount:!1,selectedSize:{},productSizes:[],addedProducts:[],plusButtonsRefs:[],modalCount:1,isSectionModifier:!1,isAnimationFly:!0,textErrorRequaired:""}),n=e.ref(t()),r=()=>n.value=t(),o=e.ref(!1),a=e.ref(!1),i=e.ref(!1),s=e.ref(),l=e.ref([]),c=e.ref({id:null,visible:!1}),d=e.ref(!0),u=e.computed(()=>{const E=n.value.groupModifiersSelected.findIndex(N=>N.group===n.value.groupCurrentOpen.id);return f(E)}),f=E=>E===-1?0:(n.value.groupModifiersSelected[E].modifiers||[]).reduce((M,R)=>M+(R.amount||0),0),m=e.computed(()=>{var N;const E=(N=n.value.openCard)==null?void 0:N.group_modifiers.findIndex(M=>M.id===n.value.groupCurrentOpen.id);return E===-1||!n.value.openCard?0:n.value.openCard.modifiers.length>0&&E===0?n.value.openCard.modifiers.reduce((M,R)=>M+R.max_amount,0):n.value.groupModifiers[E].max_amount}),h=e.computed(()=>{var N;const E=(n.value.addedProducts??[]).reduce((M,R)=>M+R.price,0);if(n.value.openCard){const M=n.value.openCard,R=ct(M)||0,T=M.amount||1;return(n.value.groupModifiersSelected.reduce((k,B)=>(B.modifiers.forEach(A=>{var C,I;A.sizes&&(A.price=((I=(C=A.sizes)==null?void 0:C.find(O=>O.id===n.value.selectedSize.id))==null?void 0:I.price)??A.price),k+=A.price*A.amount}),k),0)+R)*T+E}return(N=n.value.addedProducts)!=null&&N.length?E:0}),p=e.computed(()=>{const E=n.value.groupModifiers,N=n.value.groupModifiersSelected;for(let M=0;M<E.length;M++){const R=E[M],T=N[M];if(R.min_amount>0&&f(M)<R.min_amount)return n.value.textErrorRequaired=`В группе "${R.name}" должно содержаться не меньше ${R.min_amount} модификатора(ов)`,{haveRequaire:!0,group:R};for(const x of R.group_modifiers)if(x.min_amount>0){const k=T.modifiers.find(B=>B.id===x.id);if(!k||k.amount<x.min_amount)return n.value.textErrorRequaired=`В группе "${R.name}" выберите все обязательные модификаторы`,{haveRequaire:!0,group:R}}}return{haveRequaire:!1,group:E[0]}}),y=()=>{n.value.groupModifiers.forEach((E,N)=>{n.value.groupCurrentOpen={...E,index:N},E.group_modifiers.forEach(M=>{M.default_amount>0&&(M.amount=M.default_amount,$(M,!0))})})},b=E=>{n.value.addedProducts.push(E)},w=E=>{n.value.openCard=E},g=E=>{l.value=[...E]},_=(E,N)=>{var R,T;const M=E.id!==((R=n.value.groupCurrentOpen)==null?void 0:R.id);n.value.groupCurrentOpen={...E,index:N},M?n.value.isSectionModifier=!0:n.value.isSectionModifier=!n.value.isSectionModifier,(T=n.value.plusButtonsRefs[N])==null||T.scrollIntoView({behavior:"smooth",block:"start"})},S=()=>{n.value.modalCount>n.value.currentModifier.min_amount&&n.value.modalCount>=2&&(n.value.modalCount-=1)},P=()=>{n.value.groupCurrentOpen&&n.value.modalCount+u.value<m.value&&(n.value.currentModifier.max_amount===0||n.value.currentModifier.max_amount>n.value.modalCount)&&(n.value.modalCount+=1)},V=(E,N)=>{var R;const M=(R=n.value.groupCurrentOpen)==null?void 0:R.id.toUpperCase();if(!E&&!n.value.isModifiedAmount&&N.max_amount!==1){if(M==="Добавки2000"&&N.max_amount>1)return!0;if(Math.abs(m.value-u.value)>1&&M!=="Добавки2000")return!0}return!1},$=(E,N=!1)=>{n.value.modalCount=1,n.value.currentModifier=E;const M=n.value.groupModifiersSelected.findIndex(R=>R.group===n.value.groupCurrentOpen.id);D(M,E,N)},D=(E,N,M)=>{let R=n.value.groupModifiersSelected;if(N.sizes.length>0&&N.sizes.find(T=>{var x;return T.id===((x=n.value.selectedSize)==null?void 0:x.id)}),E===-1)V(M,N)?n.value.isModifiedAmount=!0:R[n.value.groupCurrentOpen.index]={group:n.value.groupCurrentOpen.id,modifier_count:0,modifiers:[{...N,amount:(N==null?void 0:N.amount)??1}]};else{const T=n.value.groupModifiers[E].group_modifiers.findIndex(k=>k.id===N.id);if(R[E].modifiers.findIndex(k=>k.id===N.id)===-1){if(m.value===1)R[E].modifiers=[];else if(u.value>=m.value)return;V(M,N)?n.value.isModifiedAmount=!0:(R[E].modifiers.push({...N,amount:(N==null?void 0:N.amount)??1}),R[E].modifier_count=R[E].modifiers.reduce((k,B)=>k+=B.amount,0),n.value.isAnimationFly=!0)}else R[E].modifiers=R[E].modifiers.filter(k=>k.id!==N.id),R[E].modifier_count=R[E].modifiers.reduce((k,B)=>k+=B.amount,0),n.value.groupModifiers[E].group_modifiers[T].amount=1,n.value.groupModifiers[E].group_modifiers[T].default_amount=0,n.value.isAnimationFly=!1}n.value.groupModifiersSelected=R};return{stateCard:n,totalPrice_libCard:h,recountGroupTotalAmount:u,groupTotalAmount:m,isOpenWindow:o,isUpSale:a,checkedRequiredBtn:p,dataUpSale:s,productCards:l,isAddToCard:i,openProduct:c,is_startPage:d,setProduct:g,summModifierAmount:f,setAddedProducts:b,setCurrentCard:w,minusAmount:S,plusAmount:P,toggleNotRequire:_,modifierSelect:$,defaultAmountModifiers:y,reset:r}});var ri=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yr={exports:{}};(function(t,n){(function(r,o){t.exports=o()})(ri,function(){var r=1e3,o=6e4,a=36e5,i="millisecond",s="second",l="minute",c="hour",d="day",u="week",f="month",m="quarter",h="year",p="date",y="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(x){var k=["th","st","nd","rd"],B=x%100;return"["+x+(k[(B-20)%10]||k[B]||k[0])+"]"}},_=function(x,k,B){var A=String(x);return!A||A.length>=k?x:""+Array(k+1-A.length).join(B)+x},S={s:_,z:function(x){var k=-x.utcOffset(),B=Math.abs(k),A=Math.floor(B/60),C=B%60;return(k<=0?"+":"-")+_(A,2,"0")+":"+_(C,2,"0")},m:function x(k,B){if(k.date()<B.date())return-x(B,k);var A=12*(B.year()-k.year())+(B.month()-k.month()),C=k.clone().add(A,f),I=B-C<0,O=k.clone().add(A+(I?-1:1),f);return+(-(A+(B-C)/(I?C-O:O-C))||0)},a:function(x){return x<0?Math.ceil(x)||0:Math.floor(x)},p:function(x){return{M:f,y:h,w:u,d,D:p,h:c,m:l,s,ms:i,Q:m}[x]||String(x||"").toLowerCase().replace(/s$/,"")},u:function(x){return x===void 0}},P="en",V={};V[P]=g;var $="$isDayjsObject",D=function(x){return x instanceof R||!(!x||!x[$])},E=function x(k,B,A){var C;if(!k)return P;if(typeof k=="string"){var I=k.toLowerCase();V[I]&&(C=I),B&&(V[I]=B,C=I);var O=k.split("-");if(!C&&O.length>1)return x(O[0])}else{var H=k.name;V[H]=k,C=H}return!A&&C&&(P=C),C||!A&&P},N=function(x,k){if(D(x))return x.clone();var B=typeof k=="object"?k:{};return B.date=x,B.args=arguments,new R(B)},M=S;M.l=E,M.i=D,M.w=function(x,k){return N(x,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var R=function(){function x(B){this.$L=E(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[$]=!0}var k=x.prototype;return k.parse=function(B){this.$d=function(A){var C=A.date,I=A.utc;if(C===null)return new Date(NaN);if(M.u(C))return new Date;if(C instanceof Date)return new Date(C);if(typeof C=="string"&&!/Z$/i.test(C)){var O=C.match(b);if(O){var H=O[2]-1||0,G=(O[7]||"0").substring(0,3);return I?new Date(Date.UTC(O[1],H,O[3]||1,O[4]||0,O[5]||0,O[6]||0,G)):new Date(O[1],H,O[3]||1,O[4]||0,O[5]||0,O[6]||0,G)}}return new Date(C)}(B),this.init()},k.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},k.$utils=function(){return M},k.isValid=function(){return this.$d.toString()!==y},k.isSame=function(B,A){var C=N(B);return this.startOf(A)<=C&&C<=this.endOf(A)},k.isAfter=function(B,A){return N(B)<this.startOf(A)},k.isBefore=function(B,A){return this.endOf(A)<N(B)},k.$g=function(B,A,C){return M.u(B)?this[A]:this.set(C,B)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(B,A){var C=this,I=!!M.u(A)||A,O=M.p(B),H=function(_e,ae){var U=M.w(C.$u?Date.UTC(C.$y,ae,_e):new Date(C.$y,ae,_e),C);return I?U:U.endOf(d)},G=function(_e,ae){return M.w(C.toDate()[_e].apply(C.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(ae)),C)},j=this.$W,K=this.$M,ee=this.$D,Y="set"+(this.$u?"UTC":"");switch(O){case h:return I?H(1,0):H(31,11);case f:return I?H(1,K):H(0,K+1);case u:var de=this.$locale().weekStart||0,he=(j<de?j+7:j)-de;return H(I?ee-he:ee+(6-he),K);case d:case p:return G(Y+"Hours",0);case c:return G(Y+"Minutes",1);case l:return G(Y+"Seconds",2);case s:return G(Y+"Milliseconds",3);default:return this.clone()}},k.endOf=function(B){return this.startOf(B,!1)},k.$set=function(B,A){var C,I=M.p(B),O="set"+(this.$u?"UTC":""),H=(C={},C[d]=O+"Date",C[p]=O+"Date",C[f]=O+"Month",C[h]=O+"FullYear",C[c]=O+"Hours",C[l]=O+"Minutes",C[s]=O+"Seconds",C[i]=O+"Milliseconds",C)[I],G=I===d?this.$D+(A-this.$W):A;if(I===f||I===h){var j=this.clone().set(p,1);j.$d[H](G),j.init(),this.$d=j.set(p,Math.min(this.$D,j.daysInMonth())).$d}else H&&this.$d[H](G);return this.init(),this},k.set=function(B,A){return this.clone().$set(B,A)},k.get=function(B){return this[M.p(B)]()},k.add=function(B,A){var C,I=this;B=Number(B);var O=M.p(A),H=function(K){var ee=N(I);return M.w(ee.date(ee.date()+Math.round(K*B)),I)};if(O===f)return this.set(f,this.$M+B);if(O===h)return this.set(h,this.$y+B);if(O===d)return H(1);if(O===u)return H(7);var G=(C={},C[l]=o,C[c]=a,C[s]=r,C)[O]||1,j=this.$d.getTime()+B*G;return M.w(j,this)},k.subtract=function(B,A){return this.add(-1*B,A)},k.format=function(B){var A=this,C=this.$locale();if(!this.isValid())return C.invalidDate||y;var I=B||"YYYY-MM-DDTHH:mm:ssZ",O=M.z(this),H=this.$H,G=this.$m,j=this.$M,K=C.weekdays,ee=C.months,Y=C.meridiem,de=function(ae,U,ne,ie){return ae&&(ae[U]||ae(A,I))||ne[U].slice(0,ie)},he=function(ae){return M.s(H%12||12,ae,"0")},_e=Y||function(ae,U,ne){var ie=ae<12?"AM":"PM";return ne?ie.toLowerCase():ie};return I.replace(w,function(ae,U){return U||function(ne){switch(ne){case"YY":return String(A.$y).slice(-2);case"YYYY":return M.s(A.$y,4,"0");case"M":return j+1;case"MM":return M.s(j+1,2,"0");case"MMM":return de(C.monthsShort,j,ee,3);case"MMMM":return de(ee,j);case"D":return A.$D;case"DD":return M.s(A.$D,2,"0");case"d":return String(A.$W);case"dd":return de(C.weekdaysMin,A.$W,K,2);case"ddd":return de(C.weekdaysShort,A.$W,K,3);case"dddd":return K[A.$W];case"H":return String(H);case"HH":return M.s(H,2,"0");case"h":return he(1);case"hh":return he(2);case"a":return _e(H,G,!0);case"A":return _e(H,G,!1);case"m":return String(G);case"mm":return M.s(G,2,"0");case"s":return String(A.$s);case"ss":return M.s(A.$s,2,"0");case"SSS":return M.s(A.$ms,3,"0");case"Z":return O}return null}(ae)||O.replace(":","")})},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(B,A,C){var I,O=this,H=M.p(A),G=N(B),j=(G.utcOffset()-this.utcOffset())*o,K=this-G,ee=function(){return M.m(O,G)};switch(H){case h:I=ee()/12;break;case f:I=ee();break;case m:I=ee()/3;break;case u:I=(K-j)/6048e5;break;case d:I=(K-j)/864e5;break;case c:I=K/a;break;case l:I=K/o;break;case s:I=K/r;break;default:I=K}return C?I:M.a(I)},k.daysInMonth=function(){return this.endOf(f).$D},k.$locale=function(){return V[this.$L]},k.locale=function(B,A){if(!B)return this.$L;var C=this.clone(),I=E(B,A,!0);return I&&(C.$L=I),C},k.clone=function(){return M.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},x}(),T=R.prototype;return N.prototype=T,[["$ms",i],["$s",s],["$m",l],["$H",c],["$W",d],["$M",f],["$y",h],["$D",p]].forEach(function(x){T[x[1]]=function(k){return this.$g(k,x[0],x[1])}}),N.extend=function(x,k){return x.$i||(x(k,R,N),x.$i=!0),N},N.locale=E,N.isDayjs=D,N.unix=function(x){return N(1e3*x)},N.en=V[P],N.Ls=V,N.p={},N})})(Yr);var ai=Yr.exports;const Xr=oi(ai),si=t=>{const n=Z.useRouter(),r=Z.useRoute(),o=`${t.domain}/api/`,a=re.create({baseURL:o}),i=re.create({baseURL:o}),s=re.create({baseURL:o}),l=re.create({baseURL:o}),c=re.create({baseURL:o}),d=re.create({baseURL:o}),u=re.create({baseURL:o}),f=_=>{try{const S=JSON.parse(localStorage.getItem("authTokensAccess")||"");S.length>0&&(_.headers.Authorization=`Bearer ${S}`)}catch{console.warn("accessToken is undefined [useAxios]")}return _},m=_=>{const S=localStorage.getItem("apiKey"),P=(S==null?void 0:S.replace(/^.(.*).$/,"$1"))||"";return _.headers={"Content-Type":"application/json","x-api-key":P},_},h=async _=>{if(!t.user)return _;const S=t.user.exp??0;if(!(Xr.unix(S).diff(Xr())<3e3))return _;const V=cr("authTokensRefresh",null,"string");try{const $=await re.post(`${o}user/token/refresh/`,{refresh:V.value});if(!$.data.access)return g(),_;localStorage.setItem("authTokensAccess",JSON.stringify($.data.access)),b($.data),w(lr($.data.access)),_.headers={..._.headers,Authorization:`Bearer ${$.data.access}`}}catch($){console.error("Failed to refresh token:",$),g()}return _},p=_=>{_.interceptors.request.use(S=>h(f(S)),S=>Promise.reject(S))};p(s),p(c),p(u);const y=_=>{_.interceptors.request.use(S=>m(S))};y(d),y(i),y(u);const b=(_,S=!1)=>{localStorage.setItem("authTokensAccess",JSON.stringify(_.access)),S&&localStorage.setItem("authTokensRefresh",JSON.stringify(_.refresh))},w=_=>{t.user=_,localStorage.setItem("user",JSON.stringify(_))},g=()=>{t.user=null,dt(["authTokensAccess","authTokensRefresh","user","cart","bonus"]),sessionStorage.removeItem("is_adult"),n.push(`/${r.params.orgId}/`),window.location.reload()};return{axiosInstanceAuthenticationGet:s,axiosInstanceAuthenticationPost:c,axiosInstanceAuthenticationPostApiKey:u,axiosInstancePost:l,axiosInstanceGet:a,axiosInstanceGetApiKey:i,axiosInstancePostApiKey:d}},J=class J{constructor(){te(this,"axiosInstanceGet");te(this,"axiosInstancePost");te(this,"axiosInstanceAuthenticationGet");te(this,"axiosInstanceAuthenticationPost");te(this,"axiosInstanceGetApiKey");te(this,"axiosInstancePostApiKey");te(this,"axiosInstanceAuthenticationPostApiKey");te(this,"currentUpsaleController",null);te(this,"controller",new AbortController);this.axiosInstanceGet=J._axiosGet,this.axiosInstancePost=J._axiosPost,this.axiosInstanceGetApiKey=J._axiosPostApiKey,this.axiosInstancePostApiKey=J._axiosPostApiKey,this.axiosInstanceAuthenticationPostApiKey=J._axiosAuthPostApiKey,this.axiosInstanceAuthenticationGet=J._axiosAuthGet,this.axiosInstanceAuthenticationPost=J._axiosAuthPost}static create(n){return n&&!J._config&&J._initialize(n),J._config||console.warn("InitConnection не инициализирован"),new J}static _initialize(n,r=null){const o=se(),a=fe(),{config_lib:i}=F.storeToRefs(o),{stateCard:s,recountGroupTotalAmount:l}=F.storeToRefs(a);J._config=n,J._cardStore=a,J._stateCard=s,J._recountGroupTotalAmount=l,i.value=n;const c=si(n);J._axiosPostApiKey=c.axiosInstanceGetApiKey,J._axiosPostApiKey=c.axiosInstancePostApiKey,J._axiosAuthPostApiKey=c.axiosInstanceAuthenticationPostApiKey,J._axiosGet=c.axiosInstanceGet,J._axiosPost=c.axiosInstancePost,J._axiosAuthGet=c.axiosInstanceAuthenticationGet,J._axiosAuthPost=c.axiosInstanceAuthenticationPost}get config(){return J._config}get cardStore(){return J._cardStore}get stateCard(){return J._stateCard}get recountGroupTotalAmount(){return J._recountGroupTotalAmount}async updateTheme(){var i,s;const n=JSON.parse(localStorage.getItem("themeConfig"))??null,r=ge();if(n!==null){r.updateColor(n);return}const o=se(),a=await((s=this.axiosInstanceGet)==null?void 0:s.get(`org/organizations/${(i=this.config)==null?void 0:i.orgId}/design/`));o.setStateDrum(a==null?void 0:a.data.hide_barban),o.setKioskTimeout(a==null?void 0:a.data.kiosk_timeout),localStorage.setItem("themeConfig",JSON.stringify(a.data)),r.updateColor(a.data)}async getGroupByID(n){var r,o;try{const a=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${(r=this.config)==null?void 0:r.pointId}/group/${n}`));return a==null?void 0:a.data}catch(a){throw console.error("Ошибка в request.ts[getGroupByID]",a),a}}async loadGroupProducts(n){var r,o;try{const a=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${(r=this.config)==null?void 0:r.pointId}/products/?group=${n}`)),i=(a==null?void 0:a.data)||[];for(const s of i)s&&await Go(s);return await this.cacheImagesInBackground(i),i}catch(a){return console.error("Ошибка загрузки группы:",a),[]}}async getGroup(){var n,r;try{const o=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(n=this.config)==null?void 0:n.pointId}/groups/`));return o==null?void 0:o.data}catch(o){return console.error("Error fetching products:",o),[]}}async fetchAndCacheAllPages(){var n,r;try{const o=((n=this.config)==null?void 0:n.pointId)||"",a=await dn(o);if(a)return a.data;const i=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${o}/group/`)),s=(i==null?void 0:i.data)||[],l=[];for(const c of s){c.products=c.products||[],await _t(c.id,c),l.push(c);const d=await this.loadGroupProducts(c.id);c.products=d}return await this.cacheImagesInBackground(s),await _t(o,s),l}catch(o){return console.error("fetchAndCacheAllPages error:",o),[]}}cacheImagesInBackground(n){n.forEach(r=>{var o;r.video_link&&this.loadAndCacheMedia(r.video_link,r.id+"_video"),r.image_link&&this.loadAndCacheMedia(r.image_link,r.id+"_image"),(o=r.products)==null||o.forEach(a=>{a.video_link&&this.loadAndCacheMedia(a.video_link,a.id+"_video"),a.image_link&&this.loadAndCacheMedia(a.image_link,a.id+"_image")})})}async loadAndCacheMedia(n,r){const o=await lt(r);if(o){this.dispatchImageCachedEvent(r,o);return}try{const a=await fetch(n);if(!a.ok)throw new Error("Network error");const i=await a.blob();if(i.size===0)throw new Error("Empty blob");await un(r,i),this.dispatchImageCachedEvent(r,i)}catch(a){console.warn(`[ImageCache] Failed for ${r}:`,a)}}dispatchImageCachedEvent(n,r){window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:r}}))}async getProduct(n=null){var r,o;if(!n)return[];try{const a=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${(r=this.config)==null?void 0:r.pointId}/products/${n}`));return a==null?void 0:a.data}catch(a){return console.error("Error fetching cardProducts:",a),[]}}async getSingleProduct(n){var a;const r=se(),{config_lib:o}=F.storeToRefs(r);try{let i=await Xn(n);if(i)this._fullCardProduct(i);else{const s=await((a=this.axiosInstanceGet)==null?void 0:a.get(`${o.value.pointId}/products/${n}`));(s==null?void 0:s.status)===200&&this._fullCardProduct(s.data)}}catch(i){throw console.warn("store card[getFetchProducts]:",i),i}}_fullCardProduct(n){const r=fe();r.stateCard.openCard={...n,amount:1},r.stateCard.groupModifiers=n.group_modifiers,n.modifiers.length>0&&r.stateCard.groupModifiers.unshift({default_amount:0,description:"",group_modifiers:n.modifiers,id:"Добавки2000",image_link:null,max_amount:1,min_amount:n.modifiers.reduce((o,a)=>o+=a.min_amount,0),name:"Добавки",required:!1}),r.stateCard.groupModifiersSelected=new Array(r.stateCard.groupModifiers.length).fill({group:"",modifiers:[],modifier_count:0}),r.stateCard.productSizes=n.sizes,r.defaultAmountModifiers(),n.show_recommendations&&this.productUpsale(n.id)}async getTheme(){try{this.updateTheme()}catch(n){return console.error("Error fetching products:",n),[]}}async authorizeByCard(n){var r,o;try{const a=await((o=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:o.post(`${(r=this.config)==null?void 0:r.domain}/api/user/validate-card/`,{card_number:n}));return localStorage.setItem("authTokensAccess",JSON.stringify(a==null?void 0:a.data.access)),localStorage.setItem("authTokensRefresh",JSON.stringify(a==null?void 0:a.data.refresh)),a==null?void 0:a.data}catch(a){throw console.error("Ошибка авторизации:",a),a}}async getLoyalSmsCode(n){var r,o;try{const a=await((o=this.axiosInstancePostApiKey)==null?void 0:o.post(`${(r=this.config)==null?void 0:r.domain}/api/device/auth/request-otp/`,{phone:n}));return a==null?void 0:a.data}catch(a){throw console.error("Ошибка получения sms-code:",a),a}}async sendSmsCodeForAuth(n,r){var o,a;try{const i=await((a=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:a.post(`${(o=this.config)==null?void 0:o.domain}/api/device/auth/`,{code:n,phone:r}));return i==null?void 0:i.data}catch(i){throw console.error("Ошибка отправки sms-code:",i),i}}async callStaff(n,r,o){var a,i,s,l;try{const c=await((s=this.axiosInstancePost)==null?void 0:s.post(`${(a=this.config)==null?void 0:a.domain}/api/org_unit/${(i=this.config)==null?void 0:i.pointId}/table/${n}/call-staff/`,{...r},o));return(l=c==null?void 0:c.data)==null?void 0:l.response_text}catch(c){throw console.error("Ошибка[callStaff]",c),c}}async createOrder(n,r,o=!0,a,i=!1,s=!1,l){var h,p,y;const c=i?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,d=o?c:this.axiosInstanceAuthenticationPost,u=o?"/device/order/create":"/order/create",f=o?(h=this.config)==null?void 0:h.pointId:(p=this.config)==null?void 0:p.pointId;return await(d==null?void 0:d.post(`${(y=this.config)==null?void 0:y.domain}/api/org_unit/${f}${u}`,{items:n,table:r||null,comment:a},{signal:l}))}async initPaymentLink(n,r){const o=r!=="YOOKASSA"?this.axiosInstancePost:this.axiosInstanceAuthenticationPost,a=se(),i=await(o==null?void 0:o.post("payment/init",{by_bonuses:a.countBonus,order:n,provider_type:r}));return i==null?void 0:i.data}async orderPay(n){var r;return(r=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:r.post(`order/${n}/pay/`,{order_id:n})}async getProfile(){var r,o;const n=await((o=this.axiosInstanceAuthenticationGet)==null?void 0:o.get(`user/current?organization=${(r=this.config)==null?void 0:r.orgId}`));if((n==null?void 0:n.status)===200){const a=se();return a.profile=n.data,a.is18Allowed=sessionStorage.getItem("is_adult")==="true",n.data}else return n}async calculateDiscount(n,r=!0,o=!1,a){var d,u;const i=o?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,s=r?i:this.axiosInstanceAuthenticationPost,l=r?(d=this.config)==null?void 0:d.pointId:(u=this.config)==null?void 0:u.pointId,c=await(s==null?void 0:s.post(`/org_unit/${l}/cart/calculate-discount/`,n,{signal:a}));return(c==null?void 0:c.status)===200?c.data:c}async maxPayByBonuses(n,r=!0,o=!1,a){const i=se(),s=o?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,l=r?s:this.axiosInstanceAuthenticationPost,c=await(l==null?void 0:l.post("/cart/max-pay-by-bonuses/",{total_cart_price:n},{signal:a})),d=c==null?void 0:c.data;return i.profile&&d&&"balance"in d&&(i.profile.balance=d.balance),d}async getDeviceInfo(){var o;const n=ue(),r=await((o=this.axiosInstanceGetApiKey)==null?void 0:o.get("/device/current/"));return(r==null?void 0:r.status)===200?(n.providerTypes=r.data.payment_provider_type,r.data):r}async productUpsale(n){var i,s,l;const r=fe(),{dataUpSale:o}=F.storeToRefs(r);(i=this.currentUpsaleController)==null||i.abort();const a=new AbortController;this.currentUpsaleController=a;try{const c=await((l=this.axiosInstanceGet)==null?void 0:l.get(`/${(s=this.config)==null?void 0:s.pointId}/products/${n}/recommendation/`,{signal:a.signal}));a.signal.aborted||(o.value=c==null?void 0:c.data)}catch(c){if(c.name==="AbortError"||c.name==="CanceledError"){console.warn("Upsale отменён — пришёл новый запрос");return}throw console.error("Ошибка upsale:",c),c}finally{this.currentUpsaleController===a&&(this.currentUpsaleController=null)}}};te(J,"_config",null),te(J,"_axiosGet"),te(J,"_axiosGetApiKey"),te(J,"_axiosPostApiKey"),te(J,"_axiosAuthPostApiKey"),te(J,"_axiosPost"),te(J,"_axiosAuthGet"),te(J,"_axiosAuthPost"),te(J,"_cardStore",null),te(J,"_stateCard",null),te(J,"_recountGroupTotalAmount",null);let qe=J;const ii=e.defineComponent({__name:"UseScrollCenter",props:{axis:{},behavior:{},autoScroll:{type:Boolean},container:{},idActive:{},clearContainer:{type:Boolean}},setup(t,{expose:n}){const r=t,o=se(),a=e.ref(null),i=async l=>{if(!a.value||!l)return;let c=window;r.container&&(c=typeof r.container=="string"?document.querySelector(r.container)||window:r.container);const d={behavior:r.behavior};if(r.axis==="x"){const u=c===window?window.innerWidth:c.clientWidth,f=l.offsetWidth;let m=l.offsetLeft;if(c!==window){const h=c.getBoundingClientRect();m=l.getBoundingClientRect().left-h.left+c.scrollLeft}m-=(u-f)/2,d.left=Math.max(0,m)}else{const u=c===window?window.innerHeight:c.clientHeight,f=l.offsetHeight;let m=l.offsetTop;if(c!==window){const h=c.getBoundingClientRect();m=l.getBoundingClientRect().top-h.top+c.scrollTop}m-=(u-f)/2,d.top=Math.max(0,m)}try{c===window?window.scrollTo(d):c.scrollTo(d)}catch(u){console.error("Scroll error:",u)}};e.onMounted(async()=>{if(r.autoScroll){let l=null;if(await e.nextTick(),o.activeScrolling_lib){const c=o.activeScrolling_lib.findIndex(d=>d.id===r.idActive);r.idActive?(l=document.getElementById(`scrolling${r.idActive}`),l&&c!==-1&&(o.activeScrolling_lib[c]=l)):o.activeScrolling_lib[c]&&(l=o.activeScrolling_lib[c]),i(l)}}});const s=async l=>{r.clearContainer&&(o.activeScrolling_lib=[]);const c=l.currentTarget;await e.nextTick(),o.activeScrolling_lib.includes(c)||o.activeScrolling_lib.push(c),i(c)};return n({scrollToElement:i}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:a,class:"scroll-to-wrapper"},[e.renderSlot(l.$slots,"default",{handleTargetClick:s},void 0,!0)],512))}}),X=(t,n)=>{const r=t.__vccOpts||t;for(const[o,a]of n)r[o]=a;return r},In=X(ii,[["__scopeId","data-v-b510c3f1"]]),li={},ci={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 di(t,n){return e.openBlock(),e.createElementBlock("svg",ci,[...n[0]||(n[0]=[e.createElementVNode("defs",null,null,-1),e.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 Bn=X(li,[["render",di]]),ui=["id","onClick"],fi={class:"modified_plus_btn"},mi=["src"],pi={key:2,class:"wrapper_modifier_item"},hi={key:0,class:"modifier_item_n_wrapper"},_i=["src"],gi={key:1,class:"modifier_plus_item"},yi=["src"],bi=["src"],eo=X(e.defineComponent({__name:"PlusModifier",props:{isSectionModifier:{type:Boolean},toggleNotRequire:{type:Function}},setup(t){const n=fe(),r=ge(),{stateCard:o}=F.storeToRefs(n),{itemThemes:a}=F.storeToRefs(r),i=e.ref([]),s=e.ref([]),l=e.ref(null),c=e.ref(null),d=f=>{f instanceof HTMLElement&&!i.value.includes(f)&&i.value.push(f)},u=f=>{c.value=f};return e.onMounted(async()=>{await e.nextTick(),o.value.plusButtonsRefs=i.value}),e.watchEffect(()=>{s.value=o.value.groupModifiersSelected,document.body.style.overflow=""}),e.onBeforeUnmount(()=>{i.value=[],o.value.plusButtonsRefs=[]}),(f,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({card_modified_wrapper_many:e.unref(o).groupModifiers.length>=5})},[e.unref(o).groupModifiersSelected?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["card_modified_wrapper",[e.unref(o).groupModifiers.length<=4?"card_modified_wrapper_center":""]]),ref_key:"scrollPlusContainer",ref:l},[e.createVNode(In,{axis:"x",behavior:"smooth",container:l.value,autoScroll:!0,idActive:c.value,clearContainer:!0},{default:e.withCtx(({handleTargetClick:h})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).groupModifiers,(p,y)=>{var b,w;return e.openBlock(),e.createElementBlock("div",{class:"button_modified",key:p.id,ref_for:!0,ref:d,id:"scrolling"+p.id,"data-clickable":"true",onClick:g=>{t.toggleNotRequire&&t.toggleNotRequire(p,y),u(p.id),h(g)}},[e.createElementVNode("div",fi,[s.value[y].modifiers.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{modified_plus_btn_active:p.id===((b=e.unref(o).groupCurrentOpen)==null?void 0:b.id)&&t.isSectionModifier},"modified_plus_active"])},[e.createVNode(Bn,{"aria-label":`Открыть группу модификаторов ${p.name}`},null,8,["aria-label"])],2)):s.value[y].modifiers.length===1?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["modified_plus_btn modified_plus_btn_solo",{modified_plus_btn_active:p.id===((w=e.unref(o).groupCurrentOpen)==null?void 0:w.id)&&t.isSectionModifier}])},[e.createElementVNode("img",{src:s.value[y].modifiers[0].image_link||e.unref(a).fallback_image||"",alt:"Модификатор"},null,8,mi)],2)):(e.openBlock(),e.createElementBlock("div",pi,[s.value[y].modifiers.length>2?(e.openBlock(),e.createElementBlock("div",hi,[s.value[y].modifiers.length===3?(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_plus_item modifier_item_three",src:s.value[y].modifiers[2].image_link||e.unref(a).fallback_image||""},null,8,_i)):(e.openBlock(),e.createElementBlock("p",gi," + "+e.toDisplayString(s.value[y].modifiers.length-2),1))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[s.value[y].modifiers.length>0?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.value[y].modifiers[0].image_link||e.unref(a).fallback_image||"",class:"modifier_plus_item modifier_item_first"},null,8,yi)):e.createCommentVNode("",!0),s.value[y].modifiers.length>1?(e.openBlock(),e.createElementBlock("img",{key:1,src:s.value[y].modifiers[1].image_link||e.unref(a).fallback_image||"",class:"modifier_plus_item modifier_item_second"},null,8,bi)):e.createCommentVNode("",!0)])]))]),e.createElementVNode("p",null,e.toDisplayString(p.name),1)],8,ui)}),128))]),_:1},8,["container","idActive"])],2)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-589e71ca"]]),wi={},Ci={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 ki(t,n){return e.openBlock(),e.createElementBlock("svg",Ci,[...n[0]||(n[0]=[e.createElementVNode("desc",null," Created with Pixso. ",-1),e.createElementVNode("defs",null,null,-1),e.createElementVNode("circle",{id:"Ellipse 1",cx:"10.923828",cy:"10.923462",r:"10.923489",fill:"#FF6D2E","fill-opacity":"1.000000"},null,-1),e.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 Nt=X(wi,[["render",ki]]),vt={mounted(t){t.muted=!0,t.setAttribute("muted","")}},Si={class:"wrapper_modifiers"},Ei={class:"wrapper_nutritional_value"},Ni={class:"nutritional_scheme"},vi={key:0,class:"nutritional_parameters"},Ii={key:1,class:"nutritional_parameters"},Bi={key:2,class:"nutritional_parameters"},xi={key:3,class:"nutritional_parameters"},Ai={ref:"modifierBody",class:"modifier_shadow"},Mi={class:"wrapper_modifiers_title"},Pi={class:"wrapper_text_count_modifiers"},Ti=["id","aria-label","onClick","onKeydown"],Ri={key:0,class:"counter_modifier"},$i={class:"hide_image_corners"},Vi=["src","alt"],Di={key:1,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},Oi=["src"],zi={class:"modifier_title"},Li=X(e.defineComponent({__name:"SectionModifiers",emits:["close"],setup(t,{emit:n}){const r=n,o=ge(),a=fe(),{itemThemes:i}=F.storeToRefs(o),{stateCard:s,recountGroupTotalAmount:l,groupTotalAmount:c}=F.storeToRefs(a),d=e.ref(null),u=we.useTemplateRefsList(),f=m=>{if(!m)return;const h=s.value.groupModifiers.findIndex(g=>g.id===s.value.groupCurrentOpen.id),p=s.value.plusButtonsRefs[h]||s.value.plusButtonsRefs[0];if(!p)return;const y=m.getBoundingClientRect(),b=p.getBoundingClientRect(),w=m.cloneNode(!0);w.classList.add("flyer"),Object.assign(w.style,{width:`${y.width}px`,height:`${y.height}px`,left:`${y.left}px`,top:`${y.top}px`,position:"fixed",zIndex:"1000"}),document.body.appendChild(w),d.value=w,requestAnimationFrame(()=>{const g=b.left+b.width/3-(y.left+y.width/2),_=b.top+b.height/4-(y.top+y.height/2),S=b.width/y.width*.2;w.style.transform=`translate(${g}px, ${_}px) scale(${S})`,w.style.opacity="0.4",w.style.transition="transform 0.5s ease, opacity 0.5s ease"}),w.addEventListener("transitionend",()=>{w.remove(),d.value=null,p.classList.add("bump"),setTimeout(()=>p.classList.remove("bump"),300)},{once:!0})};return e.watch(()=>s.value.isAnimationFly,m=>{m===!0&&s.value.currentModifier&&(f(u.value.find(h=>h.id===s.value.currentModifier.id)),s.value.isAnimationFly=!1)}),(m,h)=>{var p,y,b,w,g,_,S,P,V,$,D,E;return e.openBlock(),e.createElementBlock("div",Si,[e.createElementVNode("div",Ei,[e.createElementVNode("div",{class:e.normalizeClass(["card_header_inner_back",[(p=e.unref(s).openCard)!=null&&p.proteins_amount?"card_header_inner_back_nutrients":""]]),"aria-label":"Закрыть выбор модификаторов",onClick:h[0]||(h[0]=N=>r("close"))},[e.createVNode(Nt,{class:"arrow_bottom"})],2),e.createElementVNode("div",Ni,[(y=e.unref(s).openCard)!=null&&y.energy_amount?(e.openBlock(),e.createElementBlock("div",vi,[e.createElementVNode("b",null,e.toDisplayString((b=e.unref(s).openCard)==null?void 0:b.energy_amount),1),h[1]||(h[1]=e.createElementVNode("p",null,"Килокалории",-1))])):e.createCommentVNode("",!0),(w=e.unref(s).openCard)!=null&&w.proteins_amount?(e.openBlock(),e.createElementBlock("div",Ii,[e.createElementVNode("b",null,e.toDisplayString((g=e.unref(s).openCard)==null?void 0:g.proteins_amount),1),h[2]||(h[2]=e.createElementVNode("p",null,"Белки",-1))])):e.createCommentVNode("",!0),(_=e.unref(s).openCard)!=null&&_.fat_amount?(e.openBlock(),e.createElementBlock("div",Bi,[e.createElementVNode("b",null,e.toDisplayString((S=e.unref(s).openCard)==null?void 0:S.fat_amount),1),h[3]||(h[3]=e.createElementVNode("p",null,"Жиры",-1))])):e.createCommentVNode("",!0),(P=e.unref(s).openCard)!=null&&P.carbohydrates_amount?(e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("b",null,e.toDisplayString((V=e.unref(s).openCard)==null?void 0:V.carbohydrates_amount),1),h[4]||(h[4]=e.createElementVNode("p",null,"Углеводы",-1))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ai,[e.createElementVNode("p",Mi,e.toDisplayString(($=e.unref(s).groupCurrentOpen)==null?void 0:$.name),1),e.createElementVNode("p",Pi,"Выбрано "+e.toDisplayString(e.unref(l))+" из "+e.toDisplayString(e.unref(c)),1),e.createElementVNode("div",{class:e.normalizeClass((D=e.unref(s).groupModifiers.find(N=>{var M;return N.id===((M=e.unref(s).groupCurrentOpen)==null?void 0:M.id)}))!=null&&D.group_modifiers.length?"wrapper_modifiers_card":"wrapper_modifiers_card_column")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((E=e.unref(s).groupCurrentOpen)==null?void 0:E.group_modifiers)||[],N=>{var M,R,T;return e.openBlock(),e.createElementBlock("div",{key:N.id,ref_for:!0,ref:e.unref(u).set,id:N.id,class:e.normalizeClass(["modifier_card",{hidden_modifier_card:N.default_amount===0&&((M=e.unref(s).groupCurrentOpen)==null?void 0:M.id)==="Добавки2000"&&N.min_amount===0&&N.max_amount===0}]),tabindex:"0",role:"button","data-clickable":"true","aria-label":`Выбрать модификатор группы ${N.name}`,onClick:x=>e.unref(a).modifierSelect(N),onKeydown:e.withKeys(x=>e.unref(a).modifierSelect(N),["enter"])},[e.createElementVNode("div",{class:e.normalizeClass([{modifier_card_active:e.unref(s).groupModifiersSelected.some(x=>{var k;return x.group===((k=e.unref(s).groupCurrentOpen)==null?void 0:k.id)&&x.modifiers.some(B=>B.id===N.id)})},"wrapper_image_corners"])},[N.amount>1?(e.openBlock(),e.createElementBlock("div",Ri,e.toDisplayString(N.amount),1)):e.createCommentVNode("",!0),e.createElementVNode("div",$i,[N.video_link?e.withDirectives((e.openBlock(),e.createElementBlock("video",Di,[e.createElementVNode("source",{src:N.video_link||"",type:"video/webm"},null,8,Oi)])),[[e.unref(vt)]]):(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_image",src:N.image_link||e.unref(i).fallback_image||"",alt:N.name},null,8,Vi)),e.createElementVNode("div",{class:e.normalizeClass(["wrapper_modifier_title",{wrapper_modifier_title_required:N.min_amount>0||N.required}])},[e.createElementVNode("h3",zi,e.toDisplayString(N.name),1),e.createElementVNode("p",null,"+"+e.toDisplayString(((T=(R=N.sizes)==null?void 0:R.find(x=>x.id===e.unref(s).selectedSize.id))==null?void 0:T.price)||N.price||0)+"₽",1)],2)])],2)],42,Ti)}),128))],2)],512)])}}}),[["__scopeId","data-v-b4140cab"]]),Fi={key:0,class:"card_size_place"},Hi=["onClick","onKeydown","aria-label"],Ui={key:1,class:"card_size static"},qi=["onClick","onKeydown","aria-label"],xn=3,ji=X(e.defineComponent({__name:"SizeModifier",setup(t){const n=fe(),{stateCard:r}=F.storeToRefs(n),o=e.ref(null),a=e.ref(50),i=e.ref(),s=e.ref(0),l=e.ref(0),c=e.ref(null),d=e.computed(()=>{var _;if(r.value.productSizes.length<=3)return r.value.productSizes[i.value.index]||r.value.productSizes[0];const w=s.value+1,g=((_=f.value[w])==null?void 0:_.originalIndex)??1;return r.value.productSizes[g]}),u=()=>{c.value&&r.value.productSizes.length>=3&&(l.value=c.value.offsetWidth/xn)},f=e.computed(()=>{if(r.value.productSizes.length<=3)return r.value.productSizes;const w=r.value.productSizes;return[...w.map((g,_)=>({...g,originalIndex:_})),...w.map((g,_)=>({...g,originalIndex:_})),...w.map((g,_)=>({...g,originalIndex:_}))]}),m=(w,g)=>{if(i.value={id:w.id,title:w.name,index:g,is_default:w.is_default},w.price!==null&&r.value.openCard&&(r.value.openCard={...r.value.openCard,price:w.price}),r.value.selectedSize=w,r.value.productSizes.length>3){u();const _=s.value+1;g<_?h():g>_&&p()}else{const _=r.value.productSizes.length,S=(g+.5)*(100/_);a.value=S}},h=()=>{var w;if(!(r.value.productSizes.length<=3)){if(s.value--,s.value<r.value.productSizes.length-xn+1){s.value+=r.value.productSizes.length;const g=(w=c.value)==null?void 0:w.querySelector(".card_size");g&&(g.style.transition="none",g.style.transform=`translateX(-${s.value*l.value}px)`,g.offsetHeight,g.style.transition="transform 0.2s ease-in-out")}y()}},p=()=>{var w;if(!(r.value.productSizes.length<=3)){if(s.value++,s.value>=r.value.productSizes.length*2){s.value-=r.value.productSizes.length;const g=(w=c.value)==null?void 0:w.querySelector(".card_size");g&&(g.style.transition="none",g.style.transform=`translateX(-${s.value*l.value}px)`,g.offsetHeight,g.style.transition="transform 0.2s ease-in-out")}y()}},y=()=>{var S;if(r.value.productSizes.length<=3)return;const w=s.value+1,g=((S=f.value[w])==null?void 0:S.originalIndex)??0,_=r.value.productSizes[g];i.value={id:_.id,title:_.name,index:g,is_default:_.is_default}};e.watch(()=>[r.value.productSizes,c.value],([w=[],g])=>{if(Array.isArray(w)&&w.length>0&&g!==null){let _=w.findIndex(S=>S.is_default===!0);w.length<3&&o.value&&parseInt(o.value.style.minWidth)<767&&(o.value.style.width="100px"),_>-1?(s.value=_,m(w[_],_),l.value=120/xn):w.length===2||w.length===1?(m(w[0],0),a.value=(0+.5)*(100/2)):(m(w[1],1),a.value=(1+.5)*(100/3))}}),e.watch(()=>{var w;return[(w=r.value.selectedSize)==null?void 0:w.id,r.value.groupModifiersSelected]},([w,g])=>{if(!w||!Array.isArray(g))return;const _=g.map(S=>({...S,modifiers:S.modifiers.map(P=>{if(!P.sizes||P.sizes.length===0)return P;const V=P.sizes.find($=>$.id===w);return V?{...P,size:V,price:V.price??P.price}:P})}));JSON.stringify(_)!==JSON.stringify(r.value.groupModifiersSelected)&&(r.value.groupModifiersSelected=_)},{deep:!0});const b={mounted:u};return e.onBeforeUnmount(()=>{window.removeEventListener("resize",u)}),(w,g)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"slider_container",ref_key:"slider_container",ref:o},[e.createElementVNode("div",{class:"card_size_place_wrapper",ref_key:"sliderWrapper",ref:c},[e.unref(r).productSizes.length>1&&i.value?(e.openBlock(),e.createElementBlock("div",Fi,[e.unref(r).productSizes.length>3?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"card_size",style:e.normalizeStyle({transform:`translateX(-${s.value*l.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(_,S)=>(e.openBlock(),e.createElementBlock("li",{key:`${_.id}-${S}`,onClick:P=>m(_,S),onKeydown:e.withKeys(P=>m(_,S),["enter"]),class:e.normalizeClass({active:i.value.id===_.id&&i.value.index===_.originalIndex}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${_.name}`},e.toDisplayString(_.alt_name?_.alt_name:_.name),43,Hi))),128))],4)):(e.openBlock(),e.createElementBlock("ul",Ui,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).productSizes,(_,S)=>(e.openBlock(),e.createElementBlock("li",{key:`${_.id}-${S}`,onClick:P=>m(_,S),onKeydown:e.withKeys(P=>m(_,S),["enter"]),class:e.normalizeClass({active:i.value.id===_.id&&i.value.index===S}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${_.name}`},e.toDisplayString(_.alt_name?_.alt_name:_.name),43,qi))),128))])),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:2,class:"size_active",style:e.normalizeStyle(e.unref(r).productSizes.length<=3?{left:`${a.value}%`}:{})},[e.createElementVNode("p",null,e.toDisplayString(d.value.alt_name?d.value.alt_name:d.value.name),1)],4)),[[b]]):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)],512)),[[e.vShow,e.unref(r).productSizes.length>1&&i.value]])}}),[["__scopeId","data-v-bc00f0e8"]]),Wi="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",Gi={class:"counter_container"},Ki={class:"card_size_place_wrapper",ref:"sliderWrapper"},Zi={class:"cart_amount_counter"},Qi={class:"button_circle_number"},Ji=X(e.defineComponent({__name:"NumberModifier",setup(t){const n=fe(),{stateCard:r}=F.storeToRefs(n),o=()=>{var i,s;(i=r.value.openCard)!=null&&i.amount&&((s=r.value.openCard)==null?void 0:s.amount)>1&&(r.value.openCard.amount-=1)},a=()=>{var i;(i=r.value.openCard)!=null&&i.amount&&(r.value.openCard.amount+=1)};return(i,s)=>{var l,c;return e.openBlock(),e.createElementBlock("div",Gi,[e.createElementVNode("div",Ki,[e.createElementVNode("div",Zi,[e.createElementVNode("p",{class:e.normalizeClass(["cart_circle_minus",[((l=e.unref(r).openCard)==null?void 0:l.amount)===1?"card_circle_minus_alone":""]]),"aria-label":"Уменьшить количество продукта","data-clickable":"true",onClick:e.withModifiers(o,["stop","prevent"])},[...s[0]||(s[0]=[e.createElementVNode("span",null,null,-1)])],2),e.createElementVNode("p",Qi,e.toDisplayString((c=e.unref(r).openCard)==null?void 0:c.amount),1),e.createElementVNode("p",{class:"cart_circle_plus","aria-label":"Увеличить количество продукта","data-clickable":"true",onClick:e.withModifiers(a,["stop","prevent"])},"+")])],512)])}}}),[["__scopeId","data-v-c3d45434"]]);function to(t,n=800){const r=e.ref(t),o=e.ref(t);let a=null,i=null,s=t;const l=c=>{i||(i=c);const d=c-i,u=Math.min(d/n,1),f=u<.5?4*u*u*u:1-Math.pow(-2*u+2,3)/2;r.value=Math.round(s+(o.value-s)*f),u<1?a=requestAnimationFrame(l):(r.value=o.value,a=null)};return e.watch(o,()=>{a&&cancelAnimationFrame(a),s=r.value,i=null,a=requestAnimationFrame(l)},{immediate:!0}),e.onUnmounted(()=>{a&&cancelAnimationFrame(a)}),{displayNumber:r,targetNumber:o,update:c=>{o.value=c}}}const Ce=e.defineComponent({__name:"RecountNumber",props:{price:{type:Number,required:!0},duration:{type:Number},fixedFloat:{type:Number,require:!1}},setup(t){const n=t,{displayNumber:r,update:o}=to(n.price||0,n.duration||800);return e.watchEffect(()=>{o(n.price)}),(a,i)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(e.unref(r).toFixed(t.fixedFloat)),1))}}),Yi=["disabled","id"],Re=e.defineComponent({__name:"ButtonDefault",props:{textButtonDefault:{type:String,required:!0},disabled:{type:Boolean,default:!1},onClick:{type:Function,required:!0}},setup(t){const n=t,r=()=>{n.onClick()};return(o,a)=>(e.openBlock(),e.createElementBlock("button",{class:"buttonDefaultWrapper",disabled:t.disabled,onClick:r,id:t.disabled?"buttonDefaultDisabled":""},e.toDisplayString(t.textButtonDefault),9,Yi))}}),Xi={class:"notification_info"},el={key:0,class:"notification_18plus"},tl={class:"notification_18plus_image"},nl=["src"],rl={class:"notification_18plus_text"},ol={class:"notification_18plus_accept"},al={key:1,class:"notification_text"},sl={key:0,class:"wrapper_button_accept"},An=e.defineComponent({__name:"NotificationWindow",props:e.mergeModels({textNotificationDefault:{},backgroundColor:{},buttonAccept:{},type:{type:Boolean},is_qr:{type:Boolean}},{visible:{default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(t){const n=t,r=ge(),o=se(),{is18Allowed:a,notificationData_lib:i}=F.storeToRefs(o),{itemThemes:s}=F.storeToRefs(r),l=e.computed(()=>n.backgroundColor||"rgba(50, 50, 50, 0.9)"),c=e.useModel(t,"visible"),d=()=>{i.value.fastAdd&&(o.addToCart(i.value.fastAdd),i.value.fastAdd=null),sessionStorage.setItem("is_adult","true"),a.value=!0,c.value=!1,i.value.callback&&(i.value.callback(),i.value.callback=null)},u=()=>{c.value=!1};return(f,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"notificationBlack",appear:""},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"notification_background_black",onClick:u})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"notification",appear:""},{default:e.withCtx(()=>{var h;return[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"notification_overlay",onClick:u},[e.createElementVNode("div",{class:"notification_wrapper",style:e.normalizeStyle({"background-color":l.value,border:`2px solid ${l.value}`})},[e.createElementVNode("div",Xi,[t.type?(e.openBlock(),e.createElementBlock("div",el,[e.createElementVNode("div",tl,[e.createElementVNode("img",{src:e.unref(s).adult_disclaimer_image||e.unref(s).fallback_image,alt:"Дисклеймер"},null,8,nl)]),e.createElementVNode("div",rl,e.toDisplayString(e.unref(s).adult_disclaimer_text),1),e.createElementVNode("div",ol,[m[0]||(m[0]=e.createElementVNode("label",{for:"plus18"},"Содержащиеся в настоящем разделе материалы предназначены для лиц старше 18 лет, носят информационный характер об ассортименте товаров и не являются рекламой. ",-1)),e.createVNode(Re,{textButtonDefault:"Мне есть 18",onClick:d,style:{fontSize:"1rem",padding:"6px 24px",marginLeft:"10px"}})])])):(e.openBlock(),e.createElementBlock("div",al,[e.createTextVNode(e.toDisplayString(t.textNotificationDefault)+" ",1),(h=t.buttonAccept)!=null&&h.state?(e.openBlock(),e.createElementBlock("div",sl,[e.createVNode(Re,{class:"button_accept",textButtonDefault:t.buttonAccept.text,onClick:t.buttonAccept.acceptBtn,disabled:t.buttonAccept.disabled},null,8,["textButtonDefault","onClick","disabled"])])):e.createCommentVNode("",!0)]))])],4)])):e.createCommentVNode("",!0)]}),_:1})],64))}}),il={class:"button_price button_price_modifiers"},ll=["src"],cl={class:"button_text_container"},dl={class:"button_text_price"},ul=X(e.defineComponent({__name:"ButtonPriceCount",props:{qr_menu:{type:Boolean,default:!1},closeProduct:{}},setup(t){const n=Z.useRouter(),r=Z.useRoute(),o=fe(),a=se(),i=ge(),s=e.ref([]),l=e.ref([]),c=t,{stateCard:d,totalPrice_libCard:u,isOpenWindow:f,isAddToCard:m}=F.storeToRefs(o),{itemThemes:h}=F.storeToRefs(i),p=e.ref(!0),y=e.ref(!1),b=()=>{var g,_,S;if(p.value){o.setCurrentCard(d.value.openCard),y.value=!0;const P=d.value.groupModifiers.findIndex(V=>o.checkedRequiredBtn.group.id===V.id);o.checkedRequiredBtn.haveRequaire&&o.toggleNotRequire(o.checkedRequiredBtn.group,P);return}const w=d.value.groupModifiersSelected||[];if(s.value=[],l.value=[],Array.isArray(w)&&w.length>0&&w.forEach(P=>{const V=P.group,$=P.modifiers||[];V==="Добавки2000"?s.value=$.map(D=>{var E;return{...D,old_price:D.price,size:Array.isArray(D.size)?D.size.map(N=>N.id).filter(Boolean):(E=D.size)!=null&&E.id?D.size.id:void 0}}):$.length>0&&l.value.push({group:V,modifiers:$.map(D=>{var E;return{...D,old_price:D.price,size:Array.isArray(D.size)?D.size.map(N=>N.id).filter(Boolean):(E=D.size)!=null&&E.id?D.size.id:void 0}})})}),document.body.style.overflow="",d.value.openCard){const P={id:d.value.openCard.id,is_fake:d.value.openCard.is_fake||!1,is_od_united_product:d.value.openCard.is_od_united_product||!1,amount:d.value.openCard.amount,name:d.value.openCard.name,image_link:d.value.openCard.image_link,price:d.value.openCard.price,old_price:d.value.openCard.price,size:((g=d.value.selectedSize)==null?void 0:g.id)??((S=(_=d.value.openCard.sizes)==null?void 0:_.find(V=>V.is_default))==null?void 0:S.id),sizes:d.value.openCard.sizes||[],modifiers:s.value,groups:d.value.openCard.groups,group_modifiers:l.value,energy_amount:d.value.openCard.energy_amount??0,proteins_amount:d.value.openCard.proteins_amount??0,fat_amount:d.value.openCard.fat_amount??0,carbohydrates_amount:d.value.openCard.carbohydrates_amount??0};c.closeProduct&&c.closeProduct(),a.addToCart(P),m.value=!0}f.value=!1,c.qr_menu&&n.push(`/${r.params.orgId}/`)};return e.watch(()=>d.value.productSizes,w=>{!w||w.length===0||!d.value.selectedSize||(d.value.selectedSize={...d.value.selectedSize})},{immediate:!0}),e.watchEffect(()=>{o.checkedRequiredBtn.haveRequaire?p.value=!0:p.value=!1}),e.onMounted(()=>{m.value=!1}),(w,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(An,{visible:y.value,textNotificationDefault:e.unref(d).textErrorRequaired,backgroundColor:e.unref(h).accent_color?e.unref(h).accent_color:"#FF6D2E",buttonAccept:null,"onUpdate:visible":g[0]||(g[0]=_=>y.value=_)},null,8,["visible","textNotificationDefault","backgroundColor"]),e.createElementVNode("div",{class:"button_price_bg_product",onTouchstart:g[3]||(g[3]=e.withModifiers(()=>{},["stop"])),onPointerdown:g[4]||(g[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",il,[e.createVNode(Ji),e.createElementVNode("div",{class:e.normalizeClass(["card_product_button_buy",{buy_active:!p.value}]),"data-clickable":"true",onClick:b,onTouchstart:g[1]||(g[1]=e.withModifiers(()=>{},["stop"])),onPointerdown:g[2]||(g[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{src:e.unref(Wi),class:"card_product_button_icon"},null,8,ll),e.createElementVNode("div",cl,[e.createElementVNode("p",dl,[e.createVNode(Ce,{price:+e.unref(u),fixedFloat:2},null,8,["price"]),g[5]||(g[5]=e.createTextVNode(" ₽ ",-1))])])],34)])],32)],64))}}),[["__scopeId","data-v-fa26c1fb"]]),fl={class:"modified_amount"},ml={class:"hide_image_corners"},pl=["src"],hl={class:"wrapper_modifier_title"},_l={class:"amount_title"},gl={class:"wrapper_amount_counter"},yl={class:"amount_count"},bl={class:"amount_wrapper"},wl={class:"add_counter_amount"},Cl=X(e.defineComponent({__name:"ModalAmount",setup(t){const n=fe(),r=ge(),{itemThemes:o}=F.storeToRefs(r),{stateCard:a}=F.storeToRefs(n),i=e.computed(()=>{var c,d,u;return((u=(d=(c=a.value.currentModifier)==null?void 0:c.sizes)==null?void 0:d.find(f=>f.id===a.value.selectedSize.id))==null?void 0:u.price)??ct(a.value.currentModifier)}),s=()=>{a.value.currentModifier&&(a.value.currentModifier.amount=a.value.modalCount),n.modifierSelect(a.value.currentModifier),a.value.isModifiedAmount=!1},l=()=>{a.value.modalCount=1,a.value.currentModifier.amount=1};return(c,d)=>{var u,f;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",fl,[e.createElementVNode("div",ml,[e.createElementVNode("img",{class:"modifier_image",src:((u=e.unref(a).currentModifier)==null?void 0:u.image_link)||e.unref(o).fallback_image||""},null,8,pl),e.createElementVNode("div",hl,[e.createElementVNode("p",_l,e.toDisplayString((f=e.unref(a).currentModifier)==null?void 0:f.name),1),e.createElementVNode("p",null,"+ "+e.toDisplayString(i.value)+"₽",1)])])]),e.createElementVNode("div",gl,[e.createElementVNode("div",{class:"amount_mines",onClick:d[0]||(d[0]=e.withModifiers((...m)=>e.unref(n).minusAmount&&e.unref(n).minusAmount(...m),["stop"]))},[...d[1]||(d[1]=[e.createElementVNode("div",null,null,-1)])]),e.createElementVNode("p",yl,e.toDisplayString(e.unref(a).modalCount),1),e.createElementVNode("div",bl,[e.createVNode(Bn,{onClick:e.withModifiers(e.unref(n).plusAmount,["stop"])},null,8,["onClick"])])]),e.createElementVNode("p",{class:"clear_count",onClick:e.withModifiers(l,["stop"])},"Убрать все"),e.createElementVNode("div",wl,[e.createVNode(Re,{textButtonDefault:"Добавить",onClick:s,class:"button_add_group_modifiers"})])],64)}}}),[["__scopeId","data-v-84debd5d"]]),kl=(t,n,r)=>Math.max(n,Math.min(t,r)),Sl=(t,n)=>Math.pow(t,n*5),no=(t,n,r)=>n===0||Math.abs(n)===1/0?Sl(t,r):t*n*r/(n+r*t),Jt=(t,n)=>n*parseFloat(t)/100,Mn=(t,n,r,o=.15)=>o===0?kl(t,n,r):t<n?-no(n-t,r-n,o)+n:t>r?+no(t-r,r-n,o)+r:t,Ae=(t,{min:n,max:r})=>n!==void 0&&t<n?n:r!==void 0&&t>r?r:t;function El(t,n,r){const o=e.ref(0),a=e.computed(()=>t.value.map(c=>typeof c=="string"?Jt(c,r.value):c)),i=e.computed(()=>Math.min(...a.value)),s=e.computed(()=>Math.max(...a.value)),l=e.computed(()=>{const c=a.value.reduce((d,u)=>Math.abs(u-n.value)<Math.abs(d-n.value)?u:d);return a.value.indexOf(c)});return{currentSnapPointIndex:o,flattenedSnapPoints:a,minSnapPoint:i,maxSnapPoint:s,closestSnapPointIndex:l}}const Pn=X(e.defineComponent({__name:"BottomSheet",props:{duration:{default:250},snapPoints:{},initialSnapPoint:{},blocking:{type:Boolean,default:!0},canSwipeClose:{type:Boolean,default:!0},swipeCloseThreshold:{},canBackdropClose:{type:Boolean,default:!0},expandOnContentDrag:{type:Boolean,default:!0},modelValue:{type:Boolean},teleportTo:{default:"body"},teleportDefer:{type:Boolean,default:!1},headerClass:{},contentClass:{},footerClass:{}},emits:["opened","opening-started","closed","closing-started","ready","dragging-up","dragging-down","snapped","instinctHeight","update:modelValue"],setup(t,{expose:n,emit:r}){const o=t,a=r,i=we.useVModel(o,"modelValue",a,{passive:!0});e.watch(i,U=>{U&&I()}),e.onMounted(()=>{i.value&&I()});const s=e.ref(),l=e.ref(null),c=e.ref(null),d=e.ref(null),u=e.ref(null),f=e.ref(o.expandOnContentDrag),{height:m}=we.useWindowSize(),{height:h}=we.useElementBounding(s),{height:p}=we.useElementBounding(l),{height:y}=we.useElementBounding(u),{height:b}=we.useElementBounding(c),w=e.computed({get(){return Ae(Math.ceil(y.value+p.value+b.value),{max:m.value})},set(U){[p.value,y.value,b.value]=U}}),g=e.ref(0),_=e.ref(0),S=pe.useMotionValue(0),P=pe.useMotionValue(0),{snapPoints:V}=e.toRefs(o),$=e.computed(()=>V.value??[w.value]),{flattenedSnapPoints:D,currentSnapPointIndex:E,closestSnapPointIndex:N,minSnapPoint:M,maxSnapPoint:R}=El($,g,m);let T;function x(U){f.value=!0,k(U)}function k(U){f.value&&U.preventDefault()}const B=U=>{U.key==="Escape"&&H()},A=()=>{o.canBackdropClose&&H()};let C=!1;const I=async()=>{if(C)return;i.value=!0,C=!0,a("opening-started"),await e.nextTick();const U=s.value.$el;h.value=U.getBoundingClientRect().height;const ne=U.querySelector("[data-vsbs-content]"),ie=U.querySelector("[data-vsbs-header]"),me=U.querySelector("[data-vsbs-footer]");if(w.value=[ie.getBoundingClientRect().height,ne.getBoundingClientRect().height,me.getBoundingClientRect().height],await e.nextTick(),E.value=D.value.findIndex(Me=>Me===M.value),o.initialSnapPoint){const Me=o.initialSnapPoint;if(Me<0||Me>=$.value.length)return console.warn("Index out of bounds");g.value=typeof $.value[Me]=="number"?Ae($.value[Me],{max:m.value}):Jt($.value[Me],m.value)}else g.value=Ae(M.value,{max:m.value});_.value=g.value,S.jump(g.value),P.jump(g.value),requestAnimationFrame(()=>{T=pe.animate(S,g.value,{duration:o.duration/1e3,ease:"easeInOut"}),T=pe.animate(P,0,{duration:o.duration/1e3,ease:"easeInOut",onComplete:()=>{o.blocking&&a("opened")}})}),window.addEventListener("keydown",B),C=!1};let O=!1;const H=()=>{O||(i.value=!1,O=!0,a("closing-started"),window.removeEventListener("keydown",B),setTimeout(()=>{a("closed"),O=!1},o.duration))},G=U=>{if($.value){if(U<0||U>=$.value.length){console.warn("Index out of bounds");return}E.value=U,g.value=typeof $.value[U]=="number"?Ae($.value[U],{max:m.value}):Jt($.value[U],m.value),T=pe.animate(S,g.value,{duration:o.duration/1e3,ease:"easeInOut",onComplete:()=>a("snapped",$.value.indexOf($.value[U]))})}};function j(U){U>0?a("dragging-down"):U<0&&a("dragging-up")}const K=()=>{g.value=h.value,_.value=P.get(),S.jump(g.value),P.jump(_.value)},ee=async(U,ne)=>{await e.nextTick(),s.value&&(_.value<=0&&(g.value-=ne.delta.y),g.value<=M.value&&(g.value=M.value,_.value+=ne.delta.y,P.set(o.canSwipeClose?Ae(_.value,{min:0}):Ae(Mn(_.value,-h.value,0,.5),{min:0}))),S.set(Ae(Mn(g.value,0,R.value,.25),{min:0,max:m.value})),j(ne.delta.y))},Y=()=>{if(o.canSwipeClose){let U=g.value/2;o.swipeCloseThreshold&&typeof o.swipeCloseThreshold=="number"&&(U=o.swipeCloseThreshold),o.swipeCloseThreshold&&typeof o.swipeCloseThreshold=="string"&&o.swipeCloseThreshold.includes("%")&&(U=g.value*(Number(o.swipeCloseThreshold.replace("%",""))/100)),Math.abs(_.value)>U&&(_.value=g.value)}else _.value=0;T=pe.animate(P,_.value,{duration:o.duration/1e3,ease:"easeInOut"}),_.value===g.value&&(_.value=0,H()),E.value=N.value,g.value=typeof $.value[N.value]=="number"?Ae($.value[N.value],{max:m.value}):Jt($.value[N.value],m.value),T=pe.animate(S,g.value,{duration:o.duration/1e3,ease:"easeInOut",onComplete:()=>a("snapped",$.value.indexOf($.value[N.value]))}),T=pe.animate(P,0,{duration:o.duration/1e3,ease:"easeInOut"})},de=(U,ne)=>{if(g.value=h.value,_.value=P.get(),T&&T.stop(),!d.value)return;const ie=d.value.scrollTop===0,me=ne.delta.y>0,Me=D.value.length===1,Hn=.5>Math.abs(g.value-R.value);if(Me){if(!o.expandOnContentDrag)return f.value=!1;P.get()===0&&ie&&me&&(f.value=!0),P.get()===0&&ie&&!me&&(f.value=!1)}else{if(!o.expandOnContentDrag)return f.value=!1;f.value=!0,Hn&&(me&&ie&&(f.value=!0),!me&&ie&&(f.value=!1),ie||(f.value=!1))}},he=async(U,ne)=>{if(await e.nextTick(),!o.expandOnContentDrag)return f.value=!1;if(!s.value)return;_.value===0&&f.value&&o.expandOnContentDrag&&(g.value-=ne.delta.y),g.value<=M.value&&(g.value=M.value,f.value&&o.expandOnContentDrag&&(_.value+=ne.delta.y),_.value=Ae(_.value,{min:0,max:M.value}),P.set(o.canSwipeClose?Ae(_.value,{min:0}):Ae(Mn(_.value,-h.value,0,.5),{min:0}))),g.value>R.value&&(g.value=R.value),g.value=Ae(g.value,{max:m.value}),!(D.value.length===1)&&g.value===R.value&&(f.value=!1),S.set(g.value),j(ne.delta.y)},_e=()=>{if(!d.value)return;const U=d.value.scrollTop===0;f.value=U},ae=we.useDebounceFn(U=>G(U),o.duration);return e.watch($,(U,ne)=>{if(i.value===!1||!U||!ne)return;const ie=U[E.value],me=ne[E.value];typeof ie!="string"&&typeof me!="string"&&(g.value=Ae(ie,{max:m.value}),ie!==me&&(T=pe.animate(S,g.value,{duration:o.duration/1e3,ease:"easeInOut"})))}),e.watch(m,()=>ae(E.value)),e.watch(w,U=>a("instinctHeight",U)),n({open:I,close:H,snapToPoint:G}),(U,ne)=>(e.openBlock(),e.createBlock(e.Teleport,{to:t.teleportTo,defer:t.teleportDefer},[e.createElementVNode("div",e.mergeProps(U.$attrs,{"data-vsbs-container":""}),[e.createVNode(e.unref(pe.AnimatePresence),null,{default:e.withCtx(()=>[e.unref(i)&&t.blocking?(e.openBlock(),e.createBlock(e.unref(pe.Motion),{key:0,ref:"backdrop","data-vsbs-backdrop":"",onClick:ne[0]||(ne[0]=ie=>A()),transition:{ease:"easeInOut",duration:t.duration/1e3},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},null,8,["transition"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(pe.AnimatePresence),null,{default:e.withCtx(()=>[e.unref(i)?(e.openBlock(),e.createBlock(e.unref(pe.Motion),{key:0,ref_key:"sheet",ref:s,exit:{y:"100%",height:e.unref(h),opacity:0},initial:!1,style:e.normalizeStyle({y:e.unref(P),z:1,height:e.unref(S)}),"data-vsbs-shadow":!t.blocking,"data-vsbs-sheet-show":e.unref(i),"aria-modal":"true","data-vsbs-sheet":"",tabindex:"-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe.Motion),{ref_key:"sheetHeader",ref:l,"data-vsbs-header":"",onPanStart:K,onPan:ee,onPanEnd:Y,onTouchmove:x,class:e.normalizeClass(t.headerClass)},{default:e.withCtx(()=>[e.renderSlot(U.$slots,"header",{},void 0,!0)]),_:3},8,["class"]),e.createElementVNode("div",{ref_key:"sheetScroll",ref:d,"data-vsbs-scroll":"",onScrollend:_e},[e.createVNode(e.unref(pe.Motion),{ref:"sheetContentWrapper","data-vsbs-content-wrapper":"",onPanStart:de,onPan:he,onPanEnd:Y,onTouchmove:k},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"sheetContent",ref:u,"data-vsbs-content":"",class:e.normalizeClass(t.contentClass)},[e.renderSlot(U.$slots,"default",{},void 0,!0)],2)]),_:3},512)],544),e.createVNode(e.unref(pe.Motion),{ref_key:"sheetFooter",ref:c,"data-vsbs-footer":"",onPanStart:K,onPan:ee,onPanEnd:Y,onTouchmove:x,class:e.normalizeClass(t.footerClass)},{default:e.withCtx(()=>[e.renderSlot(U.$slots,"footer",{},void 0,!0)]),_:3},8,["class"])]),_:3},8,["exit","style","data-vsbs-shadow","data-vsbs-sheet-show"])):e.createCommentVNode("",!0)]),_:3})],16)],8,["to","defer"]))}}),[["__scopeId","data-v-8bf4388d"]]);function Ze(t,n=null){const r=Vt();r.initCacheSingle("defaultImage");const o=e.computed(()=>r.cache.defaultImage||null),a=e.shallowRef(!1),i=e.computed(()=>{var d;return((d=e.toValue(t))==null?void 0:d.toString())||null}),s=we.computedAsync(async()=>{const d=i.value;return d?(await r.initCacheSingle(d),r.cache[d]||null):null},null,{evaluating:a}),l=e.computed(()=>a.value&&i.value!==null);return{mediaUrl:e.computed(()=>s.value||e.toValue(n)||o.value||null),isLoading:l}}const Nl={class:"card_product_wrapper"},vl={class:"card_product_modifiers_sheet_body"},Il={class:"card__pictures"},Bl=["src"],xl=["src"],Al={class:"card_header_wrapper"},Ml={key:0,class:"card_fire_kkal_wrapper"},Pl={class:"card_content"},Tl={class:"wrapper_size"},Rl={key:0,class:"description"},$l={key:1},Vl=X(e.defineComponent({__name:"CardProductPage",props:{configPage:{}},setup(t){const n=ge(),r=fe(),{stateCard:o,isOpenWindow:a}=F.storeToRefs(r),{itemThemes:i}=F.storeToRefs(n),s=Z.useRouter(),l=Z.useRoute(),c=t,{mediaUrl:d}=Ze(()=>{var m,h;return(m=o.value.openCard)!=null&&m.video_link?`${o.value.openCard.id}_video`:(h=o.value.openCard)!=null&&h.image_link?`${o.value.openCard.id}_image`:null},()=>{var m,h;return((m=o.value.openCard)==null?void 0:m.video_link)||((h=o.value.openCard)==null?void 0:h.image_link)||null}),u=()=>{c.configPage.qr_menu?s.push(`/${l.params.orgId}`):c.configPage.closeProduct()},f=()=>{o.value.isModifiedAmount=!1};return e.watch(()=>c.configPage.data,r.setCurrentCard),e.watchEffect(()=>{a.value||(a.value=c.configPage.is_closeProduct)}),e.onBeforeUnmount(()=>r.reset()),(m,h)=>{var p,y,b,w,g,_;return e.openBlock(),e.createElementBlock("div",Nl,[e.createVNode(e.unref(Pn),{modelValue:e.unref(o).isSectionModifier,"onUpdate:modelValue":h[1]||(h[1]=S=>e.unref(o).isSectionModifier=S),class:"card_product_modifiers_sheet"},{default:e.withCtx(()=>[e.createElementVNode("div",vl,[e.createVNode(Li,{onClose:h[0]||(h[0]=S=>e.unref(o).isSectionModifier=!1)}),e.createVNode(eo,{isSectionModifier:e.unref(o).isSectionModifier,toggleNotRequire:e.unref(r).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])]),_:1},8,["modelValue"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(o).isModifiedAmount?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wrapper_modified_amount",onClick:e.withModifiers(f,["stop"])},[e.createVNode(Cl)])):e.createCommentVNode("",!0)])),e.createElementVNode("div",Il,[(p=e.unref(o).openCard)!=null&&p.video_link&&e.unref(d)?e.withDirectives((e.openBlock(),e.createElementBlock("video",{key:e.unref(d),loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},[e.createElementVNode("source",{src:e.unref(d)||"",type:"video/webm"},null,8,Bl)])),[[e.unref(vt)]]):(e.openBlock(),e.createElementBlock("img",{key:1,class:"card__pictures_images",src:e.unref(d)||"",alt:"Product image"},null,8,xl)),e.createElementVNode("div",Al,[e.createVNode(Nt,{class:"card_header_back",onClick:u,"aria-label":"Вернуться назад"}),(y=e.unref(o).openCard)!=null&&y.energy_amount?(e.openBlock(),e.createElementBlock("div",Ml,[h[3]||(h[3]=e.createElementVNode("div",{class:"card_fire_kkal"},null,-1)),e.createElementVNode("p",null,[e.createElementVNode("b",null,e.toDisplayString((b=e.unref(o).openCard)==null?void 0:b.energy_amount),1),h[2]||(h[2]=e.createTextVNode(" Ккал ",-1))])])):e.createCommentVNode("",!0)]),e.createElementVNode("h4",null,e.toDisplayString((w=e.unref(o).openCard)==null?void 0:w.name),1),e.createElementVNode("div",{class:"card__pictures__gradient",style:e.normalizeStyle(e.unref(i).gradientStyle)},null,4)]),e.createElementVNode("div",Pl,[e.createElementVNode("div",Tl,[e.createVNode(ji)]),(g=e.unref(o).openCard)!=null&&g.description?(e.openBlock(),e.createElementBlock("p",Rl,e.toDisplayString((_=e.unref(o).openCard)==null?void 0:_.description),1)):e.createCommentVNode("",!0),e.unref(o).groupModifiers.length?(e.openBlock(),e.createElementBlock("div",$l,[h[4]||(h[4]=e.createElementVNode("p",{class:"title_info_modifiers"},"Настрой, как ты любишь",-1)),e.createVNode(eo,{isSectionModifier:e.unref(o).isSectionModifier,toggleNotRequire:e.unref(r).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])):e.createCommentVNode("",!0),e.createVNode(ul,{qr_menu:t.configPage.qr_menu,closeProduct:t.configPage.closeProduct},null,8,["qr_menu","closeProduct"])])])}}}),[["__scopeId","data-v-a9fa8db1"]]),Dl={key:0,class:"popupWindowDefault_overlay"},ro=X(e.defineComponent({__name:"PopupWindowDefault",props:{visible:{type:Boolean}},emits:["update:visible"],setup(t,{emit:n}){const r=t,o=n,a=()=>{o("update:visible",!1)};return e.watch(()=>r.visible,async i=>{i&&await e.nextTick(),r.isVisible=i}),(i,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"popupWindowDefaultBlack",appear:"",onAfterLeave:s[0]||(s[0]=()=>{o("update:visible",!1)})},{default:e.withCtx(()=>[r.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"background_black",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"popupWindowDefault",appear:"",onAfterLeave:s[1]||(s[1]=()=>{o("update:visible",!1)})},{default:e.withCtx(()=>[r.visible?(e.openBlock(),e.createElementBlock("div",Dl,[e.renderSlot(i.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]),_:3})],64))}}),[["__scopeId","data-v-08e0e008"]]),Ol={},zl={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ll(t,n){return e.openBlock(),e.createElementBlock("svg",zl,[...n[0]||(n[0]=[e.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 Fl=X(Ol,[["render",Ll]]),Tn=F.defineStore("modals",()=>{const t=new Map,n=(a,i)=>{const s=o(a).value;s.visible=!0,s.context=i},r=a=>{const i=o(a).value;i.visible=!1},o=a=>(t.has(a)||t.set(a,e.ref({visible:!1})),t.get(a));return{state:o,open:n,close:r}}),Hl=["src"],Ul={class:"cart_box_content_wrapper"},ql={class:"cart_box_content_info"},jl={class:"cart_amount"},Wl={class:"cart_amount_count"},Gl={class:"cart_box_info_more"},Kl={key:1,class:"cart_modifier_info"},Zl={class:"cart_modifier_content"},Ql={class:"wrapper_price_count_cart"},Jl={class:"count_cart_box"},Yl={class:"wrapper_modifiers_discount"},oo=X(e.defineComponent({__name:"CartBox",props:{index:Number,cardItem:Object},emits:["delete"],setup(t,{emit:n}){const r=t,o=se(),a=ge(),i=Tn(),{itemThemes:s}=F.storeToRefs(a),l=e.ref(0),c=e.ref(0),d=e.ref(!1),u=e.ref(!1),f=e.ref(!1),{displayNumber:m,update:h}=to(0,800),p=e.computed(()=>{var M,R;const E=((M=r.cardItem)==null?void 0:M.modifiers)??[],N=(((R=r.cardItem)==null?void 0:R.group_modifiers)??[]).flatMap(T=>T.modifiers??[]);return[...E,...N]}),{mediaUrl:y}=Ze(()=>{var E;return((E=r.cardItem)==null?void 0:E.id)+"_image"},()=>{var E;return(E=r.cardItem)==null?void 0:E.image_link}),b=e.computed(()=>{var E,N;return((E=r.cardItem)==null?void 0:E.total_new_price)||ct(r.cardItem)*((N=r.cardItem)==null?void 0:N.amount)}),w=()=>i.open("cart-delete-confirm",r.cardItem),g=()=>{f.value=!f.value},_=()=>{o.plusAmount(r.cardItem.idSystem)},S=()=>{r.cardItem.amount>1?o.minusAmount(r.cardItem.idSystem):w()},P=E=>{l.value=E.touches[0].clientX,d.value=!0},V=E=>{d.value&&(c.value=E.touches[0].clientX-l.value,c.value>0&&(c.value=0))},$=()=>{d.value=!1,c.value<-115&&w(),c.value=0};e.onMounted(()=>{r.index===0&&(u.value=!0,setTimeout(()=>{c.value=-90,setTimeout(()=>{c.value=0,u.value=!1},700)},0))});const D=e.computed(()=>{const E=r.index===0&&u.value?1:`${1-Math.abs(c.value)/200}`;return{transform:`translateX(${c.value}px)`,opacity:E,transition:d.value?"none":"transform 0.7s, opacity 0.7s"}});return e.watch(b,h,{immediate:!0}),(E,N)=>{var M,R,T,x;return e.openBlock(),e.createElementBlock("div",{class:"cart_box_wrapper",onTouchstart:P,onTouchmove:V,onTouchend:$,style:e.normalizeStyle(D.value)},[N[2]||(N[2]=e.createElementVNode("div",{class:"wrapper_cart_delete"},[e.createElementVNode("div",{class:"cart_delete"})],-1)),e.createElementVNode("img",{src:e.unref(y)||"",class:"cart_box_image"},null,8,Hl),e.createElementVNode("div",Ul,[e.createElementVNode("div",ql,[e.createElementVNode("p",null,e.toDisplayString((M=t.cardItem)==null?void 0:M.name),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((R=r.cardItem)==null?void 0:R.discounts)||[],(k,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:"discount_banner"},[e.createElementVNode("p",null,e.toDisplayString(k.name),1),e.createElementVNode("p",null,e.toDisplayString(k.discount)+"₽",1)]))),128)),e.createElementVNode("div",jl,[e.createElementVNode("button",{onClick:S},"-"),e.createElementVNode("p",Wl,e.toDisplayString(r.cardItem.amount),1),e.createElementVNode("button",{onClick:_},"+")])]),e.createElementVNode("div",Gl,[e.createElementVNode("div",{class:"cart_box_remove_item",onClick:w},[e.createVNode(Fl)]),(T=r.cardItem)!=null&&T.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(x=r.cardItem)==null?void 0:x.new_price})},e.toDisplayString((r.cardItem.new_price*r.cardItem.amount).toFixed(2)+"₽"),3)):e.createCommentVNode("",!0),e.createElementVNode("p",null,e.toDisplayString(e.unref(m).toFixed(2)+"₽"),1)])]),!f.value&&p.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_modifier_toggle",onTouchstart:e.withModifiers(g,["stop"])},[...N[0]||(N[0]=[e.createElementVNode("p",{class:"cart_info_more"},"Посмотреть модификаторы",-1),e.createElementVNode("p",{class:"cart_arrow"},null,-1)])],32)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("div",Kl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,k=>{var B;return e.openBlock(),e.createElementBlock("div",{class:"cart_modifier_item",key:k.id},[e.createElementVNode("div",Zl,[e.createVNode(Bn,{id:"plus_orange"}),e.createElementVNode("p",null,e.toDisplayString(k.name),1)]),e.createElementVNode("div",Ql,[e.createElementVNode("p",Jl,e.toDisplayString(`x${k.amount}`),1),e.createElementVNode("div",Yl,[k!=null&&k.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(B=k==null?void 0:k.new_price)==null?void 0:B.toFixed(2)})},e.toDisplayString((k.new_price*k.amount).toFixed(2)+"₽"),3)):e.createCommentVNode("",!0),e.createElementVNode("p",null,e.toDisplayString((k.total_new_price||k.price*k.amount).toFixed(2)+"₽"),1)])])])}),128)),e.createElementVNode("div",{class:"cart_modifier_arrow",onTouchstart:e.withModifiers(g,["stop"])},[...N[1]||(N[1]=[e.createElementVNode("p",{class:"cart_info_more"},"Скрыть",-1),e.createElementVNode("p",{class:"cart_arrow_top"},null,-1)])],32)])):e.createCommentVNode("",!0)],36)}}}),[["__scopeId","data-v-868411fd"]]),Xl={},ec={class:"nfc_x",viewBox:"0 0 48 48"};function tc(t,n){return e.openBlock(),e.createElementBlock("svg",ec,[...n[0]||(n[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#B00020","stroke-width":"2.4",fill:"none"},null,-1),e.createElementVNode("path",{d:"M14 16L34 30M34 16L14 30",stroke:"#B00020","stroke-width":"3","stroke-linecap":"round"},null,-1)])])}const nc=X(Xl,[["render",tc]]),rc={},oc={style:{},"aria-hidden":"true",viewBox:"0 0 48 48",class:"nfc_ok"};function ac(t,n){return e.openBlock(),e.createElementBlock("svg",oc,[...n[0]||(n[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4",stroke:"#5D534B","stroke-width":"none",fill:"none"},null,-1),e.createElementVNode("path",{d:"M16 22h16m-10 6h6",stroke:"#5D534B","stroke-width":"2.4","stroke-linecap":"round"},null,-1),e.createElementVNode("path",{d:"M14 28l6 6l14-14",fill:"none",stroke:"#2ECC71","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])}const sc=X(rc,[["render",ac]]),ic={key:0,class:"nfc_ok",viewBox:"0 0 48 48","aria-hidden":"true"},lc=e.defineComponent({__name:"CardReaderRetry",props:{styleRetry:{type:Boolean}},setup(t){return(n,r)=>t.styleRetry?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",ic,[...r[0]||(r[0]=[e.createElementVNode("rect",{x:"8",y:"12",width:"32",height:"24",rx:"4",ry:"4"},null,-1),e.createElementVNode("path",{d:"M16 22h16m-10 6h6"},null,-1)])]))}}),cc={class:"sheet_header"},dc={class:"sheet_title",id:"sheetTitle"},uc={class:"sheet_body"},fc={class:"sheet_card"},mc={class:"nfc_title"},pc={class:"lead"},hc={class:"wrapper_input_accept"},_c={key:1},gc={key:0,class:"card_phone_auth_wrapper"},yc={class:"sr_only","aria-live":"polite"},ao=e.defineComponent({__name:"CardReader",setup(t){const n=se(),r=ge(),{is_OpenLoyal:o}=F.storeToRefs(n),{itemThemes:a}=F.storeToRefs(r),i=ue(),s=e.ref(),l=e.ref(null),c=e.ref(""),d={wait:{text:"Лояльность",title:""},success:{text:"Стикер распознан",title:"Стикер распознан"},not_found:{text:"Стикер не распознан",title:"Стикер не распознали"}},u=e.computed({get:()=>c.value,set:A=>{c.value=A.replace(/\s/g,"")}}),f=e.computed(()=>i.currentState),m=e.computed(()=>i.isDrawerOpen),h=e.computed(()=>{var A;return((A=d[f.value])==null?void 0:A.text)||""}),p=e.computed(()=>{var A;(A=d[f.value])!=null&&A.title}),y=e.computed(()=>f.value==="success"?"Добро пожаловать!":a.value.kiosk_show_loyalty_phone_input_button?"Поднесите стикер к считывателю или войдите по номеру телефона":"Поднесите стикер к считывателю или введите номер карты вручную"),b=e.computed(()=>({ok:f.value==="success",warn:f.value==="not_found"})),w=e.computed(()=>{const A=[];return f.value==="wait"&&A.push("pulse","show-x"),f.value==="not_found"&&A.push("pulse","show-x"),f.value==="success"&&A.push("pulse","show-ok"),A}),g=e.computed(()=>f.value==="not_found"),_=e.computed(()=>f.value==="success"),S=e.computed(()=>f.value==="not_found"),P=e.computed(()=>["not_found"].includes(f.value)),V=e.computed(()=>({wait:"Стикер не распознан. Нажмите «Повторить».",success:"Стикер распознан. Нажмите «Продолжить».",not_found:"Стикер не распознан. Нажмите «Повторить»."})[f.value]||""),$=()=>{i.closeDrawer(),o.value=!0},D=async A=>{var C,I;i.error="",l.value=null;try{const O=new qe;await O.authorizeByCard(A.trim()),await O.getProfile(),n.loadCart(),i.setState("success"),i.isDrawerOpen=!1,i.showNotification("Вы успешно авторизовались в программе лояльности!")}catch(O){i.error=((I=(C=O.response)==null?void 0:C.data)==null?void 0:I.user_friendly_message)||"Ошибка",i.setState("not_found"),l.value=u.value,u.value=""}},E=e.computed(()=>{var C;const A=(C=a.value)==null?void 0:C.kiosk_hide_manual_input_loyalty_card;return A??!1}),N=()=>{i.setState("wait"),i.error="",u.value="",l.value=null},M=()=>{i.closeDrawer(),l.value=null,u.value=""},R=()=>{var A,C;i.setState("wait"),(C=(A=u.value)==null?void 0:A.trim())!=null&&C.length&&D(u.value.trim())},T=A=>{A.stopPropagation(),document.activeElement!==s.value&&x()},x=()=>{e.nextTick(()=>{s.value&&(s.value.focus(),c.value&&s.value.select())})},k=A=>{const C=document.activeElement===s.value;if(!m.value||C)return;const I=A.key.toLowerCase();if(I==="backspace")return u.value=u.value.slice(0,-1);if(I==="escape")return M();if(I==="r"&&S.value)return N();if(I==="c"&&f.value==="success")return M();if(I==="enter")return R();u.value+=I},B={mounted(A){A==null||A.focus()}};return e.onMounted(()=>{document==null||document.addEventListener("keydown",k)}),e.onBeforeUnmount(()=>{document==null||document.removeEventListener("keydown",k)}),e.watchEffect(()=>{m.value&&(i.error="")}),(A,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"backdrop show",onClick:M,"aria-hidden":"true"})):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(["sheet show",{sheet_retry:S.value}]),"aria-modal":"true","aria-labelledby":"sheetTitle",onClick:T},[e.createElementVNode("header",cc,[e.createElementVNode("div",dc,e.toDisplayString(h.value),1),S.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sheet_status",b.value])},e.toDisplayString(l.value),3)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"sheet_close",onClick:M,"aria-label":"Закрыть"}," Закрыть ")]),e.createElementVNode("div",uc,[e.createElementVNode("div",fc,[e.createElementVNode("div",{class:e.normalizeClass(["nfc",w.value])},[e.createVNode(lc,{styleRetry:P.value},null,8,["styleRetry"]),g.value?(e.openBlock(),e.createBlock(nc,{key:0})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"overlay check",style:e.normalizeStyle({display:_.value?"grid":"none"}),"aria-hidden":"true"},[e.createVNode(sc)],4)],2),e.createElementVNode("h2",mc,e.toDisplayString(p.value),1),e.createElementVNode("p",pc,e.toDisplayString(y.value),1),e.createElementVNode("div",hc,[e.withDirectives(e.createElementVNode("input",{style:e.normalizeStyle(E.value?{position:"absolute",left:"-9999px"}:{}),ref_key:"cardInputManualRef",ref:s,"onUpdate:modelValue":C[0]||(C[0]=I=>u.value=I),class:"nfc_title_read_input",type:"text",placeholder:"Введите трек карты","aria-live":"polite",onKeydown:e.withKeys(R,["enter"])},null,36),[[e.vModelText,u.value],[B]]),S.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:N},"Повторить")):(e.openBlock(),e.createElementBlock("div",_c,[E.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn_ghost",onClick:C[1]||(C[1]=I=>S.value?M:R())},"Отправить"))]))]),f.value==="wait"&&e.unref(a).kiosk_show_loyalty_phone_input_button?(e.openBlock(),e.createElementBlock("div",gc,[e.createElementVNode("button",{class:"card_phone_auth_button",onClick:$},"Войти по номеру телефона")])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",yc,e.toDisplayString(V.value),1)],2)):e.createCommentVNode("",!0)],64))}});function so(){const t=Z.useRoute(),n=ue(),r=se(),{isButtonDisabled:o}=F.storeToRefs(n),a=(s,l)=>{const c=s.is_tableservice?"tableservice":s.kiosk_menu?"kiosk":"qr",d=n.createPaymentHandler(c,s.kiosk_menu,s.is_tableservice,l);return d?{...d.config,route:{params:{orgId:String(t.params.orgId)}},handler:d.handler,setButtonDisabled:u=>{o.value=u},on403Kiosk:()=>{localStorage.removeItem("apiKey"),r.is_showApiKey=!0}}:null};return{getCreateOrderConfig:a,makeCreateOrderRequest:async(s,l)=>{const c=a(s,l.paymentMethodId);if(c)return Js(l.items,l.tableDataId,c,{comment:l.comment,is_authorized:l.isAuthorized,signal:l.signal})}}}const bc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJJTk5PIGJhbmsgY2FyZCBpY29uIj4NCiAgPGRlZnM+DQogICAgPGxpbmVhckdyYWRpZW50IGlkPSJibGFja0dyYWQiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4NCiAgICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiMxQTFBMUEiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIvPg0KICAgIDwvbGluZWFyR3JhZGllbnQ+DQoNCiAgICA8bGluZWFyR3JhZGllbnQgaWQ9InNoaW5lIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMCI+DQogICAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjRkZGRkZGIiBzdG9wLW9wYWNpdHk9IjAiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iNTAlIiBzdG9wLWNvbG9yPSIjRkZGRkZGIiBzdG9wLW9wYWNpdHk9IjAuMTgiLz4NCiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI0ZGRkZGRiIgc3RvcC1vcGFjaXR5PSIwIi8+DQogICAgPC9saW5lYXJHcmFkaWVudD4NCg0KICAgIDxmaWx0ZXIgaWQ9InNoYWRvdyIgeD0iLTMwJSIgeT0iLTMwJSIgd2lkdGg9IjE2MCUiIGhlaWdodD0iMTYwJSI+DQogICAgICA8ZmVEcm9wU2hhZG93IGR4PSIwIiBkeT0iNiIgc3RkRGV2aWF0aW9uPSI2IiBmbG9vZC1jb2xvcj0iIzAwMCIgZmxvb2Qtb3BhY2l0eT0iMC4yNSIvPg0KICAgIDwvZmlsdGVyPg0KICA8L2RlZnM+DQoNCiAgPCEtLSBDZW50ZXJlZCBjYXJkIC0tPg0KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg3LjUgMjMpIHJvdGF0ZSgtMTIpIiBmaWx0ZXI9InVybCgjc2hhZG93KSI+DQogICAgPCEtLSBjYXJkIGJvZHkgLS0+DQogICAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijg1IiBoZWlnaHQ9IjU0IiByeD0iMTAiIGZpbGw9InVybCgjYmxhY2tHcmFkKSIvPg0KDQogICAgPCEtLSB0b3Agc3RyaXBlIC0tPg0KICAgIDxyZWN0IHg9IjAiIHk9IjgiIHdpZHRoPSI4NSIgaGVpZ2h0PSI4IiByeD0iNCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wNSIvPg0KDQogICAgPCEtLSBjaGlwIC0tPg0KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwIDI3KSI+DQogICAgICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTUiIHJ4PSIzIiBmaWxsPSIjQ0ZBRTcwIi8+DQogICAgICA8cmVjdCB4PSIyLjUiIHk9IjMuNSIgd2lkdGg9IjEzIiBoZWlnaHQ9IjEuMiIgZmlsbD0iIzlFODM0RSIvPg0KICAgICAgPHJlY3QgeD0iMi41IiB5PSI2LjUiIHdpZHRoPSIxMyIgaGVpZ2h0PSIxLjIiIGZpbGw9IiM5RTgzNEUiLz4NCiAgICAgIDxyZWN0IHg9IjIuNSIgeT0iOS41IiB3aWR0aD0iMTMiIGhlaWdodD0iMS4yIiBmaWxsPSIjOUU4MzRFIi8+DQogICAgICA8cmVjdCB4PSI4LjUiIHk9IjAiIHdpZHRoPSIxLjUiIGhlaWdodD0iMTUiIGZpbGw9IiM5RTgzNEUiIG9wYWNpdHk9IjAuNiIvPg0KICAgIDwvZz4NCg0KICAgIDwhLS0gSU5OTyBsb2dvIC0tPg0KICAgIDx0ZXh0IHg9IjYxIiB5PSIzOSINCiAgICAgICAgICBmb250LWZhbWlseT0ic3lzdGVtLXVpLCAtYXBwbGUtc3lzdGVtLCBTZWdvZSBVSSwgUm9ib3RvLCBBcmlhbCwgc2Fucy1zZXJpZiINCiAgICAgICAgICBmb250LXNpemU9IjEzIg0KICAgICAgICAgIGZvbnQtd2VpZ2h0PSI4MDAiDQogICAgICAgICAgbGV0dGVyLXNwYWNpbmc9IjEuMiINCiAgICAgICAgICBmaWxsPSIjRkZGRkZGIg0KICAgICAgICAgIG9wYWNpdHk9IjAuOTUiDQogICAgICAgICAgdGV4dC1hbmNob3I9Im1pZGRsZSI+DQogICAgICBpbm5vDQogICAgPC90ZXh0Pg0KDQogICAgPCEtLSBzaGluZSAtLT4NCiAgICA8cGF0aCBkPSJNLTggNiBMMjUgLTMgTDk0IDQ3IEw2MCA2MiBMLTggMjUgWiIgZmlsbD0idXJsKCNzaGluZSkiLz4NCiAgPC9nPg0KPC9zdmc+",io="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%20width='100'%20height='100'%20fill='none'%3e%3c!--%20Big%20QR%20corners%20(outer%20shape%20with%20inner%20cutout)%20--%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M72%200H163C202.765%200%20235%2032.235%20235%2072V163C235%20202.765%20202.765%20235%20163%20235H72C32.235%20235%200%20202.765%200%20163V72C0%2032.235%2032.235%200%2072%200Z%20M102%2086H133C141.837%2086%20149%2093.163%20149%20102V133C149%20141.837%20141.837%20149%20133%20149H102C93.163%20149%2086%20141.837%2086%20133V102C86%2093.163%2093.163%2086%20102%2086Z%20'/%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M349%200H440C479.765%200%20512%2032.235%20512%2072V163C512%20202.765%20479.765%20235%20440%20235H349C309.235%20235%20277%20202.765%20277%20163V72C277%2032.235%20309.235%200%20349%200Z%20M379%2086H410C418.837%2086%20426%2093.163%20426%20102V133C426%20141.837%20418.837%20149%20410%20149H379C370.163%20149%20363%20141.837%20363%20133V102C363%2093.163%20370.163%2086%20379%2086Z%20'/%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='%20M72%20277H163C202.765%20277%20235%20309.235%20235%20349V440C235%20479.765%20202.765%20512%20163%20512H72C32.235%20512%200%20479.765%200%20440V349C0%20309.235%2032.235%20277%2072%20277Z%20M102%20363H133C141.837%20363%20149%20370.163%20149%20379V410C149%20418.837%20141.837%20426%20133%20426H102C93.163%20426%2086%20418.837%2086%20410V379C86%20370.163%2093.163%20363%20102%20363Z%20'/%3e%3c!--%20Small%20modules%20--%3e%3crect%20x='277'%20y='277'%20width='86'%20height='86'%20rx='26'%20fill='currentColor'/%3e%3crect%20x='426'%20y='277'%20width='86'%20height='86'%20rx='28'%20fill='currentColor'/%3e%3crect%20x='277'%20y='426'%20width='86'%20height='86'%20rx='26'%20fill='currentColor'/%3e%3c!--%20Center%20dot%20--%3e%3ccircle%20cx='394.17'%20cy='394.17'%20r='33'%20fill='currentColor'/%3e%3c/svg%3e",wc=["src"],Cc={class:"header_description"},kc=X(e.defineComponent({__name:"PaymentBoxes",props:{configPage:{},comment:{},cartItems:{},isAuthorized:{type:Boolean},hasRmsDiscount:{type:Boolean,default:!1},hideDiscountsButton:{type:Boolean,default:!1},orderId:{default:null},signal:{},provider:{}},emits:["select"],setup(t,{emit:n}){const r=t,o=n,a=ue(),i=fe(),{selectedProvider:s,isButtonDisabled:l}=F.storeToRefs(a),{isAddToCard:c}=F.storeToRefs(i),{makeCreateOrderRequest:d}=so(),u={default:bc,SBP:io},f=async()=>{s.value=r.provider;const h=r.provider.front_type;h&&(c.value=!1,l.value=!0,o("select",h),r.hasRmsDiscount&&!r.hideDiscountsButton&&r.orderId!=null?Et(r.orderId,r.provider.type):await d(r.configPage,{paymentMethodId:h,items:r.cartItems,tableDataId:r.configPage.tableDataId,comment:r.comment,isAuthorized:r.isAuthorized,signal:r.signal}))},m=e.computed(()=>u[r.provider.front_type]||u.default);return(h,p)=>(e.openBlock(),e.createElementBlock("div",{class:"payment_boxes_wrapper",onClick:f},[e.createElementVNode("img",{class:"picture",src:m.value},null,8,wc),e.createElementVNode("div",Cc,[e.createElementVNode("b",null,e.toDisplayString(t.provider.name),1),e.createElementVNode("p",null,e.toDisplayString(t.provider.description),1)]),e.createVNode(Nt)]))}}),[["__scopeId","data-v-7e25de77"]]),Sc={key:0,class:"wrapper_cart_payment"},Ec={class:"wrapper_paid"},Nc={class:"to_be_paid"},vc=X(e.defineComponent({__name:"CartPayment",props:{configPage:{},comment:{},cartItems:{},isAuthorized:{type:Boolean},hasRmsDiscount:{type:Boolean},hideDiscountsButton:{type:Boolean},orderId:{},signal:{}},emits:["selectPayment"],setup(t,{emit:n}){const r=ue(),o=se(),a=t,{totalPrice_lib:i,countBonus:s}=F.storeToRefs(o),l=n,c=u=>{l("selectPayment",u)},d=()=>{l("selectPayment","")};return(u,f)=>e.unref(r).providerTypes.length>1?(e.openBlock(),e.createElementBlock("div",Sc,[f[2]||(f[2]=e.createElementVNode("h2",null,"Выберите способ оплаты",-1)),f[3]||(f[3]=e.createElementVNode("p",{class:"description_payment"},"Можно изменить позже до оплаты",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).providerTypes,(m,h)=>(e.openBlock(),e.createElementBlock("div",{key:h},[e.createVNode(kc,{provider:m,"config-page":a.configPage,comment:a.comment,"cart-items":a.cartItems,"is-authorized":a.isAuthorized,"has-rms-discount":a.hasRmsDiscount,"hide-discounts-button":a.hideDiscountsButton,"order-id":a.orderId,signal:a.signal,onSelect:c},null,8,["provider","config-page","comment","cart-items","is-authorized","has-rms-discount","hide-discounts-button","order-id","signal"])]))),128)),e.createElementVNode("div",Ec,[e.createElementVNode("p",Nc,[f[0]||(f[0]=e.createTextVNode("К оплате ",-1)),e.createVNode(Ce,{price:e.unref(i)-e.unref(s),fixedFloat:2},null,8,["price"]),f[1]||(f[1]=e.createTextVNode(" ₽",-1))]),e.createVNode(Re,{textButtonDefault:"Назад",onClick:d,class:"btn_payment"})])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-93970a62"]]),Ic={class:"start_page"},Bc=["src"],xc={class:"wrap"},Ac={class:"wrap_box"},Mc={class:"title_fiscal_order"},Pc={class:"wrapper_accept"},Tc={ref:"barRef",class:"bar_complete","aria-hidden":"true"},Rc=X(e.defineComponent({__name:"CartCompleteKioskSuccess",props:{mediaUrl:{},orderNumber:{}},setup(t){const n=se(),r=ue(),o=fe(),a=ge(),{cartProducts_lib:i}=F.storeToRefs(n),{orderNumber:s,orderCompleted_lib:l}=F.storeToRefs(r),{is_startPage:c}=F.storeToRefs(o),{mediaUrl:d}=Ze(()=>a.itemThemes.kiosk_preloader?"preloader":null),u=Z.useRouter(),f=Z.useRoute();let m=null;e.onMounted(()=>{m=setTimeout(()=>{c.value=!0,u.replace(`/${f.params.orgId}`)},1e4)});const h=()=>{dt(["cart","authTokensAccess","authTokensRefresh"]),i.value=[],l.value=null,r.clearCard(),n.profile=null,u.replace(`/${f.params.orgId}`)};return e.onUnmounted(()=>{m&&clearInterval(m)}),(p,y)=>(e.openBlock(),e.createElementBlock("div",Ic,[e.withDirectives((e.openBlock(),e.createElementBlock("video",{loop:"",autoplay:"",muted:"",playsinline:"",key:e.unref(d)},[e.createElementVNode("source",{src:e.unref(d)||"",type:"video/webm"},null,8,Bc)])),[[e.unref(vt)]]),y[4]||(y[4]=e.createElementVNode("div",{class:"start_img_black"},null,-1)),e.createElementVNode("div",xc,[e.createElementVNode("div",Ac,[y[1]||(y[1]=e.createElementVNode("div",{class:"icon","aria-hidden":"true"},[e.createElementVNode("svg",{viewBox:"0 0 24 24"},[e.createElementVNode("path",{d:"M20 6L9 17l-5-5"})])],-1)),y[2]||(y[2]=e.createElementVNode("h1",null," Заказ успешно оплачен ",-1)),e.createElementVNode("p",Mc,"№ "+e.toDisplayString(e.unref(s)),1),y[3]||(y[3]=e.createElementVNode("p",{class:"title_fiscal_completed"},"Спасибо! Заказ передан в работу.",-1)),e.createElementVNode("div",Pc,[e.createElementVNode("button",{class:"btn","aria-label":"Новый заказ",onClick:h},[y[0]||(y[0]=e.createElementVNode("span",{class:"label"},"Новый заказ",-1)),e.createElementVNode("span",Tc,null,512)])])])])]))}}),[["__scopeId","data-v-c8561550"]]),$c={};function Vc(t,n){return n[0]||(n[0]=e.createStaticVNode('<div class="topProgress" aria-hidden="true" data-v-3e03a6dc><i data-v-3e03a6dc></i></div><h1 class="title_fiscal" data-v-3e03a6dc>Сейчас будет распечатан фискальный чек</h1><p class="reminder" data-v-3e03a6dc>Не забудьте <b data-v-3e03a6dc>оплатить заказ</b> после печати.</p><div class="stage" aria-hidden="true" data-v-3e03a6dc><div class="printer" data-v-3e03a6dc><div class="led" data-v-3e03a6dc></div><div class="slot" data-v-3e03a6dc></div><div class="receipt" data-v-3e03a6dc><div class="tear" data-v-3e03a6dc></div><div class="line accent" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div><div class="line" data-v-3e03a6dc></div><div class="line sm" data-v-3e03a6dc></div></div></div></div>',4))}const Dc=X($c,[["render",Vc],["__scopeId","data-v-3e03a6dc"]]),Oc={},zc={class:"center"};function Lc(t,n){return e.openBlock(),e.createElementBlock("div",zc,[...n[0]||(n[0]=[e.createStaticVNode('<div class="stack" data-v-f0859fd1><h1 class="title_fiscal" data-v-f0859fd1>Приложите карту для оплаты</h1><p class="reminder" data-v-f0859fd1>Держите карту у терминала, пока операция не завершится.</p><div class="stageCard" aria-hidden="true" data-v-f0859fd1><div class="waves" data-v-f0859fd1><span data-v-f0859fd1></span><span data-v-f0859fd1></span><span data-v-f0859fd1></span></div><div class="nfc" data-v-f0859fd1><svg viewBox="0 0 24 24" data-v-f0859fd1><path d="M6 8c2.5 2.5 2.5 5.5 0 8" data-v-f0859fd1></path><path d="M10 6c4 4 4 8 0 12" data-v-f0859fd1></path><path d="M14 4c5.5 5.5 5.5 11 0 16" data-v-f0859fd1></path></svg></div><div class="card" data-v-f0859fd1><div class="logo" data-v-f0859fd1>inno.</div><div class="chip" data-v-f0859fd1></div><div class="digits" data-v-f0859fd1>4815 1623 4200 0900</div><div class="holder" data-v-f0859fd1>Гость</div></div></div></div>',1)])])}const Fc=X(Oc,[["render",Lc],["__scopeId","data-v-f0859fd1"]]);/*!
7
7
  * qrcode.vue v3.6.0
8
8
  * A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3
9
9
  * © 2017-PRESENT @scopewu(https://github.com/scopewu)
10
10
  * MIT License.
11
- */var je=function(){return je=Object.assign||function(n){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n},je.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;var ot;(function(t){var n=function(){function s(l,c,d,u){if(this.version=l,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],l<s.MIN_VERSION||l>s.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=l*4+17;for(var f=[],m=0;m<this.size;m++)f.push(!1);for(var m=0;m<this.size;m++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();var h=this.addEccAndInterleave(d);if(this.drawCodewords(h),u==-1)for(var p=1e9,m=0;m<8;m++){this.applyMask(m),this.drawFormatBits(m);var y=this.getPenaltyScore();y<p&&(u=m,p=y),this.applyMask(m)}a(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[]}return s.encodeText=function(l,c){var d=t.QrSegment.makeSegments(l);return s.encodeSegments(d,c)},s.encodeBinary=function(l,c){var d=t.QrSegment.makeBytes(l);return s.encodeSegments([d],c)},s.encodeSegments=function(l,c,d,u,f,m){if(d===void 0&&(d=1),u===void 0&&(u=40),f===void 0&&(f=-1),m===void 0&&(m=!0),!(s.MIN_VERSION<=d&&d<=u&&u<=s.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");var h,p;for(h=d;;h++){var y=s.getNumDataCodewords(h,c)*8,b=i.getTotalBits(l,h);if(b<=y){p=b;break}if(h>=u)throw new RangeError("Data too long")}for(var w=0,g=[s.Ecc.MEDIUM,s.Ecc.QUARTILE,s.Ecc.HIGH];w<g.length;w++){var _=g[w];m&&p<=s.getNumDataCodewords(h,_)*8&&(c=_)}for(var S=[],M=0,V=l;M<V.length;M++){var $=V[M];r($.mode.modeBits,4,S),r($.numChars,$.mode.numCharCountBits(h),S);for(var D=0,E=$.getData();D<E.length;D++){var N=E[D];S.push(N)}}a(S.length==p);var P=s.getNumDataCodewords(h,c)*8;a(S.length<=P),r(0,Math.min(4,P-S.length),S),r(0,(8-S.length%8)%8,S),a(S.length%8==0);for(var R=236;S.length<P;R^=253)r(R,8,S);for(var T=[];T.length*8<S.length;)T.push(0);return S.forEach(function(x,C){return T[C>>>3]|=x<<7-(C&7)}),new s(h,c,T,f)},s.prototype.getModule=function(l,c){return 0<=l&&l<this.size&&0<=c&&c<this.size&&this.modules[c][l]},s.prototype.getModules=function(){return this.modules},s.prototype.drawFunctionPatterns=function(){for(var l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);for(var c=this.getAlignmentPatternPositions(),d=c.length,l=0;l<d;l++)for(var u=0;u<d;u++)l==0&&u==0||l==0&&u==d-1||l==d-1&&u==0||this.drawAlignmentPattern(c[l],c[u]);this.drawFormatBits(0),this.drawVersion()},s.prototype.drawFormatBits=function(l){for(var c=this.errorCorrectionLevel.formatBits<<3|l,d=c,u=0;u<10;u++)d=d<<1^(d>>>9)*1335;var f=(c<<10|d)^21522;a(f>>>15==0);for(var u=0;u<=5;u++)this.setFunctionModule(8,u,o(f,u));this.setFunctionModule(8,7,o(f,6)),this.setFunctionModule(8,8,o(f,7)),this.setFunctionModule(7,8,o(f,8));for(var u=9;u<15;u++)this.setFunctionModule(14-u,8,o(f,u));for(var u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,o(f,u));for(var u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,o(f,u));this.setFunctionModule(8,this.size-8,!0)},s.prototype.drawVersion=function(){if(!(this.version<7)){for(var l=this.version,c=0;c<12;c++)l=l<<1^(l>>>11)*7973;var d=this.version<<12|l;a(d>>>18==0);for(var c=0;c<18;c++){var u=o(d,c),f=this.size-11+c%3,m=Math.floor(c/3);this.setFunctionModule(f,m,u),this.setFunctionModule(m,f,u)}}},s.prototype.drawFinderPattern=function(l,c){for(var d=-4;d<=4;d++)for(var u=-4;u<=4;u++){var f=Math.max(Math.abs(u),Math.abs(d)),m=l+u,h=c+d;0<=m&&m<this.size&&0<=h&&h<this.size&&this.setFunctionModule(m,h,f!=2&&f!=4)}},s.prototype.drawAlignmentPattern=function(l,c){for(var d=-2;d<=2;d++)for(var u=-2;u<=2;u++)this.setFunctionModule(l+u,c+d,Math.max(Math.abs(u),Math.abs(d))!=1)},s.prototype.setFunctionModule=function(l,c,d){this.modules[c][l]=d,this.isFunction[c][l]=!0},s.prototype.addEccAndInterleave=function(l){var c=this.version,d=this.errorCorrectionLevel;if(l.length!=s.getNumDataCodewords(c,d))throw new RangeError("Invalid argument");for(var u=s.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][c],f=s.ECC_CODEWORDS_PER_BLOCK[d.ordinal][c],m=Math.floor(s.getNumRawDataModules(c)/8),h=u-m%u,p=Math.floor(m/u),y=[],b=s.reedSolomonComputeDivisor(f),w=0,g=0;w<u;w++){var _=l.slice(g,g+p-f+(w<h?0:1));g+=_.length;var S=s.reedSolomonComputeRemainder(_,b);w<h&&_.push(0),y.push(_.concat(S))}for(var M=[],V=function($){y.forEach(function(D,E){($!=p-f||E>=h)&&M.push(D[$])})},w=0;w<y[0].length;w++)V(w);return a(M.length==m),M},s.prototype.drawCodewords=function(l){if(l.length!=Math.floor(s.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");for(var c=0,d=this.size-1;d>=1;d-=2){d==6&&(d=5);for(var u=0;u<this.size;u++)for(var f=0;f<2;f++){var m=d-f,h=(d+1&2)==0,p=h?this.size-1-u:u;!this.isFunction[p][m]&&c<l.length*8&&(this.modules[p][m]=o(l[c>>>3],7-(c&7)),c++)}}a(c==l.length*8)},s.prototype.applyMask=function(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(var c=0;c<this.size;c++)for(var d=0;d<this.size;d++){var u=void 0;switch(l){case 0:u=(d+c)%2==0;break;case 1:u=c%2==0;break;case 2:u=d%3==0;break;case 3:u=(d+c)%3==0;break;case 4:u=(Math.floor(d/3)+Math.floor(c/2))%2==0;break;case 5:u=d*c%2+d*c%3==0;break;case 6:u=(d*c%2+d*c%3)%2==0;break;case 7:u=((d+c)%2+d*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][d]&&u&&(this.modules[c][d]=!this.modules[c][d])}},s.prototype.getPenaltyScore=function(){for(var l=0,c=0;c<this.size;c++){for(var d=!1,u=0,f=[0,0,0,0,0,0,0],m=0;m<this.size;m++)this.modules[c][m]==d?(u++,u==5?l+=s.PENALTY_N1:u>5&&l++):(this.finderPenaltyAddHistory(u,f),d||(l+=this.finderPenaltyCountPatterns(f)*s.PENALTY_N3),d=this.modules[c][m],u=1);l+=this.finderPenaltyTerminateAndCount(d,u,f)*s.PENALTY_N3}for(var m=0;m<this.size;m++){for(var d=!1,h=0,f=[0,0,0,0,0,0,0],c=0;c<this.size;c++)this.modules[c][m]==d?(h++,h==5?l+=s.PENALTY_N1:h>5&&l++):(this.finderPenaltyAddHistory(h,f),d||(l+=this.finderPenaltyCountPatterns(f)*s.PENALTY_N3),d=this.modules[c][m],h=1);l+=this.finderPenaltyTerminateAndCount(d,h,f)*s.PENALTY_N3}for(var c=0;c<this.size-1;c++)for(var m=0;m<this.size-1;m++){var p=this.modules[c][m];p==this.modules[c][m+1]&&p==this.modules[c+1][m]&&p==this.modules[c+1][m+1]&&(l+=s.PENALTY_N2)}for(var y=0,b=0,w=this.modules;b<w.length;b++){var g=w[b];y=g.reduce(function(M,V){return M+(V?1:0)},y)}var _=this.size*this.size,S=Math.ceil(Math.abs(y*20-_*10)/_)-1;return a(0<=S&&S<=9),l+=S*s.PENALTY_N4,a(0<=l&&l<=2568888),l},s.prototype.getAlignmentPatternPositions=function(){if(this.version==1)return[];for(var l=Math.floor(this.version/7)+2,c=Math.floor((this.version*8+l*3+5)/(l*4-4))*2,d=[6],u=this.size-7;d.length<l;u-=c)d.splice(1,0,u);return d},s.getNumRawDataModules=function(l){if(l<s.MIN_VERSION||l>s.MAX_VERSION)throw new RangeError("Version number out of range");var c=(16*l+128)*l+64;if(l>=2){var d=Math.floor(l/7)+2;c-=(25*d-10)*d-55,l>=7&&(c-=36)}return a(208<=c&&c<=29648),c},s.getNumDataCodewords=function(l,c){return Math.floor(s.getNumRawDataModules(l)/8)-s.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l]*s.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l]},s.reedSolomonComputeDivisor=function(l){if(l<1||l>255)throw new RangeError("Degree out of range");for(var c=[],d=0;d<l-1;d++)c.push(0);c.push(1);for(var u=1,d=0;d<l;d++){for(var f=0;f<c.length;f++)c[f]=s.reedSolomonMultiply(c[f],u),f+1<c.length&&(c[f]^=c[f+1]);u=s.reedSolomonMultiply(u,2)}return c},s.reedSolomonComputeRemainder=function(l,c){for(var d=c.map(function(p){return 0}),u=function(p){var y=p^d.shift();d.push(0),c.forEach(function(b,w){return d[w]^=s.reedSolomonMultiply(b,y)})},f=0,m=l;f<m.length;f++){var h=m[f];u(h)}return d},s.reedSolomonMultiply=function(l,c){if(l>>>8||c>>>8)throw new RangeError("Byte out of range");for(var d=0,u=7;u>=0;u--)d=d<<1^(d>>>7)*285,d^=(c>>>u&1)*l;return a(d>>>8==0),d},s.prototype.finderPenaltyCountPatterns=function(l){var c=l[1];a(c<=this.size*3);var d=c>0&&l[2]==c&&l[3]==c*3&&l[4]==c&&l[5]==c;return(d&&l[0]>=c*4&&l[6]>=c?1:0)+(d&&l[6]>=c*4&&l[0]>=c?1:0)},s.prototype.finderPenaltyTerminateAndCount=function(l,c,d){return l&&(this.finderPenaltyAddHistory(c,d),c=0),c+=this.size,this.finderPenaltyAddHistory(c,d),this.finderPenaltyCountPatterns(d)},s.prototype.finderPenaltyAddHistory=function(l,c){c[0]==0&&(l+=this.size),c.pop(),c.unshift(l)},s.MIN_VERSION=1,s.MAX_VERSION=40,s.PENALTY_N1=3,s.PENALTY_N2=3,s.PENALTY_N3=40,s.PENALTY_N4=10,s.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],s.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],s}();t.QrCode=n;function r(s,l,c){if(l<0||l>31||s>>>l)throw new RangeError("Value out of range");for(var d=l-1;d>=0;d--)c.push(s>>>d&1)}function o(s,l){return(s>>>l&1)!=0}function a(s){if(!s)throw new Error("Assertion error")}var i=function(){function s(l,c,d){if(this.mode=l,this.numChars=c,this.bitData=d,c<0)throw new RangeError("Invalid argument");this.bitData=d.slice()}return s.makeBytes=function(l){for(var c=[],d=0,u=l;d<u.length;d++){var f=u[d];r(f,8,c)}return new s(s.Mode.BYTE,l.length,c)},s.makeNumeric=function(l){if(!s.isNumeric(l))throw new RangeError("String contains non-numeric characters");for(var c=[],d=0;d<l.length;){var u=Math.min(l.length-d,3);r(parseInt(l.substring(d,d+u),10),u*3+1,c),d+=u}return new s(s.Mode.NUMERIC,l.length,c)},s.makeAlphanumeric=function(l){if(!s.isAlphanumeric(l))throw new RangeError("String contains unencodable characters in alphanumeric mode");var c=[],d;for(d=0;d+2<=l.length;d+=2){var u=s.ALPHANUMERIC_CHARSET.indexOf(l.charAt(d))*45;u+=s.ALPHANUMERIC_CHARSET.indexOf(l.charAt(d+1)),r(u,11,c)}return d<l.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(l.charAt(d)),6,c),new s(s.Mode.ALPHANUMERIC,l.length,c)},s.makeSegments=function(l){return l==""?[]:s.isNumeric(l)?[s.makeNumeric(l)]:s.isAlphanumeric(l)?[s.makeAlphanumeric(l)]:[s.makeBytes(s.toUtf8ByteArray(l))]},s.makeEci=function(l){var c=[];if(l<0)throw new RangeError("ECI assignment value out of range");if(l<128)r(l,8,c);else if(l<16384)r(2,2,c),r(l,14,c);else if(l<1e6)r(6,3,c),r(l,21,c);else throw new RangeError("ECI assignment value out of range");return new s(s.Mode.ECI,0,c)},s.isNumeric=function(l){return s.NUMERIC_REGEX.test(l)},s.isAlphanumeric=function(l){return s.ALPHANUMERIC_REGEX.test(l)},s.prototype.getData=function(){return this.bitData.slice()},s.getTotalBits=function(l,c){for(var d=0,u=0,f=l;u<f.length;u++){var m=f[u],h=m.mode.numCharCountBits(c);if(m.numChars>=1<<h)return 1/0;d+=4+h+m.bitData.length}return d},s.toUtf8ByteArray=function(l){l=encodeURI(l);for(var c=[],d=0;d<l.length;d++)l.charAt(d)!="%"?c.push(l.charCodeAt(d)):(c.push(parseInt(l.substring(d+1,d+3),16)),d+=2);return c},s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",s}();t.QrSegment=i})(ot||(ot={})),function(t){(function(n){var r=function(){function o(a,i){this.ordinal=a,this.formatBits=i}return o.LOW=new o(0,1),o.MEDIUM=new o(1,0),o.QUARTILE=new o(2,3),o.HIGH=new o(3,2),o}();n.Ecc=r})(t.QrCode||(t.QrCode={}))}(ot||(ot={})),function(t){(function(n){var r=function(){function o(a,i){this.modeBits=a,this.numBitsCharCount=i}return o.prototype.numCharCountBits=function(a){return this.numBitsCharCount[Math.floor((a+7)/17)]},o.NUMERIC=new o(1,[10,12,14]),o.ALPHANUMERIC=new o(2,[9,11,13]),o.BYTE=new o(4,[8,16,16]),o.KANJI=new o(8,[8,10,12]),o.ECI=new o(7,[0,0,0]),o}();n.Mode=r})(t.QrSegment||(t.QrSegment={}))}(ot||(ot={}));var pt=ot,Rn="L",$n={L:pt.QrCode.Ecc.LOW,M:pt.QrCode.Ecc.MEDIUM,Q:pt.QrCode.Ecc.QUARTILE,H:pt.QrCode.Ecc.HIGH},Fc=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function Vn(t){return t in $n}function lo(t,n){n===void 0&&(n=0);var r=[];return t.forEach(function(o,a){var i=null;o.forEach(function(s,l){if(!s&&i!==null){r.push("M".concat(i+n," ").concat(a+n,"h").concat(l-i,"v1H").concat(i+n,"z")),i=null;return}if(l===o.length-1){if(!s)return;i===null?r.push("M".concat(l+n,",").concat(a+n," h1v1H").concat(l+n,"z")):r.push("M".concat(i+n,",").concat(a+n," h").concat(l+1-i,"v1H").concat(i+n,"z"));return}s&&i===null&&(i=l)})}),r.join("")}function co(t,n,r,o){var a=o.width,i=o.height,s=o.x,l=o.y,c=t.length+r*2,d=Math.floor(n*.1),u=c/n,f=(a||d)*u,m=(i||d)*u,h=s==null?t.length/2-f/2:s*u,p=l==null?t.length/2-m/2:l*u,y=null;if(o.excavate){var b=Math.floor(h),w=Math.floor(p),g=Math.ceil(f+h-b),_=Math.ceil(m+p-w);y={x:b,y:w,w:g,h:_}}return{x:h,y:p,h:m,w:f,excavation:y}}function uo(t,n){return t.slice().map(function(r,o){return o<n.y||o>=n.y+n.h?r:r.map(function(a,i){return i<n.x||i>=n.x+n.w?a:!1})})}var Dn={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:Rn,validator:function(t){return Vn(t)}},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},margin:{type:Number,required:!1,default:0},imageSettings:{type:Object,required:!1,default:function(){return{}}},gradient:{type:Boolean,required:!1,default:!1},gradientType:{type:String,required:!1,default:"linear",validator:function(t){return["linear","radial"].indexOf(t)>-1}},gradientStartColor:{type:String,required:!1,default:"#000"},gradientEndColor:{type:String,required:!1,default:"#fff"}},Hc=je(je({},Dn),{renderAs:{type:String,required:!1,default:"canvas",validator:function(t){return["canvas","svg"].indexOf(t)>-1}}}),Uc=e.defineComponent({name:"QRCodeSvg",props:Dn,setup:function(t){var n=e.ref(0),r=e.ref(""),o,a=function(){var s=t.value,l=t.level,c=t.margin,d=c>>>0,u=Vn(l)?l:Rn,f=pt.QrCode.encodeText(s,$n[u]).getModules();if(n.value=f.length+d*2,t.imageSettings.src){var m=co(f,t.size,d,t.imageSettings);o={x:m.x+d,y:m.y+d,width:m.w,height:m.h},m.excavation&&(f=uo(f,m.excavation))}r.value=lo(f,d)},i=function(){if(!t.gradient)return null;var s=t.gradientType==="linear"?{x1:"0%",y1:"0%",x2:"100%",y2:"100%"}:{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"};return e.h(t.gradientType==="linear"?"linearGradient":"radialGradient",je({id:"qr-gradient"},s),[e.h("stop",{offset:"0%",style:{stopColor:t.gradientStartColor}}),e.h("stop",{offset:"100%",style:{stopColor:t.gradientEndColor}})])};return a(),e.onUpdated(a),function(){return e.h("svg",{width:t.size,height:t.size,"shape-rendering":"crispEdges",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(n.value," ").concat(n.value)},[e.h("defs",{},[i()]),e.h("rect",{width:"100%",height:"100%",fill:t.background}),e.h("path",{fill:t.gradient?"url(#qr-gradient)":t.foreground,d:r.value}),t.imageSettings.src&&e.h("image",je({href:t.imageSettings.src},o))])}}}),qc=e.defineComponent({name:"QRCodeCanvas",props:Dn,setup:function(t,n){var r=e.ref(null),o=e.ref(null),a=function(){var s=t.value,l=t.level,c=t.size,d=t.margin,u=t.background,f=t.foreground,m=t.gradient,h=t.gradientType,p=t.gradientStartColor,y=t.gradientEndColor,b=d>>>0,w=Vn(l)?l:Rn,g=r.value;if(g){var _=g.getContext("2d");if(_){var S=pt.QrCode.encodeText(s,$n[w]).getModules(),M=S.length+b*2,V=o.value,$={x:0,y:0,width:0,height:0},D=t.imageSettings.src&&V!=null&&V.naturalWidth!==0&&V.naturalHeight!==0;if(D){var E=co(S,t.size,b,t.imageSettings);$={x:E.x+b,y:E.y+b,width:E.w,height:E.h},E.excavation&&(S=uo(S,E.excavation))}var N=window.devicePixelRatio||1,P=c/M*N;if(g.height=g.width=c*N,_.scale(P,P),_.fillStyle=u,_.fillRect(0,0,M,M),m){var R=void 0;h==="linear"?R=_.createLinearGradient(0,0,M,M):R=_.createRadialGradient(M/2,M/2,0,M/2,M/2,M/2),R.addColorStop(0,p),R.addColorStop(1,y),_.fillStyle=R}else _.fillStyle=f;Fc?_.fill(new Path2D(lo(S,b))):S.forEach(function(T,x){T.forEach(function(C,B){C&&_.fillRect(B+b,x+b,1,1)})}),D&&_.drawImage(V,$.x,$.y,$.width,$.height)}}};e.onMounted(a),e.onUpdated(a);var i=n.attrs.style;return function(){return e.h(e.Fragment,[e.h("canvas",je(je({},n.attrs),{ref:r,style:je(je({},i),{width:"".concat(t.size,"px"),height:"".concat(t.size,"px")})})),t.imageSettings.src&&e.h("img",{ref:o,src:t.imageSettings.src,style:{display:"none"},onLoad:a})])}}}),jc=e.defineComponent({name:"Qrcode",render:function(){var t=this.$props,n=t.renderAs,r=t.value,o=t.size,a=t.margin,i=t.level,s=t.background,l=t.foreground,c=t.imageSettings,d=t.gradient,u=t.gradientType,f=t.gradientStartColor,m=t.gradientEndColor;return e.h(n==="svg"?Uc:qc,{value:r,size:o,margin:a,level:i,background:s,foreground:l,imageSettings:c,gradient:d,gradientType:u,gradientStartColor:f,gradientEndColor:m})},props:Hc});const Wc={},Gc={viewBox:"0 0 24 24","aria-hidden":"true"};function Kc(t,n){return e.openBlock(),e.createElementBlock("svg",Gc,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M7 4h10a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z"},null,-1),e.createElementVNode("path",{d:"M9 7h6"},null,-1),e.createElementVNode("path",{d:"M10 18h4"},null,-1)])])}const Zc=X(Wc,[["render",Kc]]),Qc={},Jc={viewBox:"0 0 24 24","aria-hidden":"true"};function Yc(t,n){return e.openBlock(),e.createElementBlock("svg",Jc,[...n[0]||(n[0]=[e.createStaticVNode('<path d="M4 8V6a2 2 0 0 1 2-2h2"></path><path d="M20 8V6a2 2 0 0 0-2-2h-2"></path><path d="M4 16v2a2 2 0 0 0 2 2h2"></path><path d="M20 16v2a2 2 0 0 1-2 2h-2"></path><path d="M7 12h10"></path>',5)])])}const Xc=X(Qc,[["render",Yc]]),ed="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2019.6108%2014.0107'%20width='19.610840'%20height='14.010742'%20fill='none'%20customFrame='%23000000'%3e%3cpath%20id='Форма%20'%20d='M18.3054%201.30566L6.61792%2012.639L1.30542%207.48747'%20stroke='rgb(255,255,255)'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2.5999999'/%3e%3c/svg%3e",td={class:"wrapper_qr_page"},nd=["src"],rd={class:"modal_qr"},od={class:"modal_qr_content"},ad={class:"wrapper_icon_qr"},sd=["src"],id={class:"total_order_price"},ld={class:"ttl_wrapper"},cd={class:"ttl_head"},dd={class:"ttl_bar"},ud={class:"hint hint-anim","aria-label":"Инструкция по оплате"},fd={class:"steps","aria-hidden":"true"},md={class:"step is-active","data-i":"0"},pd={class:"ico"},hd={class:"step","data-i":"1"},_d={class:"ico"},gd={class:"step","data-i":"2"},yd={class:"ico"},bd=["src"],wd={class:"qr_border"},Cd=X(e.defineComponent({__name:"CompletedQRCode",setup(t){const n=ge(),r=ue(),o=se(),a=K.useRouter(),i={src:n.itemThemes.logo||"",width:60,height:60,excavate:!0},s=e.computed(()=>n.itemThemes.kiosk_qr_payment_timeout||60).value,l=e.ref(s);let c=0;const d=e.computed(()=>{const y=Math.floor(l.value/60),b=l.value%60;return`${y}:${b.toString().padStart(2,"0")}`}),u=e.computed(()=>l.value/s*100),f=e.computed(()=>r.paymentCostQR),m=()=>{l.value--,l.value<0&&(clearInterval(c),h())},h=()=>{o.removeFromLocalStorage(["cart","authTokensAccess","authTokensRefresh","user"]),sessionStorage.removeItem("is_adult"),a.replace({name:"home"}).then(()=>a.go(0))};e.onMounted(()=>{c=setInterval(m,1e3)}),e.onBeforeUnmount(()=>{clearInterval(c)});const{mediaUrl:p}=Ze(()=>n.itemThemes.kiosk_preloader?"preloader":null);return(y,b)=>(e.openBlock(),e.createElementBlock("div",td,[(e.openBlock(),e.createElementBlock("video",{loop:"",autoplay:"",muted:"",playsinline:"",key:e.unref(p)},[e.createElementVNode("source",{src:e.unref(p)||"",type:"video/webm"},null,8,nd)])),b[7]||(b[7]=e.createElementVNode("div",{class:"start_img_black"},null,-1)),e.createElementVNode("div",rd,[e.createElementVNode("div",od,[e.createElementVNode("div",ad,[e.createElementVNode("img",{src:e.unref(io),width:"100",height:"100"},null,8,sd)]),b[6]||(b[6]=e.createElementVNode("h1",null,"Оплата по QR",-1)),e.createElementVNode("p",id,[e.createVNode(Ce,{price:f.value,fixedFloat:2},null,8,["price"]),e.createTextVNode(" "+e.toDisplayString(e.unref(o).config_lib.currency_symbol),1)]),e.createElementVNode("div",ld,[e.createElementVNode("div",cd,[b[0]||(b[0]=e.createElementVNode("span",null,"Срок жизни QR-кода",-1)),e.createElementVNode("b",null,e.toDisplayString(d.value),1)]),e.createElementVNode("div",dd,[e.createElementVNode("div",{class:"ttl_fill",style:e.normalizeStyle({width:`${u.value}%`})},null,4)])]),e.createElementVNode("p",ud,[e.createElementVNode("div",fd,[e.createElementVNode("div",md,[e.createElementVNode("div",pd,[e.createVNode(Zc)]),b[1]||(b[1]=e.createElementVNode("div",{class:"txt"},"Возьмите телефон →",-1))]),b[4]||(b[4]=e.createElementVNode("div",{class:"sep"},null,-1)),e.createElementVNode("div",hd,[e.createElementVNode("div",_d,[e.createVNode(Xc)]),b[2]||(b[2]=e.createElementVNode("span",{class:"txt"},"Отсканируйте QR-код",-1))]),b[5]||(b[5]=e.createElementVNode("span",{class:"sep"},"→",-1)),e.createElementVNode("div",gd,[e.createElementVNode("div",yd,[e.createElementVNode("img",{src:e.unref(ed),width:"30",height:"30"},null,8,bd)]),b[3]||(b[3]=e.createElementVNode("span",{class:"txt"},"Оплатите заказ",-1))])])]),e.createElementVNode("div",wd,[e.createVNode(jc,{value:e.unref(r).linkQR,size:200,level:"Q","render-as":"svg","image-settings":i},null,8,["value"])]),e.createVNode(Re,{textButtonDefault:"Отменить заказ",onClick:h,class:"cancel_order_btn"})])])]))}}),[["__scopeId","data-v-ee30ad5e"]]),kd={key:0,class:"wrapper_qr"},Sd={key:1,class:"wrapper_qr"},Ed={key:2,class:"wrapper_qr"},Nd={key:3,class:"wrapper_qr"},vd=X(e.defineComponent({__name:"CartCompletedOrder",props:{orderNumber:{}},setup(t){const n=ue(),r=ge(),{orderNumber:o,orderCompleted_lib:a}=F.storeToRefs(n),{mediaUrl:i}=Ze(()=>r.itemThemes.kiosk_preloader?"preloader":null);return(s,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)&&e.unref(a)===1?(e.openBlock(),e.createElementBlock("section",kd,[e.createVNode(Vc)])):e.unref(a)&&e.unref(a)===2?(e.openBlock(),e.createElementBlock("section",Sd,[e.createVNode(Lc)])):e.createCommentVNode("",!0),e.unref(a)&&e.unref(a)===3?(e.openBlock(),e.createElementBlock("section",Ed,[e.createVNode(Tc,{orderNumber:e.unref(o),mediaUrl:e.unref(i)},null,8,["orderNumber","mediaUrl"])])):e.createCommentVNode("",!0),e.unref(a)&&e.unref(a)===4?(e.openBlock(),e.createElementBlock("section",Nd,[e.createVNode(Cd)])):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-3779e8ee"]]),Id={},Bd={class:"cart_loyal_qr",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function xd(t,n){return e.openBlock(),e.createElementBlock("svg",Bd,[...n[0]||(n[0]=[e.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 Ad=X(Id,[["render",xd]]),fo=t=>{const n=Tn(),r=l=>n.open(t,l),o=()=>n.close(t),a=n.state(t),i=e.computed({get:()=>a.value.visible,set:l=>l&&r()||o()}),s=e.computed(()=>a.value.context);return{visible:i,context:s,open:r,close:o}},Md={class:"cart_deletion_modal_content"},Pd={class:"cart_deletion_modal_title"},Td={class:"cart_deletion_modal_footer"},Rd=X(e.defineComponent({__name:"CartDeleteConfirm",emits:["confirm"],setup(t,{emit:n}){const r=n,{visible:o,context:a,close:i}=fo("cart-delete-confirm"),s=()=>{r("confirm",a.value.idSystem),i()};return(l,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(o)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_deletion_modal_overlay",onClick:c[1]||(c[1]=e.withModifiers((...d)=>e.unref(i)&&e.unref(i)(...d),["self"]))},[e.createElementVNode("div",Md,[e.createElementVNode("div",Pd,"Удалить "+e.toDisplayString(e.unref(a).name)+"?",1),c[2]||(c[2]=e.createElementVNode("div",{class:"cart_deletion_modal_body"},"Эта позиция будет полностью удалена из заказа.",-1)),e.createElementVNode("div",Td,[e.createElementVNode("button",{class:"primary",onClick:s}," Удалить "),e.createElementVNode("button",{onClick:c[0]||(c[0]=(...d)=>e.unref(i)&&e.unref(i)(...d))},"Отмена")])])])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-018f66f3"]]),$d={class:"cart_wrapper"},Vd={class:"cart_header_content"},Dd={key:0,class:"cart_header_subwrapper"},Od={class:"cart_kso_button_wrapper"},zd={key:0},Ld={key:0,class:"kso_btn_wrapper"},Fd=["src"],Hd={key:0,class:"cart_qr_button_wrapper"},Ud={class:"cart_header_info"},qd={class:"cart_header_info"},jd={class:"cart_header_info"},Wd={class:"cart_header_info"},Gd={key:0,class:"wrapper_comment"},Kd={class:"wrapper_limit_in_area"},Zd=["placeholder"],Qd={class:"limit_comment"},Jd={key:1,class:"wrapper_comment"},Yd={class:"wrapper_limit_in_area"},Xd=["placeholder"],eu={class:"limit_comment"},tu={key:2},nu={class:"cart_cards"},ru={class:"cart_footer_wrapper"},ou={key:0,class:"footer_title"},au=["disabled","max"],su={key:1,class:"footer_sales"},iu=["max"],lu={class:"list_price"},cu={key:0},du={key:1},uu={key:2},fu={class:"accept_field"},mu={class:"accept_field"},pu={key:3},hu={class:"accept_field"},_u={class:"accept_field"},gu={class:"accept_field"},yu={key:3,class:"cart_min_order_notice"},bu={class:"wrapper_footer_cart_btn"},wu=e.defineComponent({__name:"CartPage",props:{configPage:{},textPaymentBtn:{},config_qr:{type:Boolean}},setup(t){const n=qe.create();let r;const o=se(),a=ue(),i=ge(),s=t,{totalPrice_lib:l,countBonus:c,config_lib:d,cartProducts_lib:u,profile:f}=F.storeToRefs(o),{itemThemes:m}=F.storeToRefs(i),{textPaymentBtn_lib:h,isButtonDisabled:p,orderCompleted_lib:y,orderNumber:b,extraDiscount:w,is_notification_lib:g,discountBtn:_,is_paymentCart:S,providerTypes:M,notificationData_lib:V,selectedProvider:$,configPayment:D}=F.storeToRefs(a),E=K.useRouter(),N=K.useRoute(),P=e.useTemplateRef("stickerLoyality"),R=e.ref(!1),T=e.ref(!1),x=e.ref(""),C=e.ref(!1),B=e.ref(!1),A=e.ref(0),k=e.ref(0),I=e.ref(),O=e.computed(()=>s.configPage.qr_menu?"YOOKASSA_BASE":M.value[0].front_type),H=e.computed(()=>s.configPage.qr_menu?"YOOKASSA":M.value[0].type),{width:W}=we.useElementSize(P,{width:0,height:0},{box:"border-box"}),j=e.computed(()=>{const Z={energy_amount:0,proteins_amount:0,fat_amount:0,carbohydrates_amount:0};return u.value.reduce((z,le)=>(z.energy_amount+=(le.energy_amount||0)*(le.amount||0),z.proteins_amount+=(le.proteins_amount||0)*(le.amount||0),z.fat_amount+=(le.fat_amount||0)*(le.amount||0),z.carbohydrates_amount+=(le.carbohydrates_amount||0)*(le.amount||0),z),Z)}),G=e.computed(()=>{var Z;if((Z=m.value)!=null&&Z.comments){const z=m.value.comments;return{fieldName:s.configPage.kiosk_menu?z.kiosk_comment_field_name:z.qr_comment_field_name,placeholder:s.configPage.kiosk_menu?z.kiosk_comment_field_placeholder:z.qr_comment_field_placeholder,show:s.configPage.kiosk_menu?z.kiosk_show_order_comment:z.qr_show_order_comment}}}),ee=we.computedAsync(async Z=>{var Ye;const z=new AbortController;if(Z(()=>z.abort()),!R.value||!((Ye=f.value)!=null&&Ye.balance))return 0;const le=await n.maxPayByBonuses(l.value,s.configPage.kiosk_menu,!!s.configPage.userData||!!f.value,z.signal);return le!=null&&le.by_bonuses?f.value.balance>le.by_bonuses?le.by_bonuses:f.value.balance:0},0,{shallow:!0}),Y=()=>E.push(`/${N.params.orgId}/`),de=Z=>{["a","A","+","-",".",","].includes(Z.key)&&Z.preventDefault()},pe=Z=>{o.deleteItemFromCart(Z),u.value.length===0&&(C.value=!1,B.value=!1)},he=()=>{C.value=!C.value,x.value.length},ae=e.computed(()=>{var z;return(((z=m.value.cart_loyalty_button)==null?void 0:z.cart_loyalty_button_text)||"Программа лояльности").replace(/\S+/g,le=>le.length>15?le.slice(0,15)+"...":le)}),U=()=>{B.value=!B.value,x.value.length},ne=()=>{let Z=Math.floor(c.value)||0;Z>ee.value&&(Z=ee.value),Z!==c.value&&o.setBonus(Z)};e.watchEffect(()=>{ne(),o.setBonus(l.value===0?0:Math.floor(c.value))});const ie=()=>u.value.map(Z=>({id:Z.id,front_item_id:Z.idSystem,is_fake:!!Z.is_fake,removals:Z.removals??null,amount:Z.amount,size:Z.size,modifiers:Z.modifiers??[],group_modifiers:Z.group_modifiers??[]})),{makeCreateOrderRequest:me}=so(),Me=e.computed(()=>ie()),Hn=async()=>{if(!f.value&&s.configPage.qr_menu){E.push(`/${N.params.orgId}/register`);return}if(s.configPage.qr_menu||M.value.length<=1){d.value.has_rms_discount&&!m.value.hide_discounts_calculate_button&&I!=null?(p.value=!0,await Et(I.value,H.value).then(Z=>{const z=D.value;z&&(z.is_tableservice?Zr(z,null):Z.url&&window.location.replace(Z.url))})):($.value={front_type:O},await me(s.configPage,{paymentMethodId:O.value,items:Me.value,tableDataId:s.configPage.tableDataId,comment:x.value,isAuthorized:!!s.configPage.userData||!!f,signal:r==null?void 0:r.signal}));return}return S.value=!S.value},Zf=()=>{S.value=!1},Qf=async()=>{var le,Ye,At,Mt;w.value=0,p.value=!0;const Z={items:[...ie()],table:((le=s.configPage)==null?void 0:le.tableDataId)||null,combos:[]},z=qe.create();r=new AbortController;try{T.value=!0;const oe=await z.calculateDiscount(Z,s.configPage.kiosk_menu,!!s.configPage.userData||!!f.value,r.signal);if(!u.value)return;if(u.value.forEach(ve=>{const Xe=oe.items.find(Pe=>Pe.front_item_id===ve.idSystem);if(Xe&&(ve.group_modifiers.forEach(Pe=>{const Ie=Xe.group_modifiers.find(Be=>Be.group===Pe.group);Ie&&Pe.modifiers.forEach(Be=>{const Fe=Ie.modifiers.find(Pt=>Pt.id===Be.id);if(Fe&&Number(Be.price)!==Number(Fe==null?void 0:Fe.new_price)){const Pt=(Fe.discounts||[]).reduce((em,tm)=>em+=+tm.discount,0);A.value+=Pt,Be.new_price=Be.price,Be.price=Number(Fe==null?void 0:Fe.new_price),Be.total_new_price=Number(Fe.total_new_price)}})}),ve.modifiers.forEach(Pe=>{const Ie=Xe.modifiers.find(Be=>Be.id===Pe.id);if(Ie&&Number(Pe.price)!==Number(Ie==null?void 0:Ie.new_price)){const Be=(Ie.discounts||[]).reduce((Fe,Pt)=>Fe+=+Pt.discount,0);A.value+=Be,Pe.new_price=Pe.price,Pe.price=Number(Ie==null?void 0:Ie.new_price),Pe.total_new_price=Number(Ie.total_new_price)}}),ve.price!==Number(Xe.new_price))){const Pe=(Xe.discounts||[]).reduce((Ie,Be)=>Ie+=+Be.discount,0);A.value=A.value+Pe,ve.new_price=ve.price,ve.price=Xe.new_price,ve.discounts=Xe.discounts,ve.total_new_price=Number(Xe.total_new_price)}}),u.value=[...u.value],A.value!==0&&(l.value=oe.total_cart_price),d.value.has_rms_discount){$.value={front_type:O};const ve=await me(s.configPage,{paymentMethodId:O.value,items:Me.value,tableDataId:s.configPage.tableDataId,comment:x.value,isAuthorized:!!s.configPage.userData||!!f,signal:r==null?void 0:r.signal});I.value=(Ye=ve==null?void 0:ve.data)==null?void 0:Ye.id}else p.value=!1;_.value=!1}catch(oe){re.isCancel(oe)||a.showNotification(((Mt=(At=oe==null?void 0:oe.response)==null?void 0:At.data)==null?void 0:Mt.user_friendly_message)||"Скидки временно недоступны"),_.value=!0,T.value=!1,p.value=!1}},Jf=()=>{var Z;(Z=f.value)!=null&&Z.balance?f.value.balance>=1&&(R.value=!R.value):a.showNotification("У Вас пока нет бонусов")},Yf=()=>{var Z,z;if(m.value.hide_discounts_calculate_button){_.value=!1;return}d.value.has_rms_discount&&(s.configPage.kiosk_menu||s.configPage.qr_menu&&f.value)?(I.value=null,_.value=!0):((Z=d.value)==null?void 0:Z.loyalty)==="IIKO"&&(d.value.has_loyalty_default_user||f.value)&&s.configPage.kiosk_menu||((z=d.value)==null?void 0:z.loyalty)==="IIKO"&&s.configPage.qr_menu&&f.value?_.value=!0:_.value=!1};e.onMounted(async()=>{h.value=s.textPaymentBtn,o.loadCart(),y.value=null,l.value=null,w.value=0,u.value.splice(0,u.value.length,...u.value.map(o.makeProductFullyReactive))}),e.onUnmounted(()=>{I.value=null,y.value=null,l.value=null,w.value=0,u.value.splice(0,u.value.length,...u.value.map(o.makeProductFullyReactive))});const Un=e.computed(()=>l.value-w.value-A.value),xt=e.computed(()=>s.configPage.qr_menu?d.value.qr_order_minimum_price||0:s.configPage.kiosk_menu&&d.value.kiosk_order_minimum_price||0),Xf=e.computed(()=>xt.value>Un.value||T.value||p.value?!0:["АВТОРИЗОВАТЬСЯ ДЛЯ ЗАКАЗА"].includes(h.value.toUpperCase())?!1:u.value.length===0||l.value===0?!0:(y.value=null,p.value)),qn=e.computed(()=>{var Z;return((Z=u.value)==null?void 0:Z.reduce((z,le)=>z+le.amount,0))||0}),vo=e.computed(()=>{var Z;return(Z=f.value)==null?void 0:Z.phone});return e.watch([qn,vo],()=>{qn.value===0&&(r=null),r==null||r.abort(),p.value=!1}),e.watch([()=>o.cartProducts_lib,vo,qn],Z=>{if(k.value>0){k.value--;return}Z&&!T.value&&(Yf(),u.value.splice(0,u.value.length,...u.value.map(o.makeProductFullyReactive)),A.value=0,l.value=null,w.value=0,k.value=1),T.value=!1},{deep:!0}),(Z,z)=>{var le,Ye,At,Mt;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",$d,[e.createVNode(Rd,{onConfirm:pe}),e.createVNode(ro,{visible:e.unref(a).isDrawerOpen,"onUpdate:visible":z[0]||(z[0]=oe=>e.unref(a).isDrawerOpen=oe)},{default:e.withCtx(()=>[e.createVNode(ao)]),_:1},8,["visible"]),e.createElementVNode("header",Vd,[s.configPage.kiosk_menu?(e.openBlock(),e.createElementBlock("div",Dd,[e.createElementVNode("div",Od,[e.createElementVNode("div",{class:e.normalizeClass(["arrow_wrapper",{arrow_wrapper_kso:s.configPage.kiosk_menu}]),onClick:Y},[e.createVNode(Nt,{class:"cart_header_back_button"}),s.configPage.kiosk_menu?(e.openBlock(),e.createElementBlock("span",zd,"Назад")):e.createCommentVNode("",!0)],2)]),G.value&&G.value.show?(e.openBlock(),e.createElementBlock("div",Ld,[e.createVNode(Re,{style:e.normalizeStyle({visibility:!C.value&&e.unref(u).length>0?"visible":"hidden"}),class:e.normalizeClass({button_kso_comment:t.configPage.kiosk_menu}),textButtonDefault:x.value.length>0?"Редактировать":G.value&&G.value.fieldName||"",onClick:()=>C.value=!C.value,id:"button_kso_comment"},null,8,["style","class","textButtonDefault","onClick"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass({cart_header_wrapper:s.configPage.kiosk_menu})},[(e.unref(m).kiosk_show_loyalty_card_button||e.unref(m).kiosk_show_loyalty_phone_input_button)&&!s.config_qr?(e.openBlock(),e.createElementBlock("button",{key:0,class:"buttonDefaultWrapper button_payment_cart button_payment_cart_loyal",style:e.normalizeStyle({marginRight:(le=e.unref(m).cart_loyalty_button)!=null&&le.cart_loyalty_button_sticker?`${Math.ceil(e.unref(W)/2+10)}px`:"",paddingRight:(Ye=e.unref(m).cart_loyalty_button)!=null&&Ye.cart_loyalty_button_sticker?0:""}),onClick:z[1]||(z[1]=(...oe)=>e.unref(a).openDrawer&&e.unref(a).openDrawer(...oe))},[e.createElementVNode("p",{class:"cart_loyal_program",style:e.normalizeStyle({marginRight:`${Math.ceil(e.unref(W)/2)}px`})},e.toDisplayString(ae.value),5),(At=e.unref(m).cart_loyalty_button)!=null&&At.cart_loyalty_button_sticker?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"stickerLoyality",ref:P,class:"cart_loyal_program_icon",style:e.normalizeStyle({"--sticker-mask":`url(${e.unref(m).cart_loyalty_button.cart_loyalty_button_sticker})`})},[e.createElementVNode("img",{src:e.unref(m).cart_loyalty_button.cart_loyalty_button_sticker},null,8,Fd)],4)):(e.openBlock(),e.createBlock(Ad,{key:1,class:"cart_loyal_qr"}))],4)):e.createCommentVNode("",!0)],2)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([t.config_qr?"cart_kbju_qr_wrapper":"cart_kbju_kso_wrapper"])},[t.config_qr?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("div",{class:"arrow_wrapper",onClick:Y},[e.createVNode(Nt,{class:"cart_header_back_button"})])])):e.createCommentVNode("",!0),e.unref(m).show_nutrition_in_cart?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cart_header",style:e.normalizeStyle({paddingTop:s.config_qr?0:"10px",paddingRight:s.config_qr?"10px":0})},[e.createElementVNode("div",Ud,[e.createElementVNode("p",null,[e.createVNode(Ce,{price:j.value.energy_amount,duration:800},null,8,["price"]),z[8]||(z[8]=e.createTextVNode(" г",-1))]),z[9]||(z[9]=e.createElementVNode("p",{class:"cart_info_name"},"Килокалории",-1))]),e.createElementVNode("div",qd,[e.createElementVNode("p",null,[e.createVNode(Ce,{price:j.value.proteins_amount,duration:900},null,8,["price"]),z[10]||(z[10]=e.createTextVNode(" г",-1))]),z[11]||(z[11]=e.createElementVNode("p",{class:"cart_info_name"},"Белки",-1))]),e.createElementVNode("div",jd,[e.createElementVNode("p",null,[e.createVNode(Ce,{price:j.value.fat_amount,duration:1e3},null,8,["price"]),z[12]||(z[12]=e.createTextVNode(" г",-1))]),z[13]||(z[13]=e.createElementVNode("p",{class:"cart_info_name"},"Жиры",-1))]),e.createElementVNode("div",Wd,[e.createElementVNode("p",null,[e.createVNode(Ce,{price:j.value.carbohydrates_amount,duration:1100},null,8,["price"]),z[14]||(z[14]=e.createTextVNode(" г",-1))]),z[15]||(z[15]=e.createElementVNode("p",{class:"cart_info_name"},"Углеводы",-1))])],4)):e.createCommentVNode("",!0)],2)]),C.value&&t.configPage.kiosk_menu?(e.openBlock(),e.createElementBlock("div",Gd,[e.createElementVNode("div",Kd,[e.withDirectives(e.createElementVNode("textarea",{class:"comment_order",placeholder:G.value&&G.value.placeholder||"Ваш комментарий к заказу...",name:"commentKso",maxlength:"50","onUpdate:modelValue":z[2]||(z[2]=oe=>x.value=oe)},null,8,Zd),[[e.vModelText,x.value]]),e.createElementVNode("p",Qd,e.toDisplayString(x.value.length+" / 50"),1)]),e.createVNode(Re,{textButtonDefault:"Сохранить",onClick:he,class:"button_bonus_cart"})])):e.createCommentVNode("",!0),B.value&&t.config_qr?(e.openBlock(),e.createElementBlock("div",Jd,[e.createElementVNode("div",Yd,[e.withDirectives(e.createElementVNode("textarea",{class:"comment_order",placeholder:G.value&&G.value.placeholder||"Ваш комментарий к заказу...",name:"commentQr",maxlength:"50","onUpdate:modelValue":z[3]||(z[3]=oe=>x.value=oe)},null,8,Xd),[[e.vModelText,x.value]]),e.createElementVNode("p",eu,e.toDisplayString(x.value.length+" / 50"),1)]),e.createVNode(Re,{textButtonDefault:"Сохранить",onClick:U,class:"button_bonus_cart"})])):e.createCommentVNode("",!0),t.config_qr&&G.value&&G.value.show?(e.openBlock(),e.createElementBlock("div",tu,[!B.value&&e.unref(u).length>0?(e.openBlock(),e.createBlock(Re,{key:0,textButtonDefault:x.value.length>0?"Редактировать":G.value.fieldName||"",onClick:()=>B.value=!B.value,id:"button_comments"},null,8,["textButtonDefault","onClick"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),oe=>(e.openBlock(),e.createBlock(oo,{key:oe.idSystem,cardItem:oe,onDelete:ve=>pe(oe.idSystem)},null,8,["cardItem","onDelete"]))),128))]),e.createElementVNode("div",ru,[R.value?(e.openBlock(),e.createElementBlock("p",ou,[z[16]||(z[16]=e.createTextVNode(" Списать ",-1)),e.withDirectives(e.createElementVNode("input",{type:"number",placeholder:"0",style:e.normalizeStyle({maxWidth:`${e.unref(c).toString().length||1}em`}),disabled:e.unref(f)===null||((Mt=e.unref(f))==null?void 0:Mt.balance)===0,"onUpdate:modelValue":z[4]||(z[4]=oe=>e.isRef(c)?c.value=oe:null),onInput:ne,min:"0",max:e.unref(ee),onKeypress:de},null,44,au),[[e.vModelText,e.unref(c),void 0,{number:!0}]]),z[17]||(z[17]=e.createTextVNode(" бонусов ",-1))])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("p",su,"У вас есть "+e.toDisplayString(e.unref(f)?e.unref(f).balance:0)+" B",1)):e.createCommentVNode("",!0),R.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"range",class:"footer_range","onUpdate:modelValue":z[5]||(z[5]=oe=>e.isRef(c)?c.value=oe:null),min:0,max:e.unref(ee)},null,8,iu)),[[e.vModelText,e.unref(c),void 0,{number:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("ul",lu,[R.value?(e.openBlock(),e.createElementBlock("li",cu,[z[19]||(z[19]=e.createElementVNode("p",null,"Сумма заказа:",-1)),e.createElementVNode("p",null,[e.createVNode(Ce,{price:e.unref(l),fixedFloat:2},null,8,["price"]),z[18]||(z[18]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("li",du,[z[21]||(z[21]=e.createElementVNode("p",null,"Будет оплачено бонусами:",-1)),e.createElementVNode("p",null,[e.createVNode(Ce,{price:e.unref(c),fixedFloat:2},null,8,["price"]),z[20]||(z[20]=e.createTextVNode(" Б",-1))])])):e.createCommentVNode("",!0),e.unref(w)!==0?(e.openBlock(),e.createElementBlock("li",uu,[e.createElementVNode("p",fu,e.toDisplayString(e.unref(w)>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",mu,[e.createVNode(Ce,{price:Math.abs(e.unref(w)),fixedFloat:2},null,8,["price"]),z[22]||(z[22]=e.createTextVNode(" ₽",-1))])])):A.value!==0?(e.openBlock(),e.createElementBlock("li",pu,[e.createElementVNode("p",hu,e.toDisplayString(A.value>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",_u,[e.createVNode(Ce,{price:Math.abs(A.value),fixedFloat:2},null,8,["price"]),z[23]||(z[23]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),e.createElementVNode("li",null,[z[25]||(z[25]=e.createElementVNode("p",{class:"accept_field"},"Итого к оплате:",-1)),e.createElementVNode("p",gu,[e.createVNode(Ce,{price:e.unref(l)-e.unref(c),fixedFloat:2},null,8,["price"]),z[24]||(z[24]=e.createTextVNode(" ₽",-1))])])]),xt.value&&Un.value<xt.value?(e.openBlock(),e.createElementBlock("div",yu,[z[26]||(z[26]=e.createTextVNode(" Минимальная сумма заказа ",-1)),e.createVNode(Ce,{price:xt.value,fixedFloat:2},null,8,["price"]),e.createTextVNode(" "+e.toDisplayString(e.unref(d).currency_symbol)+". Для оформления заказа необходимо добавить товаров на сумму ",1),e.createVNode(Ce,{price:xt.value-Un.value,fixedFloat:2},null,8,["price"]),e.createTextVNode(" "+e.toDisplayString(e.unref(d).currency_symbol),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",bu,[e.unref(f)?(e.openBlock(),e.createBlock(Re,{key:0,textButtonDefault:"Бонусы",onClick:Jf,class:"button_bonus_cart"})):e.createCommentVNode("",!0),e.createVNode(Re,{textButtonDefault:e.unref(_)?"Рассчитать скидки":e.unref(h),onClick:e.unref(_)?Qf:Hn,class:"button_payment_cart",disabled:Xf.value},null,8,["textButtonDefault","onClick","disabled"])])])]),e.createVNode(vd,{orderNumber:e.unref(b),pageNumber:1},null,8,["orderNumber"]),e.createVNode(An,{visible:e.unref(g),"onUpdate:visible":z[6]||(z[6]=oe=>e.isRef(g)?g.value=oe:null),textNotificationDefault:e.unref(V).textNotification,backgroundColor:e.unref(m).accent_color?e.unref(m).accent_color:"#FF6D2E",buttonAccept:null},null,8,["visible","textNotificationDefault","backgroundColor"]),e.createVNode(Pn,{modelValue:e.unref(S),"onUpdate:modelValue":z[7]||(z[7]=oe=>e.isRef(S)?S.value=oe:null),class:"product_card_sheet","snap-points":["80%"]},{default:e.withCtx(()=>{var oe;return[e.createVNode(Nc,{"config-page":t.configPage,comment:x.value,"cart-items":Me.value,"is-authorized":!!s.configPage.userData||!!e.unref(f),"has-rms-discount":e.unref(d).has_rms_discount,"hide-discounts-button":e.unref(m).hide_discounts_calculate_button,"order-id":I.value,signal:(oe=e.unref(r))==null?void 0:oe.signal,onSelectPayment:Zf},null,8,["config-page","comment","cart-items","is-authorized","has-rms-discount","hide-discounts-button","order-id","signal"])]}),_:1},8,["modelValue"])],64)}}}),Cu={},ku={viewBox:"0 0 24 24"};function Su(t,n){return e.openBlock(),e.createElementBlock("svg",ku,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Eu=X(Cu,[["render",Su]]),Nu={class:"retry_screen"},vu={class:"retry_all_in_screen"},Iu={class:"retry_content"},Bu={class:"retry_icon_wrap"},xu={class:"retry_icon_circle"},Au={class:"retry_error_x"},Mu=e.defineComponent({__name:"RetryPage",setup(t){const n=ue(),r=K.useRouter(),o=K.useRoute(),a=se(),i=()=>{n.notificationData_lib.textNotification="",n.is_notification_lib=!1,a.openApiKey=!0,r.replace(`/${o.params.orgId}/`)};return(s,l)=>(e.openBlock(),e.createElementBlock("section",Nu,[e.createElementVNode("div",vu,[e.createElementVNode("main",Iu,[e.createElementVNode("div",Bu,[e.createElementVNode("div",xu,[l[0]||(l[0]=e.createElementVNode("div",{class:"retry_loader_mini"},null,-1)),e.createElementVNode("div",Au,[e.createVNode(Eu)])])]),l[1]||(l[1]=e.createElementVNode("div",{class:"retry_oops"},"OOPS",-1)),l[2]||(l[2]=e.createElementVNode("h1",{class:"retry_title"},"Что-то пошло не так",-1)),l[3]||(l[3]=e.createElementVNode("div",{class:"retry_hint"},[e.createElementVNode("p",null,"Похоже, произошёл технический сбой."),e.createElementVNode("p",null,"Мы уже знаем о проблеме и сейчас разбираемся."),e.createElementVNode("p",null,"Приносим извинения за доставленные неудобства."),e.createElementVNode("p",null,"Попробуйте начать новый заказ.")],-1))]),e.createElementVNode("div",{class:"retry_footer"},[e.createElementVNode("button",{onClick:i,class:"retry_new_order_btn"},"Новый заказ")]),l[4]||(l[4]=e.createElementVNode("p",{class:"retry_bottom_note"},"Если ошибка повторяется — обратитесь к сотруднику зала.",-1))])]))}}),Pu={class:"wrapper_loader"},Tu=e.defineComponent({__name:"Loader",props:{size:{type:String,default:"40px"}},setup(t){return(n,r)=>(e.openBlock(),e.createElementBlock("div",Pu,[e.createElementVNode("div",{class:"loader",style:e.normalizeStyle({width:t.size})},null,4)]))}}),Ru=X(e.defineComponent({__name:"AnimationLoader",props:{id:{}},setup(t){const n=e.ref(!0);return e.watch(()=>n.value,()=>{n.value=!1,setTimeout(()=>{n.value=!0},0)}),(r,o)=>(e.openBlock(),e.createElementBlock("div",{class:"opacity-animation",key:t.id},[e.renderSlot(r.$slots,"opacityLoader",{},void 0,!0)]))}}),[["__scopeId","data-v-c6b97942"]]),$u={key:0},Vu={class:"card__main__wrapper"},Du={key:0,class:"folder_content_top"},Ou={key:0,class:"loader_card_main"},zu={key:1,class:"card__main_content"},Lu=["src","alt"],Fu={class:"card_title_price_wrapper"},Hu={class:"title"},Uu={key:0,class:"price"},qu={key:1,class:"card_button_add_wrapper"},mo=X(e.defineComponent({__name:"CardMain",props:{data:{},activeTags:{},is_group:{type:Boolean},parent:{},isLoading:{type:Boolean},selectGroupChild:{type:Function},takeCurrentCard:{type:Function}},setup(t){const n=ge(),r=se(),o=fe(),{itemThemes:a}=F.storeToRefs(n),{is_18_above_content:i,is18Allowed:s,notificationData_lib:l}=F.storeToRefs(r),c=t,d=(h,p)=>{var w,g,_;const y={id:h.id,is_fake:h.is_fake||!1,amount:h.amount||1,name:h.name,image_link:h.image_link,price:h.price,old_price:h.price,size:void 0,sizes:[],modifiers:[],groups:h.groups,group_modifiers:[],energy_amount:h.energy_amount??0,proteins_amount:h.proteins_amount??0,fat_amount:h.fat_amount??0,carbohydrates_amount:h.carbohydrates_amount??0},b=!((w=h.modifiers)!=null&&w.length)&&!((g=h.group_modifiers)!=null&&g.length)&&!((_=h.sizes)!=null&&_.length);if(o.isUpSale=!1,h.adult&&!s.value){i.value=!0,b&&(l.value.fastAdd=y);return}if(b){r.addToCart(y);return}if(h.amount||(h.amount=1),c.is_group&&c.selectGroupChild){c.selectGroupChild({...h,parent:c.parent,child:p.child_groups});return}c.takeCurrentCard&&c.takeCurrentCard(p.id)},u=h=>{if(c.is_group&&c.selectGroupChild){h={...h,parent:c.parent,child:h.child_groups},c.selectGroupChild(h);return}if(h.adult&&!s.value){i.value=!0;return}c.takeCurrentCard&&c.takeCurrentCard(h.id)},f=e.computed(()=>c.activeTags.every(h=>c.data.tags.includes(h))),{mediaUrl:m}=Ze(()=>c.data.id+"_image",()=>c.data.image_link);return(h,p)=>{var y;return((y=c.activeTags)==null?void 0:y.length)===0||f.value||c.is_group?(e.openBlock(),e.createElementBlock("div",$u,[e.createVNode(Ru,{id:c.data.id},{opacityLoader:e.withCtx(()=>[e.createElementVNode("div",Vu,[t.is_group?(e.openBlock(),e.createElementBlock("div",Du)):e.createCommentVNode("",!0),e.createElementVNode("div",{onClick:p[0]||(p[0]=b=>u(c.data)),class:e.normalizeClass(["card__main",{card__main_folder:t.is_group}])},[t.isLoading?(e.openBlock(),e.createElementBlock("div",Ou,[e.createVNode(Tu)])):(e.openBlock(),e.createElementBlock("div",zu,[e.createElementVNode("img",{src:e.unref(m)||"",class:e.normalizeClass(["img",{card_blur_image:c.data.adult&&!e.unref(s)}]),loading:"lazy",alt:t.data.name},null,10,Lu),e.createElementVNode("div",Fu,[e.createElementVNode("p",Hu,e.toDisplayString(t.data.name),1),t.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",Uu,e.toDisplayString(e.unref(ct)(t.data))+" ₽",1))])]))],2),t.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",qu,[e.createElementVNode("div",{onClick:p[1]||(p[1]=b=>d(t.data,c.data)),class:"add_button"},[...p[2]||(p[2]=[e.createElementVNode("div",{class:"image_add_button"},null,-1)])])]))])]),_:1},8,["id"])])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-d1595389"]]),ju=["id","onClick"],Wu=X(e.defineComponent({__name:"GroupMain",props:{menuGroup:{},idActiveGroup:{},activeTakeGroup:{type:Function}},setup(t){const n=e.ref(null);return(r,o)=>t.menuGroup.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__menu",ref_key:"scrollGroup",ref:n},[e.createVNode(In,{axis:"x",behavior:"smooth",container:n.value,autoScroll:!0,idActive:t.idActiveGroup,clearContainer:!0},{default:e.withCtx(({handleTargetClick:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.menuGroup,(i,s)=>(e.openBlock(),e.createElementBlock("li",{key:i.id,id:"scrolling"+i.id,onClick:l=>{t.activeTakeGroup&&t.activeTakeGroup(i.id,s),a(l)},style:e.normalizeStyle(t.idActiveGroup==i.id?{fontFamily:"Bounded"}:{})},e.toDisplayString(i.name),13,ju))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-33006a7e"]]),Gu=["id","onClick"],Ku=X(e.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(t){const n=t,r=e.ref(null),o=e.computed(()=>{if(n.isSolo&&!n.groupIndex)return Array.isArray(n.currentActiveTag)?n.currentActiveTag:[];if(n.groupIndex!==null&&n.groupIndex!==void 0){const a=n.currentActiveTag[n.groupIndex];return Array.isArray(a)?a:[]}return[]});return(a,i)=>t.menuTags.length>0?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__filters",ref_key:"scrollTagContainer",ref:r},[e.createVNode(In,{axis:"x",behavior:"smooth",container:r.value,autoScroll:!0,idActive:o.value?o.value[t.currentActiveTag.length-1]:null,clearContainer:!1},{default:e.withCtx(({handleTargetClick:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.menuTags,(l,c)=>(e.openBlock(),e.createElementBlock("li",{key:c,id:`scrolling${l}`,onClick:d=>{t.activeTakeTags&&(t.groupIndex||t.groupIndex===0)?t.activeTakeTags(l,t.groupIndex):t.activeTakeTagsSolo&&t.activeTakeTagsSolo(l),s(d)},class:e.normalizeClass({main__filter_active:(o.value??[]).includes(l)})},e.toDisplayString(l),11,Gu))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-818940a4"]]),Zu=["data-id"],Qu=["src"],Ju=["src"],Yu=X(e.defineComponent({__name:"DrumItem",props:{group:{},index:{},active:{type:Boolean}},setup(t){const n=t,{mediaUrl:r}=Ze(()=>{var o,a;return(o=n.group)!=null&&o.video_link?`${n.group.id}_video`:(a=n.group)!=null&&a.image_link?`${n.group.id}_image`:null});return(o,a)=>t.group?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["drum_item",{active:n.active}]),"data-id":t.group.id},[t.group.video_link?e.withDirectives((e.openBlock(),e.createElementBlock("video",{key:e.unref(r),loop:"",autoplay:"",muted:"",playsinline:"",class:"drum_img"},[e.createElementVNode("source",{src:e.unref(r)||"",type:"video/webm"},null,8,Qu)])),[[e.unref(vt)]]):(e.openBlock(),e.createElementBlock("img",{key:1,class:"drum_img",src:e.unref(r)||""},null,8,Ju)),e.createElementVNode("p",null,e.toDisplayString(t.group.name),1)],10,Zu)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-2b994529"]]),Xu={},ef={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 tf(t,n){return e.openBlock(),e.createElementBlock("svg",ef,[...n[0]||(n[0]=[e.createElementVNode("desc",null," Created with Pixso. ",-1),e.createElementVNode("defs",null,null,-1),e.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 nf=X(Xu,[["render",tf]]),rf={class:"recommendation_wrapper"},of={class:"recommendation_header"},af={class:"recommendation_info"},sf=X(e.defineComponent({__name:"Recommendation",props:{closeCurrentCard:{},openCurrentCard:{}},setup(t){const n=fe(),{isUpSale:r,dataUpSale:o}=F.storeToRefs(n),a=()=>{r.value=!1};return e.onUnmounted(()=>{o.value=null}),(i,s)=>(e.openBlock(),e.createElementBlock("div",rf,[e.createElementVNode("div",of,[s[0]||(s[0]=e.createElementVNode("p",{class:"header_title"},"Часто берут вместе",-1)),e.createElementVNode("div",{class:"header_close",onClick:a},[e.createVNode(nf,{class:"close_icon"})])]),e.createElementVNode("div",af,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),l=>(e.openBlock(),e.createBlock(mo,{data:l,key:l.id,parent:l.id,is_group:!1,is_product:!0,class:"card",activeTags:[],isLoading:!1,closeCurrentCard:t.closeCurrentCard,takeCurrentCard:()=>t.openCurrentCard(l.id,!0)},null,8,["data","parent","closeCurrentCard","takeCurrentCard"]))),128))])]))}}),[["__scopeId","data-v-d545ec45"]]),lf=e.defineComponent({__name:"Blackout",props:{data:{type:Boolean}},setup(t){const n=t;return e.watch(()=>n.data,r=>{document.body.style.overflow=r?"hidden":""}),()=>{}}}),cf={class:"wrapper_modal"},df={class:"card_modal"},uf=X(e.defineComponent({__name:"ModalWindows",props:{visible:{type:Boolean}},setup(t){const n=t,r=fe(),{isUpSale:o}=F.storeToRefs(r),a=()=>{o.value=!1};return(i,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(lf,{data:n.visible},null,8,["data"]),e.createElementVNode("div",{class:"black_modal",onClick:a}),e.createElementVNode("div",cf,[e.createElementVNode("div",df,[e.renderSlot(i.$slots,"default",{},void 0,!0)])])],64))}}),[["__scopeId","data-v-ec2b2c4d"]]),On=F.defineStore("modulesLib",()=>{const t=e.ref(!1),n=e.ref({textNotification:""});return{is_notification_lib:t,notificationData_lib:n}}),Yt=Symbol("clickOutside"),ff={mounted(t,n){t[Yt]=r=>{t.contains(r.target)||n.value(r)},document.addEventListener("click",t[Yt])},unmounted(t){t[Yt]&&document.removeEventListener("click",t[Yt])}};class mf{constructor(n){te(this,"value");te(this,"next");this.value=n}}class pf{constructor(){tn(this,Ne);tn(this,Je);tn(this,st);this.clear()}enqueue(n){const r=new mf(n);$e(this,Ne)?($e(this,Je).next=r,We(this,Je,r)):(We(this,Ne,r),We(this,Je,r)),jn(this,st)._++}dequeue(){const n=$e(this,Ne);if(n)return We(this,Ne,$e(this,Ne).next),jn(this,st)._--,$e(this,Ne)||We(this,Je,void 0),n.value}peek(){if($e(this,Ne))return $e(this,Ne).value}clear(){We(this,Ne,void 0),We(this,Je,void 0),We(this,st,0)}get size(){return $e(this,st)}*[Symbol.iterator](){let n=$e(this,Ne);for(;n;)yield n.value,n=n.next}*drain(){for(;$e(this,Ne);)yield this.dequeue()}}Ne=new WeakMap,Je=new WeakMap,st=new WeakMap;function hf(t){po(t);const n=new pf;let r=0;const o=()=>{r<t&&n.size>0&&(r++,n.dequeue()())},a=()=>{r--,o()},i=async(c,d,u)=>{const f=(async()=>c(...u))();d(f);try{await f}catch{}a()},s=(c,d,u)=>{new Promise(f=>{n.enqueue(f)}).then(i.bind(void 0,c,d,u)),r<t&&o()},l=(c,...d)=>new Promise(u=>{s(c,u,d)});return Object.defineProperties(l,{activeCount:{get:()=>r},pendingCount:{get:()=>n.size},clearQueue:{value(){n.clear()}},concurrency:{get:()=>t,set(c){po(c),t=c,queueMicrotask(()=>{for(;r<t&&n.size>0;)o()})}},map:{async value(c,d){const u=Array.from(c,(f,m)=>this(d,f,m));return Promise.all(u)}}}),l}function po(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}let Ee=null;const ho=hf(5),_f=async(t,n)=>{Ee&&wf();const r=se(),o=On(),a=fe(),{displayCards:i}=F.storeToRefs(r),{is_notification_lib:s,notificationData_lib:l}=F.storeToRefs(o),{stateCard:c,openProduct:d}=F.storeToRefs(a),u=qe.create();await gf(t),Ee=Ot(`wss://${n}/ws/org-unit/${t}/`),Ee.on("open",()=>console.warn("Realtime WebSocket подключён (pointId:",t,")")),Ee.on("error",f=>console.warn("WebSocket ошибка:",f)),Ee.on("close",()=>console.warn("Realtime WebSocket закрыт")),Ee.on("message",async f=>{if(f.type)return;l.value.textNotification="Мы обновили меню";const m=f.params||f,h=m.active_groups||[],p=m.updated_groups||[],y=m.updated_product_groups||[],b=await et(),w=new Set(h.map(E=>E)),g=new Map(i.value.map(E=>[E.id,E])),_=[],S=b.transaction("groups","readwrite");let V=await S.objectStore("groups").openCursor();for(;V;){const E=V.key;!w.has(E)&&E!==t&&(_.push(E),await V.delete(),g.delete(E)),V=await V.continue()}await S.done,i.value=Array.from(g.values()),_.length>0&&await yf(w);const $=[...p.map(E=>ho(async()=>{const[N,P]=await Promise.all([u.getGroupByID(E),u.loadGroupProducts(E)]);N.products=P,g.set(E,N),await _t(E,N),await go(N,P,!0)})),...y.map(E=>ho(async()=>{const[N,P]=await Promise.all([u.getGroupByID(E),u.loadGroupProducts(E)]);N.products=P,g.set(E,N),await _t(E,N),await go(N,P,!0),await bf(P,E)}))];await Promise.all($),i.value=Array.from(g.values()),await Wo(t,i),s.value=!0;const D=c.value.openCard;if(D!=null&&D.id){const E=new Set(D.groups??[]),N=new Set;let P=!1;for(const T of g.values()){const x=T==null?void 0:T.products;if(!Array.isArray(x))continue;const C=x.find(B=>(B==null?void 0:B.id)===D.id);if((C==null?void 0:C.adult)===!0){d.value={id:null,visible:!1},a.reset();return}C&&(T==null?void 0:T.id)!=null&&(N.add(T.id),(p.includes(T.id)||y.includes(T.id))&&(P=!0))}if(N.size===0){d.value={id:null,visible:!1},a.reset();return}(!(E.size===N.size&&[...E].every(T=>N.has(T)))||P)&&await u.getSingleProduct(D==null?void 0:D.id)}}),Ee.connect()},gf=async t=>{try{const n=se(),r=await dn(t);r!=null&&r.data&&(n.displayCards=r.data)}catch(n){console.error("Ошибка загрузки кэша групп:",n)}},_o=async t=>{const n=se(),r=On(),o=fe(),{stateCard:a,openProduct:i}=F.storeToRefs(o),{cartProducts_lib:s}=F.storeToRefs(n),l=s.value,c=[],d=[],u=a.value.openCard;for(const f of l)t(f)?(c.push(f),(f.id===(u==null?void 0:u.id)||u!=null&&u.adult)&&(i.value={id:null,visible:!1})):d.push(f);if(c.length>0){const f=c.map(m=>m.name).slice(0,3).join(", ");r.notificationData_lib.textNotification=`Некоторые позиции стали недоступны и были убраны из заказа: ${f}${c.length>3?` и ещё ${c.length-3}`:""}`,s.value=d,n.updateCartInLocalStorage()}},yf=async t=>{await _o(n=>{var r;return(r=n.groups)!=null&&r.length?!n.groups.some(o=>t.has(o)):!0})},bf=async(t,n)=>{const r=se(),o=new Set(t.filter(a=>!a.adult||r.is18Allowed).map(a=>a.id));await _o(a=>{var i;return(i=a.groups)!=null&&i.includes(n)?!o.has(a.id):!1})},go=async(t,n,r=!0)=>{if(t.video_link&&Xt(t.video_link,`${t.id}_video`,r),t.image_link&&Xt(t.image_link,`${t.id}_image`,r),n!=null&&n.length)for(const o of n)o.video_link&&Xt(o.video_link,`${o.id}_video`,r),o.image_link&&Xt(o.image_link,`${o.id}_image`,r)},Xt=async(t,n,r=!1)=>{try{const o=Vt();if(!r){const s=await lt(n);if(s){o.updateCacheFromBlob(n,s),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:s}}));return}}const a=await fetch(t);if(!a.ok)throw new Error("Network error");const i=await a.blob();if(i.size===0)throw new Error("Empty blob");await un(n,i),o.updateCacheFromBlob(n,i),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:i}}))}catch(o){console.warn(`[MediaCache] Failed for ${n}:`,o)}},wf=()=>{Ee&&(Ee.off("open"),Ee.off("message"),Ee.off("error"),Ee.off("close"),Ee.close(!0),Ee=null)},Cf={key:0,class:"valentine-hearts"},kf=e.defineComponent({__name:"FallingHearts",props:{symbols:{default:()=>["❤","♥","💕"]},max:{default:15},interval:{default:1500}},setup(t){const n=t,r=we.useDocumentVisibility(),o=we.useMediaQuery("(prefers-reduced-motion: reduce)"),a=e.ref([]);let i=null;const s=(u,f)=>Math.random()*(f-u)+u,l=()=>{if(o.value||a.value.length>=n.max)return;const u=n.symbols[Math.floor(Math.random()*n.symbols.length)],f=s(18,26),m=s(5,95),h=s(10,18),p=s(0,.3),y=s(.6,.9),b=Math.floor(s(1,6)),g={id:crypto.randomUUID(),icon:u,style:{left:`${m}%`,fontSize:`${f}px`,color:`rgba(255, 105, 180, ${y})`,animationName:`heartFall${b}`,animationDuration:`${h}s`,animationDelay:`${p}s`}};a.value.push(g);const S=setTimeout(()=>{a.value=a.value.filter(M=>M.id!==g.id),clearTimeout(S)},(p+h+1)*1e3)},c=()=>{if(!o.value){for(let u=0;u<3;u++){const f=setTimeout(()=>{l(),clearTimeout(f)},u*200)}i=setInterval(l,n.interval)}},d=()=>{i&&(clearInterval(i),i=null),a.value=[]};return e.onMounted(()=>{o.value||c()}),e.onUnmounted(()=>{d()}),e.watch(r,(u,f)=>{u==="visible"&&f==="hidden"&&c(),u==="hidden"&&f==="visible"&&d()}),(u,f)=>e.unref(o)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Cf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("span",{key:m.id,class:"heart",style:e.normalizeStyle(m.style)},e.toDisplayString(m.icon),5))),128))]))}}),Sf=["src"],Ef=e.defineComponent({__name:"BasketImage",props:{id:{},fallback:{}},setup(t){const n=t,{mediaUrl:r}=Ze(()=>n.id,()=>n.fallback);return(o,a)=>(e.openBlock(),e.createElementBlock("img",{src:e.unref(r)||""},null,8,Sf))}}),Nf={class:"button_price_bg"},vf={class:"wrapper_container_price_bg"},If={class:"button_price"},Bf={key:0,class:"image_product_container"},xf=e.defineComponent({__name:"BasketButton",emits:["goToCart"],setup(t){const n=se(),{totalPrice_lib:r,cartProducts_lib:o}=F.storeToRefs(n),a=e.computed(()=>{var i;return(i=o.value)!=null&&i.length,o.value.slice(0,3).map(s=>({id:`${s.id}_image`,fallback:s.image_link}))});return(i,s)=>(e.openBlock(),e.createElementBlock("div",Nf,[e.createElementVNode("div",vf,[e.createElementVNode("div",If,[e.unref(r)>0&&a.value.length>0?(e.openBlock(),e.createElementBlock("div",Bf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l.id,class:"filter_image_product"},[e.createVNode(Ef,{id:l.id,fallback:l.fallback,class:"img_product"},null,8,["id","fallback"])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"button_default_main",onClick:s[0]||(s[0]=l=>i.$emit("goToCart"))},[s[2]||(s[2]=e.createElementVNode("div",{class:"icont_cart"},null,-1)),e.createElementVNode("p",null,[e.createVNode(Ce,{price:e.unref(r),fixedFloat:2},null,8,["price"]),s[1]||(s[1]=e.createTextVNode(" ₽",-1))])])])])]))}}),It=null,{min:at,max:Le,abs:yo,floor:Af}=Math,bo=(t,n,r)=>at(r,Le(n,t)),wo=t=>[...t].sort((n,r)=>n-r),Mf=typeof queueMicrotask=="function"?queueMicrotask:t=>{Promise.resolve().then(t)},zn=()=>{let t;return[new Promise(n=>{t=n}),t]},Co=t=>{let n;return()=>(t&&(n=t(),t=void 0),n)},Bt=(t,n,r)=>{const o=r?"unshift":"push";for(let a=0;a<n;a++)t[o](-1);return t},ko=(t,n)=>{const r=t.t[n];return r===-1?t.o:r},Pf=(t,n,r)=>{const o=t.t[n]===-1;return t.t[n]=r,t.i=at(n,t.i),o},en=(t,n)=>{if(!t.l)return 0;if(t.i>=n)return t.u[n];t.i<0&&(t.u[0]=0,t.i=0);let r=t.i,o=t.u[r];for(;r<n;)o+=ko(t,r),t.u[++r]=o;return t.i=n,o},ht=(t,n,r=0,o=t.l-1)=>{let a=r;for(;r<=o;){const i=Af((r+o)/2);en(t,i)<=n?(a=i,r=i+1):o=i-1}return bo(a,0,t.l-1)},So=(t,n,r)=>{const o=n-t.l;return t.i=r?-1:at(n-1,t.i),t.l=n,o>0?(Bt(t.u,o),Bt(t.t,o,r),t.o*o):(t.u.splice(o),(r?t.t.splice(0,-o):t.t.splice(o)).reduce((a,i)=>a-(i===-1?t.o:i),0))},Tf=t=>t.documentElement,Rf=t=>t.ownerDocument,$f=t=>t.defaultView,Eo=Co(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>0),Vf=Co(()=>"scrollBehavior"in Tf(document).style),Df=(t,n=40,r=0,o,a=!1)=>{let i=!!r,s=1,l=0,c=0,d=0,u=0,f=0,m=0,h=0,p=0,y=It,b=[0,i?Le(r-1,0):-1],w=0,g=!1;const _=((T,x,C)=>({o:x,t:C?Bt(C.slice(0,at(T,C.length)),Le(0,T-C.length)):Bt([],T),l:T,i:-1,u:Bt([],T+1)}))(t,o?o[1]:n,o&&o[0]),S=new Set,M=()=>d-c,V=()=>M()+f+u,$=(T,x)=>((C,B,A,k)=>{if(k=at(k,C.l-1),en(C,k)<=B){const I=ht(C,A,k);return[ht(C,B,k,I),I]}{const I=ht(C,B,void 0,k);return[I,ht(C,A,I)]}})(_,T,x,b[0]),D=()=>en(_,_.l),E=(T,x)=>{const C=en(_,T)-f;return x?D()-C-N(T):C},N=T=>ko(_,T),P=(T,x=-1)=>_.t[T]===x,R=T=>{T&&(Eo()&&h!==0||y&&p===1?f+=T:u+=T)};return{p:()=>{S.clear()},h:()=>s,m:()=>(T=>[T.t.slice(),T.o])(_),v:(T=200)=>{if(!g||i)return b;let x,C;if(m)[x,C]=b;else{let B=Le(0,V()),A=B+l;a||(T=Le(0,T),h!==1&&(B-=T),h!==2&&(A+=T)),[x,C]=b=$(Le(0,B),Le(0,A)),y&&(x=at(x,y[0]),C=Le(C,y[1]))}return[Le(x,0),at(C,_.l-1)]},S:T=>ht(_,T-c),I:P,O:E,k:N,j:()=>_.l,N:()=>d,B:()=>h!==0,T:()=>l,q:()=>c,M:D,P:()=>(m=u,u=0,[m,p===2]),R:(T,x)=>{const C=[T,x];return S.add(C),()=>{S.delete(C)}},A:(T,x)=>{let C,B,A=0;switch(T){case 1:{if(x===d&&p===0)break;const k=m;m=0;const I=x-d,O=yo(I);k&&O<yo(k)+1||p!==0||(h=I<0?2:1),i&&(i=!1),d=x,A=4;const H=M();H>=-l&&H<=D()&&(A+=1,B=O>l);break}case 2:A=8,h!==0&&(C=!0,A+=1),h=0,p=0,y=It;break;case 3:{const k=x.filter(([I,O])=>!P(I,O));if(!k.length)break;R(k.reduce((I,[O,H])=>((p===2||(y&&p===1?O<y[0]:E(O+(h===0&&p===0?1:0))<M()))&&(I+=H-N(O)),I),0));for(const[I,O]of k){const H=N(I),W=Pf(_,I,O);a&&(w+=W?O:O-H)}a&&l&&w>l&&(R(((I,O)=>{let H=0;const W=[];I.t.forEach((pe,he)=>{pe!==-1&&(W.push(pe),he<O&&H++)}),I.i=-1;const j=wo(W),G=j.length,ee=G/2|0,Y=G%2==0?(j[ee-1]+j[ee])/2:j[ee],de=I.o;return((I.o=Y)-de)*Le(O-H,0)})(_,ht(_,V()))),a=!1),A=3,B=!0;break}case 4:l!==x&&(l||(g=B=!0),l=x,A=3);break;case 5:x[1]?(R(So(_,x[0],!0)),p=2,A=1):(So(_,x[0]),A=1);break;case 6:c=x;break;case 7:p=1;break;case 8:y=$(x,x+l),A=1}A&&(s=1+(2147483647&s),C&&f&&(u+=f,f=0),S.forEach(([k,I])=>{A&k&&I(B)}))}}},Ln=setTimeout,Fn=(t,n)=>n?-t:t,Of=(t,n,r,o,a,i)=>{const s=Date.now;let l=0,c=!1,d=!1,u=!1,f=!1;const m=(()=>{let w;const g=()=>{w!=It&&clearTimeout(w)},_=()=>{g(),w=Ln(()=>{w=It,(()=>{if(c||d)return c=!1,void m();u=!1,t.A(2)})()},150)};return _.C=g,_})(),h=()=>{l=s(),u&&(f=!0),t.A(1,o()),m()},p=w=>{if(c||!t.B()||w.ctrlKey)return;const g=s()-l;150>g&&50<g&&(r?w.deltaX:w.deltaY)&&(c=!0)},y=()=>{d=!0,u=f=!1},b=()=>{d=!1,Eo()&&(u=!0)};return n.addEventListener("scroll",h),n.addEventListener("wheel",p,{passive:!0}),n.addEventListener("touchstart",y,{passive:!0}),n.addEventListener("touchend",b,{passive:!0}),{H:()=>{n.removeEventListener("scroll",h),n.removeEventListener("wheel",p),n.removeEventListener("touchstart",y),n.removeEventListener("touchend",b),m.C()},V:()=>{const[w,g]=t.P();w&&(a(w,g,f),f=!1,g&&t.T()>t.M()&&t.A(1,o()))}}},zf=(t,n,r)=>{let o;return[async(a,i)=>{if(!await n())return;o&&o();const s=()=>{const[l,c]=zn();return o=()=>{c(!1)},t.T()&&Ln(o,150),[l,t.R(2,()=>{c(!0)})]};if(i&&Vf())t.A(8,a()),Mf(async()=>{for(;;){let l=!0;for(let[u,f]=t.v();u<=f;u++)if(t.I(u)){l=!1;break}if(l)break;const[c,d]=s();try{if(!await c)return}finally{d()}}t.A(7),r(a(),i)});else for(;;){const[l,c]=s();try{if(t.A(7),r(a()),!await l)return}finally{c()}}},()=>{o&&o()}]},Lf=t=>{let n;return{F(r){(n||(n=new($f(Rf(r))).ResizeObserver(t))).observe(r)},J(r){n.unobserve(r)},H(){n&&n.disconnect()}}},Ff=e.defineComponent({props:{L:{type:Object,required:!0},W:{type:Object,required:!0},X:{type:Object,required:!0},Y:{type:Function,required:!0},D:{type:Number,required:!0},U:{type:Boolean},G:{type:Boolean},K:{type:Boolean},Z:{type:String,required:!0},ee:Object},setup(t){const n=e.ref(),r=e.computed(()=>t.L.value&&t.W.O(t.D,t.K)),o=e.computed(()=>t.L.value&&t.W.I(t.D));return e.watch(()=>n.value&&t.D,(a,i,s)=>{s(t.Y(n.value,t.D))},{flush:"post"}),()=>{var a;const{X:i,U:s,G:l,Z:c}=t,d=o.value,{style:u,...f}=(a=t.ee)!==null&&a!==void 0?a:{},m={contain:"layout style",position:d&&l?void 0:"absolute",[s?"height":"width"]:"100%",[s?"top":"left"]:"0px",[s?"left":"top"]:r.value+"px",visibility:!d||l?void 0:"hidden",...u};return s&&(m.display="inline-flex"),e.createVNode(c,e.mergeProps({ref:n,style:m},f),typeof(h=i)=="function"||Object.prototype.toString.call(h)==="[object Object]"&&!e.isVNode(h)?i:{default:()=>[i],_:2},16,["style"]);var h}}}),Hf=(t,n)=>{const r=t.key;return r??"_"+n},Uf=(t,n)=>t[0]===n[0]&&t[1]===n[1],No=e.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,startMargin:{type:Number,default:0},ssrCount:Number,scrollRef:Object,as:{type:String,default:"div"},item:{type:String,default:"div"},itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(t,{emit:n,expose:r,slots:o}){let a=!!t.ssrCount;const i=t.horizontal,s=e.ref(),l=Df(t.data.length,t.itemSize,t.ssrCount,t.cache,!t.itemSize),c=((p,y)=>{let b;const w=y?"width":"height",g=new WeakMap,_=Lf(S=>{const M=[];for(const{target:V,contentRect:$}of S)if(V.offsetParent)if(V===b)p.A(4,$[w]);else{const D=g.get(V);D!=It&&M.push([D,$[w]])}M.length&&p.A(3,M)});return{te(S){_.F(b=S)},re:(S,M)=>(g.set(S,M),_.F(S),()=>{g.delete(S),_.J(S)}),p:_.H}})(l,i),d=((p,y)=>{let b,w,g=zn(),_=!1;const S=y?"scrollLeft":"scrollTop",M=y?"overflowX":"overflowY",[V,$]=zf(p,()=>g[0],(D,E)=>{D=Fn(D,_),E?b.scrollTo({[y?"left":"top"]:D,behavior:"smooth"}):b[S]=D});return{oe(D){b=D,y&&(_=getComputedStyle(D).direction==="rtl"),w=Of(p,D,y,()=>Fn(D[S],_),(E,N,P)=>{if(P){const R=D.style,T=R[M];R[M]="hidden",Ln(()=>{R[M]=T})}D[S]=Fn(p.N()+E,_),N&&$()}),g[1](!0)},p(){w&&w.H(),g[1](!1),g=zn()},ne:()=>_,se(D){V(()=>D)},ie(D){D+=p.N(),V(()=>D)},le(D,{align:E,smooth:N,offset:P=0}={}){if(D=bo(D,0,p.j()-1),E==="nearest"){const R=p.O(D),T=p.N();if(R<T)E="start";else{if(!(R+p.k(D)>T+p.T()))return;E="end"}}V(()=>P+p.q()+p.O(D)+(E==="end"?p.k(D)-p.T():E==="center"?(p.k(D)-p.T())/2:0),N)},ce:()=>{w&&w.V()}}})(l,i),u=e.ref(l.h());l.R(1,()=>{u.value=l.h()}),l.R(4,()=>{n("scroll",l.N())}),l.R(8,()=>{n("scrollEnd")});const f=e.computed(p=>{u.value;const y=l.v(t.bufferSize);return p&&Uf(p,y)?p:y}),m=e.computed(()=>u.value&&l.B()),h=e.computed(()=>u.value&&l.M());return e.onMounted(()=>{a=!1;const p=requestAnimationFrame(()=>{const y=b=>{c.te(b),d.oe(b)};t.scrollRef?y(t.scrollRef):y(s.value.parentElement)});e.onUnmounted(()=>{cancelAnimationFrame(p)})}),e.onUnmounted(()=>{l.p(),c.p(),d.p()}),e.watch(()=>t.data.length,p=>{l.A(5,[p,t.shift])}),e.watch(()=>t.startMargin,p=>{l.A(6,p)},{immediate:!0}),e.watch([u],()=>{d.ce()},{flush:"post"}),r({get cache(){return l.m()},get scrollOffset(){return l.N()},get scrollSize(){return(p=>Le(p.M(),p.T()))(l)},get viewportSize(){return l.T()},findItemIndex:l.S,getItemOffset:l.O,getItemSize:l.k,scrollToIndex:d.le,scrollTo:d.se,scrollBy:d.ie}),()=>{const p=t.as,y=t.item,b=h.value,w=d.ne(),g=!i&&w?"unshift":"push",_=[],S=V=>{var $;const D=o.default({item:t.data[V],index:V})[0];return e.createVNode(Ff,{key:Hf(D,V),L:u,W:l,Y:c.re,D:V,X:D,U:i,K:w,G:a,Z:y,ee:($=t.itemProps)===null||$===void 0?void 0:$.call(t,{item:t.data[V],index:V})},null,8,["L","W","Y","D","X","U","K","G","Z","ee"])};if(t.keepMounted){const V=new Set(t.keepMounted);for(let[$,D]=f.value;$<=D;$++)V.add($);wo([...V]).forEach($=>{_[g](S($))})}else for(let[V,$]=f.value;V<=$;V++)_[g](S(V));return e.createVNode(p,{ref:s,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:i?b+"px":"100%",height:i?"100%":b+"px",pointerEvents:m.value?"none":void 0}},typeof(M=_)=="function"||Object.prototype.toString.call(M)==="[object Object]"&&!e.isVNode(M)?_:{default:()=>[_],_:2},8,["style"]);var M}}}),qf=e.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,ssrCount:Number,itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(t,{emit:n,expose:r,slots:o}){const a=t.horizontal,i=c=>{n("scroll",c)},s=()=>{n("scrollEnd")},l=e.ref();return r({get cache(){return l.value.cache},get scrollOffset(){return l.value.scrollOffset},get scrollSize(){return l.value.scrollSize},get viewportSize(){return l.value.viewportSize},findItemIndex:(...c)=>l.value.findItemIndex(...c),getItemOffset:(...c)=>l.value.getItemOffset(...c),getItemSize:(...c)=>l.value.getItemSize(...c),scrollToIndex:(...c)=>l.value.scrollToIndex(...c),scrollTo:(...c)=>l.value.scrollTo(...c),scrollBy:(...c)=>l.value.scrollBy(...c)}),()=>{return e.createVNode("div",{style:{display:a?"inline-block":"block",[a?"overflowX":"overflowY"]:"auto",contain:"strict",width:"100%",height:"100%"}},[e.createVNode(No,{ref:l,data:t.data,bufferSize:t.bufferSize,itemSize:t.itemSize,itemProps:t.itemProps,shift:t.shift,ssrCount:t.ssrCount,horizontal:a,keepMounted:t.keepMounted,cache:t.cache,onScroll:i,onScrollEnd:s},(c=o,typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!e.isVNode(c)?o:{default:()=>[o],_:2}),8,["data","bufferSize","itemSize","itemProps","shift","ssrCount","horizontal","keepMounted","cache","onScroll","onScrollEnd"])],4);var c}}}),jf=(t,n=10)=>new Promise(r=>{let o=0,a=0,i=0;const s=()=>{const l=t.scrollSize;l===i&&l>0?o++:(o=0)&&(i=l),a++,o>=2||a>=n?r():requestAnimationFrame(s)};requestAnimationFrame(s)});function Wf(t,n){const r=(n==null?void 0:n.align)??"start";let o=!1;const a=e.ref(null),i=e.ref(!1),s=e.ref("measure"),l=e.computed(()=>e.toValue(t).length),c=e.computed(()=>s.value==="measure"?1:5),d=e.computed(()=>Array.from({length:l.value*c.value},(b,w)=>w)),u=async()=>{if(a.value&&(s.value="measure",o=!1,i.value=!1,await e.nextTick(),s.value==="measure")){if(await jf(a.value),i.value=a.value.scrollSize>a.value.viewportSize,!i.value){o=!1;return}o=!0,s.value="loop",await e.nextTick(),a.value.scrollToIndex(l.value*3,{align:r})}},f=b=>s.value==="measure"?b:l.value===0?0:b%l.value,m=(b,w)=>{a.value&&a.value.scrollToIndex(b,w)},h=(b,w)=>!o||s.value!=="loop"?w:w+Math.round((b-w)/l.value)*l.value,p=b=>{if(!o||s.value!=="loop"||!a.value)return;const w=l.value-1,g=l.value*4;if(b<w)return m(l.value*3-1,{align:"start"});if(b>=g)return m(l.value*3,{align:"start"})},y=()=>{if(!a.value||!o)return;const b=a.value.findItemIndex(a.value.scrollOffset);p(b)};return e.onMounted(u),e.onUnmounted(()=>a.value=null),e.watch(l,()=>e.nextTick(u)),{listRef:a,items:d,hasScroll:i,realIndex:f,findNearestIndex:h,scrollToIndex:m,init:u,onScroll:y}}const Gf={pinch:!0,doubleTap:!0,wheel:!0,buttons:["+","-","=","0"]},Kf=t=>{var r;const n=Object.assign({},Gf,t);if(n.pinch&&(document.addEventListener("touchstart",o=>o.touches.length>1&&o.preventDefault(),{passive:!1}),document.addEventListener("gesturestart",o=>o.preventDefault(),{passive:!1})),n.doubleTap){let o=0;document.addEventListener("touchend",a=>{const i=Date.now();i-o<=250&&a.preventDefault(),o=i},{passive:!1})}n.wheel&&document.addEventListener("wheel",o=>(o.ctrlKey||o.metaKey)&&o.preventDefault(),{passive:!1}),(r=n.buttons)!=null&&r.length&&document.addEventListener("keydown",o=>(o.ctrlKey||o.metaKey)&&n.buttons.includes(o.key)&&o.preventDefault())};Object.defineProperty(L,"useRoute",{enumerable:!0,get:()=>K.useRoute}),Object.defineProperty(L,"useRouter",{enumerable:!0,get:()=>K.useRouter}),L.BasketButton=xf,L.BottomSheet=Pn,L.ButtonDefault=Re,L.CardMain=mo,L.CardProductPage=Vl,L.CardReader=ao,L.CartBox=oo,L.CartPage=wu,L.DrumItem=Yu,L.FallingHearts=kf,L.GroupMain=Wu,L.InitConnection=qe,L.ModalWindows=uf,L.NotificationWindow=An,L.PopupWindowDefault=ro,L.PricePrerender=ct,L.Recommendation=sf,L.RetryPage=Mu,L.TagsMain=Ku,L.VList=qf,L.Virtualizer=No,L.clearAllProductDB=Ko,L.clearLocalStorage=dt,L.getCachedGroup=dn,L.getCachedProduct=Xn,L.getWebSocketInstance=Ot,L.initPinia=Ao,L.initRouter=Po,L.preventZoom=Kf,L.updateIndexedDB=_f,L.useCachedMedia=Ze,L.useCardLibStore=fe,L.useCartLibStore=ue,L.useImageCacheStore=Vt,L.useMainLibStore=se,L.useModal=fo,L.useModalStore=Tn,L.useModulesLibStore=On,L.useThemeStore=ge,L.useVirtuaLoop=Wf,L.vClickOutside=ff,L.vMuted=vt,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
11
+ */var je=function(){return je=Object.assign||function(n){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n},je.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;var ot;(function(t){var n=function(){function s(l,c,d,u){if(this.version=l,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],l<s.MIN_VERSION||l>s.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=l*4+17;for(var f=[],m=0;m<this.size;m++)f.push(!1);for(var m=0;m<this.size;m++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();var h=this.addEccAndInterleave(d);if(this.drawCodewords(h),u==-1)for(var p=1e9,m=0;m<8;m++){this.applyMask(m),this.drawFormatBits(m);var y=this.getPenaltyScore();y<p&&(u=m,p=y),this.applyMask(m)}a(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),this.isFunction=[]}return s.encodeText=function(l,c){var d=t.QrSegment.makeSegments(l);return s.encodeSegments(d,c)},s.encodeBinary=function(l,c){var d=t.QrSegment.makeBytes(l);return s.encodeSegments([d],c)},s.encodeSegments=function(l,c,d,u,f,m){if(d===void 0&&(d=1),u===void 0&&(u=40),f===void 0&&(f=-1),m===void 0&&(m=!0),!(s.MIN_VERSION<=d&&d<=u&&u<=s.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");var h,p;for(h=d;;h++){var y=s.getNumDataCodewords(h,c)*8,b=i.getTotalBits(l,h);if(b<=y){p=b;break}if(h>=u)throw new RangeError("Data too long")}for(var w=0,g=[s.Ecc.MEDIUM,s.Ecc.QUARTILE,s.Ecc.HIGH];w<g.length;w++){var _=g[w];m&&p<=s.getNumDataCodewords(h,_)*8&&(c=_)}for(var S=[],P=0,V=l;P<V.length;P++){var $=V[P];r($.mode.modeBits,4,S),r($.numChars,$.mode.numCharCountBits(h),S);for(var D=0,E=$.getData();D<E.length;D++){var N=E[D];S.push(N)}}a(S.length==p);var M=s.getNumDataCodewords(h,c)*8;a(S.length<=M),r(0,Math.min(4,M-S.length),S),r(0,(8-S.length%8)%8,S),a(S.length%8==0);for(var R=236;S.length<M;R^=253)r(R,8,S);for(var T=[];T.length*8<S.length;)T.push(0);return S.forEach(function(x,k){return T[k>>>3]|=x<<7-(k&7)}),new s(h,c,T,f)},s.prototype.getModule=function(l,c){return 0<=l&&l<this.size&&0<=c&&c<this.size&&this.modules[c][l]},s.prototype.getModules=function(){return this.modules},s.prototype.drawFunctionPatterns=function(){for(var l=0;l<this.size;l++)this.setFunctionModule(6,l,l%2==0),this.setFunctionModule(l,6,l%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);for(var c=this.getAlignmentPatternPositions(),d=c.length,l=0;l<d;l++)for(var u=0;u<d;u++)l==0&&u==0||l==0&&u==d-1||l==d-1&&u==0||this.drawAlignmentPattern(c[l],c[u]);this.drawFormatBits(0),this.drawVersion()},s.prototype.drawFormatBits=function(l){for(var c=this.errorCorrectionLevel.formatBits<<3|l,d=c,u=0;u<10;u++)d=d<<1^(d>>>9)*1335;var f=(c<<10|d)^21522;a(f>>>15==0);for(var u=0;u<=5;u++)this.setFunctionModule(8,u,o(f,u));this.setFunctionModule(8,7,o(f,6)),this.setFunctionModule(8,8,o(f,7)),this.setFunctionModule(7,8,o(f,8));for(var u=9;u<15;u++)this.setFunctionModule(14-u,8,o(f,u));for(var u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,o(f,u));for(var u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,o(f,u));this.setFunctionModule(8,this.size-8,!0)},s.prototype.drawVersion=function(){if(!(this.version<7)){for(var l=this.version,c=0;c<12;c++)l=l<<1^(l>>>11)*7973;var d=this.version<<12|l;a(d>>>18==0);for(var c=0;c<18;c++){var u=o(d,c),f=this.size-11+c%3,m=Math.floor(c/3);this.setFunctionModule(f,m,u),this.setFunctionModule(m,f,u)}}},s.prototype.drawFinderPattern=function(l,c){for(var d=-4;d<=4;d++)for(var u=-4;u<=4;u++){var f=Math.max(Math.abs(u),Math.abs(d)),m=l+u,h=c+d;0<=m&&m<this.size&&0<=h&&h<this.size&&this.setFunctionModule(m,h,f!=2&&f!=4)}},s.prototype.drawAlignmentPattern=function(l,c){for(var d=-2;d<=2;d++)for(var u=-2;u<=2;u++)this.setFunctionModule(l+u,c+d,Math.max(Math.abs(u),Math.abs(d))!=1)},s.prototype.setFunctionModule=function(l,c,d){this.modules[c][l]=d,this.isFunction[c][l]=!0},s.prototype.addEccAndInterleave=function(l){var c=this.version,d=this.errorCorrectionLevel;if(l.length!=s.getNumDataCodewords(c,d))throw new RangeError("Invalid argument");for(var u=s.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][c],f=s.ECC_CODEWORDS_PER_BLOCK[d.ordinal][c],m=Math.floor(s.getNumRawDataModules(c)/8),h=u-m%u,p=Math.floor(m/u),y=[],b=s.reedSolomonComputeDivisor(f),w=0,g=0;w<u;w++){var _=l.slice(g,g+p-f+(w<h?0:1));g+=_.length;var S=s.reedSolomonComputeRemainder(_,b);w<h&&_.push(0),y.push(_.concat(S))}for(var P=[],V=function($){y.forEach(function(D,E){($!=p-f||E>=h)&&P.push(D[$])})},w=0;w<y[0].length;w++)V(w);return a(P.length==m),P},s.prototype.drawCodewords=function(l){if(l.length!=Math.floor(s.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");for(var c=0,d=this.size-1;d>=1;d-=2){d==6&&(d=5);for(var u=0;u<this.size;u++)for(var f=0;f<2;f++){var m=d-f,h=(d+1&2)==0,p=h?this.size-1-u:u;!this.isFunction[p][m]&&c<l.length*8&&(this.modules[p][m]=o(l[c>>>3],7-(c&7)),c++)}}a(c==l.length*8)},s.prototype.applyMask=function(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(var c=0;c<this.size;c++)for(var d=0;d<this.size;d++){var u=void 0;switch(l){case 0:u=(d+c)%2==0;break;case 1:u=c%2==0;break;case 2:u=d%3==0;break;case 3:u=(d+c)%3==0;break;case 4:u=(Math.floor(d/3)+Math.floor(c/2))%2==0;break;case 5:u=d*c%2+d*c%3==0;break;case 6:u=(d*c%2+d*c%3)%2==0;break;case 7:u=((d+c)%2+d*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][d]&&u&&(this.modules[c][d]=!this.modules[c][d])}},s.prototype.getPenaltyScore=function(){for(var l=0,c=0;c<this.size;c++){for(var d=!1,u=0,f=[0,0,0,0,0,0,0],m=0;m<this.size;m++)this.modules[c][m]==d?(u++,u==5?l+=s.PENALTY_N1:u>5&&l++):(this.finderPenaltyAddHistory(u,f),d||(l+=this.finderPenaltyCountPatterns(f)*s.PENALTY_N3),d=this.modules[c][m],u=1);l+=this.finderPenaltyTerminateAndCount(d,u,f)*s.PENALTY_N3}for(var m=0;m<this.size;m++){for(var d=!1,h=0,f=[0,0,0,0,0,0,0],c=0;c<this.size;c++)this.modules[c][m]==d?(h++,h==5?l+=s.PENALTY_N1:h>5&&l++):(this.finderPenaltyAddHistory(h,f),d||(l+=this.finderPenaltyCountPatterns(f)*s.PENALTY_N3),d=this.modules[c][m],h=1);l+=this.finderPenaltyTerminateAndCount(d,h,f)*s.PENALTY_N3}for(var c=0;c<this.size-1;c++)for(var m=0;m<this.size-1;m++){var p=this.modules[c][m];p==this.modules[c][m+1]&&p==this.modules[c+1][m]&&p==this.modules[c+1][m+1]&&(l+=s.PENALTY_N2)}for(var y=0,b=0,w=this.modules;b<w.length;b++){var g=w[b];y=g.reduce(function(P,V){return P+(V?1:0)},y)}var _=this.size*this.size,S=Math.ceil(Math.abs(y*20-_*10)/_)-1;return a(0<=S&&S<=9),l+=S*s.PENALTY_N4,a(0<=l&&l<=2568888),l},s.prototype.getAlignmentPatternPositions=function(){if(this.version==1)return[];for(var l=Math.floor(this.version/7)+2,c=Math.floor((this.version*8+l*3+5)/(l*4-4))*2,d=[6],u=this.size-7;d.length<l;u-=c)d.splice(1,0,u);return d},s.getNumRawDataModules=function(l){if(l<s.MIN_VERSION||l>s.MAX_VERSION)throw new RangeError("Version number out of range");var c=(16*l+128)*l+64;if(l>=2){var d=Math.floor(l/7)+2;c-=(25*d-10)*d-55,l>=7&&(c-=36)}return a(208<=c&&c<=29648),c},s.getNumDataCodewords=function(l,c){return Math.floor(s.getNumRawDataModules(l)/8)-s.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l]*s.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l]},s.reedSolomonComputeDivisor=function(l){if(l<1||l>255)throw new RangeError("Degree out of range");for(var c=[],d=0;d<l-1;d++)c.push(0);c.push(1);for(var u=1,d=0;d<l;d++){for(var f=0;f<c.length;f++)c[f]=s.reedSolomonMultiply(c[f],u),f+1<c.length&&(c[f]^=c[f+1]);u=s.reedSolomonMultiply(u,2)}return c},s.reedSolomonComputeRemainder=function(l,c){for(var d=c.map(function(p){return 0}),u=function(p){var y=p^d.shift();d.push(0),c.forEach(function(b,w){return d[w]^=s.reedSolomonMultiply(b,y)})},f=0,m=l;f<m.length;f++){var h=m[f];u(h)}return d},s.reedSolomonMultiply=function(l,c){if(l>>>8||c>>>8)throw new RangeError("Byte out of range");for(var d=0,u=7;u>=0;u--)d=d<<1^(d>>>7)*285,d^=(c>>>u&1)*l;return a(d>>>8==0),d},s.prototype.finderPenaltyCountPatterns=function(l){var c=l[1];a(c<=this.size*3);var d=c>0&&l[2]==c&&l[3]==c*3&&l[4]==c&&l[5]==c;return(d&&l[0]>=c*4&&l[6]>=c?1:0)+(d&&l[6]>=c*4&&l[0]>=c?1:0)},s.prototype.finderPenaltyTerminateAndCount=function(l,c,d){return l&&(this.finderPenaltyAddHistory(c,d),c=0),c+=this.size,this.finderPenaltyAddHistory(c,d),this.finderPenaltyCountPatterns(d)},s.prototype.finderPenaltyAddHistory=function(l,c){c[0]==0&&(l+=this.size),c.pop(),c.unshift(l)},s.MIN_VERSION=1,s.MAX_VERSION=40,s.PENALTY_N1=3,s.PENALTY_N2=3,s.PENALTY_N3=40,s.PENALTY_N4=10,s.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],s.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],s}();t.QrCode=n;function r(s,l,c){if(l<0||l>31||s>>>l)throw new RangeError("Value out of range");for(var d=l-1;d>=0;d--)c.push(s>>>d&1)}function o(s,l){return(s>>>l&1)!=0}function a(s){if(!s)throw new Error("Assertion error")}var i=function(){function s(l,c,d){if(this.mode=l,this.numChars=c,this.bitData=d,c<0)throw new RangeError("Invalid argument");this.bitData=d.slice()}return s.makeBytes=function(l){for(var c=[],d=0,u=l;d<u.length;d++){var f=u[d];r(f,8,c)}return new s(s.Mode.BYTE,l.length,c)},s.makeNumeric=function(l){if(!s.isNumeric(l))throw new RangeError("String contains non-numeric characters");for(var c=[],d=0;d<l.length;){var u=Math.min(l.length-d,3);r(parseInt(l.substring(d,d+u),10),u*3+1,c),d+=u}return new s(s.Mode.NUMERIC,l.length,c)},s.makeAlphanumeric=function(l){if(!s.isAlphanumeric(l))throw new RangeError("String contains unencodable characters in alphanumeric mode");var c=[],d;for(d=0;d+2<=l.length;d+=2){var u=s.ALPHANUMERIC_CHARSET.indexOf(l.charAt(d))*45;u+=s.ALPHANUMERIC_CHARSET.indexOf(l.charAt(d+1)),r(u,11,c)}return d<l.length&&r(s.ALPHANUMERIC_CHARSET.indexOf(l.charAt(d)),6,c),new s(s.Mode.ALPHANUMERIC,l.length,c)},s.makeSegments=function(l){return l==""?[]:s.isNumeric(l)?[s.makeNumeric(l)]:s.isAlphanumeric(l)?[s.makeAlphanumeric(l)]:[s.makeBytes(s.toUtf8ByteArray(l))]},s.makeEci=function(l){var c=[];if(l<0)throw new RangeError("ECI assignment value out of range");if(l<128)r(l,8,c);else if(l<16384)r(2,2,c),r(l,14,c);else if(l<1e6)r(6,3,c),r(l,21,c);else throw new RangeError("ECI assignment value out of range");return new s(s.Mode.ECI,0,c)},s.isNumeric=function(l){return s.NUMERIC_REGEX.test(l)},s.isAlphanumeric=function(l){return s.ALPHANUMERIC_REGEX.test(l)},s.prototype.getData=function(){return this.bitData.slice()},s.getTotalBits=function(l,c){for(var d=0,u=0,f=l;u<f.length;u++){var m=f[u],h=m.mode.numCharCountBits(c);if(m.numChars>=1<<h)return 1/0;d+=4+h+m.bitData.length}return d},s.toUtf8ByteArray=function(l){l=encodeURI(l);for(var c=[],d=0;d<l.length;d++)l.charAt(d)!="%"?c.push(l.charCodeAt(d)):(c.push(parseInt(l.substring(d+1,d+3),16)),d+=2);return c},s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",s}();t.QrSegment=i})(ot||(ot={})),function(t){(function(n){var r=function(){function o(a,i){this.ordinal=a,this.formatBits=i}return o.LOW=new o(0,1),o.MEDIUM=new o(1,0),o.QUARTILE=new o(2,3),o.HIGH=new o(3,2),o}();n.Ecc=r})(t.QrCode||(t.QrCode={}))}(ot||(ot={})),function(t){(function(n){var r=function(){function o(a,i){this.modeBits=a,this.numBitsCharCount=i}return o.prototype.numCharCountBits=function(a){return this.numBitsCharCount[Math.floor((a+7)/17)]},o.NUMERIC=new o(1,[10,12,14]),o.ALPHANUMERIC=new o(2,[9,11,13]),o.BYTE=new o(4,[8,16,16]),o.KANJI=new o(8,[8,10,12]),o.ECI=new o(7,[0,0,0]),o}();n.Mode=r})(t.QrSegment||(t.QrSegment={}))}(ot||(ot={}));var pt=ot,Rn="L",$n={L:pt.QrCode.Ecc.LOW,M:pt.QrCode.Ecc.MEDIUM,Q:pt.QrCode.Ecc.QUARTILE,H:pt.QrCode.Ecc.HIGH},Hc=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function Vn(t){return t in $n}function lo(t,n){n===void 0&&(n=0);var r=[];return t.forEach(function(o,a){var i=null;o.forEach(function(s,l){if(!s&&i!==null){r.push("M".concat(i+n," ").concat(a+n,"h").concat(l-i,"v1H").concat(i+n,"z")),i=null;return}if(l===o.length-1){if(!s)return;i===null?r.push("M".concat(l+n,",").concat(a+n," h1v1H").concat(l+n,"z")):r.push("M".concat(i+n,",").concat(a+n," h").concat(l+1-i,"v1H").concat(i+n,"z"));return}s&&i===null&&(i=l)})}),r.join("")}function co(t,n,r,o){var a=o.width,i=o.height,s=o.x,l=o.y,c=t.length+r*2,d=Math.floor(n*.1),u=c/n,f=(a||d)*u,m=(i||d)*u,h=s==null?t.length/2-f/2:s*u,p=l==null?t.length/2-m/2:l*u,y=null;if(o.excavate){var b=Math.floor(h),w=Math.floor(p),g=Math.ceil(f+h-b),_=Math.ceil(m+p-w);y={x:b,y:w,w:g,h:_}}return{x:h,y:p,h:m,w:f,excavation:y}}function uo(t,n){return t.slice().map(function(r,o){return o<n.y||o>=n.y+n.h?r:r.map(function(a,i){return i<n.x||i>=n.x+n.w?a:!1})})}var Dn={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:Rn,validator:function(t){return Vn(t)}},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},margin:{type:Number,required:!1,default:0},imageSettings:{type:Object,required:!1,default:function(){return{}}},gradient:{type:Boolean,required:!1,default:!1},gradientType:{type:String,required:!1,default:"linear",validator:function(t){return["linear","radial"].indexOf(t)>-1}},gradientStartColor:{type:String,required:!1,default:"#000"},gradientEndColor:{type:String,required:!1,default:"#fff"}},Uc=je(je({},Dn),{renderAs:{type:String,required:!1,default:"canvas",validator:function(t){return["canvas","svg"].indexOf(t)>-1}}}),qc=e.defineComponent({name:"QRCodeSvg",props:Dn,setup:function(t){var n=e.ref(0),r=e.ref(""),o,a=function(){var s=t.value,l=t.level,c=t.margin,d=c>>>0,u=Vn(l)?l:Rn,f=pt.QrCode.encodeText(s,$n[u]).getModules();if(n.value=f.length+d*2,t.imageSettings.src){var m=co(f,t.size,d,t.imageSettings);o={x:m.x+d,y:m.y+d,width:m.w,height:m.h},m.excavation&&(f=uo(f,m.excavation))}r.value=lo(f,d)},i=function(){if(!t.gradient)return null;var s=t.gradientType==="linear"?{x1:"0%",y1:"0%",x2:"100%",y2:"100%"}:{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"};return e.h(t.gradientType==="linear"?"linearGradient":"radialGradient",je({id:"qr-gradient"},s),[e.h("stop",{offset:"0%",style:{stopColor:t.gradientStartColor}}),e.h("stop",{offset:"100%",style:{stopColor:t.gradientEndColor}})])};return a(),e.onUpdated(a),function(){return e.h("svg",{width:t.size,height:t.size,"shape-rendering":"crispEdges",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(n.value," ").concat(n.value)},[e.h("defs",{},[i()]),e.h("rect",{width:"100%",height:"100%",fill:t.background}),e.h("path",{fill:t.gradient?"url(#qr-gradient)":t.foreground,d:r.value}),t.imageSettings.src&&e.h("image",je({href:t.imageSettings.src},o))])}}}),jc=e.defineComponent({name:"QRCodeCanvas",props:Dn,setup:function(t,n){var r=e.ref(null),o=e.ref(null),a=function(){var s=t.value,l=t.level,c=t.size,d=t.margin,u=t.background,f=t.foreground,m=t.gradient,h=t.gradientType,p=t.gradientStartColor,y=t.gradientEndColor,b=d>>>0,w=Vn(l)?l:Rn,g=r.value;if(g){var _=g.getContext("2d");if(_){var S=pt.QrCode.encodeText(s,$n[w]).getModules(),P=S.length+b*2,V=o.value,$={x:0,y:0,width:0,height:0},D=t.imageSettings.src&&V!=null&&V.naturalWidth!==0&&V.naturalHeight!==0;if(D){var E=co(S,t.size,b,t.imageSettings);$={x:E.x+b,y:E.y+b,width:E.w,height:E.h},E.excavation&&(S=uo(S,E.excavation))}var N=window.devicePixelRatio||1,M=c/P*N;if(g.height=g.width=c*N,_.scale(M,M),_.fillStyle=u,_.fillRect(0,0,P,P),m){var R=void 0;h==="linear"?R=_.createLinearGradient(0,0,P,P):R=_.createRadialGradient(P/2,P/2,0,P/2,P/2,P/2),R.addColorStop(0,p),R.addColorStop(1,y),_.fillStyle=R}else _.fillStyle=f;Hc?_.fill(new Path2D(lo(S,b))):S.forEach(function(T,x){T.forEach(function(k,B){k&&_.fillRect(B+b,x+b,1,1)})}),D&&_.drawImage(V,$.x,$.y,$.width,$.height)}}};e.onMounted(a),e.onUpdated(a);var i=n.attrs.style;return function(){return e.h(e.Fragment,[e.h("canvas",je(je({},n.attrs),{ref:r,style:je(je({},i),{width:"".concat(t.size,"px"),height:"".concat(t.size,"px")})})),t.imageSettings.src&&e.h("img",{ref:o,src:t.imageSettings.src,style:{display:"none"},onLoad:a})])}}}),Wc=e.defineComponent({name:"Qrcode",render:function(){var t=this.$props,n=t.renderAs,r=t.value,o=t.size,a=t.margin,i=t.level,s=t.background,l=t.foreground,c=t.imageSettings,d=t.gradient,u=t.gradientType,f=t.gradientStartColor,m=t.gradientEndColor;return e.h(n==="svg"?qc:jc,{value:r,size:o,margin:a,level:i,background:s,foreground:l,imageSettings:c,gradient:d,gradientType:u,gradientStartColor:f,gradientEndColor:m})},props:Uc});const Gc={},Kc={viewBox:"0 0 24 24","aria-hidden":"true"};function Zc(t,n){return e.openBlock(),e.createElementBlock("svg",Kc,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M7 4h10a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z"},null,-1),e.createElementVNode("path",{d:"M9 7h6"},null,-1),e.createElementVNode("path",{d:"M10 18h4"},null,-1)])])}const Qc=X(Gc,[["render",Zc]]),Jc={},Yc={viewBox:"0 0 24 24","aria-hidden":"true"};function Xc(t,n){return e.openBlock(),e.createElementBlock("svg",Yc,[...n[0]||(n[0]=[e.createStaticVNode('<path d="M4 8V6a2 2 0 0 1 2-2h2"></path><path d="M20 8V6a2 2 0 0 0-2-2h-2"></path><path d="M4 16v2a2 2 0 0 0 2 2h2"></path><path d="M20 16v2a2 2 0 0 1-2 2h-2"></path><path d="M7 12h10"></path>',5)])])}const ed=X(Jc,[["render",Xc]]),td="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2019.6108%2014.0107'%20width='19.610840'%20height='14.010742'%20fill='none'%20customFrame='%23000000'%3e%3cpath%20id='Форма%20'%20d='M18.3054%201.30566L6.61792%2012.639L1.30542%207.48747'%20stroke='rgb(255,255,255)'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2.5999999'/%3e%3c/svg%3e",nd={class:"wrapper_qr_page"},rd=["src"],od={class:"modal_qr"},ad={class:"modal_qr_content"},sd={class:"wrapper_icon_qr"},id=["src"],ld={class:"total_order_price"},cd={class:"ttl_wrapper"},dd={class:"ttl_head"},ud={class:"ttl_bar"},fd={class:"hint hint-anim","aria-label":"Инструкция по оплате"},md={class:"steps","aria-hidden":"true"},pd={class:"step is-active","data-i":"0"},hd={class:"ico"},_d={class:"step","data-i":"1"},gd={class:"ico"},yd={class:"step","data-i":"2"},bd={class:"ico"},wd=["src"],Cd={class:"qr_border"},kd=X(e.defineComponent({__name:"CompletedQRCode",setup(t){const n=ge(),r=ue(),o=se(),a=Z.useRouter(),i={src:n.itemThemes.logo||"",width:60,height:60,excavate:!0},s=e.computed(()=>n.itemThemes.kiosk_qr_payment_timeout||60).value,l=e.ref(s);let c=0;const d=e.computed(()=>{const y=Math.floor(l.value/60),b=l.value%60;return`${y}:${b.toString().padStart(2,"0")}`}),u=e.computed(()=>l.value/s*100),f=e.computed(()=>r.paymentCostQR),m=()=>{l.value--,l.value<0&&(clearInterval(c),h())},h=()=>{o.removeFromLocalStorage(["cart","authTokensAccess","authTokensRefresh","user"]),sessionStorage.removeItem("is_adult"),a.replace({name:"home"}).then(()=>a.go(0))};e.onMounted(()=>{c=setInterval(m,1e3)}),e.onBeforeUnmount(()=>{clearInterval(c)});const{mediaUrl:p}=Ze(()=>n.itemThemes.kiosk_preloader?"preloader":null);return(y,b)=>(e.openBlock(),e.createElementBlock("div",nd,[(e.openBlock(),e.createElementBlock("video",{loop:"",autoplay:"",muted:"",playsinline:"",key:e.unref(p)},[e.createElementVNode("source",{src:e.unref(p)||"",type:"video/webm"},null,8,rd)])),b[7]||(b[7]=e.createElementVNode("div",{class:"start_img_black"},null,-1)),e.createElementVNode("div",od,[e.createElementVNode("div",ad,[e.createElementVNode("div",sd,[e.createElementVNode("img",{src:e.unref(io),width:"100",height:"100"},null,8,id)]),b[6]||(b[6]=e.createElementVNode("h1",null,"Оплата по QR",-1)),e.createElementVNode("p",ld,[e.createVNode(Ce,{price:f.value,fixedFloat:2},null,8,["price"]),e.createTextVNode(" "+e.toDisplayString(e.unref(o).config_lib.currency_symbol),1)]),e.createElementVNode("div",cd,[e.createElementVNode("div",dd,[b[0]||(b[0]=e.createElementVNode("span",null,"Срок жизни QR-кода",-1)),e.createElementVNode("b",null,e.toDisplayString(d.value),1)]),e.createElementVNode("div",ud,[e.createElementVNode("div",{class:"ttl_fill",style:e.normalizeStyle({width:`${u.value}%`})},null,4)])]),e.createElementVNode("p",fd,[e.createElementVNode("div",md,[e.createElementVNode("div",pd,[e.createElementVNode("div",hd,[e.createVNode(Qc)]),b[1]||(b[1]=e.createElementVNode("div",{class:"txt"},"Возьмите телефон →",-1))]),b[4]||(b[4]=e.createElementVNode("div",{class:"sep"},null,-1)),e.createElementVNode("div",_d,[e.createElementVNode("div",gd,[e.createVNode(ed)]),b[2]||(b[2]=e.createElementVNode("span",{class:"txt"},"Отсканируйте QR-код",-1))]),b[5]||(b[5]=e.createElementVNode("span",{class:"sep"},"→",-1)),e.createElementVNode("div",yd,[e.createElementVNode("div",bd,[e.createElementVNode("img",{src:e.unref(td),width:"30",height:"30"},null,8,wd)]),b[3]||(b[3]=e.createElementVNode("span",{class:"txt"},"Оплатите заказ",-1))])])]),e.createElementVNode("div",Cd,[e.createVNode(Wc,{value:e.unref(r).linkQR,size:200,level:"Q","render-as":"svg","image-settings":i},null,8,["value"])]),e.createVNode(Re,{textButtonDefault:"Отменить заказ",onClick:h,class:"cancel_order_btn"})])])]))}}),[["__scopeId","data-v-ee30ad5e"]]),Sd={key:0,class:"wrapper_qr"},Ed={key:1,class:"wrapper_qr"},Nd={key:2,class:"wrapper_qr"},vd={key:3,class:"wrapper_qr"},Id=X(e.defineComponent({__name:"CartCompletedOrder",props:{orderNumber:{}},setup(t){const n=ue(),r=ge(),{orderNumber:o,orderCompleted_lib:a}=F.storeToRefs(n),{mediaUrl:i}=Ze(()=>r.itemThemes.kiosk_preloader?"preloader":null);return(s,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)&&e.unref(a)===1?(e.openBlock(),e.createElementBlock("section",Sd,[e.createVNode(Dc)])):e.unref(a)&&e.unref(a)===2?(e.openBlock(),e.createElementBlock("section",Ed,[e.createVNode(Fc)])):e.createCommentVNode("",!0),e.unref(a)&&e.unref(a)===3?(e.openBlock(),e.createElementBlock("section",Nd,[e.createVNode(Rc,{orderNumber:e.unref(o),mediaUrl:e.unref(i)},null,8,["orderNumber","mediaUrl"])])):e.createCommentVNode("",!0),e.unref(a)&&e.unref(a)===4?(e.openBlock(),e.createElementBlock("section",vd,[e.createVNode(kd)])):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-3779e8ee"]]),Bd={},xd={class:"cart_loyal_qr",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Ad(t,n){return e.openBlock(),e.createElementBlock("svg",xd,[...n[0]||(n[0]=[e.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 Md=X(Bd,[["render",Ad]]),fo=t=>{const n=Tn(),r=l=>n.open(t,l),o=()=>n.close(t),a=n.state(t),i=e.computed({get:()=>a.value.visible,set:l=>l&&r()||o()}),s=e.computed(()=>a.value.context);return{visible:i,context:s,open:r,close:o}},Pd={class:"cart_deletion_modal_content"},Td={class:"cart_deletion_modal_title"},Rd={class:"cart_deletion_modal_footer"},$d=X(e.defineComponent({__name:"CartDeleteConfirm",emits:["confirm"],setup(t,{emit:n}){const r=n,{visible:o,context:a,close:i}=fo("cart-delete-confirm"),s=()=>{r("confirm",a.value.idSystem),i()};return(l,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(o)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_deletion_modal_overlay",onClick:c[1]||(c[1]=e.withModifiers((...d)=>e.unref(i)&&e.unref(i)(...d),["self"]))},[e.createElementVNode("div",Pd,[e.createElementVNode("div",Td,"Удалить "+e.toDisplayString(e.unref(a).name)+"?",1),c[2]||(c[2]=e.createElementVNode("div",{class:"cart_deletion_modal_body"},"Эта позиция будет полностью удалена из заказа.",-1)),e.createElementVNode("div",Rd,[e.createElementVNode("button",{class:"primary",onClick:s}," Удалить "),e.createElementVNode("button",{onClick:c[0]||(c[0]=(...d)=>e.unref(i)&&e.unref(i)(...d))},"Отмена")])])])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-018f66f3"]]),Vd={class:"cart_wrapper"},Dd={class:"cart_header_content"},Od={key:0,class:"cart_header_subwrapper"},zd={class:"cart_kso_button_wrapper"},Ld={key:0},Fd={key:0,class:"kso_btn_wrapper"},Hd=["src"],Ud={key:0,class:"cart_qr_button_wrapper"},qd={class:"cart_header_info"},jd={class:"cart_header_info"},Wd={class:"cart_header_info"},Gd={class:"cart_header_info"},Kd={key:0,class:"wrapper_comment"},Zd={class:"wrapper_limit_in_area"},Qd=["placeholder"],Jd={class:"limit_comment"},Yd={key:1,class:"wrapper_comment"},Xd={class:"wrapper_limit_in_area"},eu=["placeholder"],tu={class:"limit_comment"},nu={key:2},ru={class:"cart_cards"},ou={class:"cart_footer_wrapper"},au={key:0,class:"footer_title"},su=["disabled","max"],iu={key:1,class:"footer_sales"},lu=["max"],cu={class:"list_price"},du={key:0},uu={key:1},fu={key:2},mu={class:"accept_field"},pu={class:"accept_field"},hu={key:3},_u={class:"accept_field"},gu={class:"accept_field"},yu={class:"accept_field"},bu={key:3,class:"cart_min_order_notice"},wu={class:"wrapper_footer_cart_btn"},Cu=e.defineComponent({__name:"CartPage",props:{configPage:{},textPaymentBtn:{},config_qr:{type:Boolean}},setup(t){const n=qe.create();let r;const o=se(),a=ue(),i=ge(),s=t,{totalPrice_lib:l,countBonus:c,config_lib:d,cartProducts_lib:u,profile:f}=F.storeToRefs(o),{itemThemes:m}=F.storeToRefs(i),{textPaymentBtn_lib:h,isButtonDisabled:p,orderCompleted_lib:y,orderNumber:b,extraDiscount:w,is_notification_lib:g,discountBtn:_,is_paymentCart:S,providerTypes:P,notificationData_lib:V,selectedProvider:$,configPayment:D}=F.storeToRefs(a),E=Z.useRouter(),N=Z.useRoute(),M=e.useTemplateRef("stickerLoyality"),R=e.ref(!1),T=e.ref(!1),x=e.ref(""),k=e.ref(!1),B=e.ref(!1),A=e.ref(0),C=e.ref(0),I=e.ref(),O=e.computed(()=>s.configPage.qr_menu?"YOOKASSA_BASE":P.value[0].front_type),H=e.computed(()=>s.configPage.qr_menu?"YOOKASSA":P.value[0].type),{width:G}=we.useElementSize(M,{width:0,height:0},{box:"border-box"}),j=e.computed(()=>{const W={energy_amount:0,proteins_amount:0,fat_amount:0,carbohydrates_amount:0};return u.value.reduce((z,le)=>(z.energy_amount+=(le.energy_amount||0)*(le.amount||0),z.proteins_amount+=(le.proteins_amount||0)*(le.amount||0),z.fat_amount+=(le.fat_amount||0)*(le.amount||0),z.carbohydrates_amount+=(le.carbohydrates_amount||0)*(le.amount||0),z),W)}),K=e.computed(()=>{var W;if((W=m.value)!=null&&W.comments){const z=m.value.comments;return{fieldName:s.configPage.kiosk_menu?z.kiosk_comment_field_name:z.qr_comment_field_name,placeholder:s.configPage.kiosk_menu?z.kiosk_comment_field_placeholder:z.qr_comment_field_placeholder,show:s.configPage.kiosk_menu?z.kiosk_show_order_comment:z.qr_show_order_comment}}}),ee=we.computedAsync(async W=>{var Ye;const z=new AbortController;if(W(()=>z.abort()),!R.value||!((Ye=f.value)!=null&&Ye.balance))return 0;const le=await n.maxPayByBonuses(l.value,s.configPage.kiosk_menu,!!s.configPage.userData||!!f.value,z.signal);return le!=null&&le.by_bonuses?f.value.balance>le.by_bonuses?le.by_bonuses:f.value.balance:0},0,{shallow:!0}),Y=()=>E.push(`/${N.params.orgId}/`),de=W=>{["a","A","+","-",".",","].includes(W.key)&&W.preventDefault()},he=W=>{o.deleteItemFromCart(W),u.value.length===0&&(k.value=!1,B.value=!1)},_e=()=>{k.value=!k.value,x.value.length},ae=e.computed(()=>{var z;return(((z=m.value.cart_loyalty_button)==null?void 0:z.cart_loyalty_button_text)||"Программа лояльности").replace(/\S+/g,le=>le.length>15?le.slice(0,15)+"...":le)}),U=()=>{B.value=!B.value,x.value.length},ne=()=>{let W=Math.floor(c.value)||0;W>ee.value&&(W=ee.value),W!==c.value&&o.setBonus(W)};e.watchEffect(()=>{ne(),o.setBonus(l.value===0?0:Math.floor(c.value))});const ie=()=>u.value.map(W=>({id:W.id,front_item_id:W.idSystem,is_fake:!!W.is_fake,is_od_united_product:!!W.is_od_united_product,removals:W.removals??null,amount:W.amount,size:W.size,modifiers:W.modifiers??[],group_modifiers:W.group_modifiers??[]})),{makeCreateOrderRequest:me}=so(),Me=e.computed(()=>ie()),Hn=e.computed(()=>{const W=m.value.bonuses_button_name;if(W)return W.split("").length>15?W.slice(0,16)+"...":W}),Qf=async()=>{if(!f.value&&s.configPage.qr_menu){E.push(`/${N.params.orgId}/register`);return}if(s.configPage.qr_menu||P.value.length<=1){d.value.has_rms_discount&&!m.value.hide_discounts_calculate_button&&I!=null?(p.value=!0,await Et(I.value,H.value).then(W=>{const z=D.value;z&&(z.is_tableservice?Zr(z,null):W.url&&window.location.replace(W.url))})):($.value={front_type:O},await me(s.configPage,{paymentMethodId:O.value,items:Me.value,tableDataId:s.configPage.tableDataId,comment:x.value,isAuthorized:!!s.configPage.userData||!!f,signal:r==null?void 0:r.signal}));return}return S.value=!S.value},Jf=()=>{S.value=!1},Yf=async()=>{var le,Ye,At,Mt;w.value=0,p.value=!0;const W={items:[...ie()],table:((le=s.configPage)==null?void 0:le.tableDataId)||null,combos:[]},z=qe.create();r=new AbortController;try{T.value=!0;const oe=await z.calculateDiscount(W,s.configPage.kiosk_menu,!!s.configPage.userData||!!f.value,r.signal);if(!u.value)return;if(u.value.forEach(ve=>{const Xe=oe.items.find(Pe=>Pe.front_item_id===ve.idSystem);if(Xe&&(ve.group_modifiers.forEach(Pe=>{const Ie=Xe.group_modifiers.find(Be=>Be.group===Pe.group);Ie&&Pe.modifiers.forEach(Be=>{const Fe=Ie.modifiers.find(Pt=>Pt.id===Be.id);if(Fe&&Number(Be.price)!==Number(Fe==null?void 0:Fe.new_price)){const Pt=(Fe.discounts||[]).reduce((nm,rm)=>nm+=+rm.discount,0);A.value+=Pt,Be.new_price=Be.price,Be.price=Number(Fe==null?void 0:Fe.new_price),Be.total_new_price=Number(Fe.total_new_price)}})}),ve.modifiers.forEach(Pe=>{const Ie=Xe.modifiers.find(Be=>Be.id===Pe.id);if(Ie&&Number(Pe.price)!==Number(Ie==null?void 0:Ie.new_price)){const Be=(Ie.discounts||[]).reduce((Fe,Pt)=>Fe+=+Pt.discount,0);A.value+=Be,Pe.new_price=Pe.price,Pe.price=Number(Ie==null?void 0:Ie.new_price),Pe.total_new_price=Number(Ie.total_new_price)}}),ve.price!==Number(Xe.new_price))){const Pe=(Xe.discounts||[]).reduce((Ie,Be)=>Ie+=+Be.discount,0);A.value=A.value+Pe,ve.new_price=ve.price,ve.price=Xe.new_price,ve.discounts=Xe.discounts,ve.total_new_price=Number(Xe.total_new_price)}}),u.value=[...u.value],A.value!==0&&(l.value=oe.total_cart_price),d.value.has_rms_discount){$.value={front_type:O};const ve=await me(s.configPage,{paymentMethodId:O.value,items:Me.value,tableDataId:s.configPage.tableDataId,comment:x.value,isAuthorized:!!s.configPage.userData||!!f,signal:r==null?void 0:r.signal});I.value=(Ye=ve==null?void 0:ve.data)==null?void 0:Ye.id}else p.value=!1;_.value=!1}catch(oe){re.isCancel(oe)||a.showNotification(((Mt=(At=oe==null?void 0:oe.response)==null?void 0:At.data)==null?void 0:Mt.user_friendly_message)||"Скидки временно недоступны"),_.value=!0,T.value=!1,p.value=!1}},Xf=()=>{var W;(W=f.value)!=null&&W.balance?f.value.balance>=1&&(R.value=!R.value):a.showNotification("У Вас пока нет бонусов")},em=()=>{var W,z;if(m.value.hide_discounts_calculate_button){_.value=!1;return}d.value.has_rms_discount&&(s.configPage.kiosk_menu||s.configPage.qr_menu&&f.value)?(I.value=null,_.value=!0):((W=d.value)==null?void 0:W.loyalty)==="IIKO"&&(d.value.has_loyalty_default_user||f.value)&&s.configPage.kiosk_menu||((z=d.value)==null?void 0:z.loyalty)==="IIKO"&&s.configPage.qr_menu&&f.value?_.value=!0:_.value=!1};e.onMounted(async()=>{h.value=s.textPaymentBtn,o.loadCart(),y.value=null,l.value=null,w.value=0,u.value.splice(0,u.value.length,...u.value.map(o.makeProductFullyReactive))}),e.onUnmounted(()=>{I.value=null,y.value=null,l.value=null,w.value=0,u.value.splice(0,u.value.length,...u.value.map(o.makeProductFullyReactive))});const Un=e.computed(()=>l.value-w.value-A.value),xt=e.computed(()=>s.configPage.qr_menu?d.value.qr_order_minimum_price||0:s.configPage.kiosk_menu&&d.value.kiosk_order_minimum_price||0),tm=e.computed(()=>xt.value>Un.value||T.value||p.value?!0:["АВТОРИЗОВАТЬСЯ ДЛЯ ЗАКАЗА"].includes(h.value.toUpperCase())?!1:u.value.length===0||l.value===0?!0:(y.value=null,p.value)),qn=e.computed(()=>{var W;return((W=u.value)==null?void 0:W.reduce((z,le)=>z+le.amount,0))||0}),vo=e.computed(()=>{var W;return(W=f.value)==null?void 0:W.phone});return e.watch([qn,vo],()=>{qn.value===0&&(r=null),r==null||r.abort(),p.value=!1}),e.watch([()=>o.cartProducts_lib,vo,qn],W=>{if(C.value>0){C.value--;return}W&&!T.value&&(em(),u.value.splice(0,u.value.length,...u.value.map(o.makeProductFullyReactive)),A.value=0,l.value=null,w.value=0,C.value=1),T.value=!1},{deep:!0}),(W,z)=>{var le,Ye,At,Mt;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Vd,[e.createVNode($d,{onConfirm:he}),e.createVNode(ro,{visible:e.unref(a).isDrawerOpen,"onUpdate:visible":z[0]||(z[0]=oe=>e.unref(a).isDrawerOpen=oe)},{default:e.withCtx(()=>[e.createVNode(ao)]),_:1},8,["visible"]),e.createElementVNode("header",Dd,[s.configPage.kiosk_menu?(e.openBlock(),e.createElementBlock("div",Od,[e.createElementVNode("div",zd,[e.createElementVNode("div",{class:e.normalizeClass(["arrow_wrapper",{arrow_wrapper_kso:s.configPage.kiosk_menu}]),onClick:Y},[e.createVNode(Nt,{class:"cart_header_back_button"}),s.configPage.kiosk_menu?(e.openBlock(),e.createElementBlock("span",Ld,"Назад")):e.createCommentVNode("",!0)],2)]),K.value&&K.value.show?(e.openBlock(),e.createElementBlock("div",Fd,[e.createVNode(Re,{style:e.normalizeStyle({visibility:!k.value&&e.unref(u).length>0?"visible":"hidden"}),class:e.normalizeClass({button_kso_comment:t.configPage.kiosk_menu}),textButtonDefault:x.value.length>0?"Редактировать":K.value&&K.value.fieldName||"",onClick:()=>k.value=!k.value,id:"button_kso_comment"},null,8,["style","class","textButtonDefault","onClick"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass({cart_header_wrapper:s.configPage.kiosk_menu})},[(e.unref(m).kiosk_show_loyalty_card_button||e.unref(m).kiosk_show_loyalty_phone_input_button)&&!s.config_qr?(e.openBlock(),e.createElementBlock("button",{key:0,class:"buttonDefaultWrapper button_payment_cart button_payment_cart_loyal",style:e.normalizeStyle({marginRight:(le=e.unref(m).cart_loyalty_button)!=null&&le.cart_loyalty_button_sticker?`${Math.ceil(e.unref(G)/2+10)}px`:"",paddingRight:(Ye=e.unref(m).cart_loyalty_button)!=null&&Ye.cart_loyalty_button_sticker?0:""}),onClick:z[1]||(z[1]=(...oe)=>e.unref(a).openDrawer&&e.unref(a).openDrawer(...oe))},[e.createElementVNode("p",{class:"cart_loyal_program",style:e.normalizeStyle({marginRight:`${Math.ceil(e.unref(G)/2)}px`})},e.toDisplayString(ae.value),5),(At=e.unref(m).cart_loyalty_button)!=null&&At.cart_loyalty_button_sticker?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"stickerLoyality",ref:M,class:"cart_loyal_program_icon",style:e.normalizeStyle({"--sticker-mask":`url(${e.unref(m).cart_loyalty_button.cart_loyalty_button_sticker})`})},[e.createElementVNode("img",{src:e.unref(m).cart_loyalty_button.cart_loyalty_button_sticker},null,8,Hd)],4)):(e.openBlock(),e.createBlock(Md,{key:1,class:"cart_loyal_qr"}))],4)):e.createCommentVNode("",!0)],2)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([t.config_qr?"cart_kbju_qr_wrapper":"cart_kbju_kso_wrapper"])},[t.config_qr?(e.openBlock(),e.createElementBlock("div",Ud,[e.createElementVNode("div",{class:"arrow_wrapper",onClick:Y},[e.createVNode(Nt,{class:"cart_header_back_button"})])])):e.createCommentVNode("",!0),e.unref(m).show_nutrition_in_cart?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cart_header",style:e.normalizeStyle({paddingTop:s.config_qr?0:"10px",paddingRight:s.config_qr?"10px":0})},[e.createElementVNode("div",qd,[e.createElementVNode("p",null,[e.createVNode(Ce,{price:j.value.energy_amount,duration:800},null,8,["price"]),z[8]||(z[8]=e.createTextVNode(" г",-1))]),z[9]||(z[9]=e.createElementVNode("p",{class:"cart_info_name"},"Килокалории",-1))]),e.createElementVNode("div",jd,[e.createElementVNode("p",null,[e.createVNode(Ce,{price:j.value.proteins_amount,duration:900},null,8,["price"]),z[10]||(z[10]=e.createTextVNode(" г",-1))]),z[11]||(z[11]=e.createElementVNode("p",{class:"cart_info_name"},"Белки",-1))]),e.createElementVNode("div",Wd,[e.createElementVNode("p",null,[e.createVNode(Ce,{price:j.value.fat_amount,duration:1e3},null,8,["price"]),z[12]||(z[12]=e.createTextVNode(" г",-1))]),z[13]||(z[13]=e.createElementVNode("p",{class:"cart_info_name"},"Жиры",-1))]),e.createElementVNode("div",Gd,[e.createElementVNode("p",null,[e.createVNode(Ce,{price:j.value.carbohydrates_amount,duration:1100},null,8,["price"]),z[14]||(z[14]=e.createTextVNode(" г",-1))]),z[15]||(z[15]=e.createElementVNode("p",{class:"cart_info_name"},"Углеводы",-1))])],4)):e.createCommentVNode("",!0)],2)]),k.value&&t.configPage.kiosk_menu?(e.openBlock(),e.createElementBlock("div",Kd,[e.createElementVNode("div",Zd,[e.withDirectives(e.createElementVNode("textarea",{class:"comment_order",placeholder:K.value&&K.value.placeholder||"Ваш комментарий к заказу...",name:"commentKso",maxlength:"50","onUpdate:modelValue":z[2]||(z[2]=oe=>x.value=oe)},null,8,Qd),[[e.vModelText,x.value]]),e.createElementVNode("p",Jd,e.toDisplayString(x.value.length+" / 50"),1)]),e.createVNode(Re,{textButtonDefault:"Сохранить",onClick:_e,class:"button_bonus_cart"})])):e.createCommentVNode("",!0),B.value&&t.config_qr?(e.openBlock(),e.createElementBlock("div",Yd,[e.createElementVNode("div",Xd,[e.withDirectives(e.createElementVNode("textarea",{class:"comment_order",placeholder:K.value&&K.value.placeholder||"Ваш комментарий к заказу...",name:"commentQr",maxlength:"50","onUpdate:modelValue":z[3]||(z[3]=oe=>x.value=oe)},null,8,eu),[[e.vModelText,x.value]]),e.createElementVNode("p",tu,e.toDisplayString(x.value.length+" / 50"),1)]),e.createVNode(Re,{textButtonDefault:"Сохранить",onClick:U,class:"button_bonus_cart"})])):e.createCommentVNode("",!0),t.config_qr&&K.value&&K.value.show?(e.openBlock(),e.createElementBlock("div",nu,[!B.value&&e.unref(u).length>0?(e.openBlock(),e.createBlock(Re,{key:0,textButtonDefault:x.value.length>0?"Редактировать":K.value.fieldName||"",onClick:()=>B.value=!B.value,id:"button_comments"},null,8,["textButtonDefault","onClick"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ru,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),oe=>(e.openBlock(),e.createBlock(oo,{key:oe.idSystem,cardItem:oe,onDelete:ve=>he(oe.idSystem)},null,8,["cardItem","onDelete"]))),128))]),e.createElementVNode("div",ou,[R.value?(e.openBlock(),e.createElementBlock("p",au,[z[16]||(z[16]=e.createTextVNode(" Списать ",-1)),e.withDirectives(e.createElementVNode("input",{type:"number",placeholder:"0",style:e.normalizeStyle({maxWidth:`${e.unref(c).toString().length||1}em`}),disabled:e.unref(f)===null||((Mt=e.unref(f))==null?void 0:Mt.balance)===0,"onUpdate:modelValue":z[4]||(z[4]=oe=>e.isRef(c)?c.value=oe:null),onInput:ne,min:"0",max:e.unref(ee),onKeypress:de},null,44,su),[[e.vModelText,e.unref(c),void 0,{number:!0}]]),z[17]||(z[17]=e.createTextVNode(" бонусов ",-1))])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("p",iu,"У вас есть "+e.toDisplayString(e.unref(f)?e.unref(f).balance:0)+" B",1)):e.createCommentVNode("",!0),R.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"range",class:"footer_range","onUpdate:modelValue":z[5]||(z[5]=oe=>e.isRef(c)?c.value=oe:null),min:0,max:e.unref(ee)},null,8,lu)),[[e.vModelText,e.unref(c),void 0,{number:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("ul",cu,[R.value?(e.openBlock(),e.createElementBlock("li",du,[z[19]||(z[19]=e.createElementVNode("p",null,"Сумма заказа:",-1)),e.createElementVNode("p",null,[e.createVNode(Ce,{price:e.unref(l),fixedFloat:2},null,8,["price"]),z[18]||(z[18]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("li",uu,[z[21]||(z[21]=e.createElementVNode("p",null,"Будет оплачено бонусами:",-1)),e.createElementVNode("p",null,[e.createVNode(Ce,{price:e.unref(c),fixedFloat:2},null,8,["price"]),z[20]||(z[20]=e.createTextVNode(" Б",-1))])])):e.createCommentVNode("",!0),e.unref(w)!==0?(e.openBlock(),e.createElementBlock("li",fu,[e.createElementVNode("p",mu,e.toDisplayString(e.unref(w)>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",pu,[e.createVNode(Ce,{price:Math.abs(e.unref(w)),fixedFloat:2},null,8,["price"]),z[22]||(z[22]=e.createTextVNode(" ₽",-1))])])):A.value!==0?(e.openBlock(),e.createElementBlock("li",hu,[e.createElementVNode("p",_u,e.toDisplayString(A.value>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",gu,[e.createVNode(Ce,{price:Math.abs(A.value),fixedFloat:2},null,8,["price"]),z[23]||(z[23]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),e.createElementVNode("li",null,[z[25]||(z[25]=e.createElementVNode("p",{class:"accept_field"},"Итого к оплате:",-1)),e.createElementVNode("p",yu,[e.createVNode(Ce,{price:e.unref(l)-e.unref(c),fixedFloat:2},null,8,["price"]),z[24]||(z[24]=e.createTextVNode(" ₽",-1))])])]),xt.value&&Un.value<xt.value?(e.openBlock(),e.createElementBlock("div",bu,[z[26]||(z[26]=e.createTextVNode(" Минимальная сумма заказа ",-1)),e.createVNode(Ce,{price:xt.value,fixedFloat:2},null,8,["price"]),e.createTextVNode(" "+e.toDisplayString(e.unref(d).currency_symbol)+". Для оформления заказа необходимо добавить товаров на сумму ",1),e.createVNode(Ce,{price:xt.value-Un.value,fixedFloat:2},null,8,["price"]),e.createTextVNode(" "+e.toDisplayString(e.unref(d).currency_symbol),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",wu,[e.unref(f)?(e.openBlock(),e.createBlock(Re,{key:0,textButtonDefault:Hn.value||"Бонусы",onClick:Xf,class:"button_bonus_cart"},null,8,["textButtonDefault"])):e.createCommentVNode("",!0),e.createVNode(Re,{textButtonDefault:e.unref(_)?"Рассчитать скидки":e.unref(h),onClick:e.unref(_)?Yf:Qf,class:"button_payment_cart",disabled:tm.value},null,8,["textButtonDefault","onClick","disabled"])])])]),e.createVNode(Id,{orderNumber:e.unref(b),pageNumber:1},null,8,["orderNumber"]),e.createVNode(An,{visible:e.unref(g),"onUpdate:visible":z[6]||(z[6]=oe=>e.isRef(g)?g.value=oe:null),textNotificationDefault:e.unref(V).textNotification,backgroundColor:e.unref(m).accent_color?e.unref(m).accent_color:"#FF6D2E",buttonAccept:null},null,8,["visible","textNotificationDefault","backgroundColor"]),e.createVNode(Pn,{modelValue:e.unref(S),"onUpdate:modelValue":z[7]||(z[7]=oe=>e.isRef(S)?S.value=oe:null),class:"product_card_sheet","snap-points":["80%"]},{default:e.withCtx(()=>{var oe;return[e.createVNode(vc,{"config-page":t.configPage,comment:x.value,"cart-items":Me.value,"is-authorized":!!s.configPage.userData||!!e.unref(f),"has-rms-discount":e.unref(d).has_rms_discount,"hide-discounts-button":e.unref(m).hide_discounts_calculate_button,"order-id":I.value,signal:(oe=e.unref(r))==null?void 0:oe.signal,onSelectPayment:Jf},null,8,["config-page","comment","cart-items","is-authorized","has-rms-discount","hide-discounts-button","order-id","signal"])]}),_:1},8,["modelValue"])],64)}}}),ku={},Su={viewBox:"0 0 24 24"};function Eu(t,n){return e.openBlock(),e.createElementBlock("svg",Su,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Nu=X(ku,[["render",Eu]]),vu={class:"retry_screen"},Iu={class:"retry_all_in_screen"},Bu={class:"retry_content"},xu={class:"retry_icon_wrap"},Au={class:"retry_icon_circle"},Mu={class:"retry_error_x"},Pu=e.defineComponent({__name:"RetryPage",setup(t){const n=ue(),r=Z.useRouter(),o=Z.useRoute(),a=se(),i=()=>{n.notificationData_lib.textNotification="",n.is_notification_lib=!1,a.openApiKey=!0,r.replace(`/${o.params.orgId}/`)};return(s,l)=>(e.openBlock(),e.createElementBlock("section",vu,[e.createElementVNode("div",Iu,[e.createElementVNode("main",Bu,[e.createElementVNode("div",xu,[e.createElementVNode("div",Au,[l[0]||(l[0]=e.createElementVNode("div",{class:"retry_loader_mini"},null,-1)),e.createElementVNode("div",Mu,[e.createVNode(Nu)])])]),l[1]||(l[1]=e.createElementVNode("div",{class:"retry_oops"},"OOPS",-1)),l[2]||(l[2]=e.createElementVNode("h1",{class:"retry_title"},"Что-то пошло не так",-1)),l[3]||(l[3]=e.createElementVNode("div",{class:"retry_hint"},[e.createElementVNode("p",null,"Похоже, произошёл технический сбой."),e.createElementVNode("p",null,"Мы уже знаем о проблеме и сейчас разбираемся."),e.createElementVNode("p",null,"Приносим извинения за доставленные неудобства."),e.createElementVNode("p",null,"Попробуйте начать новый заказ.")],-1))]),e.createElementVNode("div",{class:"retry_footer"},[e.createElementVNode("button",{onClick:i,class:"retry_new_order_btn"},"Новый заказ")]),l[4]||(l[4]=e.createElementVNode("p",{class:"retry_bottom_note"},"Если ошибка повторяется — обратитесь к сотруднику зала.",-1))])]))}}),Tu={class:"wrapper_loader"},Ru=e.defineComponent({__name:"Loader",props:{size:{type:String,default:"40px"}},setup(t){return(n,r)=>(e.openBlock(),e.createElementBlock("div",Tu,[e.createElementVNode("div",{class:"loader",style:e.normalizeStyle({width:t.size})},null,4)]))}}),$u=X(e.defineComponent({__name:"AnimationLoader",props:{id:{}},setup(t){const n=e.ref(!0);return e.watch(()=>n.value,()=>{n.value=!1,setTimeout(()=>{n.value=!0},0)}),(r,o)=>(e.openBlock(),e.createElementBlock("div",{class:"opacity-animation",key:t.id},[e.renderSlot(r.$slots,"opacityLoader",{},void 0,!0)]))}}),[["__scopeId","data-v-c6b97942"]]),Vu={key:0},Du={class:"card__main__wrapper"},Ou={key:0,class:"folder_content_top"},zu={key:0,class:"loader_card_main"},Lu={key:1,class:"card__main_content"},Fu=["src","alt"],Hu={class:"card_title_price_wrapper"},Uu={class:"title"},qu={key:0,class:"price"},ju={key:1,class:"card_button_add_wrapper"},mo=X(e.defineComponent({__name:"CardMain",props:{data:{},activeTags:{},is_group:{type:Boolean},parent:{},isLoading:{type:Boolean},selectGroupChild:{type:Function},takeCurrentCard:{type:Function}},setup(t){const n=ge(),r=se(),o=fe(),{itemThemes:a}=F.storeToRefs(n),{is_18_above_content:i,is18Allowed:s,notificationData_lib:l}=F.storeToRefs(r),c=t,d=(h,p)=>{var w,g,_;const y={id:h.id,is_fake:h.is_fake||!1,is_od_united_product:h.is_od_united_product||!1,amount:h.amount||1,name:h.name,image_link:h.image_link,price:h.price,old_price:h.price,size:void 0,sizes:[],modifiers:[],groups:h.groups,group_modifiers:[],energy_amount:h.energy_amount??0,proteins_amount:h.proteins_amount??0,fat_amount:h.fat_amount??0,carbohydrates_amount:h.carbohydrates_amount??0},b=!((w=h.modifiers)!=null&&w.length)&&!((g=h.group_modifiers)!=null&&g.length)&&!((_=h.sizes)!=null&&_.length);if(o.isUpSale=!1,h.adult&&!s.value){i.value=!0,b&&(l.value.fastAdd=y);return}if(b){r.addToCart(y);return}if(h.amount||(h.amount=1),c.is_group&&c.selectGroupChild){c.selectGroupChild({...h,parent:c.parent,child:p.child_groups});return}c.takeCurrentCard&&c.takeCurrentCard(p.id)},u=h=>{if(c.is_group&&c.selectGroupChild){h={...h,parent:c.parent,child:h.child_groups},c.selectGroupChild(h);return}if(h.adult&&!s.value){i.value=!0;return}c.takeCurrentCard&&c.takeCurrentCard(h.id)},f=e.computed(()=>c.activeTags.every(h=>c.data.tags.includes(h))),{mediaUrl:m}=Ze(()=>c.data.id+"_image",()=>c.data.image_link);return(h,p)=>{var y;return((y=c.activeTags)==null?void 0:y.length)===0||f.value||c.is_group?(e.openBlock(),e.createElementBlock("div",Vu,[e.createVNode($u,{id:c.data.id},{opacityLoader:e.withCtx(()=>[e.createElementVNode("div",Du,[t.is_group?(e.openBlock(),e.createElementBlock("div",Ou)):e.createCommentVNode("",!0),e.createElementVNode("div",{onClick:p[0]||(p[0]=b=>u(c.data)),class:e.normalizeClass(["card__main",{card__main_folder:t.is_group}])},[t.isLoading?(e.openBlock(),e.createElementBlock("div",zu,[e.createVNode(Ru)])):(e.openBlock(),e.createElementBlock("div",Lu,[e.createElementVNode("img",{src:e.unref(m)||"",class:e.normalizeClass(["img",{card_blur_image:c.data.adult&&!e.unref(s)}]),loading:"lazy",alt:t.data.name},null,10,Fu),e.createElementVNode("div",Hu,[e.createElementVNode("p",Uu,e.toDisplayString(t.data.name),1),t.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",qu,e.toDisplayString(e.unref(ct)(t.data))+" ₽",1))])]))],2),t.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ju,[e.createElementVNode("div",{onClick:p[1]||(p[1]=b=>d(t.data,c.data)),class:"add_button"},[...p[2]||(p[2]=[e.createElementVNode("div",{class:"image_add_button"},null,-1)])])]))])]),_:1},8,["id"])])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-fe2b6c42"]]),Wu=["id","onClick"],Gu=X(e.defineComponent({__name:"GroupMain",props:{menuGroup:{},idActiveGroup:{},activeTakeGroup:{type:Function}},setup(t){const n=e.ref(null);return(r,o)=>t.menuGroup.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__menu",ref_key:"scrollGroup",ref:n},[e.createVNode(In,{axis:"x",behavior:"smooth",container:n.value,autoScroll:!0,idActive:t.idActiveGroup,clearContainer:!0},{default:e.withCtx(({handleTargetClick:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.menuGroup,(i,s)=>(e.openBlock(),e.createElementBlock("li",{key:i.id,id:"scrolling"+i.id,onClick:l=>{t.activeTakeGroup&&t.activeTakeGroup(i.id,s),a(l)},style:e.normalizeStyle(t.idActiveGroup==i.id?{fontFamily:"Bounded"}:{})},e.toDisplayString(i.name),13,Wu))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-33006a7e"]]),Ku=["id","onClick"],Zu=X(e.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(t){const n=t,r=e.ref(null),o=e.computed(()=>{if(n.isSolo&&!n.groupIndex)return Array.isArray(n.currentActiveTag)?n.currentActiveTag:[];if(n.groupIndex!==null&&n.groupIndex!==void 0){const a=n.currentActiveTag[n.groupIndex];return Array.isArray(a)?a:[]}return[]});return(a,i)=>t.menuTags.length>0?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__filters",ref_key:"scrollTagContainer",ref:r},[e.createVNode(In,{axis:"x",behavior:"smooth",container:r.value,autoScroll:!0,idActive:o.value?o.value[t.currentActiveTag.length-1]:null,clearContainer:!1},{default:e.withCtx(({handleTargetClick:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.menuTags,(l,c)=>(e.openBlock(),e.createElementBlock("li",{key:c,id:`scrolling${l}`,onClick:d=>{t.activeTakeTags&&(t.groupIndex||t.groupIndex===0)?t.activeTakeTags(l,t.groupIndex):t.activeTakeTagsSolo&&t.activeTakeTagsSolo(l),s(d)},class:e.normalizeClass({main__filter_active:(o.value??[]).includes(l)})},e.toDisplayString(l),11,Ku))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-818940a4"]]),Qu=["data-id"],Ju=["src"],Yu=["src"],Xu=X(e.defineComponent({__name:"DrumItem",props:{group:{},index:{},active:{type:Boolean}},setup(t){const n=t,{mediaUrl:r}=Ze(()=>{var o,a;return(o=n.group)!=null&&o.video_link?`${n.group.id}_video`:(a=n.group)!=null&&a.image_link?`${n.group.id}_image`:null});return(o,a)=>t.group?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["drum_item",{active:n.active}]),"data-id":t.group.id},[t.group.video_link?e.withDirectives((e.openBlock(),e.createElementBlock("video",{key:e.unref(r),loop:"",autoplay:"",muted:"",playsinline:"",class:"drum_img"},[e.createElementVNode("source",{src:e.unref(r)||"",type:"video/webm"},null,8,Ju)])),[[e.unref(vt)]]):(e.openBlock(),e.createElementBlock("img",{key:1,class:"drum_img",src:e.unref(r)||""},null,8,Yu)),e.createElementVNode("p",null,e.toDisplayString(t.group.name),1)],10,Qu)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-2b994529"]]),ef={},tf={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 nf(t,n){return e.openBlock(),e.createElementBlock("svg",tf,[...n[0]||(n[0]=[e.createElementVNode("desc",null," Created with Pixso. ",-1),e.createElementVNode("defs",null,null,-1),e.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 rf=X(ef,[["render",nf]]),of={class:"recommendation_wrapper"},af={class:"recommendation_header"},sf={class:"recommendation_info"},lf=X(e.defineComponent({__name:"Recommendation",props:{closeCurrentCard:{},openCurrentCard:{}},setup(t){const n=fe(),{isUpSale:r,dataUpSale:o}=F.storeToRefs(n),a=()=>{r.value=!1};return e.onUnmounted(()=>{o.value=null}),(i,s)=>(e.openBlock(),e.createElementBlock("div",of,[e.createElementVNode("div",af,[s[0]||(s[0]=e.createElementVNode("p",{class:"header_title"},"Часто берут вместе",-1)),e.createElementVNode("div",{class:"header_close",onClick:a},[e.createVNode(rf,{class:"close_icon"})])]),e.createElementVNode("div",sf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),l=>(e.openBlock(),e.createBlock(mo,{data:l,key:l.id,parent:l.id,is_group:!1,is_product:!0,class:"card",activeTags:[],isLoading:!1,closeCurrentCard:t.closeCurrentCard,takeCurrentCard:()=>t.openCurrentCard(l.id,!0)},null,8,["data","parent","closeCurrentCard","takeCurrentCard"]))),128))])]))}}),[["__scopeId","data-v-d545ec45"]]),cf=e.defineComponent({__name:"Blackout",props:{data:{type:Boolean}},setup(t){const n=t;return e.watch(()=>n.data,r=>{document.body.style.overflow=r?"hidden":""}),()=>{}}}),df={class:"wrapper_modal"},uf={class:"card_modal"},ff=X(e.defineComponent({__name:"ModalWindows",props:{visible:{type:Boolean}},setup(t){const n=t,r=fe(),{isUpSale:o}=F.storeToRefs(r),a=()=>{o.value=!1};return(i,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(cf,{data:n.visible},null,8,["data"]),e.createElementVNode("div",{class:"black_modal",onClick:a}),e.createElementVNode("div",df,[e.createElementVNode("div",uf,[e.renderSlot(i.$slots,"default",{},void 0,!0)])])],64))}}),[["__scopeId","data-v-ec2b2c4d"]]),On=F.defineStore("modulesLib",()=>{const t=e.ref(!1),n=e.ref({textNotification:""});return{is_notification_lib:t,notificationData_lib:n}}),Yt=Symbol("clickOutside"),mf={mounted(t,n){t[Yt]=r=>{t.contains(r.target)||n.value(r)},document.addEventListener("click",t[Yt])},unmounted(t){t[Yt]&&document.removeEventListener("click",t[Yt])}};class pf{constructor(n){te(this,"value");te(this,"next");this.value=n}}class hf{constructor(){tn(this,Ne);tn(this,Je);tn(this,st);this.clear()}enqueue(n){const r=new pf(n);$e(this,Ne)?($e(this,Je).next=r,We(this,Je,r)):(We(this,Ne,r),We(this,Je,r)),jn(this,st)._++}dequeue(){const n=$e(this,Ne);if(n)return We(this,Ne,$e(this,Ne).next),jn(this,st)._--,$e(this,Ne)||We(this,Je,void 0),n.value}peek(){if($e(this,Ne))return $e(this,Ne).value}clear(){We(this,Ne,void 0),We(this,Je,void 0),We(this,st,0)}get size(){return $e(this,st)}*[Symbol.iterator](){let n=$e(this,Ne);for(;n;)yield n.value,n=n.next}*drain(){for(;$e(this,Ne);)yield this.dequeue()}}Ne=new WeakMap,Je=new WeakMap,st=new WeakMap;function _f(t){po(t);const n=new hf;let r=0;const o=()=>{r<t&&n.size>0&&(r++,n.dequeue()())},a=()=>{r--,o()},i=async(c,d,u)=>{const f=(async()=>c(...u))();d(f);try{await f}catch{}a()},s=(c,d,u)=>{new Promise(f=>{n.enqueue(f)}).then(i.bind(void 0,c,d,u)),r<t&&o()},l=(c,...d)=>new Promise(u=>{s(c,u,d)});return Object.defineProperties(l,{activeCount:{get:()=>r},pendingCount:{get:()=>n.size},clearQueue:{value(){n.clear()}},concurrency:{get:()=>t,set(c){po(c),t=c,queueMicrotask(()=>{for(;r<t&&n.size>0;)o()})}},map:{async value(c,d){const u=Array.from(c,(f,m)=>this(d,f,m));return Promise.all(u)}}}),l}function po(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}let Ee=null;const ho=_f(5),gf=async(t,n)=>{Ee&&Cf();const r=se(),o=On(),a=fe(),{displayCards:i}=F.storeToRefs(r),{is_notification_lib:s,notificationData_lib:l}=F.storeToRefs(o),{stateCard:c,openProduct:d}=F.storeToRefs(a),u=qe.create();await yf(t),Ee=Ot(`wss://${n}/ws/org-unit/${t}/`),Ee.on("open",()=>console.warn("Realtime WebSocket подключён (pointId:",t,")")),Ee.on("error",f=>console.warn("WebSocket ошибка:",f)),Ee.on("close",()=>console.warn("Realtime WebSocket закрыт")),Ee.on("message",async f=>{if(f.type)return;l.value.textNotification="Мы обновили меню";const m=f.params||f,h=m.active_groups||[],p=m.updated_groups||[],y=m.updated_product_groups||[],b=await et(),w=new Set(h.map(E=>E)),g=new Map(i.value.map(E=>[E.id,E])),_=[],S=b.transaction("groups","readwrite");let V=await S.objectStore("groups").openCursor();for(;V;){const E=V.key;!w.has(E)&&E!==t&&(_.push(E),await V.delete(),g.delete(E)),V=await V.continue()}await S.done,i.value=Array.from(g.values()),_.length>0&&await bf(w);const $=[...p.map(E=>ho(async()=>{const[N,M]=await Promise.all([u.getGroupByID(E),u.loadGroupProducts(E)]);N.products=M,g.set(E,N),await _t(E,N),await go(N,M,!0)})),...y.map(E=>ho(async()=>{const[N,M]=await Promise.all([u.getGroupByID(E),u.loadGroupProducts(E)]);N.products=M,g.set(E,N),await _t(E,N),await go(N,M,!0),await wf(M,E)}))];await Promise.all($),i.value=Array.from(g.values()),await Wo(t,i),s.value=!0;const D=c.value.openCard;if(D!=null&&D.id){const E=new Set(D.groups??[]),N=new Set;let M=!1;for(const T of g.values()){const x=T==null?void 0:T.products;if(!Array.isArray(x))continue;const k=x.find(B=>(B==null?void 0:B.id)===D.id);if((k==null?void 0:k.adult)===!0){d.value={id:null,visible:!1},a.reset();return}k&&(T==null?void 0:T.id)!=null&&(N.add(T.id),(p.includes(T.id)||y.includes(T.id))&&(M=!0))}if(N.size===0){d.value={id:null,visible:!1},a.reset();return}(!(E.size===N.size&&[...E].every(T=>N.has(T)))||M)&&await u.getSingleProduct(D==null?void 0:D.id)}}),Ee.connect()},yf=async t=>{try{const n=se(),r=await dn(t);r!=null&&r.data&&(n.displayCards=r.data)}catch(n){console.error("Ошибка загрузки кэша групп:",n)}},_o=async t=>{const n=se(),r=On(),o=fe(),{stateCard:a,openProduct:i}=F.storeToRefs(o),{cartProducts_lib:s}=F.storeToRefs(n),l=s.value,c=[],d=[],u=a.value.openCard;for(const f of l)t(f)?(c.push(f),(f.id===(u==null?void 0:u.id)||u!=null&&u.adult)&&(i.value={id:null,visible:!1})):d.push(f);if(c.length>0){const f=c.map(m=>m.name).slice(0,3).join(", ");r.notificationData_lib.textNotification=`Некоторые позиции стали недоступны и были убраны из заказа: ${f}${c.length>3?` и ещё ${c.length-3}`:""}`,s.value=d,n.updateCartInLocalStorage()}},bf=async t=>{await _o(n=>{var r;return(r=n.groups)!=null&&r.length?!n.groups.some(o=>t.has(o)):!0})},wf=async(t,n)=>{const r=se(),o=new Set(t.filter(a=>!a.adult||r.is18Allowed).map(a=>a.id));await _o(a=>{var i;return(i=a.groups)!=null&&i.includes(n)?!o.has(a.id):!1})},go=async(t,n,r=!0)=>{if(t.video_link&&Xt(t.video_link,`${t.id}_video`,r),t.image_link&&Xt(t.image_link,`${t.id}_image`,r),n!=null&&n.length)for(const o of n)o.video_link&&Xt(o.video_link,`${o.id}_video`,r),o.image_link&&Xt(o.image_link,`${o.id}_image`,r)},Xt=async(t,n,r=!1)=>{try{const o=Vt();if(!r){const s=await lt(n);if(s){o.updateCacheFromBlob(n,s),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:s}}));return}}const a=await fetch(t);if(!a.ok)throw new Error("Network error");const i=await a.blob();if(i.size===0)throw new Error("Empty blob");await un(n,i),o.updateCacheFromBlob(n,i),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:i}}))}catch(o){console.warn(`[MediaCache] Failed for ${n}:`,o)}},Cf=()=>{Ee&&(Ee.off("open"),Ee.off("message"),Ee.off("error"),Ee.off("close"),Ee.close(!0),Ee=null)},kf={key:0,class:"valentine-hearts"},Sf=e.defineComponent({__name:"FallingHearts",props:{symbols:{default:()=>["❤","♥","💕"]},max:{default:15},interval:{default:1500}},setup(t){const n=t,r=we.useDocumentVisibility(),o=we.useMediaQuery("(prefers-reduced-motion: reduce)"),a=e.ref([]);let i=null;const s=(u,f)=>Math.random()*(f-u)+u,l=()=>{if(o.value||a.value.length>=n.max)return;const u=n.symbols[Math.floor(Math.random()*n.symbols.length)],f=s(18,26),m=s(5,95),h=s(10,18),p=s(0,.3),y=s(.6,.9),b=Math.floor(s(1,6)),g={id:crypto.randomUUID(),icon:u,style:{left:`${m}%`,fontSize:`${f}px`,color:`rgba(255, 105, 180, ${y})`,animationName:`heartFall${b}`,animationDuration:`${h}s`,animationDelay:`${p}s`}};a.value.push(g);const S=setTimeout(()=>{a.value=a.value.filter(P=>P.id!==g.id),clearTimeout(S)},(p+h+1)*1e3)},c=()=>{if(!o.value){for(let u=0;u<3;u++){const f=setTimeout(()=>{l(),clearTimeout(f)},u*200)}i=setInterval(l,n.interval)}},d=()=>{i&&(clearInterval(i),i=null),a.value=[]};return e.onMounted(()=>{o.value||c()}),e.onUnmounted(()=>{d()}),e.watch(r,(u,f)=>{u==="visible"&&f==="hidden"&&c(),u==="hidden"&&f==="visible"&&d()}),(u,f)=>e.unref(o)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createElementBlock("span",{key:m.id,class:"heart",style:e.normalizeStyle(m.style)},e.toDisplayString(m.icon),5))),128))]))}}),Ef=["src"],Nf=e.defineComponent({__name:"BasketImage",props:{id:{},fallback:{}},setup(t){const n=t,{mediaUrl:r}=Ze(()=>n.id,()=>n.fallback);return(o,a)=>(e.openBlock(),e.createElementBlock("img",{src:e.unref(r)||""},null,8,Ef))}}),vf={class:"button_price_bg"},If={class:"wrapper_container_price_bg"},Bf={class:"button_price"},xf={key:0,class:"image_product_container"},Af=e.defineComponent({__name:"BasketButton",emits:["goToCart"],setup(t){const n=se(),{totalPrice_lib:r,cartProducts_lib:o}=F.storeToRefs(n),a=e.computed(()=>{var i;return(i=o.value)!=null&&i.length,o.value.slice(0,3).map(s=>({id:`${s.id}_image`,fallback:s.image_link}))});return(i,s)=>(e.openBlock(),e.createElementBlock("div",vf,[e.createElementVNode("div",If,[e.createElementVNode("div",Bf,[e.unref(r)>0&&a.value.length>0?(e.openBlock(),e.createElementBlock("div",xf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l.id,class:"filter_image_product"},[e.createVNode(Nf,{id:l.id,fallback:l.fallback,class:"img_product"},null,8,["id","fallback"])]))),128))])):e.createCommentVNode("",!0),e.createVNode(e.unref(pe.motion).div,{class:"button_default_main",whilePress:{scale:.92},onClick:s[0]||(s[0]=l=>i.$emit("goToCart"))},{default:e.withCtx(()=>[s[2]||(s[2]=e.createElementVNode("div",{class:"icont_cart"},null,-1)),e.createElementVNode("p",null,[e.createVNode(Ce,{price:e.unref(r),fixedFloat:2},null,8,["price"]),s[1]||(s[1]=e.createTextVNode(" ₽",-1))])]),_:1})])])]))}}),It=null,{min:at,max:Le,abs:yo,floor:Mf}=Math,bo=(t,n,r)=>at(r,Le(n,t)),wo=t=>[...t].sort((n,r)=>n-r),Pf=typeof queueMicrotask=="function"?queueMicrotask:t=>{Promise.resolve().then(t)},zn=()=>{let t;return[new Promise(n=>{t=n}),t]},Co=t=>{let n;return()=>(t&&(n=t(),t=void 0),n)},Bt=(t,n,r)=>{const o=r?"unshift":"push";for(let a=0;a<n;a++)t[o](-1);return t},ko=(t,n)=>{const r=t.t[n];return r===-1?t.o:r},Tf=(t,n,r)=>{const o=t.t[n]===-1;return t.t[n]=r,t.i=at(n,t.i),o},en=(t,n)=>{if(!t.l)return 0;if(t.i>=n)return t.u[n];t.i<0&&(t.u[0]=0,t.i=0);let r=t.i,o=t.u[r];for(;r<n;)o+=ko(t,r),t.u[++r]=o;return t.i=n,o},ht=(t,n,r=0,o=t.l-1)=>{let a=r;for(;r<=o;){const i=Mf((r+o)/2);en(t,i)<=n?(a=i,r=i+1):o=i-1}return bo(a,0,t.l-1)},So=(t,n,r)=>{const o=n-t.l;return t.i=r?-1:at(n-1,t.i),t.l=n,o>0?(Bt(t.u,o),Bt(t.t,o,r),t.o*o):(t.u.splice(o),(r?t.t.splice(0,-o):t.t.splice(o)).reduce((a,i)=>a-(i===-1?t.o:i),0))},Rf=t=>t.documentElement,$f=t=>t.ownerDocument,Vf=t=>t.defaultView,Eo=Co(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>0),Df=Co(()=>"scrollBehavior"in Rf(document).style),Of=(t,n=40,r=0,o,a=!1)=>{let i=!!r,s=1,l=0,c=0,d=0,u=0,f=0,m=0,h=0,p=0,y=It,b=[0,i?Le(r-1,0):-1],w=0,g=!1;const _=((T,x,k)=>({o:x,t:k?Bt(k.slice(0,at(T,k.length)),Le(0,T-k.length)):Bt([],T),l:T,i:-1,u:Bt([],T+1)}))(t,o?o[1]:n,o&&o[0]),S=new Set,P=()=>d-c,V=()=>P()+f+u,$=(T,x)=>((k,B,A,C)=>{if(C=at(C,k.l-1),en(k,C)<=B){const I=ht(k,A,C);return[ht(k,B,C,I),I]}{const I=ht(k,B,void 0,C);return[I,ht(k,A,I)]}})(_,T,x,b[0]),D=()=>en(_,_.l),E=(T,x)=>{const k=en(_,T)-f;return x?D()-k-N(T):k},N=T=>ko(_,T),M=(T,x=-1)=>_.t[T]===x,R=T=>{T&&(Eo()&&h!==0||y&&p===1?f+=T:u+=T)};return{p:()=>{S.clear()},h:()=>s,m:()=>(T=>[T.t.slice(),T.o])(_),v:(T=200)=>{if(!g||i)return b;let x,k;if(m)[x,k]=b;else{let B=Le(0,V()),A=B+l;a||(T=Le(0,T),h!==1&&(B-=T),h!==2&&(A+=T)),[x,k]=b=$(Le(0,B),Le(0,A)),y&&(x=at(x,y[0]),k=Le(k,y[1]))}return[Le(x,0),at(k,_.l-1)]},S:T=>ht(_,T-c),I:M,O:E,k:N,j:()=>_.l,N:()=>d,B:()=>h!==0,T:()=>l,q:()=>c,M:D,P:()=>(m=u,u=0,[m,p===2]),R:(T,x)=>{const k=[T,x];return S.add(k),()=>{S.delete(k)}},A:(T,x)=>{let k,B,A=0;switch(T){case 1:{if(x===d&&p===0)break;const C=m;m=0;const I=x-d,O=yo(I);C&&O<yo(C)+1||p!==0||(h=I<0?2:1),i&&(i=!1),d=x,A=4;const H=P();H>=-l&&H<=D()&&(A+=1,B=O>l);break}case 2:A=8,h!==0&&(k=!0,A+=1),h=0,p=0,y=It;break;case 3:{const C=x.filter(([I,O])=>!M(I,O));if(!C.length)break;R(C.reduce((I,[O,H])=>((p===2||(y&&p===1?O<y[0]:E(O+(h===0&&p===0?1:0))<P()))&&(I+=H-N(O)),I),0));for(const[I,O]of C){const H=N(I),G=Tf(_,I,O);a&&(w+=G?O:O-H)}a&&l&&w>l&&(R(((I,O)=>{let H=0;const G=[];I.t.forEach((he,_e)=>{he!==-1&&(G.push(he),_e<O&&H++)}),I.i=-1;const j=wo(G),K=j.length,ee=K/2|0,Y=K%2==0?(j[ee-1]+j[ee])/2:j[ee],de=I.o;return((I.o=Y)-de)*Le(O-H,0)})(_,ht(_,V()))),a=!1),A=3,B=!0;break}case 4:l!==x&&(l||(g=B=!0),l=x,A=3);break;case 5:x[1]?(R(So(_,x[0],!0)),p=2,A=1):(So(_,x[0]),A=1);break;case 6:c=x;break;case 7:p=1;break;case 8:y=$(x,x+l),A=1}A&&(s=1+(2147483647&s),k&&f&&(u+=f,f=0),S.forEach(([C,I])=>{A&C&&I(B)}))}}},Ln=setTimeout,Fn=(t,n)=>n?-t:t,zf=(t,n,r,o,a,i)=>{const s=Date.now;let l=0,c=!1,d=!1,u=!1,f=!1;const m=(()=>{let w;const g=()=>{w!=It&&clearTimeout(w)},_=()=>{g(),w=Ln(()=>{w=It,(()=>{if(c||d)return c=!1,void m();u=!1,t.A(2)})()},150)};return _.C=g,_})(),h=()=>{l=s(),u&&(f=!0),t.A(1,o()),m()},p=w=>{if(c||!t.B()||w.ctrlKey)return;const g=s()-l;150>g&&50<g&&(r?w.deltaX:w.deltaY)&&(c=!0)},y=()=>{d=!0,u=f=!1},b=()=>{d=!1,Eo()&&(u=!0)};return n.addEventListener("scroll",h),n.addEventListener("wheel",p,{passive:!0}),n.addEventListener("touchstart",y,{passive:!0}),n.addEventListener("touchend",b,{passive:!0}),{H:()=>{n.removeEventListener("scroll",h),n.removeEventListener("wheel",p),n.removeEventListener("touchstart",y),n.removeEventListener("touchend",b),m.C()},V:()=>{const[w,g]=t.P();w&&(a(w,g,f),f=!1,g&&t.T()>t.M()&&t.A(1,o()))}}},Lf=(t,n,r)=>{let o;return[async(a,i)=>{if(!await n())return;o&&o();const s=()=>{const[l,c]=zn();return o=()=>{c(!1)},t.T()&&Ln(o,150),[l,t.R(2,()=>{c(!0)})]};if(i&&Df())t.A(8,a()),Pf(async()=>{for(;;){let l=!0;for(let[u,f]=t.v();u<=f;u++)if(t.I(u)){l=!1;break}if(l)break;const[c,d]=s();try{if(!await c)return}finally{d()}}t.A(7),r(a(),i)});else for(;;){const[l,c]=s();try{if(t.A(7),r(a()),!await l)return}finally{c()}}},()=>{o&&o()}]},Ff=t=>{let n;return{F(r){(n||(n=new(Vf($f(r))).ResizeObserver(t))).observe(r)},J(r){n.unobserve(r)},H(){n&&n.disconnect()}}},Hf=e.defineComponent({props:{L:{type:Object,required:!0},W:{type:Object,required:!0},X:{type:Object,required:!0},Y:{type:Function,required:!0},D:{type:Number,required:!0},U:{type:Boolean},G:{type:Boolean},K:{type:Boolean},Z:{type:String,required:!0},ee:Object},setup(t){const n=e.ref(),r=e.computed(()=>t.L.value&&t.W.O(t.D,t.K)),o=e.computed(()=>t.L.value&&t.W.I(t.D));return e.watch(()=>n.value&&t.D,(a,i,s)=>{s(t.Y(n.value,t.D))},{flush:"post"}),()=>{var a;const{X:i,U:s,G:l,Z:c}=t,d=o.value,{style:u,...f}=(a=t.ee)!==null&&a!==void 0?a:{},m={contain:"layout style",position:d&&l?void 0:"absolute",[s?"height":"width"]:"100%",[s?"top":"left"]:"0px",[s?"left":"top"]:r.value+"px",visibility:!d||l?void 0:"hidden",...u};return s&&(m.display="inline-flex"),e.createVNode(c,e.mergeProps({ref:n,style:m},f),typeof(h=i)=="function"||Object.prototype.toString.call(h)==="[object Object]"&&!e.isVNode(h)?i:{default:()=>[i],_:2},16,["style"]);var h}}}),Uf=(t,n)=>{const r=t.key;return r??"_"+n},qf=(t,n)=>t[0]===n[0]&&t[1]===n[1],No=e.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,startMargin:{type:Number,default:0},ssrCount:Number,scrollRef:Object,as:{type:String,default:"div"},item:{type:String,default:"div"},itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(t,{emit:n,expose:r,slots:o}){let a=!!t.ssrCount;const i=t.horizontal,s=e.ref(),l=Of(t.data.length,t.itemSize,t.ssrCount,t.cache,!t.itemSize),c=((p,y)=>{let b;const w=y?"width":"height",g=new WeakMap,_=Ff(S=>{const P=[];for(const{target:V,contentRect:$}of S)if(V.offsetParent)if(V===b)p.A(4,$[w]);else{const D=g.get(V);D!=It&&P.push([D,$[w]])}P.length&&p.A(3,P)});return{te(S){_.F(b=S)},re:(S,P)=>(g.set(S,P),_.F(S),()=>{g.delete(S),_.J(S)}),p:_.H}})(l,i),d=((p,y)=>{let b,w,g=zn(),_=!1;const S=y?"scrollLeft":"scrollTop",P=y?"overflowX":"overflowY",[V,$]=Lf(p,()=>g[0],(D,E)=>{D=Fn(D,_),E?b.scrollTo({[y?"left":"top"]:D,behavior:"smooth"}):b[S]=D});return{oe(D){b=D,y&&(_=getComputedStyle(D).direction==="rtl"),w=zf(p,D,y,()=>Fn(D[S],_),(E,N,M)=>{if(M){const R=D.style,T=R[P];R[P]="hidden",Ln(()=>{R[P]=T})}D[S]=Fn(p.N()+E,_),N&&$()}),g[1](!0)},p(){w&&w.H(),g[1](!1),g=zn()},ne:()=>_,se(D){V(()=>D)},ie(D){D+=p.N(),V(()=>D)},le(D,{align:E,smooth:N,offset:M=0}={}){if(D=bo(D,0,p.j()-1),E==="nearest"){const R=p.O(D),T=p.N();if(R<T)E="start";else{if(!(R+p.k(D)>T+p.T()))return;E="end"}}V(()=>M+p.q()+p.O(D)+(E==="end"?p.k(D)-p.T():E==="center"?(p.k(D)-p.T())/2:0),N)},ce:()=>{w&&w.V()}}})(l,i),u=e.ref(l.h());l.R(1,()=>{u.value=l.h()}),l.R(4,()=>{n("scroll",l.N())}),l.R(8,()=>{n("scrollEnd")});const f=e.computed(p=>{u.value;const y=l.v(t.bufferSize);return p&&qf(p,y)?p:y}),m=e.computed(()=>u.value&&l.B()),h=e.computed(()=>u.value&&l.M());return e.onMounted(()=>{a=!1;const p=requestAnimationFrame(()=>{const y=b=>{c.te(b),d.oe(b)};t.scrollRef?y(t.scrollRef):y(s.value.parentElement)});e.onUnmounted(()=>{cancelAnimationFrame(p)})}),e.onUnmounted(()=>{l.p(),c.p(),d.p()}),e.watch(()=>t.data.length,p=>{l.A(5,[p,t.shift])}),e.watch(()=>t.startMargin,p=>{l.A(6,p)},{immediate:!0}),e.watch([u],()=>{d.ce()},{flush:"post"}),r({get cache(){return l.m()},get scrollOffset(){return l.N()},get scrollSize(){return(p=>Le(p.M(),p.T()))(l)},get viewportSize(){return l.T()},findItemIndex:l.S,getItemOffset:l.O,getItemSize:l.k,scrollToIndex:d.le,scrollTo:d.se,scrollBy:d.ie}),()=>{const p=t.as,y=t.item,b=h.value,w=d.ne(),g=!i&&w?"unshift":"push",_=[],S=V=>{var $;const D=o.default({item:t.data[V],index:V})[0];return e.createVNode(Hf,{key:Uf(D,V),L:u,W:l,Y:c.re,D:V,X:D,U:i,K:w,G:a,Z:y,ee:($=t.itemProps)===null||$===void 0?void 0:$.call(t,{item:t.data[V],index:V})},null,8,["L","W","Y","D","X","U","K","G","Z","ee"])};if(t.keepMounted){const V=new Set(t.keepMounted);for(let[$,D]=f.value;$<=D;$++)V.add($);wo([...V]).forEach($=>{_[g](S($))})}else for(let[V,$]=f.value;V<=$;V++)_[g](S(V));return e.createVNode(p,{ref:s,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:i?b+"px":"100%",height:i?"100%":b+"px",pointerEvents:m.value?"none":void 0}},typeof(P=_)=="function"||Object.prototype.toString.call(P)==="[object Object]"&&!e.isVNode(P)?_:{default:()=>[_],_:2},8,["style"]);var P}}}),jf=e.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,ssrCount:Number,itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(t,{emit:n,expose:r,slots:o}){const a=t.horizontal,i=c=>{n("scroll",c)},s=()=>{n("scrollEnd")},l=e.ref();return r({get cache(){return l.value.cache},get scrollOffset(){return l.value.scrollOffset},get scrollSize(){return l.value.scrollSize},get viewportSize(){return l.value.viewportSize},findItemIndex:(...c)=>l.value.findItemIndex(...c),getItemOffset:(...c)=>l.value.getItemOffset(...c),getItemSize:(...c)=>l.value.getItemSize(...c),scrollToIndex:(...c)=>l.value.scrollToIndex(...c),scrollTo:(...c)=>l.value.scrollTo(...c),scrollBy:(...c)=>l.value.scrollBy(...c)}),()=>{return e.createVNode("div",{style:{display:a?"inline-block":"block",[a?"overflowX":"overflowY"]:"auto",contain:"strict",width:"100%",height:"100%"}},[e.createVNode(No,{ref:l,data:t.data,bufferSize:t.bufferSize,itemSize:t.itemSize,itemProps:t.itemProps,shift:t.shift,ssrCount:t.ssrCount,horizontal:a,keepMounted:t.keepMounted,cache:t.cache,onScroll:i,onScrollEnd:s},(c=o,typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!e.isVNode(c)?o:{default:()=>[o],_:2}),8,["data","bufferSize","itemSize","itemProps","shift","ssrCount","horizontal","keepMounted","cache","onScroll","onScrollEnd"])],4);var c}}}),Wf=(t,n=10)=>new Promise(r=>{let o=0,a=0,i=0;const s=()=>{const l=t.scrollSize;l===i&&l>0?o++:(o=0)&&(i=l),a++,o>=2||a>=n?r():requestAnimationFrame(s)};requestAnimationFrame(s)});function Gf(t,n){const r=(n==null?void 0:n.align)??"start";let o=!1;const a=e.ref(null),i=e.ref(!1),s=e.ref("measure"),l=e.computed(()=>e.toValue(t).length),c=e.computed(()=>s.value==="measure"?1:5),d=e.computed(()=>Array.from({length:l.value*c.value},(b,w)=>w)),u=async()=>{if(a.value&&(s.value="measure",o=!1,i.value=!1,await e.nextTick(),s.value==="measure")){if(await Wf(a.value),i.value=a.value.scrollSize>a.value.viewportSize,!i.value){o=!1;return}o=!0,s.value="loop",await e.nextTick(),a.value.scrollToIndex(l.value*3,{align:r})}},f=b=>s.value==="measure"?b:l.value===0?0:b%l.value,m=(b,w)=>{a.value&&a.value.scrollToIndex(b,w)},h=(b,w)=>!o||s.value!=="loop"?w:w+Math.round((b-w)/l.value)*l.value,p=b=>{if(!o||s.value!=="loop"||!a.value)return;const w=l.value-1,g=l.value*4;if(b<w)return m(l.value*3-1,{align:"start"});if(b>=g)return m(l.value*3,{align:"start"})},y=()=>{if(!a.value||!o)return;const b=a.value.findItemIndex(a.value.scrollOffset);p(b)};return e.onMounted(u),e.onUnmounted(()=>a.value=null),e.watch(l,()=>e.nextTick(u)),{listRef:a,items:d,hasScroll:i,realIndex:f,findNearestIndex:h,scrollToIndex:m,init:u,onScroll:y}}const Kf={pinch:!0,doubleTap:!0,wheel:!0,buttons:["+","-","=","0"]},Zf=t=>{var r;const n=Object.assign({},Kf,t);if(n.pinch&&(document.addEventListener("touchstart",o=>o.touches.length>1&&o.preventDefault(),{passive:!1}),document.addEventListener("gesturestart",o=>o.preventDefault(),{passive:!1})),n.doubleTap){let o=0;document.addEventListener("touchend",a=>{const i=Date.now();i-o<=250&&a.preventDefault(),o=i},{passive:!1})}n.wheel&&document.addEventListener("wheel",o=>(o.ctrlKey||o.metaKey)&&o.preventDefault(),{passive:!1}),(r=n.buttons)!=null&&r.length&&document.addEventListener("keydown",o=>(o.ctrlKey||o.metaKey)&&n.buttons.includes(o.key)&&o.preventDefault())};Object.defineProperty(L,"useRoute",{enumerable:!0,get:()=>Z.useRoute}),Object.defineProperty(L,"useRouter",{enumerable:!0,get:()=>Z.useRouter}),L.BasketButton=Af,L.BottomSheet=Pn,L.ButtonDefault=Re,L.CardMain=mo,L.CardProductPage=Vl,L.CardReader=ao,L.CartBox=oo,L.CartPage=Cu,L.DrumItem=Xu,L.FallingHearts=Sf,L.GroupMain=Gu,L.InitConnection=qe,L.ModalWindows=ff,L.NotificationWindow=An,L.PopupWindowDefault=ro,L.PricePrerender=ct,L.Recommendation=lf,L.RetryPage=Pu,L.TagsMain=Zu,L.VList=jf,L.Virtualizer=No,L.clearAllProductDB=Ko,L.clearLocalStorage=dt,L.getCachedGroup=dn,L.getCachedProduct=Xn,L.getWebSocketInstance=Ot,L.initPinia=Ao,L.initRouter=Po,L.preventZoom=Zf,L.updateIndexedDB=gf,L.useCachedMedia=Ze,L.useCardLibStore=fe,L.useCartLibStore=ue,L.useImageCacheStore=Vt,L.useMainLibStore=se,L.useModal=fo,L.useModalStore=Tn,L.useModulesLibStore=On,L.useThemeStore=ge,L.useVirtuaLoop=Gf,L.vClickOutside=mf,L.vMuted=vt,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});