@inno_user/inno_clouds_lib 9.1.0 → 9.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(z,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):(z=typeof globalThis<"u"?globalThis:z||self,K(z.InnoCloudsLib={},z.VueRouter,z.Pinia,z.Vue,z.VueuseCore,z.motionV))})(this,function(z,K,j,e,Ne,pe){"use strict";var Zd=Object.defineProperty;var Lo=z=>{throw TypeError(z)};var Yd=(z,K,j)=>K in z?Zd(z,K,{enumerable:!0,configurable:!0,writable:!0,value:j}):z[K]=j;var ee=(z,K,j)=>Yd(z,typeof K!="symbol"?K+"":K,j),zo=(z,K,j)=>K.has(z)||Lo("Cannot "+j);var xe=(z,K,j)=>(zo(z,K,"read from private field"),j?j.call(z):K.get(z)),Tt=(z,K,j)=>K.has(z)?Lo("Cannot add the same private member more than once"):K instanceof WeakSet?K.add(z):K.set(z,j),Pe=(z,K,j,e)=>(zo(z,K,"write to private field"),e?e.call(z,j):K.set(z,j),j);var un=(z,K,j,e)=>({set _(Ne){Pe(z,K,Ne,j)},get _(){return xe(z,K,e)}});var we,Oe,We;function jo(t){return t}const Ho=[];function qo(){return K.createRouter({history:K.createWebHistory(),routes:Ho})}const Mt=(t,n)=>n.some(o=>t instanceof o);let fn,mn;function Wo(){return fn||(fn=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Go(){return mn||(mn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Pt=new WeakMap,Vt=new WeakMap,ft=new WeakMap;function Ko(t){const n=new Promise((o,r)=>{const a=()=>{t.removeEventListener("success",s),t.removeEventListener("error",i)},s=()=>{o(Re(t.result)),a()},i=()=>{r(t.error),a()};t.addEventListener("success",s),t.addEventListener("error",i)});return ft.set(n,t),n}function Jo(t){if(Pt.has(t))return;const n=new Promise((o,r)=>{const a=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",i),t.removeEventListener("abort",i)},s=()=>{o(),a()},i=()=>{r(t.error||new DOMException("AbortError","AbortError")),a()};t.addEventListener("complete",s),t.addEventListener("error",i),t.addEventListener("abort",i)});Pt.set(t,n)}let It={get(t,n,o){if(t instanceof IDBTransaction){if(n==="done")return Pt.get(t);if(n==="store")return o.objectStoreNames[1]?void 0:o.objectStore(o.objectStoreNames[0])}return Re(t[n])},set(t,n,o){return t[n]=o,!0},has(t,n){return t instanceof IDBTransaction&&(n==="done"||n==="store")?!0:n in t}};function pn(t){It=t(It)}function Xo(t){return Go().includes(t)?function(...n){return t.apply(Rt(this),n),Re(this.request)}:function(...n){return Re(t.apply(Rt(this),n))}}function Zo(t){return typeof t=="function"?Xo(t):(t instanceof IDBTransaction&&Jo(t),Mt(t,Wo())?new Proxy(t,It):t)}function Re(t){if(t instanceof IDBRequest)return Ko(t);if(Vt.has(t))return Vt.get(t);const n=Zo(t);return n!==t&&(Vt.set(t,n),ft.set(n,t)),n}const Rt=t=>ft.get(t);function Yo(t,n,{blocked:o,upgrade:r,blocking:a,terminated:s}={}){const i=indexedDB.open(t,n),l=Re(i);return r&&i.addEventListener("upgradeneeded",c=>{r(Re(i.result),c.oldVersion,c.newVersion,Re(i.transaction),c)}),o&&i.addEventListener("blocked",c=>o(c.oldVersion,c.newVersion,c)),l.then(c=>{s&&c.addEventListener("close",()=>s()),a&&c.addEventListener("versionchange",d=>a(d.oldVersion,d.newVersion,d))}).catch(()=>{}),l}function Qo(t,{blocked:n}={}){const o=indexedDB.deleteDatabase(t);return n&&o.addEventListener("blocked",r=>n(r.oldVersion,r)),Re(o).then(()=>{})}const er=["get","getKey","getAll","getAllKeys","count"],tr=["put","add","delete","clear"],Dt=new Map;function hn(t,n){if(!(t instanceof IDBDatabase&&!(n in t)&&typeof n=="string"))return;if(Dt.get(n))return Dt.get(n);const o=n.replace(/FromIndex$/,""),r=n!==o,a=tr.includes(o);if(!(o in(r?IDBIndex:IDBObjectStore).prototype)||!(a||er.includes(o)))return;const s=async function(i,...l){const c=this.transaction(i,a?"readwrite":"readonly");let d=c.store;return r&&(d=d.index(l.shift())),(await Promise.all([d[o](...l),a&&c.done]))[0]};return Dt.set(n,s),s}pn(t=>({...t,get:(n,o,r)=>hn(n,o)||t.get(n,o,r),has:(n,o)=>!!hn(n,o)||t.has(n,o)}));const nr=["continue","continuePrimaryKey","advance"],_n={},Ot=new WeakMap,gn=new WeakMap,or={get(t,n){if(!nr.includes(n))return t[n];let o=_n[n];return o||(o=_n[n]=function(...r){Ot.set(this,gn.get(this)[n](...r))}),o}};async function*rr(...t){let n=this;if(n instanceof IDBCursor||(n=await n.openCursor(...t)),!n)return;n=n;const o=new Proxy(n,or);for(gn.set(o,n),ft.set(o,Rt(n));n;)yield o,n=await(Ot.get(o)||n.continue()),Ot.delete(o)}function yn(t,n){return n===Symbol.asyncIterator&&Mt(t,[IDBIndex,IDBObjectStore,IDBCursor])||n==="iterate"&&Mt(t,[IDBIndex,IDBObjectStore])}pn(t=>({...t,get(n,o,r){return yn(n,o)?rr:t.get(n,o,r)},has(n,o){return yn(n,o)||t.has(n,o)}}));let Ge;async function Fe(){return Ge||(Ge=Yo("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"})}})),Ge}async function Ft(t){return(await Fe()).transaction("groups","readonly").objectStore("groups").get(t)}async function et(t,n){const r=(await Fe()).transaction("groups","readwrite");await r.objectStore("groups").put({id:t,data:n,timestamp:Date.now()}),await r.done}async function ar(t,n){const o=JSON.parse(JSON.stringify(e.toRaw(n.value)));await et(t,o)}async function Lt(t,n){const r=(await Fe()).transaction("media","readwrite");await r.objectStore("media").put({id:t,blob:n,timestamp:Date.now()}),await r.done}async function Ke(t){const a=await(await Fe()).transaction("media","readonly").objectStore("media").get(t);return a==null?void 0:a.blob}async function sr(t){const o=(await Fe()).transaction("products","readwrite"),r=o.objectStore("products"),a=t.id;await r.put({id:a,product:t,timestamp:Date.now()}),await o.done}async function bn(t){const a=await(await Fe()).transaction("products","readonly").objectStore("products").get(t);return a==null?void 0:a.product}async function ir(){if(Ge){const t=await Ge.catch(()=>null);t&&t.close(),Ge=void 0}try{await Qo("data",{blocked(){console.warn("Удаление заблокировано. открыты другие вкладки с сайтом.")}})}catch(t){console.error("Не удалось удалить базу: [lib, indexedDB]",t)}}function mt(t){"@babel/helpers - typeof";return mt=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},mt(t)}var lr=/^\s+/,cr=/\s+$/;function W(t,n){if(t=t||"",n=n||{},t instanceof W)return t;if(!(this instanceof W))return new W(t,n);var o=dr(t);this._originalInput=t,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||o.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=o.ok}W.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(),o,r,a,s,i,l;return o=n.r/255,r=n.g/255,a=n.b/255,o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),a<=.03928?l=a/12.92:l=Math.pow((a+.055)/1.055,2.4),.2126*s+.7152*i+.0722*l},setAlpha:function(n){return this._a=Nn(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=kn(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=kn(this._r,this._g,this._b),o=Math.round(n.h*360),r=Math.round(n.s*100),a=Math.round(n.v*100);return this._a==1?"hsv("+o+", "+r+"%, "+a+"%)":"hsva("+o+", "+r+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var n=wn(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=wn(this._r,this._g,this._b),o=Math.round(n.h*360),r=Math.round(n.s*100),a=Math.round(n.l*100);return this._a==1?"hsl("+o+", "+r+"%, "+a+"%)":"hsla("+o+", "+r+"%, "+a+"%, "+this._roundA+")"},toHex:function(n){return Cn(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return pr(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(se(this._r,255)*100)+"%",g:Math.round(se(this._g,255)*100)+"%",b:Math.round(se(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(se(this._r,255)*100)+"%, "+Math.round(se(this._g,255)*100)+"%, "+Math.round(se(this._b,255)*100)+"%)":"rgba("+Math.round(se(this._r,255)*100)+"%, "+Math.round(se(this._g,255)*100)+"%, "+Math.round(se(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:xr[Cn(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var o="#"+Sn(this._r,this._g,this._b,this._a),r=o,a=this._gradientType?"GradientType = 1, ":"";if(n){var s=W(n);r="#"+Sn(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+o+",endColorstr="+r+")"},toString:function(n){var o=!!n;n=n||this._format;var r=!1,a=this._a<1&&this._a>=0,s=!o&&a&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return s?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(r=this.toRgbString()),n==="prgb"&&(r=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(r=this.toHexString()),n==="hex3"&&(r=this.toHexString(!0)),n==="hex4"&&(r=this.toHex8String(!0)),n==="hex8"&&(r=this.toHex8String()),n==="name"&&(r=this.toName()),n==="hsl"&&(r=this.toHslString()),n==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return W(this.toString())},_applyModification:function(n,o){var r=n.apply(null,[this].concat([].slice.call(o)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(yr,arguments)},brighten:function(){return this._applyModification(br,arguments)},darken:function(){return this._applyModification(wr,arguments)},desaturate:function(){return this._applyModification(hr,arguments)},saturate:function(){return this._applyModification(_r,arguments)},greyscale:function(){return this._applyModification(gr,arguments)},spin:function(){return this._applyModification(kr,arguments)},_applyCombination:function(n,o){return n.apply(null,[this].concat([].slice.call(o)))},analogous:function(){return this._applyCombination(Er,arguments)},complement:function(){return this._applyCombination(Cr,arguments)},monochromatic:function(){return this._applyCombination(Nr,arguments)},splitcomplement:function(){return this._applyCombination(Sr,arguments)},triad:function(){return this._applyCombination(En,[3])},tetrad:function(){return this._applyCombination(En,[4])}},W.fromRatio=function(t,n){if(mt(t)=="object"){var o={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?o[r]=t[r]:o[r]=tt(t[r]));t=o}return W(t,n)};function dr(t){var n={r:0,g:0,b:0},o=1,r=null,a=null,s=null,i=!1,l=!1;return typeof t=="string"&&(t=$r(t)),mt(t)=="object"&&(Ve(t.r)&&Ve(t.g)&&Ve(t.b)?(n=ur(t.r,t.g,t.b),i=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Ve(t.h)&&Ve(t.s)&&Ve(t.v)?(r=tt(t.s),a=tt(t.v),n=mr(t.h,r,a),i=!0,l="hsv"):Ve(t.h)&&Ve(t.s)&&Ve(t.l)&&(r=tt(t.s),s=tt(t.l),n=fr(t.h,r,s),i=!0,l="hsl"),t.hasOwnProperty("a")&&(o=t.a)),o=Nn(o),{ok:i,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:o}}function ur(t,n,o){return{r:se(t,255)*255,g:se(n,255)*255,b:se(o,255)*255}}function wn(t,n,o){t=se(t,255),n=se(n,255),o=se(o,255);var r=Math.max(t,n,o),a=Math.min(t,n,o),s,i,l=(r+a)/2;if(r==a)s=i=0;else{var c=r-a;switch(i=l>.5?c/(2-r-a):c/(r+a),r){case t:s=(n-o)/c+(n<o?6:0);break;case n:s=(o-t)/c+2;break;case o:s=(t-n)/c+4;break}s/=6}return{h:s,s:i,l}}function fr(t,n,o){var r,a,s;t=se(t,360),n=se(n,100),o=se(o,100);function i(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)r=a=s=o;else{var l=o<.5?o*(1+n):o+n-o*n,c=2*o-l;r=i(c,l,t+1/3),a=i(c,l,t),s=i(c,l,t-1/3)}return{r:r*255,g:a*255,b:s*255}}function kn(t,n,o){t=se(t,255),n=se(n,255),o=se(o,255);var r=Math.max(t,n,o),a=Math.min(t,n,o),s,i,l=r,c=r-a;if(i=r===0?0:c/r,r==a)s=0;else{switch(r){case t:s=(n-o)/c+(n<o?6:0);break;case n:s=(o-t)/c+2;break;case o:s=(t-n)/c+4;break}s/=6}return{h:s,s:i,v:l}}function mr(t,n,o){t=se(t,360)*6,n=se(n,100),o=se(o,100);var r=Math.floor(t),a=t-r,s=o*(1-n),i=o*(1-a*n),l=o*(1-(1-a)*n),c=r%6,d=[o,i,s,s,l,o][c],u=[l,o,o,i,s,s][c],f=[s,s,l,o,o,i][c];return{r:d*255,g:u*255,b:f*255}}function Cn(t,n,o,r){var a=[Be(Math.round(t).toString(16)),Be(Math.round(n).toString(16)),Be(Math.round(o).toString(16))];return r&&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 pr(t,n,o,r,a){var s=[Be(Math.round(t).toString(16)),Be(Math.round(n).toString(16)),Be(Math.round(o).toString(16)),Be(xn(r))];return a&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function Sn(t,n,o,r){var a=[Be(xn(r)),Be(Math.round(t).toString(16)),Be(Math.round(n).toString(16)),Be(Math.round(o).toString(16))];return a.join("")}W.equals=function(t,n){return!t||!n?!1:W(t).toRgbString()==W(n).toRgbString()},W.random=function(){return W.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function hr(t,n){n=n===0?0:n||10;var o=W(t).toHsl();return o.s-=n/100,o.s=pt(o.s),W(o)}function _r(t,n){n=n===0?0:n||10;var o=W(t).toHsl();return o.s+=n/100,o.s=pt(o.s),W(o)}function gr(t){return W(t).desaturate(100)}function yr(t,n){n=n===0?0:n||10;var o=W(t).toHsl();return o.l+=n/100,o.l=pt(o.l),W(o)}function br(t,n){n=n===0?0:n||10;var o=W(t).toRgb();return o.r=Math.max(0,Math.min(255,o.r-Math.round(255*-(n/100)))),o.g=Math.max(0,Math.min(255,o.g-Math.round(255*-(n/100)))),o.b=Math.max(0,Math.min(255,o.b-Math.round(255*-(n/100)))),W(o)}function wr(t,n){n=n===0?0:n||10;var o=W(t).toHsl();return o.l-=n/100,o.l=pt(o.l),W(o)}function kr(t,n){var o=W(t).toHsl(),r=(o.h+n)%360;return o.h=r<0?360+r:r,W(o)}function Cr(t){var n=W(t).toHsl();return n.h=(n.h+180)%360,W(n)}function En(t,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var o=W(t).toHsl(),r=[W(t)],a=360/n,s=1;s<n;s++)r.push(W({h:(o.h+s*a)%360,s:o.s,l:o.l}));return r}function Sr(t){var n=W(t).toHsl(),o=n.h;return[W(t),W({h:(o+72)%360,s:n.s,l:n.l}),W({h:(o+216)%360,s:n.s,l:n.l})]}function Er(t,n,o){n=n||6,o=o||30;var r=W(t).toHsl(),a=360/o,s=[W(t)];for(r.h=(r.h-(a*n>>1)+720)%360;--n;)r.h=(r.h+a)%360,s.push(W(r));return s}function Nr(t,n){n=n||6;for(var o=W(t).toHsv(),r=o.h,a=o.s,s=o.v,i=[],l=1/n;n--;)i.push(W({h:r,s:a,v:s})),s=(s+l)%1;return i}W.mix=function(t,n,o){o=o===0?0:o||50;var r=W(t).toRgb(),a=W(n).toRgb(),s=o/100,i={r:(a.r-r.r)*s+r.r,g:(a.g-r.g)*s+r.g,b:(a.b-r.b)*s+r.b,a:(a.a-r.a)*s+r.a};return W(i)},W.readability=function(t,n){var o=W(t),r=W(n);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},W.isReadable=function(t,n,o){var r=W.readability(t,n),a,s;switch(s=!1,a=Tr(o),a.level+a.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s},W.mostReadable=function(t,n,o){var r=null,a=0,s,i,l,c;o=o||{},i=o.includeFallbackColors,l=o.level,c=o.size;for(var d=0;d<n.length;d++)s=W.readability(t,n[d]),s>a&&(a=s,r=W(n[d]));return W.isReadable(t,r,{level:l,size:c})||!i?r:(o.includeFallbackColors=!1,W.mostReadable(t,["#fff","#000"],o))};var zt=W.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"},xr=W.hexNames=Br(zt);function Br(t){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[t[o]]=o);return n}function Nn(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function se(t,n){vr(t)&&(t="100%");var o=Ar(t);return t=Math.min(n,Math.max(0,parseFloat(t))),o&&(t=parseInt(t*n,10)/100),Math.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function pt(t){return Math.min(1,Math.max(0,t))}function Ce(t){return parseInt(t,16)}function vr(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function Ar(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Be(t){return t.length==1?"0"+t:""+t}function tt(t){return t<=1&&(t=t*100+"%"),t}function xn(t){return Math.round(parseFloat(t)*255).toString(16)}function Bn(t){return Ce(t)/255}var ve=function(){var t="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",o="(?:"+n+")|(?:"+t+")",r="[\\s|\\(]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")\\s*\\)?",a="[\\s|\\(]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")\\s*\\)?";return{CSS_UNIT:new RegExp(o),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+r),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 Ve(t){return!!ve.CSS_UNIT.exec(t)}function $r(t){t=t.replace(lr,"").replace(cr,"").toLowerCase();var n=!1;if(zt[t])t=zt[t],n=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var o;return(o=ve.rgb.exec(t))?{r:o[1],g:o[2],b:o[3]}:(o=ve.rgba.exec(t))?{r:o[1],g:o[2],b:o[3],a:o[4]}:(o=ve.hsl.exec(t))?{h:o[1],s:o[2],l:o[3]}:(o=ve.hsla.exec(t))?{h:o[1],s:o[2],l:o[3],a:o[4]}:(o=ve.hsv.exec(t))?{h:o[1],s:o[2],v:o[3]}:(o=ve.hsva.exec(t))?{h:o[1],s:o[2],v:o[3],a:o[4]}:(o=ve.hex8.exec(t))?{r:Ce(o[1]),g:Ce(o[2]),b:Ce(o[3]),a:Bn(o[4]),format:n?"name":"hex8"}:(o=ve.hex6.exec(t))?{r:Ce(o[1]),g:Ce(o[2]),b:Ce(o[3]),format:n?"name":"hex"}:(o=ve.hex4.exec(t))?{r:Ce(o[1]+""+o[1]),g:Ce(o[2]+""+o[2]),b:Ce(o[3]+""+o[3]),a:Bn(o[4]+""+o[4]),format:n?"name":"hex8"}:(o=ve.hex3.exec(t))?{r:Ce(o[1]+""+o[1]),g:Ce(o[2]+""+o[2]),b:Ce(o[3]+""+o[3]),format:n?"name":"hex"}:!1}function Tr(t){var n,o;return t=t||{level:"AA",size:"small"},n=(t.level||"AA").toUpperCase(),o=(t.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),o!=="small"&&o!=="large"&&(o="small"),{level:n,size:o}}const nt=j.defineStore("imageCache",()=>{const t=e.ref({});let n=!1;function o(c,d){const u=String(c);t.value[u]&&URL.revokeObjectURL(t.value[u]);const f=URL.createObjectURL(d);t.value={...t.value,[u]:f}}async function r(c){if(!c){console.warn("initCacheSingle called with null/undefined id");return}const d=String(c);if(t.value[d])return;const u=await Ke(d);u&&(o(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&&o(d,u)}function s(){typeof window>"u"||n||(window.addEventListener("image-cached",a),n=!0)}function i(){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"&&s(),{cache:t,initCacheSingle:r,updateCacheFromBlob:o,cleanup:l,setupEventListener:s,removeEventListener:i}}),_e=j.defineStore("themeLib",()=>{const t=nt(),{initCacheSingle:n}=t,o=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,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:"",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},show_order_comment:null,show_nutrition_in_cart:null,apply_custom_size_picker_fonts:null,size_picker_unselected_font_size:null,size_picker_selected_font_size:null}),r=async s=>{if(!s)return;o.value={...s};const i=await Ke("banner"),l=await Ke("preloader"),c=await Ke("defaultImage");i||a(s.kiosk_banner,"banner"),l||a(s.kiosk_preloader,"preloader"),c||a(s.fallback_image,"defaultImage"),document.documentElement.style.setProperty("--primaryColor",s.primary_color),document.documentElement.style.setProperty("--accentColor",s.accent_color),document.documentElement.style.setProperty("--accentLightColor",s.accent_light_color),document.documentElement.style.setProperty("--accentDarkColor",s.accent_dark_color),document.documentElement.style.setProperty("--bgButtonColor",s.bg_button_color),document.documentElement.style.setProperty("--inactiveButtonColor",s.inactive_button_color),document.documentElement.style.setProperty("--cardsColor",s.cards_color),document.documentElement.style.setProperty("--textColor",s.text_color),document.documentElement.style.setProperty("--nonworkingBgColor",s.nonworking_bg_color),s.apply_custom_size_picker_fonts&&s.size_picker_unselected_font_size&&s.size_picker_unselected_font_size>0&&document.documentElement.style.setProperty("--sizePickerUnselectedFontSize",`${s.size_picker_unselected_font_size}rem`),s.apply_custom_size_picker_fonts&&s.size_picker_selected_font_size&&s.size_picker_selected_font_size>0&&document.documentElement.style.setProperty("--sizePickerSelectedFontSize",`${s.size_picker_selected_font_size}rem`);const d=o.value.primary_color||"#F2F7FF",u=W(d).setAlpha(.7).toRgbString(),f=`linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`,g=`-webkit-linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`;return o.value.gradientStyle={background:f,backgroundColor:g},o.value},a=async(s,i)=>{if(s){const l=await fetch(s);if(!l.ok)throw new Error("Network error");const c=await l.blob();Lt(i,c),n(i)}};return{itemThemes:o,updateColor:r}}),ot=t=>{if(!t)return 0;if((t.price===0||t.price===null)&&t.sizes&&t.sizes.length>0){const n=t.sizes.find(o=>o.is_default===!0);return n?n.price:t.sizes.length>1&&t.sizes[1].price||t.sizes[0].price}return t.price};class rt extends Error{}rt.prototype.name="InvalidTokenError";function Mr(t){return decodeURIComponent(atob(t).replace(/(.)/g,(n,o)=>{let r=o.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function Pr(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 Mr(n)}catch{return atob(n)}}function vn(t,n){if(typeof t!="string")throw new rt("Invalid token specified: must be a string");n||(n={});const o=n.header===!0?0:1,r=t.split(".")[o];if(typeof r!="string")throw new rt(`Invalid token specified: missing part #${o+1}`);let a;try{a=Pr(r)}catch(s){throw new rt(`Invalid token specified: invalid base64 for part #${o+1} (${s.message})`)}try{return JSON.parse(a)}catch(s){throw new rt(`Invalid token specified: invalid json for part #${o+1} (${s.message})`)}}const Vr=(t,n)=>{if(typeof window<"u"){const o=localStorage.getItem(t);return o?JSON.parse(o):n}return n},Ir=(t,n)=>{if(typeof window<"u"){const o=localStorage.getItem(t);if(o)try{return vn(JSON.parse(o))}catch(r){return console.error("Failed to decode JWT:",r),n}}return n},An=(t,n,o="normal")=>{const r=e.ref(o==="jwt"?Ir(t,n):Vr(t,n));return e.watchEffect(()=>{r.value===null||r.value===void 0?localStorage.removeItem(t):o!=="jwt"&&localStorage.setItem(t,JSON.stringify(r.value))}),r},Je=t=>{t.forEach(n=>{try{localStorage.removeItem(n)}catch(o){console.error(`Ошибка при удалении ключа "${n}":`,o)}})};class Rr{constructor(n,o={}){ee(this,"url");ee(this,"options");ee(this,"ws");ee(this,"reconnectInterval");ee(this,"listeners");ee(this,"isConnected");ee(this,"heartbeat");ee(this,"pingTimeout");ee(this,"pingResponseTimeout");ee(this,"_shouldReconnect",!0);this.url=n,this.options=o,this.ws=null,this.reconnectInterval=5e3,this.pingResponseTimeout=5e3,this.listeners=new Map,this.isConnected=e.ref(!1)}connect(){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),this.ws.onopen=()=>{console.warn("WebSocket connected"),this.isConnected.value=!0,this.emit("open"),this.heartbeat=setInterval(()=>this.sendPing(),3e5)},this.ws.onmessage=o=>{try{const r=JSON.parse(o.data);this.emit("message",r),r!=null&&r.type&&r.type!=="ping"&&clearTimeout(this.pingTimeout)}catch(r){console.error("Error parsing WebSocket message:",r)}},this.ws.onerror=o=>{console.error("WebSocket error:",o),this.emit("error",o),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 o;this.isConnected.value&&((o=this.ws)==null?void 0:o.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,o){this.listeners.has(n)||this.listeners.set(n,[]),this.listeners.get(n).push(o)}off(n,o){const r=this.listeners.get(n);r&&this.listeners.set(n,r.filter(a=>a!==o))}emit(n,o=null){const r=this.listeners.get(n);r&&r.forEach(a=>a(o))}getConnectionStatus(){return this.isConnected}}let ht=new Map;function _t(t,n={}){var r;if(ht.has(t)){const a=ht.get(t);if(a.isConnected.value&&((r=a.ws)==null?void 0:r.readyState)===WebSocket.OPEN)return a;a.close(!0),ht.delete(t)}const o=new Rr(t,n);return ht.set(t,o),o}const ie=j.defineStore("mainLib",()=>{const t=e.ref(),n=e.ref(!1),o=e.ref(localStorage.getItem("kiosk_timeout")),r=e.ref(0),a=e.ref(!1),s=e.ref(sessionStorage.getItem("is_adult")==="true"),i=e.ref([]),l=e.ref([]),c=e.ref(),d=e.ref(""),u=e.ref(0),f=e.ref(!1),g=e.ref(!1),_=e.ref(!0),m=e.ref(localStorage.getItem("apiKey")===null),y=e.ref(!1),S=e.ref({textNotification:""}),w=e.ref([]);let h=null;const p=b=>{const x=`wss://${c.value.area}/ws/device/${b}/`;h=_t(x);function V(){console.log("WebSocket connection opened")}function F(H){if(H.error)y.value=!0,S.value.textNotification=H.error,h==null||h.close(!0);else{if(!(H!=null&&H.params))return;typeof H.params.components.shift.is_ok!==null?_.value=H.params.components.shift.is_ok:_.value=!0}}function G(H){console.error("WebSocket error:",H),h.close(!0)}h.on("open",V),h.on("message",F),h.on("error",G),h.connect()},A=b=>{r.value=b,localStorage.setItem("kiosk_timeout",b)},D=b=>{n.value=b},O=e.ref(null),R=e.computed(()=>i.value.reduce((b,x)=>{let V=0,F=0;return x.group_modifiers&&(V=x.group_modifiers.reduce((G,H)=>H.modifiers?G+H.modifiers.reduce((X,te)=>X+te.old_price*te.amount,0):0,0)*x.amount),x.modifiers&&(F=x.modifiers.reduce((G,H)=>G+H.old_price*H.amount,0)*x.amount),b+x.old_price*x.amount+V+F},0)),M=e.computed({get:()=>i.value.length===0?0:O.value&&O.value!==0?O.value:i.value.reduce((b,x)=>{const V=ot(x)*x.amount;let F=0,G=0;return x.group_modifiers&&(F=x.group_modifiers.reduce((H,X)=>X.modifiers?H+X.modifiers.reduce((te,de)=>te+de.price*de.amount,0):0,0)*x.amount),x.modifiers&&(G=x.modifiers.reduce((H,X)=>H+X.price*X.amount,0)*x.amount),b+V+F+G},0),set(b){O.value=b}}),k=b=>{u.value=b,localStorage.removeItem("bonus"),An("bonus",u.value)},N=b=>{Je(b)},B=b=>{b={...b,idSystem:crypto.randomUUID()};const x=P(b);i.value.push(x),I()},I=()=>{try{if(!i.value||i.value.length===0){localStorage.removeItem("cart");return}localStorage.setItem("cart",JSON.stringify(e.toRaw(i.value)))}catch(b){console.error("Failed to update cart in localStorage:",b)}},P=b=>e.reactive({...b,amount:b.amount??1,price:b.old_price,new_price:null,total_new_price:null,discounts:[],modifiers:(b.modifiers||[]).map(x=>e.reactive({...x,price:x.old_price,new_price:null,total_new_price:null})),group_modifiers:(b.group_modifiers||[]).map(x=>e.reactive({...x,modifiers:(x.modifiers||[]).map(V=>e.reactive({...V,price:V.old_price,new_price:null,total_new_price:null}))}))}),T=b=>{const x=i.value.find(V=>V.idSystem===b);x&&(x.amount+=1),I()},C=b=>{const x=i.value.find(V=>V.idSystem===b);x&&(x.amount>=1&&(x.amount-=1),I())},v=()=>{try{const b=localStorage.getItem("cart");if(b){const x=JSON.parse(b);i.value.splice(0,i.value.length,...x.map(P)),O.value=null}}catch(b){console.error("Failed to load cart from localStorage:",b)}};return v(),{cartProducts_lib:i,activeScrolling_lib:l,config_lib:c,totalPrice_lib:M,initialCartPrice_lib:R,is_notification_lib:y,notificationData_lib:S,xApiKey_lib:d,countBonus:u,toggleDrum:n,is_showApiKey:m,openApiKey:f,kiosk_timeout:o,kiosk_FirstTimeout:r,is_OpenLoyal:g,profile:t,is_18_above_content:a,is18Allowed:s,healthState:_,displayCards:w,removeFromLocalStorage:N,setKioskTimeout:A,setBonus:k,setStateDrum:D,addToCart:B,plusAmount:T,minusAmount:C,loadCart:v,deleteItemFromCart:b=>{if(b){const x=i.value.findIndex(V=>V.idSystem===b);if(x===-1)return;i.value.splice(x,1),I(),O.value=null}else i.value=[],I()},updateCartInLocalStorage:I,makeProductFullyReactive:P,checkHeartbeatApp:p}}),Le=j.defineStore("cartLib",()=>{const t=K.useRouter(),n=K.useRoute(),o=_e(),r=ie(),{config_lib:a,countBonus:s,totalPrice_lib:i,initialCartPrice_lib:l,is18Allowed:c}=j.storeToRefs(r),{itemThemes:d}=j.storeToRefs(o),u=e.ref(!1),f=e.ref(""),g=e.ref(null),_=e.ref("wait"),m=e.ref(0),y=e.ref(null),S=e.ref(["failed_payment","failed_after_paid","failed","failed_after_sent","failed_after_sent_fiscalization","payment_initiation_retry"]),w=e.ref("Оплатить"),h=e.ref(null),p=e.ref(!1),A=e.ref(null),D=e.ref(0),O=e.ref(!1),R=e.ref({textNotification:""});let M=null;const k=V=>{O.value=!0,R.value.textNotification=V},N=async(V,F,G=!1)=>{if(!V)return console.warn("makeInitPaymentLinkRequest","orderId is empry");try{const X=await Ie.create().initPaymentLink(V,F);x(null,F),G?(M==null||M.close(!0),b(),x("profile",F)):F||window.location.replace(X.url)}catch(H){A.value=null,r.loadCart(),H.response.data.user_friendly_message?(k(H.response.data.user_friendly_message),M==null||M.close(!0),F&&S.value.includes(H.response.status)?x("retryPage",F):G?(b(),x("",F)):(s.value=0,F||t.push(`/${n.params.orgId}/errorPayment`))):G?b():F||(s.value=0,t.push(`/${n.params.orgId}/errorPayment`))}},B=(V,F,G=!1)=>{M&&(M.off("open",X),M.off("message",te),M.off("error",de),M.close(!0));const H=`wss://${a.value.area}/ws/order/${V}/`;M=_t(H);function X(){console.log("WebSocket connection opened")}function te(oe){if(oe!=null&&oe.params)if(h.value=oe,oe.error)k(oe.error),A.value=null,M==null||M.close(!0);else if(oe.params.status==="sent"){if(a.value.has_rms_discount)return oe.params.new_discounts&&(m.value=Number(oe.params.new_total_cost)-l.value,i.value=Number(oe.params.new_total_cost),k("К заказу были добавлены скидки")),p.value=!1;N(V,F,G)}else oe.params.status==="payment_initiation_retry"||oe.params.status==="fiscalized"?(A.value=2,Ie.create().orderPay(V).then(q=>{y.value=q.data.order_number}).catch(q=>{q.response.data.user_friendly_message&&(k(q.response.data.user_friendly_message),M.close(!0),F?S.value.includes(q.response.status)&&(x("retryPage",F),A.value=null):(s.value=0,t.push(`/${n.params.orgId}/errorPayment`),A.value=null))}).finally(()=>{p.value=!1})):oe.params.status==="paid"?(A.value=3,M.close(!0),localStorage.removeItem("cart")):S.value.includes(oe.params.status)&&(F?(x("retryPage",F),A.value=null):G?(b(),k("Ошибка создания заказа. Пожалуйста попробуйте еще раз")):(s.value=0,t.push(`/${n.params.orgId}/errorPayment`),A.value=null))}function de(oe){console.error("WebSocket error:",oe),M.close(!0),p.value=!1,A.value=null}M.on("open",X),M.on("message",te),M.on("error",de),M.connect()},I=e.computed(()=>!!g.value),P=V=>{_.value=V},T=V=>g.value=V,C=()=>{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?r.is_OpenLoyal=!0:u.value=!0,_.value="wait",f.value=""},v=()=>{u.value=!1,_.value="wait",f.value=""},$=()=>{g.value=null,f.value="",_.value="wait",v()},b=()=>{s.value=0,p.value=!1,A.value=null},x=(V=null,F=!1)=>{r.cartProducts_lib=[],Je(["cart"]),F&&(Je(["authTokensAccess","authTokensRefresh","user"]),r.profile=null,sessionStorage.removeItem("is_adult"),c.value=!1),V&&t.push(`/${n.params.orgId}/${V}`)};return{statusWSCreate:h,isButtonDisabled:p,orderCompleted_lib:A,extraDiscount:m,orderNumber:y,is_notification_lib:O,notificationData_lib:R,textPaymentBtn_lib:w,count:D,guestInfo:g,error:f,isDrawerOpen:u,currentState:_,isAuthorized:I,orderSocket:B,deleteCart:x,setGuestInfo:T,setState:P,openDrawer:C,closeDrawer:v,clearCard:$,makeInitPaymentLinkRequest:N,showNotification:k}}),fe=j.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()),o=()=>n.value=t(),r=e.ref(!1),a=e.ref(!1),s=e.ref(!1),i=e.ref(),l=e.ref([]),c=e.ref({id:null,visible:!1}),d=e.ref(!0),u=e.computed(()=>{const k=n.value.groupModifiersSelected.findIndex(N=>N.group===n.value.groupCurrentOpen.id);return f(k)}),f=k=>k===-1?0:(n.value.groupModifiersSelected[k].modifiers||[]).reduce((B,I)=>B+(I.amount||0),0),g=e.computed(()=>{var N;const k=(N=n.value.openCard)==null?void 0:N.group_modifiers.findIndex(B=>B.id===n.value.groupCurrentOpen.id);return k===-1||!n.value.openCard?0:n.value.openCard.modifiers.length>0&&k===0?n.value.openCard.modifiers.reduce((B,I)=>B+I.max_amount,0):n.value.groupModifiers[k].max_amount}),_=e.computed(()=>{var N;const k=(n.value.addedProducts??[]).reduce((B,I)=>B+I.price,0);if(n.value.openCard){const B=n.value.openCard,I=ot(B)||0,P=B.amount||1;return(n.value.groupModifiersSelected.reduce((C,v)=>(v.modifiers.forEach($=>{var b,x;$.sizes&&($.price=((x=(b=$.sizes)==null?void 0:b.find(V=>V.id===n.value.selectedSize.id))==null?void 0:x.price)??$.price),C+=$.price*$.amount}),C),0)+I)*P+k}return(N=n.value.addedProducts)!=null&&N.length?k:0}),m=e.computed(()=>{const k=n.value.groupModifiers,N=n.value.groupModifiersSelected;for(let B=0;B<k.length;B++){const I=k[B],P=N[B];if(I.min_amount>0&&f(B)<I.min_amount)return n.value.textErrorRequaired=`В группе "${I.name}" должно содержаться не меньше ${I.min_amount} модификатора(ов)`,{haveRequaire:!0,group:I};for(const T of I.group_modifiers)if(T.min_amount>0){const C=P.modifiers.find(v=>v.id===T.id);if(!C||C.amount<T.min_amount)return n.value.textErrorRequaired=`В группе "${I.name}" выберите все обязательные модификаторы`,{haveRequaire:!0,group:I}}}return{haveRequaire:!1,group:k[0]}}),y=()=>{n.value.groupModifiers.forEach((k,N)=>{n.value.groupCurrentOpen={...k,index:N},k.group_modifiers.forEach(B=>{B.default_amount>0&&(B.amount=B.default_amount,R(B,!0))})})},S=k=>{n.value.addedProducts.push(k)},w=k=>{n.value.openCard=k},h=k=>{l.value=[...k]},p=(k,N)=>{var I,P;const B=k.id!==((I=n.value.groupCurrentOpen)==null?void 0:I.id);n.value.groupCurrentOpen={...k,index:N},B?n.value.isSectionModifier=!0:n.value.isSectionModifier=!n.value.isSectionModifier,document.body.style.overflow=n.value.isSectionModifier?"hidden":"",(P=n.value.plusButtonsRefs[N])==null||P.scrollIntoView({behavior:"smooth",block:"start"})},A=()=>{n.value.modalCount>n.value.currentModifier.min_amount&&n.value.modalCount>=2&&(n.value.modalCount-=1)},D=()=>{n.value.groupCurrentOpen&&n.value.modalCount+u.value<g.value&&(n.value.currentModifier.max_amount===0||n.value.currentModifier.max_amount>n.value.modalCount)&&(n.value.modalCount+=1)},O=(k,N)=>{var I;const B=(I=n.value.groupCurrentOpen)==null?void 0:I.id.toUpperCase();if(!k&&!n.value.isModifiedAmount&&N.max_amount!==1){if(B==="Добавки2000"&&N.max_amount>1)return!0;if(Math.abs(g.value-u.value)>1&&B!=="Добавки2000")return!0}return!1},R=(k,N=!1)=>{n.value.modalCount=1,n.value.currentModifier=k;const B=n.value.groupModifiersSelected.findIndex(I=>I.group===n.value.groupCurrentOpen.id);M(B,k,N)},M=(k,N,B)=>{let I=n.value.groupModifiersSelected;if(N.sizes.length>0&&N.sizes.find(P=>{var T;return P.id===((T=n.value.selectedSize)==null?void 0:T.id)}),k===-1)O(B,N)?n.value.isModifiedAmount=!0:I[n.value.groupCurrentOpen.index]={group:n.value.groupCurrentOpen.id,modifier_count:0,modifiers:[{...N,amount:(N==null?void 0:N.amount)??1}]};else{const P=n.value.groupModifiers[k].group_modifiers.findIndex(C=>C.id===N.id);if(I[k].modifiers.findIndex(C=>C.id===N.id)===-1){if(g.value===1)I[k].modifiers=[];else if(u.value>=g.value)return;O(B,N)?n.value.isModifiedAmount=!0:(I[k].modifiers.push({...N,amount:(N==null?void 0:N.amount)??1}),I[k].modifier_count=I[k].modifiers.reduce((C,v)=>C+=v.amount,0),n.value.isAnimationFly=!0)}else I[k].modifiers=I[k].modifiers.filter(C=>C.id!==N.id),I[k].modifier_count=I[k].modifiers.reduce((C,v)=>C+=v.amount,0),n.value.groupModifiers[k].group_modifiers[P].amount=1,n.value.groupModifiers[k].group_modifiers[P].default_amount=0,n.value.isAnimationFly=!1}n.value.groupModifiersSelected=I};return{stateCard:n,totalPrice_libCard:_,recountGroupTotalAmount:u,groupTotalAmount:g,isOpenWindow:r,isUpSale:a,checkedRequiredBtn:m,dataUpSale:i,productCards:l,isAddToCard:s,openProduct:c,is_startPage:d,setProduct:h,summModifierAmount:f,setAddedProducts:S,setCurrentCard:w,minusAmount:A,plusAmount:D,toggleNotRequire:p,modifierSelect:R,defaultAmountModifiers:y,reset:o}});function $n(t,n){return function(){return t.apply(n,arguments)}}const{toString:Dr}=Object.prototype,{getPrototypeOf:Ut}=Object,{iterator:gt,toStringTag:Tn}=Symbol,yt=(t=>n=>{const o=Dr.call(n);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Ae=t=>(t=t.toLowerCase(),n=>yt(n)===t),bt=t=>n=>typeof n===t,{isArray:Xe}=Array,Ze=bt("undefined");function at(t){return t!==null&&!Ze(t)&&t.constructor!==null&&!Ze(t.constructor)&&ge(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Mn=Ae("ArrayBuffer");function Or(t){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(t):n=t&&t.buffer&&Mn(t.buffer),n}const Fr=bt("string"),ge=bt("function"),Pn=bt("number"),st=t=>t!==null&&typeof t=="object",Lr=t=>t===!0||t===!1,wt=t=>{if(yt(t)!=="object")return!1;const n=Ut(t);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Tn in t)&&!(gt in t)},zr=t=>{if(!st(t)||at(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Ur=Ae("Date"),jr=Ae("File"),Hr=Ae("Blob"),qr=Ae("FileList"),Wr=t=>st(t)&&ge(t.pipe),Gr=t=>{let n;return t&&(typeof FormData=="function"&&t instanceof FormData||ge(t.append)&&((n=yt(t))==="formdata"||n==="object"&&ge(t.toString)&&t.toString()==="[object FormData]"))},Kr=Ae("URLSearchParams"),[Jr,Xr,Zr,Yr]=["ReadableStream","Request","Response","Headers"].map(Ae),Qr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function it(t,n,{allOwnKeys:o=!1}={}){if(t===null||typeof t>"u")return;let r,a;if(typeof t!="object"&&(t=[t]),Xe(t))for(r=0,a=t.length;r<a;r++)n.call(null,t[r],r,t);else{if(at(t))return;const s=o?Object.getOwnPropertyNames(t):Object.keys(t),i=s.length;let l;for(r=0;r<i;r++)l=s[r],n.call(null,t[l],l,t)}}function Vn(t,n){if(at(t))return null;n=n.toLowerCase();const o=Object.keys(t);let r=o.length,a;for(;r-- >0;)if(a=o[r],n===a.toLowerCase())return a;return null}const ze=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,In=t=>!Ze(t)&&t!==ze;function jt(){const{caseless:t,skipUndefined:n}=In(this)&&this||{},o={},r=(a,s)=>{const i=t&&Vn(o,s)||s;wt(o[i])&&wt(a)?o[i]=jt(o[i],a):wt(a)?o[i]=jt({},a):Xe(a)?o[i]=a.slice():(!n||!Ze(a))&&(o[i]=a)};for(let a=0,s=arguments.length;a<s;a++)arguments[a]&&it(arguments[a],r);return o}const ea=(t,n,o,{allOwnKeys:r}={})=>(it(n,(a,s)=>{o&&ge(a)?t[s]=$n(a,o):t[s]=a},{allOwnKeys:r}),t),ta=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),na=(t,n,o,r)=>{t.prototype=Object.create(n.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:n.prototype}),o&&Object.assign(t.prototype,o)},oa=(t,n,o,r)=>{let a,s,i;const l={};if(n=n||{},t==null)return n;do{for(a=Object.getOwnPropertyNames(t),s=a.length;s-- >0;)i=a[s],(!r||r(i,t,n))&&!l[i]&&(n[i]=t[i],l[i]=!0);t=o!==!1&&Ut(t)}while(t&&(!o||o(t,n))&&t!==Object.prototype);return n},ra=(t,n,o)=>{t=String(t),(o===void 0||o>t.length)&&(o=t.length),o-=n.length;const r=t.indexOf(n,o);return r!==-1&&r===o},aa=t=>{if(!t)return null;if(Xe(t))return t;let n=t.length;if(!Pn(n))return null;const o=new Array(n);for(;n-- >0;)o[n]=t[n];return o},sa=(t=>n=>t&&n instanceof t)(typeof Uint8Array<"u"&&Ut(Uint8Array)),ia=(t,n)=>{const r=(t&&t[gt]).call(t);let a;for(;(a=r.next())&&!a.done;){const s=a.value;n.call(t,s[0],s[1])}},la=(t,n)=>{let o;const r=[];for(;(o=t.exec(n))!==null;)r.push(o);return r},ca=Ae("HTMLFormElement"),da=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,r,a){return r.toUpperCase()+a}),Rn=(({hasOwnProperty:t})=>(n,o)=>t.call(n,o))(Object.prototype),ua=Ae("RegExp"),Dn=(t,n)=>{const o=Object.getOwnPropertyDescriptors(t),r={};it(o,(a,s)=>{let i;(i=n(a,s,t))!==!1&&(r[s]=i||a)}),Object.defineProperties(t,r)},fa=t=>{Dn(t,(n,o)=>{if(ge(t)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const r=t[o];if(ge(r)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},ma=(t,n)=>{const o={},r=a=>{a.forEach(s=>{o[s]=!0})};return Xe(t)?r(t):r(String(t).split(n)),o},pa=()=>{},ha=(t,n)=>t!=null&&Number.isFinite(t=+t)?t:n;function _a(t){return!!(t&&ge(t.append)&&t[Tn]==="FormData"&&t[gt])}const ga=t=>{const n=new Array(10),o=(r,a)=>{if(st(r)){if(n.indexOf(r)>=0)return;if(at(r))return r;if(!("toJSON"in r)){n[a]=r;const s=Xe(r)?[]:{};return it(r,(i,l)=>{const c=o(i,a+1);!Ze(c)&&(s[l]=c)}),n[a]=void 0,s}}return r};return o(t,0)},ya=Ae("AsyncFunction"),ba=t=>t&&(st(t)||ge(t))&&ge(t.then)&&ge(t.catch),On=((t,n)=>t?setImmediate:n?((o,r)=>(ze.addEventListener("message",({source:a,data:s})=>{a===ze&&s===o&&r.length&&r.shift()()},!1),a=>{r.push(a),ze.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",ge(ze.postMessage)),wa=typeof queueMicrotask<"u"?queueMicrotask.bind(ze):typeof process<"u"&&process.nextTick||On,E={isArray:Xe,isArrayBuffer:Mn,isBuffer:at,isFormData:Gr,isArrayBufferView:Or,isString:Fr,isNumber:Pn,isBoolean:Lr,isObject:st,isPlainObject:wt,isEmptyObject:zr,isReadableStream:Jr,isRequest:Xr,isResponse:Zr,isHeaders:Yr,isUndefined:Ze,isDate:Ur,isFile:jr,isBlob:Hr,isRegExp:ua,isFunction:ge,isStream:Wr,isURLSearchParams:Kr,isTypedArray:sa,isFileList:qr,forEach:it,merge:jt,extend:ea,trim:Qr,stripBOM:ta,inherits:na,toFlatObject:oa,kindOf:yt,kindOfTest:Ae,endsWith:ra,toArray:aa,forEachEntry:ia,matchAll:la,isHTMLForm:ca,hasOwnProperty:Rn,hasOwnProp:Rn,reduceDescriptors:Dn,freezeMethods:fa,toObjectSet:ma,toCamelCase:da,noop:pa,toFiniteNumber:ha,findKey:Vn,global:ze,isContextDefined:In,isSpecCompliantForm:_a,toJSONObject:ga,isAsyncFn:ya,isThenable:ba,setImmediate:On,asap:wa,isIterable:t=>t!=null&&ge(t[gt])};function J(t,n,o,r,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),o&&(this.config=o),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}E.inherits(J,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:E.toJSONObject(this.config),code:this.code,status:this.status}}});const Fn=J.prototype,Ln={};["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=>{Ln[t]={value:t}}),Object.defineProperties(J,Ln),Object.defineProperty(Fn,"isAxiosError",{value:!0}),J.from=(t,n,o,r,a,s)=>{const i=Object.create(Fn);E.toFlatObject(t,i,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 J.call(i,l,c,o,r,a),t&&i.cause==null&&Object.defineProperty(i,"cause",{value:t,configurable:!0}),i.name=t&&t.name||"Error",s&&Object.assign(i,s),i};const ka=null;function Ht(t){return E.isPlainObject(t)||E.isArray(t)}function zn(t){return E.endsWith(t,"[]")?t.slice(0,-2):t}function Un(t,n,o){return t?t.concat(n).map(function(a,s){return a=zn(a),!o&&s?"["+a+"]":a}).join(o?".":""):n}function Ca(t){return E.isArray(t)&&!t.some(Ht)}const Sa=E.toFlatObject(E,{},null,function(n){return/^is[A-Z]/.test(n)});function kt(t,n,o){if(!E.isObject(t))throw new TypeError("target must be an object");n=n||new FormData,o=E.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,S){return!E.isUndefined(S[y])});const r=o.metaTokens,a=o.visitor||u,s=o.dots,i=o.indexes,c=(o.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(n);if(!E.isFunction(a))throw new TypeError("visitor must be a function");function d(m){if(m===null)return"";if(E.isDate(m))return m.toISOString();if(E.isBoolean(m))return m.toString();if(!c&&E.isBlob(m))throw new J("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(m)||E.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,y,S){let w=m;if(m&&!S&&typeof m=="object"){if(E.endsWith(y,"{}"))y=r?y:y.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&Ca(m)||(E.isFileList(m)||E.endsWith(y,"[]"))&&(w=E.toArray(m)))return y=zn(y),w.forEach(function(p,A){!(E.isUndefined(p)||p===null)&&n.append(i===!0?Un([y],A,s):i===null?y:y+"[]",d(p))}),!1}return Ht(m)?!0:(n.append(Un(S,y,s),d(m)),!1)}const f=[],g=Object.assign(Sa,{defaultVisitor:u,convertValue:d,isVisitable:Ht});function _(m,y){if(!E.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(m),E.forEach(m,function(w,h){(!(E.isUndefined(w)||w===null)&&a.call(n,w,E.isString(h)?h.trim():h,y,g))===!0&&_(w,y?y.concat(h):[h])}),f.pop()}}if(!E.isObject(t))throw new TypeError("data must be an object");return _(t),n}function jn(t){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return n[r]})}function qt(t,n){this._pairs=[],t&&kt(t,this,n)}const Hn=qt.prototype;Hn.append=function(n,o){this._pairs.push([n,o])},Hn.toString=function(n){const o=n?function(r){return n.call(this,r,jn)}:jn;return this._pairs.map(function(a){return o(a[0])+"="+o(a[1])},"").join("&")};function Ea(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qn(t,n,o){if(!n)return t;const r=o&&o.encode||Ea;E.isFunction(o)&&(o={serialize:o});const a=o&&o.serialize;let s;if(a?s=a(n,o):s=E.isURLSearchParams(n)?n.toString():new qt(n,o).toString(r),s){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Wn{constructor(){this.handlers=[]}use(n,o,r){return this.handlers.push({fulfilled:n,rejected:o,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){E.forEach(this.handlers,function(r){r!==null&&n(r)})}}const Gn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Na={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:qt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Wt=typeof window<"u"&&typeof document<"u",Gt=typeof navigator=="object"&&navigator||void 0,xa=Wt&&(!Gt||["ReactNative","NativeScript","NS"].indexOf(Gt.product)<0),Ba=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",va=Wt&&window.location.href||"http://localhost",he={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wt,hasStandardBrowserEnv:xa,hasStandardBrowserWebWorkerEnv:Ba,navigator:Gt,origin:va},Symbol.toStringTag,{value:"Module"})),...Na};function Aa(t,n){return kt(t,new he.classes.URLSearchParams,{visitor:function(o,r,a,s){return he.isNode&&E.isBuffer(o)?(this.append(r,o.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...n})}function $a(t){return E.matchAll(/\w+|\[(\w*)]/g,t).map(n=>n[0]==="[]"?"":n[1]||n[0])}function Ta(t){const n={},o=Object.keys(t);let r;const a=o.length;let s;for(r=0;r<a;r++)s=o[r],n[s]=t[s];return n}function Kn(t){function n(o,r,a,s){let i=o[s++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),c=s>=o.length;return i=!i&&E.isArray(a)?a.length:i,c?(E.hasOwnProp(a,i)?a[i]=[a[i],r]:a[i]=r,!l):((!a[i]||!E.isObject(a[i]))&&(a[i]=[]),n(o,r,a[i],s)&&E.isArray(a[i])&&(a[i]=Ta(a[i])),!l)}if(E.isFormData(t)&&E.isFunction(t.entries)){const o={};return E.forEachEntry(t,(r,a)=>{n($a(r),a,o,0)}),o}return null}function Ma(t,n,o){if(E.isString(t))try{return(n||JSON.parse)(t),E.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(o||JSON.stringify)(t)}const lt={transitional:Gn,adapter:["xhr","http","fetch"],transformRequest:[function(n,o){const r=o.getContentType()||"",a=r.indexOf("application/json")>-1,s=E.isObject(n);if(s&&E.isHTMLForm(n)&&(n=new FormData(n)),E.isFormData(n))return a?JSON.stringify(Kn(n)):n;if(E.isArrayBuffer(n)||E.isBuffer(n)||E.isStream(n)||E.isFile(n)||E.isBlob(n)||E.isReadableStream(n))return n;if(E.isArrayBufferView(n))return n.buffer;if(E.isURLSearchParams(n))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Aa(n,this.formSerializer).toString();if((l=E.isFileList(n))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return kt(l?{"files[]":n}:n,c&&new c,this.formSerializer)}}return s||a?(o.setContentType("application/json",!1),Ma(n)):n}],transformResponse:[function(n){const o=this.transitional||lt.transitional,r=o&&o.forcedJSONParsing,a=this.responseType==="json";if(E.isResponse(n)||E.isReadableStream(n))return n;if(n&&E.isString(n)&&(r&&!this.responseType||a)){const i=!(o&&o.silentJSONParsing)&&a;try{return JSON.parse(n,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?J.from(l,J.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:he.classes.FormData,Blob:he.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],t=>{lt.headers[t]={}});const Pa=E.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"]),Va=t=>{const n={};let o,r,a;return t&&t.split(`
|
|
2
|
-
`).forEach(function(i){a=i.indexOf(":"),o=i.substring(0,a).trim().toLowerCase(),r=i.substring(a+1).trim(),!(!o||n[o]&&
|
|
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,...o){const r=new this(n);return o.forEach(a=>r.set(a)),r}static accessor(n){const r=(this[Jn]=this[Jn]={accessors:{}}).accessors,a=this.prototype;function s(i){const l=ct(i);r[l]||(Oa(a,i),r[l]=!0)}return E.isArray(n)?n.forEach(s):s(n),this}};ye.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),E.reduceDescriptors(ye.prototype,({value:t},n)=>{let o=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(r){this[o]=r}}}),E.freezeMethods(ye);function Jt(t,n){const o=this||lt,r=n||o,a=ye.from(r.headers);let s=r.data;return E.forEach(t,function(l){s=l.call(o,s,a.normalize(),n?n.status:void 0)}),a.normalize(),s}function Xn(t){return!!(t&&t.__CANCEL__)}function Ye(t,n,o){J.call(this,t??"canceled",J.ERR_CANCELED,n,o),this.name="CanceledError"}E.inherits(Ye,J,{__CANCEL__:!0});function Zn(t,n,o){const r=o.config.validateStatus;!o.status||!r||r(o.status)?t(o):n(new J("Request failed with status code "+o.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function Fa(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function La(t,n){t=t||10;const o=new Array(t),r=new Array(t);let a=0,s=0,i;return n=n!==void 0?n:1e3,function(c){const d=Date.now(),u=r[s];i||(i=d),o[a]=c,r[a]=d;let f=s,g=0;for(;f!==a;)g+=o[f++],f=f%t;if(a=(a+1)%t,a===s&&(s=(s+1)%t),d-i<n)return;const _=u&&d-u;return _?Math.round(g*1e3/_):void 0}}function za(t,n){let o=0,r=1e3/n,a,s;const i=(d,u=Date.now())=>{o=u,a=null,s&&(clearTimeout(s),s=null),t(...d)};return[(...d)=>{const u=Date.now(),f=u-o;f>=r?i(d,u):(a=d,s||(s=setTimeout(()=>{s=null,i(a)},r-f)))},()=>a&&i(a)]}const St=(t,n,o=3)=>{let r=0;const a=La(50,250);return za(s=>{const i=s.loaded,l=s.lengthComputable?s.total:void 0,c=i-r,d=a(c),u=i<=l;r=i;const f={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-i)/d:void 0,event:s,lengthComputable:l!=null,[n?"download":"upload"]:!0};t(f)},o)},Yn=(t,n)=>{const o=t!=null;return[r=>n[0]({lengthComputable:o,total:t,loaded:r}),n[1]]},Qn=t=>(...n)=>E.asap(()=>t(...n)),Ua=he.hasStandardBrowserEnv?((t,n)=>o=>(o=new URL(o,he.origin),t.protocol===o.protocol&&t.host===o.host&&(n||t.port===o.port)))(new URL(he.origin),he.navigator&&/(msie|trident)/i.test(he.navigator.userAgent)):()=>!0,ja=he.hasStandardBrowserEnv?{write(t,n,o,r,a,s,i){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(n)}`];E.isNumber(o)&&l.push(`expires=${new Date(o).toUTCString()}`),E.isString(r)&&l.push(`path=${r}`),E.isString(a)&&l.push(`domain=${a}`),s===!0&&l.push("secure"),E.isString(i)&&l.push(`SameSite=${i}`),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 Ha(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function qa(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function eo(t,n,o){let r=!Ha(n);return t&&(r||o==!1)?qa(t,n):n}const to=t=>t instanceof ye?{...t}:t;function Ue(t,n){n=n||{};const o={};function r(d,u,f,g){return E.isPlainObject(d)&&E.isPlainObject(u)?E.merge.call({caseless:g},d,u):E.isPlainObject(u)?E.merge({},u):E.isArray(u)?u.slice():u}function a(d,u,f,g){if(E.isUndefined(u)){if(!E.isUndefined(d))return r(void 0,d,f,g)}else return r(d,u,f,g)}function s(d,u){if(!E.isUndefined(u))return r(void 0,u)}function i(d,u){if(E.isUndefined(u)){if(!E.isUndefined(d))return r(void 0,d)}else return r(void 0,u)}function l(d,u,f){if(f in n)return r(d,u);if(f in t)return r(void 0,d)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(d,u,f)=>a(to(d),to(u),f,!0)};return E.forEach(Object.keys({...t,...n}),function(u){const f=c[u]||a,g=f(t[u],n[u],u);E.isUndefined(g)&&f!==l||(o[u]=g)}),o}const no=t=>{const n=Ue({},t);let{data:o,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:s,headers:i,auth:l}=n;if(n.headers=i=ye.from(i),n.url=qn(eo(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),E.isFormData(o)){if(he.hasStandardBrowserEnv||he.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(E.isFunction(o.getHeaders)){const c=o.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,f])=>{d.includes(u.toLowerCase())&&i.set(u,f)})}}if(he.hasStandardBrowserEnv&&(r&&E.isFunction(r)&&(r=r(n)),r||r!==!1&&Ua(n.url))){const c=a&&s&&ja.read(s);c&&i.set(a,c)}return n},Wa=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(o,r){const a=no(t);let s=a.data;const i=ye.from(a.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=a,u,f,g,_,m;function y(){_&&_(),m&&m(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let S=new XMLHttpRequest;S.open(a.method.toUpperCase(),a.url,!0),S.timeout=a.timeout;function w(){if(!S)return;const p=ye.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),D={data:!l||l==="text"||l==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:p,config:t,request:S};Zn(function(R){o(R),y()},function(R){r(R),y()},D),S=null}"onloadend"in S?S.onloadend=w:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(w)},S.onabort=function(){S&&(r(new J("Request aborted",J.ECONNABORTED,t,S)),S=null)},S.onerror=function(A){const D=A&&A.message?A.message:"Network Error",O=new J(D,J.ERR_NETWORK,t,S);O.event=A||null,r(O),S=null},S.ontimeout=function(){let A=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const D=a.transitional||Gn;a.timeoutErrorMessage&&(A=a.timeoutErrorMessage),r(new J(A,D.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,t,S)),S=null},s===void 0&&i.setContentType(null),"setRequestHeader"in S&&E.forEach(i.toJSON(),function(A,D){S.setRequestHeader(D,A)}),E.isUndefined(a.withCredentials)||(S.withCredentials=!!a.withCredentials),l&&l!=="json"&&(S.responseType=a.responseType),d&&([g,m]=St(d,!0),S.addEventListener("progress",g)),c&&S.upload&&([f,_]=St(c),S.upload.addEventListener("progress",f),S.upload.addEventListener("loadend",_)),(a.cancelToken||a.signal)&&(u=p=>{S&&(r(!p||p.type?new Ye(null,t,S):p),S.abort(),S=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const h=Fa(a.url);if(h&&he.protocols.indexOf(h)===-1){r(new J("Unsupported protocol "+h+":",J.ERR_BAD_REQUEST,t));return}S.send(s||null)})},Ga=(t,n)=>{const{length:o}=t=t?t.filter(Boolean):[];if(n||o){let r=new AbortController,a;const s=function(d){if(!a){a=!0,l();const u=d instanceof Error?d:this.reason;r.abort(u instanceof J?u:new Ye(u instanceof Error?u.message:u))}};let i=n&&setTimeout(()=>{i=null,s(new J(`timeout ${n} of ms exceeded`,J.ETIMEDOUT))},n);const l=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),t=null)};t.forEach(d=>d.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>E.asap(l),c}},Ka=function*(t,n){let o=t.byteLength;if(o<n){yield t;return}let r=0,a;for(;r<o;)a=r+n,yield t.slice(r,a),r=a},Ja=async function*(t,n){for await(const o of Xa(t))yield*Ka(o,n)},Xa=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const n=t.getReader();try{for(;;){const{done:o,value:r}=await n.read();if(o)break;yield r}}finally{await n.cancel()}},oo=(t,n,o,r)=>{const a=Ja(t,n);let s=0,i,l=c=>{i||(i=!0,r&&r(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(o){let g=s+=f;o(g)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),a.return()}},{highWaterMark:2})},ro=64*1024,{isFunction:Et}=E,Za=(({Request:t,Response:n})=>({Request:t,Response:n}))(E.global),{ReadableStream:ao,TextEncoder:so}=E.global,io=(t,...n)=>{try{return!!t(...n)}catch{return!1}},Ya=t=>{t=E.merge.call({skipUndefined:!0},Za,t);const{fetch:n,Request:o,Response:r}=t,a=n?Et(n):typeof fetch=="function",s=Et(o),i=Et(r);if(!a)return!1;const l=a&&Et(ao),c=a&&(typeof so=="function"?(m=>y=>m.encode(y))(new so):async m=>new Uint8Array(await new o(m).arrayBuffer())),d=s&&l&&io(()=>{let m=!1;const y=new o(he.origin,{body:new ao,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!y}),u=i&&l&&io(()=>E.isReadableStream(new r("").body)),f={stream:u&&(m=>m.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(y,S)=>{let w=y&&y[m];if(w)return w.call(y);throw new J(`Response type '${m}' is not supported`,J.ERR_NOT_SUPPORT,S)})});const g=async m=>{if(m==null)return 0;if(E.isBlob(m))return m.size;if(E.isSpecCompliantForm(m))return(await new o(he.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(E.isArrayBufferView(m)||E.isArrayBuffer(m))return m.byteLength;if(E.isURLSearchParams(m)&&(m=m+""),E.isString(m))return(await c(m)).byteLength},_=async(m,y)=>{const S=E.toFiniteNumber(m.getContentLength());return S??g(y)};return async m=>{let{url:y,method:S,data:w,signal:h,cancelToken:p,timeout:A,onDownloadProgress:D,onUploadProgress:O,responseType:R,headers:M,withCredentials:k="same-origin",fetchOptions:N}=no(m),B=n||fetch;R=R?(R+"").toLowerCase():"text";let I=Ga([h,p&&p.toAbortSignal()],A),P=null;const T=I&&I.unsubscribe&&(()=>{I.unsubscribe()});let C;try{if(O&&d&&S!=="get"&&S!=="head"&&(C=await _(M,w))!==0){let F=new o(y,{method:"POST",body:w,duplex:"half"}),G;if(E.isFormData(w)&&(G=F.headers.get("content-type"))&&M.setContentType(G),F.body){const[H,X]=Yn(C,St(Qn(O)));w=oo(F.body,ro,H,X)}}E.isString(k)||(k=k?"include":"omit");const v=s&&"credentials"in o.prototype,$={...N,signal:I,method:S.toUpperCase(),headers:M.normalize().toJSON(),body:w,duplex:"half",credentials:v?k:void 0};P=s&&new o(y,$);let b=await(s?B(P,N):B(y,$));const x=u&&(R==="stream"||R==="response");if(u&&(D||x&&T)){const F={};["status","statusText","headers"].forEach(te=>{F[te]=b[te]});const G=E.toFiniteNumber(b.headers.get("content-length")),[H,X]=D&&Yn(G,St(Qn(D),!0))||[];b=new r(oo(b.body,ro,H,()=>{X&&X(),T&&T()}),F)}R=R||"text";let V=await f[E.findKey(f,R)||"text"](b,m);return!x&&T&&T(),await new Promise((F,G)=>{Zn(F,G,{data:V,headers:ye.from(b.headers),status:b.status,statusText:b.statusText,config:m,request:P})})}catch(v){throw T&&T(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,m,P),{cause:v.cause||v}):J.from(v,v&&v.code,m,P)}}},Qa=new Map,lo=t=>{let n=t&&t.env||{};const{fetch:o,Request:r,Response:a}=n,s=[r,a,o];let i=s.length,l=i,c,d,u=Qa;for(;l--;)c=s[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:Ya(n)),u=d;return d};lo();const Xt={http:ka,xhr:Wa,fetch:{get:lo}};E.forEach(Xt,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const co=t=>`- ${t}`,es=t=>E.isFunction(t)||t===null||t===!1;function ts(t,n){t=E.isArray(t)?t:[t];const{length:o}=t;let r,a;const s={};for(let i=0;i<o;i++){r=t[i];let l;if(a=r,!es(r)&&(a=Xt[(l=String(r)).toLowerCase()],a===void 0))throw new J(`Unknown adapter '${l}'`);if(a&&(E.isFunction(a)||(a=a.get(n))))break;s[l||"#"+i]=a}if(!a){const i=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=o?i.length>1?`since :
|
|
4
|
-
`+i.map(
|
|
5
|
-
`):" "+
|
|
6
|
-
`+s):r.stack=s}catch{}}throw r}}_request(n,o){typeof n=="string"?(o=o||{},o.url=n):o=n||{},o=Ue(this.defaults,o);const{transitional:r,paramsSerializer:a,headers:s}=o;r!==void 0&&xt.assertOptions(r,{silentJSONParsing:Me.transitional(Me.boolean),forcedJSONParsing:Me.transitional(Me.boolean),clarifyTimeoutError:Me.transitional(Me.boolean)},!1),a!=null&&(E.isFunction(a)?o.paramsSerializer={serialize:a}:xt.assertOptions(a,{encode:Me.function,serialize:Me.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),xt.assertOptions(o,{baseUrl:Me.spelling("baseURL"),withXsrfToken:Me.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let i=s&&E.merge(s.common,s[o.method]);s&&E.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),o.headers=ye.concat(i,s);const l=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(o)===!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,g;if(!c){const m=[fo.bind(this),void 0];for(m.unshift(...l),m.push(...d),g=m.length,u=Promise.resolve(o);f<g;)u=u.then(m[f++],m[f++]);return u}g=l.length;let _=o;for(;f<g;){const m=l[f++],y=l[f++];try{_=m(_)}catch(S){y.call(this,S);break}}try{u=fo.call(this,_)}catch(m){return Promise.reject(m)}for(f=0,g=d.length;f<g;)u=u.then(d[f++],d[f++]);return u}getUri(n){n=Ue(this.defaults,n);const o=eo(n.baseURL,n.url,n.allowAbsoluteUrls);return qn(o,n.params,n.paramsSerializer)}};E.forEach(["delete","get","head","options"],function(n){je.prototype[n]=function(o,r){return this.request(Ue(r||{},{method:n,url:o,data:(r||{}).data}))}}),E.forEach(["post","put","patch"],function(n){function o(r){return function(s,i,l){return this.request(Ue(l||{},{method:n,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}je.prototype[n]=o(),je.prototype[n+"Form"]=o(!0)});let os=class Uo{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(s){o=s});const r=this;this.promise.then(a=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](a);r._listeners=null}),this.promise.then=a=>{let s;const i=new Promise(l=>{r.subscribe(l),s=l}).then(a);return i.cancel=function(){r.unsubscribe(s)},i},n(function(s,i,l){r.reason||(r.reason=new Ye(s,i,l),o(r.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 o=this._listeners.indexOf(n);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const n=new AbortController,o=r=>{n.abort(r)};return this.subscribe(o),n.signal.unsubscribe=()=>this.unsubscribe(o),n.signal}static source(){let n;return{token:new Uo(function(a){n=a}),cancel:n}}};function rs(t){return function(o){return t.apply(null,o)}}function as(t){return E.isObject(t)&&t.isAxiosError===!0}const Yt={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(Yt).forEach(([t,n])=>{Yt[n]=t});function ho(t){const n=new je(t),o=$n(je.prototype.request,n);return E.extend(o,je.prototype,n,{allOwnKeys:!0}),E.extend(o,n,null,{allOwnKeys:!0}),o.create=function(a){return ho(Ue(t,a))},o}const re=ho(lt);re.Axios=je,re.CanceledError=Ye,re.CancelToken=os,re.isCancel=Xn,re.VERSION=mo,re.toFormData=kt,re.AxiosError=J,re.Cancel=re.CanceledError,re.all=function(n){return Promise.all(n)},re.spread=rs,re.isAxiosError=as,re.mergeConfig=Ue,re.AxiosHeaders=ye,re.formToJSON=t=>Kn(E.isHTMLForm(t)?new FormData(t):t),re.getAdapter=uo.getAdapter,re.HttpStatusCode=Yt,re.default=re;const{Axios:au,AxiosError:su,CanceledError:iu,isCancel:lu,CancelToken:cu,VERSION:du,all:uu,Cancel:fu,isAxiosError:mu,spread:pu,toFormData:hu,AxiosHeaders:_u,HttpStatusCode:gu,formToJSON:yu,getAdapter:bu,mergeConfig:wu}=re;var ss=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function is(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _o={exports:{}};(function(t,n){(function(o,r){t.exports=r()})(ss,function(){var o=1e3,r=6e4,a=36e5,s="millisecond",i="second",l="minute",c="hour",d="day",u="week",f="month",g="quarter",_="year",m="date",y="Invalid Date",S=/^(\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,h={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(T){var C=["th","st","nd","rd"],v=T%100;return"["+T+(C[(v-20)%10]||C[v]||C[0])+"]"}},p=function(T,C,v){var $=String(T);return!$||$.length>=C?T:""+Array(C+1-$.length).join(v)+T},A={s:p,z:function(T){var C=-T.utcOffset(),v=Math.abs(C),$=Math.floor(v/60),b=v%60;return(C<=0?"+":"-")+p($,2,"0")+":"+p(b,2,"0")},m:function T(C,v){if(C.date()<v.date())return-T(v,C);var $=12*(v.year()-C.year())+(v.month()-C.month()),b=C.clone().add($,f),x=v-b<0,V=C.clone().add($+(x?-1:1),f);return+(-($+(v-b)/(x?b-V:V-b))||0)},a:function(T){return T<0?Math.ceil(T)||0:Math.floor(T)},p:function(T){return{M:f,y:_,w:u,d,D:m,h:c,m:l,s:i,ms:s,Q:g}[T]||String(T||"").toLowerCase().replace(/s$/,"")},u:function(T){return T===void 0}},D="en",O={};O[D]=h;var R="$isDayjsObject",M=function(T){return T instanceof I||!(!T||!T[R])},k=function T(C,v,$){var b;if(!C)return D;if(typeof C=="string"){var x=C.toLowerCase();O[x]&&(b=x),v&&(O[x]=v,b=x);var V=C.split("-");if(!b&&V.length>1)return T(V[0])}else{var F=C.name;O[F]=C,b=F}return!$&&b&&(D=b),b||!$&&D},N=function(T,C){if(M(T))return T.clone();var v=typeof C=="object"?C:{};return v.date=T,v.args=arguments,new I(v)},B=A;B.l=k,B.i=M,B.w=function(T,C){return N(T,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var I=function(){function T(v){this.$L=k(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[R]=!0}var C=T.prototype;return C.parse=function(v){this.$d=function($){var b=$.date,x=$.utc;if(b===null)return new Date(NaN);if(B.u(b))return new Date;if(b instanceof Date)return new Date(b);if(typeof b=="string"&&!/Z$/i.test(b)){var V=b.match(S);if(V){var F=V[2]-1||0,G=(V[7]||"0").substring(0,3);return x?new Date(Date.UTC(V[1],F,V[3]||1,V[4]||0,V[5]||0,V[6]||0,G)):new Date(V[1],F,V[3]||1,V[4]||0,V[5]||0,V[6]||0,G)}}return new Date(b)}(v),this.init()},C.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},C.$utils=function(){return B},C.isValid=function(){return this.$d.toString()!==y},C.isSame=function(v,$){var b=N(v);return this.startOf($)<=b&&b<=this.endOf($)},C.isAfter=function(v,$){return N(v)<this.startOf($)},C.isBefore=function(v,$){return this.endOf($)<N(v)},C.$g=function(v,$,b){return B.u(v)?this[$]:this.set(b,v)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(v,$){var b=this,x=!!B.u($)||$,V=B.p(v),F=function(q,L){var U=B.w(b.$u?Date.UTC(b.$y,L,q):new Date(b.$y,L,q),b);return x?U:U.endOf(d)},G=function(q,L){return B.w(b.toDate()[q].apply(b.toDate("s"),(x?[0,0,0,0]:[23,59,59,999]).slice(L)),b)},H=this.$W,X=this.$M,te=this.$D,de="set"+(this.$u?"UTC":"");switch(V){case _:return x?F(1,0):F(31,11);case f:return x?F(1,X):F(0,X+1);case u:var oe=this.$locale().weekStart||0,Ee=(H<oe?H+7:H)-oe;return F(x?te-Ee:te+(6-Ee),X);case d:case m:return G(de+"Hours",0);case c:return G(de+"Minutes",1);case l:return G(de+"Seconds",2);case i:return G(de+"Milliseconds",3);default:return this.clone()}},C.endOf=function(v){return this.startOf(v,!1)},C.$set=function(v,$){var b,x=B.p(v),V="set"+(this.$u?"UTC":""),F=(b={},b[d]=V+"Date",b[m]=V+"Date",b[f]=V+"Month",b[_]=V+"FullYear",b[c]=V+"Hours",b[l]=V+"Minutes",b[i]=V+"Seconds",b[s]=V+"Milliseconds",b)[x],G=x===d?this.$D+($-this.$W):$;if(x===f||x===_){var H=this.clone().set(m,1);H.$d[F](G),H.init(),this.$d=H.set(m,Math.min(this.$D,H.daysInMonth())).$d}else F&&this.$d[F](G);return this.init(),this},C.set=function(v,$){return this.clone().$set(v,$)},C.get=function(v){return this[B.p(v)]()},C.add=function(v,$){var b,x=this;v=Number(v);var V=B.p($),F=function(X){var te=N(x);return B.w(te.date(te.date()+Math.round(X*v)),x)};if(V===f)return this.set(f,this.$M+v);if(V===_)return this.set(_,this.$y+v);if(V===d)return F(1);if(V===u)return F(7);var G=(b={},b[l]=r,b[c]=a,b[i]=o,b)[V]||1,H=this.$d.getTime()+v*G;return B.w(H,this)},C.subtract=function(v,$){return this.add(-1*v,$)},C.format=function(v){var $=this,b=this.$locale();if(!this.isValid())return b.invalidDate||y;var x=v||"YYYY-MM-DDTHH:mm:ssZ",V=B.z(this),F=this.$H,G=this.$m,H=this.$M,X=b.weekdays,te=b.months,de=b.meridiem,oe=function(L,U,Y,Q){return L&&(L[U]||L($,x))||Y[U].slice(0,Q)},Ee=function(L){return B.s(F%12||12,L,"0")},q=de||function(L,U,Y){var Q=L<12?"AM":"PM";return Y?Q.toLowerCase():Q};return x.replace(w,function(L,U){return U||function(Y){switch(Y){case"YY":return String($.$y).slice(-2);case"YYYY":return B.s($.$y,4,"0");case"M":return H+1;case"MM":return B.s(H+1,2,"0");case"MMM":return oe(b.monthsShort,H,te,3);case"MMMM":return oe(te,H);case"D":return $.$D;case"DD":return B.s($.$D,2,"0");case"d":return String($.$W);case"dd":return oe(b.weekdaysMin,$.$W,X,2);case"ddd":return oe(b.weekdaysShort,$.$W,X,3);case"dddd":return X[$.$W];case"H":return String(F);case"HH":return B.s(F,2,"0");case"h":return Ee(1);case"hh":return Ee(2);case"a":return q(F,G,!0);case"A":return q(F,G,!1);case"m":return String(G);case"mm":return B.s(G,2,"0");case"s":return String($.$s);case"ss":return B.s($.$s,2,"0");case"SSS":return B.s($.$ms,3,"0");case"Z":return V}return null}(L)||V.replace(":","")})},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(v,$,b){var x,V=this,F=B.p($),G=N(v),H=(G.utcOffset()-this.utcOffset())*r,X=this-G,te=function(){return B.m(V,G)};switch(F){case _:x=te()/12;break;case f:x=te();break;case g:x=te()/3;break;case u:x=(X-H)/6048e5;break;case d:x=(X-H)/864e5;break;case c:x=X/a;break;case l:x=X/r;break;case i:x=X/o;break;default:x=X}return b?x:B.a(x)},C.daysInMonth=function(){return this.endOf(f).$D},C.$locale=function(){return O[this.$L]},C.locale=function(v,$){if(!v)return this.$L;var b=this.clone(),x=k(v,$,!0);return x&&(b.$L=x),b},C.clone=function(){return B.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()},T}(),P=I.prototype;return N.prototype=P,[["$ms",s],["$s",i],["$m",l],["$H",c],["$W",d],["$M",f],["$y",_],["$D",m]].forEach(function(T){P[T[1]]=function(C){return this.$g(C,T[0],T[1])}}),N.extend=function(T,C){return T.$i||(T(C,I,N),T.$i=!0),N},N.locale=k,N.isDayjs=M,N.unix=function(T){return N(1e3*T)},N.en=O[D],N.Ls=O,N.p={},N})})(_o);var ls=_o.exports;const go=is(ls),cs=t=>{const n=K.useRouter(),o=K.useRoute(),r=`${t.domain}/api/`,a=re.create({baseURL:r}),s=re.create({baseURL:r}),i=re.create({baseURL:r}),l=re.create({baseURL:r}),c=re.create({baseURL:r}),d=re.create({baseURL:r}),u=re.create({baseURL:r}),f=p=>{try{const A=JSON.parse(localStorage.getItem("authTokensAccess")||"");A.length>0&&(p.headers.Authorization=`Bearer ${A}`)}catch{console.warn("accessToken is undefined [useAxios]")}return p},g=p=>{const A=localStorage.getItem("apiKey"),D=(A==null?void 0:A.replace(/^.(.*).$/,"$1"))||"";return p.headers={"Content-Type":"application/json","x-api-key":D},p},_=async p=>{if(!t.user)return p;const A=t.user.exp??0;if(!(go.unix(A).diff(go())<3e3))return p;const O=An("authTokensRefresh",null,"string");try{const R=await re.post(`${r}user/token/refresh/`,{refresh:O.value});if(!R.data.access)return h(),p;localStorage.setItem("authTokensAccess",JSON.stringify(R.data.access)),S(R.data),w(vn(R.data.access)),p.headers={...p.headers,Authorization:`Bearer ${R.data.access}`}}catch(R){console.error("Failed to refresh token:",R),h()}return p},m=p=>{p.interceptors.request.use(A=>_(f(A)),A=>Promise.reject(A))};m(i),m(c),m(u);const y=p=>{p.interceptors.request.use(A=>g(A))};y(d),y(s),y(u);const S=(p,A=!1)=>{localStorage.setItem("authTokensAccess",JSON.stringify(p.access)),A&&localStorage.setItem("authTokensRefresh",JSON.stringify(p.refresh))},w=p=>{t.user=p,localStorage.setItem("user",JSON.stringify(p))},h=()=>{t.user=null,Je(["authTokensAccess","authTokensRefresh","user","cart","bonus"]),sessionStorage.removeItem("is_adult"),n.push(`/${o.params.orgId}/`),window.location.reload()};return{axiosInstanceAuthenticationGet:i,axiosInstanceAuthenticationPost:c,axiosInstanceAuthenticationPostApiKey:u,axiosInstancePost:l,axiosInstanceGet:a,axiosInstanceGetApiKey:s,axiosInstancePostApiKey:d}},Z=class Z{constructor(){ee(this,"axiosInstanceGet");ee(this,"axiosInstancePost");ee(this,"axiosInstanceAuthenticationGet");ee(this,"axiosInstanceAuthenticationPost");ee(this,"axiosInstanceGetApiKey");ee(this,"axiosInstancePostApiKey");ee(this,"axiosInstanceAuthenticationPostApiKey");ee(this,"currentUpsaleController",null);ee(this,"controller",new AbortController);this.axiosInstanceGet=Z._axiosGet,this.axiosInstancePost=Z._axiosPost,this.axiosInstanceGetApiKey=Z._axiosPostApiKey,this.axiosInstancePostApiKey=Z._axiosPostApiKey,this.axiosInstanceAuthenticationPostApiKey=Z._axiosAuthPostApiKey,this.axiosInstanceAuthenticationGet=Z._axiosAuthGet,this.axiosInstanceAuthenticationPost=Z._axiosAuthPost}static create(n){return n&&!Z._config&&Z._initialize(n),Z._config||console.warn("InitConnection не инициализирован"),new Z}static _initialize(n,o=null){const r=ie(),a=fe(),{config_lib:s}=j.storeToRefs(r),{stateCard:i,recountGroupTotalAmount:l}=j.storeToRefs(a);Z._config=n,Z._cardStore=a,Z._stateCard=i,Z._recountGroupTotalAmount=l,s.value=n;const c=cs(n);Z._axiosPostApiKey=c.axiosInstanceGetApiKey,Z._axiosPostApiKey=c.axiosInstancePostApiKey,Z._axiosAuthPostApiKey=c.axiosInstanceAuthenticationPostApiKey,Z._axiosGet=c.axiosInstanceGet,Z._axiosPost=c.axiosInstancePost,Z._axiosAuthGet=c.axiosInstanceAuthenticationGet,Z._axiosAuthPost=c.axiosInstanceAuthenticationPost}get config(){return Z._config}get cardStore(){return Z._cardStore}get stateCard(){return Z._stateCard}get recountGroupTotalAmount(){return Z._recountGroupTotalAmount}async updateTheme(){var s,i;const n=JSON.parse(localStorage.getItem("themeConfig"))??null,o=_e();if(n!==null){o.updateColor(n);return}const r=ie(),a=await((i=this.axiosInstanceGet)==null?void 0:i.get(`org/organizations/${(s=this.config)==null?void 0:s.orgId}/design/`));r.setStateDrum(a==null?void 0:a.data.hide_barban),r.setKioskTimeout(a==null?void 0:a.data.kiosk_timeout),localStorage.setItem("themeConfig",JSON.stringify(a.data)),o.updateColor(a.data)}async getGroupByID(n){var o,r;try{const a=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.pointId}/group/${n}`));return a==null?void 0:a.data}catch(a){throw console.error("Ошибка в request.ts[getGroupByID]",a),a}}async loadGroupProducts(n){var o,r;try{const a=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.pointId}/products/?group=${n}`)),s=(a==null?void 0:a.data)||[];for(const i of s)i&&await sr(i);return await this.cacheImagesInBackground(s),s}catch(a){return console.error("Ошибка загрузки группы:",a),[]}}async getGroup(){var n,o;try{const r=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${(n=this.config)==null?void 0:n.pointId}/groups/`));return r==null?void 0:r.data}catch(r){return console.error("Error fetching products:",r),[]}}async fetchAndCacheAllPages(){var n,o;try{const r=((n=this.config)==null?void 0:n.pointId)||"",a=await Ft(r);if(a)return a.data;const s=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${r}/group/`)),i=(s==null?void 0:s.data)||[],l=[];for(const c of i){c.products=c.products||[],await et(c.id,c),l.push(c);const d=await this.loadGroupProducts(c.id);c.products=d}return await this.cacheImagesInBackground(i),await et(r,i),l}catch(r){return console.error("fetchAndCacheAllPages error:",r),[]}}cacheImagesInBackground(n){n.forEach(o=>{var r;o.video_link&&this.loadAndCacheMedia(o.video_link,o.id+"_video"),o.image_link&&this.loadAndCacheMedia(o.image_link,o.id+"_image"),(r=o.products)==null||r.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,o){const r=await Ke(o);if(r){this.dispatchImageCachedEvent(o,r);return}try{const a=await fetch(n);if(!a.ok)throw new Error("Network error");const s=await a.blob();if(s.size===0)throw new Error("Empty blob");await Lt(o,s),this.dispatchImageCachedEvent(o,s)}catch(a){console.warn(`[ImageCache] Failed for ${o}:`,a)}}dispatchImageCachedEvent(n,o){window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:o}}))}async getProduct(n=null){var o,r;if(!n)return[];try{const a=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.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 o=ie(),{config_lib:r}=j.storeToRefs(o);try{let s=await bn(n);if(s)this._fullCardProduct(s);else{const i=await((a=this.axiosInstanceGet)==null?void 0:a.get(`${r.value.pointId}/products/${n}`));(i==null?void 0:i.status)===200&&this._fullCardProduct(i.data)}}catch(s){throw console.log("store card[getFetchProducts]:",s),s}}_fullCardProduct(n){const o=fe();o.stateCard.openCard={...n,amount:1},o.stateCard.groupModifiers=n.group_modifiers,n.modifiers.length>0&&o.stateCard.groupModifiers.unshift({default_amount:0,description:"",group_modifiers:n.modifiers,id:"Добавки2000",image_link:null,max_amount:1,min_amount:n.modifiers.reduce((r,a)=>r+=a.min_amount,0),name:"Добавки",required:!1}),o.stateCard.groupModifiersSelected=new Array(o.stateCard.groupModifiers.length).fill({group:"",modifiers:[],modifier_count:0}),o.stateCard.productSizes=n.sizes,o.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 o,r;try{const a=await((r=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:r.post(`${(o=this.config)==null?void 0:o.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 o,r;try{const a=await((r=this.axiosInstancePostApiKey)==null?void 0:r.post(`${(o=this.config)==null?void 0:o.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,o){var r,a;try{const s=await((a=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:a.post(`${(r=this.config)==null?void 0:r.domain}/api/device/auth/`,{code:n,phone:o}));return s==null?void 0:s.data}catch(s){throw console.error("Ошибка отправки sms-code:",s),s}}async callStaff(n,o){var r,a,s,i;try{const l=await((s=this.axiosInstancePost)==null?void 0:s.post(`${(r=this.config)==null?void 0:r.domain}/api/org_unit/${(a=this.config)==null?void 0:a.pointId}/table/${n}/call-staff/`,{reason:o}));return(i=l==null?void 0:l.data)==null?void 0:i.response_text}catch(l){throw console.error("Ошибка[callWaiter]",l),l}}async createOrder(n,o,r=!0,a,s=!1,i=!1){var _,m,y;const l=Le(),c=s?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,d=r?c:this.axiosInstanceAuthenticationPost,u=r?"/device/order/create":"/order/create",f=r?(_=this.config)==null?void 0:_.pointId:(m=this.config)==null?void 0:m.pointId,g=await(d==null?void 0:d.post(`${(y=this.config)==null?void 0:y.domain}/api/org_unit/${f}${u}`,{items:n,table:o||null,comment:a}));return(g==null?void 0:g.status)===201&&l.orderSocket(g==null?void 0:g.data.id,r,i),g}async initPaymentLink(n,o=!0){const r=o?this.axiosInstancePost:this.axiosInstanceAuthenticationPost,a=ie(),s=o?"TERMINAL":"YOOKASSA",i=await(r==null?void 0:r.post("payment/init",{by_bonuses:a.countBonus,order:n,provider_type:s}));return i==null?void 0:i.data}async orderPay(n){var o;return(o=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:o.post(`order/${n}/pay/`,{order_id:n})}async getProfile(){var o,r;const n=await((r=this.axiosInstanceAuthenticationGet)==null?void 0:r.get(`user/current?organization=${(o=this.config)==null?void 0:o.orgId}`));if((n==null?void 0:n.status)===200){const a=ie();return a.profile=n.data,a.is18Allowed=sessionStorage.getItem("is_adult")==="true",n.data}else return n}async calculateDiscount(n,o=!0,r=!1){var c,d;const a=r?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,s=o?a:this.axiosInstanceAuthenticationPost,i=o?(c=this.config)==null?void 0:c.pointId:(d=this.config)==null?void 0:d.pointId,l=await(s==null?void 0:s.post(`/org_unit/${i}/cart/calculate-discount/`,n));return(l==null?void 0:l.status)===200?l.data:l}async getDeviceInfo(){var o;const n=await((o=this.axiosInstanceGetApiKey)==null?void 0:o.get("/device/current/"));return(n==null?void 0:n.status)===200?n.data:n}async productUpsale(n){var s,i,l;const o=fe(),{dataUpSale:r}=j.storeToRefs(o);(s=this.currentUpsaleController)==null||s.abort();const a=new AbortController;this.currentUpsaleController=a;try{const c=await((l=this.axiosInstanceGet)==null?void 0:l.get(`/${(i=this.config)==null?void 0:i.pointId}/products/${n}/recommendation/`,{signal:a.signal}));a.signal.aborted||(r.value=c==null?void 0:c.data)}catch(c){if(c.name==="AbortError"||c.name==="CanceledError"){console.log("Upsale отменён — пришёл новый запрос");return}throw console.error("Ошибка upsale:",c),c}finally{this.currentUpsaleController===a&&(this.currentUpsaleController=null)}}};ee(Z,"_config",null),ee(Z,"_axiosGet"),ee(Z,"_axiosGetApiKey"),ee(Z,"_axiosPostApiKey"),ee(Z,"_axiosAuthPostApiKey"),ee(Z,"_axiosPost"),ee(Z,"_axiosAuthGet"),ee(Z,"_axiosAuthPost"),ee(Z,"_cardStore",null),ee(Z,"_stateCard",null),ee(Z,"_recountGroupTotalAmount",null);let Ie=Z;const ds=e.defineComponent({__name:"UseScrollCenter",props:{axis:{},behavior:{},autoScroll:{type:Boolean},container:{},idActive:{},clearContainer:{type:Boolean}},setup(t,{expose:n}){const o=t,r=ie(),a=e.ref(null),s=async l=>{if(!a.value||!l)return;let c=window;o.container&&(c=typeof o.container=="string"?document.querySelector(o.container)||window:o.container);const d={behavior:o.behavior};if(o.axis==="x"){const u=c===window?window.innerWidth:c.clientWidth,f=l.offsetWidth;let g=l.offsetLeft;if(c!==window){const _=c.getBoundingClientRect();g=l.getBoundingClientRect().left-_.left+c.scrollLeft}g-=(u-f)/2,d.left=Math.max(0,g)}else{const u=c===window?window.innerHeight:c.clientHeight,f=l.offsetHeight;let g=l.offsetTop;if(c!==window){const _=c.getBoundingClientRect();g=l.getBoundingClientRect().top-_.top+c.scrollTop}g-=(u-f)/2,d.top=Math.max(0,g)}try{c===window?window.scrollTo(d):c.scrollTo(d)}catch(u){console.error("Scroll error:",u)}};e.onMounted(async()=>{if(o.autoScroll){let l=null;if(await e.nextTick(),r.activeScrolling_lib){const c=r.activeScrolling_lib.findIndex(d=>d.id===o.idActive);o.idActive?(l=document.getElementById(`scrolling${o.idActive}`),l&&c!==-1&&(r.activeScrolling_lib[c]=l)):r.activeScrolling_lib[c]&&(l=r.activeScrolling_lib[c]),s(l)}}});const i=async l=>{o.clearContainer&&(r.activeScrolling_lib=[]);const c=l.currentTarget;await e.nextTick(),r.activeScrolling_lib.includes(c)||r.activeScrolling_lib.push(c),s(c)};return n({scrollToElement:s}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:a,class:"scroll-to-wrapper"},[e.renderSlot(l.$slots,"default",{handleTargetClick:i},void 0,!0)],512))}}),ne=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Qt=ne(ds,[["__scopeId","data-v-b510c3f1"]]),us={},fs={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 ms(t,n){return e.openBlock(),e.createElementBlock("svg",fs,[...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 en=ne(us,[["render",ms]]),ps=["id","onClick"],hs={class:"modified_plus_btn"},_s=["src"],gs={key:2,class:"wrapper_modifier_item"},ys={key:0,class:"modifier_item_n_wrapper"},bs=["src"],ws={key:1,class:"modifier_plus_item"},ks=["src"],Cs=["src"],yo=ne(e.defineComponent({__name:"PlusModifier",props:{isSectionModifier:{type:Boolean},toggleNotRequire:{type:Function}},setup(t){const n=fe(),o=_e(),{stateCard:r}=j.storeToRefs(n),{itemThemes:a}=j.storeToRefs(o),s=e.ref([]),i=e.ref([]),l=e.ref(null),c=e.ref(null),d=f=>{f instanceof HTMLElement&&!s.value.includes(f)&&s.value.push(f)},u=f=>{c.value=f};return e.onMounted(async()=>{await e.nextTick(),r.value.plusButtonsRefs=s.value}),e.watchEffect(()=>{i.value=r.value.groupModifiersSelected,document.body.style.overflow=""}),e.onBeforeUnmount(()=>{s.value=[],r.value.plusButtonsRefs=[]}),(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({card_modified_wrapper_many:e.unref(r).groupModifiers.length>=5})},[e.unref(r).groupModifiersSelected?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["card_modified_wrapper",[e.unref(r).groupModifiers.length<=4?"card_modified_wrapper_center":""]]),ref_key:"scrollPlusContainer",ref:l},[e.createVNode(Qt,{axis:"x",behavior:"smooth",container:l.value,autoScroll:!0,idActive:c.value,clearContainer:!0},{default:e.withCtx(({handleTargetClick:_})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).groupModifiers,(m,y)=>{var S,w;return e.openBlock(),e.createElementBlock("div",{class:"button_modified",key:m.id,ref_for:!0,ref:d,id:"scrolling"+m.id,"data-clickable":"true",onClick:h=>{t.toggleNotRequire&&t.toggleNotRequire(m,y),u(m.id),_(h)}},[e.createElementVNode("div",hs,[i.value[y].modifiers.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{modified_plus_btn_active:m.id===((S=e.unref(r).groupCurrentOpen)==null?void 0:S.id)&&t.isSectionModifier},"modified_plus_active"])},[e.createVNode(en,{"aria-label":`Открыть группу модификаторов ${m.name}`},null,8,["aria-label"])],2)):i.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:m.id===((w=e.unref(r).groupCurrentOpen)==null?void 0:w.id)&&t.isSectionModifier}])},[e.createElementVNode("img",{src:i.value[y].modifiers[0].image_link||e.unref(a).fallback_image||"",alt:"Модификатор"},null,8,_s)],2)):(e.openBlock(),e.createElementBlock("div",gs,[i.value[y].modifiers.length>2?(e.openBlock(),e.createElementBlock("div",ys,[i.value[y].modifiers.length===3?(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_plus_item modifier_item_three",src:i.value[y].modifiers[2].image_link||e.unref(a).fallback_image||""},null,8,bs)):(e.openBlock(),e.createElementBlock("p",ws," + "+e.toDisplayString(i.value[y].modifiers.length-2),1))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[i.value[y].modifiers.length>0?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.value[y].modifiers[0].image_link||e.unref(a).fallback_image||"",class:"modifier_plus_item modifier_item_first"},null,8,ks)):e.createCommentVNode("",!0),i.value[y].modifiers.length>1?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.value[y].modifiers[1].image_link||e.unref(a).fallback_image||"",class:"modifier_plus_item modifier_item_second"},null,8,Cs)):e.createCommentVNode("",!0)])]))]),e.createElementVNode("p",null,e.toDisplayString(m.name),1)],8,ps)}),128))]),_:1},8,["container","idActive"])],2)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-589e71ca"]]),Ss={},Es={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 Ns(t,n){return e.openBlock(),e.createElementBlock("svg",Es,[...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 tn=ne(Ss,[["render",Ns]]),xs={class:"wrapper_modifiers"},Bs={class:"wrapper_nutritional_value"},vs={class:"nutritional_scheme"},As={key:0,class:"nutritional_parameters"},$s={key:1,class:"nutritional_parameters"},Ts={key:2,class:"nutritional_parameters"},Ms={key:3,class:"nutritional_parameters"},Ps={ref:"modifierBody",class:"modifier_shadow"},Vs={class:"wrapper_modifiers_title"},Is={class:"wrapper_text_count_modifiers"},Rs=["id","aria-label","onClick","onKeydown"],Ds={key:0,class:"counter_modifier"},Os={class:"hide_image_corners"},Fs=["src","alt"],Ls={key:1,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},zs=["src"],Us={class:"modifier_title"},js=ne(e.defineComponent({__name:"SectionModifiers",emits:["close"],setup(t,{emit:n}){const o=n,r=_e(),a=fe(),{itemThemes:s}=j.storeToRefs(r),{stateCard:i,recountGroupTotalAmount:l,groupTotalAmount:c}=j.storeToRefs(a),d=e.ref(null),u=Ne.useTemplateRefsList(),f=g=>{if(!g)return;const _=i.value.groupModifiers.findIndex(h=>h.id===i.value.groupCurrentOpen.id),m=i.value.plusButtonsRefs[_]||i.value.plusButtonsRefs[0];if(!m)return;const y=g.getBoundingClientRect(),S=m.getBoundingClientRect(),w=g.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 h=S.left+S.width/3-(y.left+y.width/2),p=S.top+S.height/4-(y.top+y.height/2),A=S.width/y.width*.2;w.style.transform=`translate(${h}px, ${p}px) scale(${A})`,w.style.opacity="0.4",w.style.transition="transform 0.5s ease, opacity 0.5s ease"}),w.addEventListener("transitionend",()=>{w.remove(),d.value=null,m.classList.add("bump"),setTimeout(()=>m.classList.remove("bump"),300)},{once:!0})};return e.watch(()=>i.value.isAnimationFly,g=>{g===!0&&i.value.currentModifier&&(f(u.value.find(_=>_.id===i.value.currentModifier.id)),i.value.isAnimationFly=!1)}),(g,_)=>{var m,y,S,w,h,p,A,D,O,R,M,k;return e.openBlock(),e.createElementBlock("div",xs,[e.createElementVNode("div",Bs,[e.createElementVNode("div",{class:e.normalizeClass(["card_header_inner_back",[(m=e.unref(i).openCard)!=null&&m.proteins_amount?"card_header_inner_back_nutrients":""]]),"aria-label":"Закрыть выбор модификаторов",onClick:_[0]||(_[0]=N=>o("close"))},[e.createVNode(tn,{class:"arrow_bottom"})],2),e.createElementVNode("div",vs,[(y=e.unref(i).openCard)!=null&&y.energy_amount?(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("b",null,e.toDisplayString((S=e.unref(i).openCard)==null?void 0:S.energy_amount),1),_[1]||(_[1]=e.createElementVNode("p",null,"Килокалории",-1))])):e.createCommentVNode("",!0),(w=e.unref(i).openCard)!=null&&w.proteins_amount?(e.openBlock(),e.createElementBlock("div",$s,[e.createElementVNode("b",null,e.toDisplayString((h=e.unref(i).openCard)==null?void 0:h.proteins_amount),1),_[2]||(_[2]=e.createElementVNode("p",null,"Белки",-1))])):e.createCommentVNode("",!0),(p=e.unref(i).openCard)!=null&&p.fat_amount?(e.openBlock(),e.createElementBlock("div",Ts,[e.createElementVNode("b",null,e.toDisplayString((A=e.unref(i).openCard)==null?void 0:A.fat_amount),1),_[3]||(_[3]=e.createElementVNode("p",null,"Жиры",-1))])):e.createCommentVNode("",!0),(D=e.unref(i).openCard)!=null&&D.carbohydrates_amount?(e.openBlock(),e.createElementBlock("div",Ms,[e.createElementVNode("b",null,e.toDisplayString((O=e.unref(i).openCard)==null?void 0:O.carbohydrates_amount),1),_[4]||(_[4]=e.createElementVNode("p",null,"Углеводы",-1))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ps,[e.createElementVNode("p",Vs,e.toDisplayString((R=e.unref(i).groupCurrentOpen)==null?void 0:R.name),1),e.createElementVNode("p",Is,"Выбрано "+e.toDisplayString(e.unref(l))+" из "+e.toDisplayString(e.unref(c)),1),e.createElementVNode("div",{class:e.normalizeClass((M=e.unref(i).groupModifiers.find(N=>{var B;return N.id===((B=e.unref(i).groupCurrentOpen)==null?void 0:B.id)}))!=null&&M.group_modifiers.length?"wrapper_modifiers_card":"wrapper_modifiers_card_column")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((k=e.unref(i).groupCurrentOpen)==null?void 0:k.group_modifiers)||[],N=>{var B,I,P;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&&((B=e.unref(i).groupCurrentOpen)==null?void 0:B.id)==="Добавки2000"&&N.min_amount===0&&N.max_amount===0}]),tabindex:"0",role:"button","data-clickable":"true","aria-label":`Выбрать модификатор группы ${N.name}`,onClick:T=>e.unref(a).modifierSelect(N),onKeydown:e.withKeys(T=>e.unref(a).modifierSelect(N),["enter"])},[e.createElementVNode("div",{class:e.normalizeClass([{modifier_card_active:e.unref(i).groupModifiersSelected.some(T=>{var C;return T.group===((C=e.unref(i).groupCurrentOpen)==null?void 0:C.id)&&T.modifiers.some(v=>v.id===N.id)})},"wrapper_image_corners"])},[N.amount>1?(e.openBlock(),e.createElementBlock("div",Ds,e.toDisplayString(N.amount),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Os,[N.video_link?(e.openBlock(),e.createElementBlock("video",Ls,[e.createElementVNode("source",{src:N.video_link||"",type:"video/webm"},null,8,zs)])):(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_image",src:N.image_link||e.unref(s).fallback_image||"",alt:N.name},null,8,Fs)),e.createElementVNode("div",{class:e.normalizeClass(["wrapper_modifier_title",{wrapper_modifier_title_required:N.min_amount>0||N.required}])},[e.createElementVNode("h3",Us,e.toDisplayString(N.name),1),e.createElementVNode("p",null,"+"+e.toDisplayString(((P=(I=N.sizes)==null?void 0:I.find(T=>T.id===e.unref(i).selectedSize.id))==null?void 0:P.price)||N.price||0)+"₽",1)],2)])],2)],42,Rs)}),128))],2)],512)])}}}),[["__scopeId","data-v-22d945f1"]]),Hs={key:0,class:"card_size_place"},qs=["onClick","onKeydown","aria-label"],Ws={key:1,class:"card_size static"},Gs=["onClick","onKeydown","aria-label"],nn=3,Ks=ne(e.defineComponent({__name:"SizeModifier",setup(t){const n=fe(),{stateCard:o}=j.storeToRefs(n),r=e.ref(null),a=e.ref(50),s=e.ref(),i=e.ref(0),l=e.ref(0),c=e.ref(null),d=e.computed(()=>{var p;if(o.value.productSizes.length<=3)return o.value.productSizes[s.value.index]||o.value.productSizes[0];const w=i.value+1,h=((p=f.value[w])==null?void 0:p.originalIndex)??1;return o.value.productSizes[h]}),u=()=>{c.value&&o.value.productSizes.length>=3&&(l.value=c.value.offsetWidth/nn)},f=e.computed(()=>{if(o.value.productSizes.length<=3)return o.value.productSizes;const w=o.value.productSizes;return[...w.map((h,p)=>({...h,originalIndex:p})),...w.map((h,p)=>({...h,originalIndex:p})),...w.map((h,p)=>({...h,originalIndex:p}))]}),g=(w,h)=>{if(s.value={id:w.id,title:w.name,index:h,is_default:w.is_default},w.price!==null&&o.value.openCard&&(o.value.openCard={...o.value.openCard,price:w.price}),o.value.selectedSize=w,o.value.productSizes.length>3){u();const p=i.value+1;h<p?_():h>p&&m()}else{const p=o.value.productSizes.length,A=(h+.5)*(100/p);a.value=A}},_=()=>{var w;if(!(o.value.productSizes.length<=3)){if(i.value--,i.value<o.value.productSizes.length-nn+1){i.value+=o.value.productSizes.length;const h=(w=c.value)==null?void 0:w.querySelector(".card_size");h&&(h.style.transition="none",h.style.transform=`translateX(-${i.value*l.value}px)`,h.offsetHeight,h.style.transition="transform 0.2s ease-in-out")}y()}},m=()=>{var w;if(!(o.value.productSizes.length<=3)){if(i.value++,i.value>=o.value.productSizes.length*2){i.value-=o.value.productSizes.length;const h=(w=c.value)==null?void 0:w.querySelector(".card_size");h&&(h.style.transition="none",h.style.transform=`translateX(-${i.value*l.value}px)`,h.offsetHeight,h.style.transition="transform 0.2s ease-in-out")}y()}},y=()=>{var A;if(o.value.productSizes.length<=3)return;const w=i.value+1,h=((A=f.value[w])==null?void 0:A.originalIndex)??0,p=o.value.productSizes[h];s.value={id:p.id,title:p.name,index:h,is_default:p.is_default}};e.watch(()=>[o.value.productSizes,c.value],([w=[],h])=>{if(Array.isArray(w)&&w.length>0&&h!==null){let p=w.findIndex(A=>A.is_default===!0);w.length<3&&r.value&&parseInt(r.value.style.minWidth)<767&&(r.value.style.width="100px"),p>-1?(i.value=p,g(w[p],p),l.value=120/nn):w.length===2||w.length===1?(g(w[0],0),a.value=(0+.5)*(100/2)):(g(w[1],1),a.value=(1+.5)*(100/3))}}),e.watch(()=>{var w;return[(w=o.value.selectedSize)==null?void 0:w.id,o.value.groupModifiersSelected]},([w,h])=>{if(!w||!Array.isArray(h))return;const p=h.map(A=>({...A,modifiers:A.modifiers.map(D=>{if(!D.sizes||D.sizes.length===0)return D;const O=D.sizes.find(R=>R.id===w);return O?{...D,size:O,price:O.price??D.price}:D})}));JSON.stringify(p)!==JSON.stringify(o.value.groupModifiersSelected)&&(o.value.groupModifiersSelected=p)},{deep:!0});const S={mounted:u};return e.onBeforeUnmount(()=>{window.removeEventListener("resize",u)}),(w,h)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"slider_container",ref_key:"slider_container",ref:r},[e.createElementVNode("div",{class:"card_size_place_wrapper",ref_key:"sliderWrapper",ref:c},[e.unref(o).productSizes.length>1&&s.value?(e.openBlock(),e.createElementBlock("div",Hs,[e.unref(o).productSizes.length>3?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"card_size",style:e.normalizeStyle({transform:`translateX(-${i.value*l.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(p,A)=>(e.openBlock(),e.createElementBlock("li",{key:`${p.id}-${A}`,onClick:D=>g(p,A),onKeydown:e.withKeys(D=>g(p,A),["enter"]),class:e.normalizeClass({active:s.value.id===p.id&&s.value.index===p.originalIndex}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${p.name}`},e.toDisplayString(p.alt_name?p.alt_name:p.name),43,qs))),128))],4)):(e.openBlock(),e.createElementBlock("ul",Ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).productSizes,(p,A)=>(e.openBlock(),e.createElementBlock("li",{key:`${p.id}-${A}`,onClick:D=>g(p,A),onKeydown:e.withKeys(D=>g(p,A),["enter"]),class:e.normalizeClass({active:s.value.id===p.id&&s.value.index===A}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${p.name}`},e.toDisplayString(p.alt_name?p.alt_name:p.name),43,Gs))),128))])),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:2,class:"size_active",style:e.normalizeStyle(e.unref(o).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)),[[S]]):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)],512)),[[e.vShow,e.unref(o).productSizes.length>1&&s.value]])}}),[["__scopeId","data-v-bc00f0e8"]]),Js="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",Xs={class:"counter_container"},Zs={class:"card_size_place_wrapper",ref:"sliderWrapper"},Ys={class:"cart_amount_counter"},Qs={class:"button_circle_number"},ei=ne(e.defineComponent({__name:"NumberModifier",setup(t){const n=fe(),{stateCard:o}=j.storeToRefs(n),r=()=>{var s,i;(s=o.value.openCard)!=null&&s.amount&&((i=o.value.openCard)==null?void 0:i.amount)>1&&(o.value.openCard.amount-=1)},a=()=>{var s;(s=o.value.openCard)!=null&&s.amount&&(o.value.openCard.amount+=1)};return(s,i)=>{var l,c;return e.openBlock(),e.createElementBlock("div",Xs,[e.createElementVNode("div",Zs,[e.createElementVNode("div",Ys,[e.createElementVNode("p",{class:e.normalizeClass(["cart_circle_minus",[((l=e.unref(o).openCard)==null?void 0:l.amount)===1?"card_circle_minus_alone":""]]),"aria-label":"Уменьшить количество продукта","data-clickable":"true",onClick:e.withModifiers(r,["stop","prevent"])},[...i[0]||(i[0]=[e.createElementVNode("span",null,null,-1)])],2),e.createElementVNode("p",Qs,e.toDisplayString((c=e.unref(o).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 bo(t,n=800){const o=e.ref(t),r=e.ref(t);let a=null,s=null,i=t;const l=c=>{s||(s=c);const d=c-s,u=Math.min(d/n,1),f=u<.5?4*u*u*u:1-Math.pow(-2*u+2,3)/2;o.value=Math.round(i+(r.value-i)*f),u<1?a=requestAnimationFrame(l):(o.value=r.value,a=null)};return e.watch(r,()=>{a&&cancelAnimationFrame(a),i=o.value,s=null,a=requestAnimationFrame(l)},{immediate:!0}),e.onUnmounted(()=>{a&&cancelAnimationFrame(a)}),{displayNumber:o,targetNumber:r,update:c=>{r.value=c}}}const $e=e.defineComponent({__name:"RecountNumber",props:{price:{type:Number,required:!0},duration:{type:Number},fixedFloat:{type:Number,require:!1}},setup(t){const n=t,{displayNumber:o,update:r}=bo(n.price||0,n.duration||800);return e.watchEffect(()=>{r(n.price)}),(a,s)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(e.unref(o).toFixed(t.fixedFloat)),1))}}),ti=["disabled","id"],De=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,o=()=>{n.onClick()};return(r,a)=>(e.openBlock(),e.createElementBlock("button",{class:"buttonDefaultWrapper",disabled:t.disabled,onClick:o,id:t.disabled?"buttonDefaultDisabled":""},e.toDisplayString(t.textButtonDefault),9,ti))}}),ni={class:"notification_info"},oi={key:0,class:"notification_18plus"},ri={class:"notification_18plus_image"},ai=["src"],si={class:"notification_18plus_text"},ii={class:"notification_18plus_accept"},li={key:1,class:"notification_text"},ci={key:0,class:"wrapper_button_accept"},on=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,o=_e(),r=ie(),{is18Allowed:a,notificationData_lib:s}=j.storeToRefs(r),{itemThemes:i}=j.storeToRefs(o),l=e.computed(()=>n.backgroundColor||"rgba(50, 50, 50, 0.9)"),c=e.useModel(t,"visible"),d=()=>{s.value.fastAdd&&(r.addToCart(s.value.fastAdd),s.value.fastAdd=null),sessionStorage.setItem("is_adult","true"),a.value=!0,c.value=!1},u=()=>{c.value=!1};return(f,g)=>(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 _;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",ni,[t.type?(e.openBlock(),e.createElementBlock("div",oi,[e.createElementVNode("div",ri,[e.createElementVNode("img",{src:e.unref(i).adult_disclaimer_image||e.unref(i).fallback_image,alt:"Дисклеймер"},null,8,ai)]),e.createElementVNode("div",si,e.toDisplayString(e.unref(i).adult_disclaimer_text),1),e.createElementVNode("div",ii,[g[0]||(g[0]=e.createElementVNode("label",{for:"plus18"},"Содержащиеся в настоящем разделе материалы предназначены для лиц старше 18 лет, носят информационный характер об ассортименте товаров и не являются рекламой.",-1)),e.createVNode(De,{textButtonDefault:"Мне есть 18",onClick:d,style:{fontSize:"1rem",padding:"6px 24px",marginLeft:"10px"}})])])):(e.openBlock(),e.createElementBlock("div",li,[e.createTextVNode(e.toDisplayString(t.textNotificationDefault)+" ",1),(_=t.buttonAccept)!=null&&_.state?(e.openBlock(),e.createElementBlock("div",ci,[e.createVNode(De,{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))}}),di={class:"button_price button_price_modifiers"},ui=["src"],fi={class:"button_text_container"},mi={class:"button_text_price"},pi=ne(e.defineComponent({__name:"ButtonPriceCount",props:{qr_menu:{type:Boolean,default:!1},closeProduct:{}},setup(t){const n=K.useRouter(),o=K.useRoute(),r=fe(),a=ie(),s=_e(),i=e.ref([]),l=e.ref([]),c=t,{stateCard:d,totalPrice_libCard:u,isOpenWindow:f,isAddToCard:g}=j.storeToRefs(r),{itemThemes:_}=j.storeToRefs(s),m=e.ref(!0),y=e.ref(!1),S=()=>{var h,p,A,D,O,R;if(m.value){r.setCurrentCard(d.value.openCard),y.value=!0;const M=d.value.groupModifiers.findIndex(k=>r.checkedRequiredBtn.group.id===k.id);r.checkedRequiredBtn.haveRequaire&&r.toggleNotRequire(r.checkedRequiredBtn.group,M);return}const w=d.value.groupModifiersSelected||[];if(i.value=[],l.value=[],Array.isArray(w)&&w.length>0&&w.forEach(M=>{const k=M.group,N=M.modifiers||[];k==="Добавки2000"?i.value=N.map(B=>{var I;return{...B,old_price:B.price,size:Array.isArray(B.size)?B.size.map(P=>P.id).filter(Boolean):(I=B.size)!=null&&I.id?B.size.id:void 0}}):N.length>0&&l.value.push({group:k,modifiers:N.map(B=>{var I;return{...B,old_price:B.price,size:Array.isArray(B.size)?B.size.map(P=>P.id).filter(Boolean):(I=B.size)!=null&&I.id?B.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:((h=d.value.selectedSize)==null?void 0:h.id)??((A=(p=d.value.openCard.sizes)==null?void 0:p.find(k=>k.is_default))==null?void 0:A.id),sizes:((D=d.value.selectedSize)==null?void 0:D.id)??((R=(O=d.value.openCard.sizes)==null?void 0:O.find(k=>k.is_default))==null?void 0:R.id),modifiers:i.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),g.value=!0}f.value=!1,n.push(`/${o.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(()=>{r.checkedRequiredBtn.haveRequaire?m.value=!0:m.value=!1}),e.onMounted(()=>{g.value=!1}),(w,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(on,{visible:y.value,textNotificationDefault:e.unref(d).textErrorRequaired,backgroundColor:e.unref(_).accent_color?e.unref(_).accent_color:"#FF6D2E",buttonAccept:null,"onUpdate:visible":h[0]||(h[0]=p=>y.value=p)},null,8,["visible","textNotificationDefault","backgroundColor"]),e.createElementVNode("div",{class:"button_price_bg_product",onTouchstart:h[3]||(h[3]=e.withModifiers(()=>{},["stop"])),onPointerdown:h[4]||(h[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",di,[e.createVNode(ei),e.createElementVNode("div",{class:e.normalizeClass(["card_product_button_buy",{buy_active:!m.value}]),"data-clickable":"true",onClick:S,onTouchstart:h[1]||(h[1]=e.withModifiers(()=>{},["stop"])),onPointerdown:h[2]||(h[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{src:e.unref(Js),class:"card_product_button_icon"},null,8,ui),e.createElementVNode("div",fi,[e.createElementVNode("p",mi,[e.createVNode($e,{price:+e.unref(u),fixedFloat:2},null,8,["price"]),h[5]||(h[5]=e.createTextVNode(" ₽ ",-1))])])],34)])],32)],64))}}),[["__scopeId","data-v-dbbf98fb"]]),hi={class:"modified_amount"},_i={class:"hide_image_corners"},gi=["src"],yi={class:"wrapper_modifier_title"},bi={class:"amount_title"},wi={class:"wrapper_amount_counter"},ki={class:"amount_count"},Ci={class:"amount_wrapper"},Si={class:"add_counter_amount"},Ei=ne(e.defineComponent({__name:"ModalAmount",setup(t){const n=fe(),o=_e(),{itemThemes:r}=j.storeToRefs(o),{stateCard:a}=j.storeToRefs(n),s=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)??ot(a.value.currentModifier)}),i=()=>{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",hi,[e.createElementVNode("div",_i,[e.createElementVNode("img",{class:"modifier_image",src:((u=e.unref(a).currentModifier)==null?void 0:u.image_link)||e.unref(r).fallback_image||""},null,8,gi),e.createElementVNode("div",yi,[e.createElementVNode("p",bi,e.toDisplayString((f=e.unref(a).currentModifier)==null?void 0:f.name),1),e.createElementVNode("p",null,"+ "+e.toDisplayString(s.value)+"₽",1)])])]),e.createElementVNode("div",wi,[e.createElementVNode("div",{class:"amount_mines",onClick:d[0]||(d[0]=e.withModifiers((...g)=>e.unref(n).minusAmount&&e.unref(n).minusAmount(...g),["stop"]))},[...d[1]||(d[1]=[e.createElementVNode("div",null,null,-1)])]),e.createElementVNode("p",ki,e.toDisplayString(e.unref(a).modalCount),1),e.createElementVNode("div",Ci,[e.createVNode(en,{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",Si,[e.createVNode(De,{textButtonDefault:"Добавить",onClick:i,class:"button_add_group_modifiers"})])],64)}}}),[["__scopeId","data-v-6b4f039c"]]),Ni=(t,n,o)=>Math.max(n,Math.min(t,o)),xi=(t,n)=>Math.pow(t,n*5),wo=(t,n,o)=>n===0||Math.abs(n)===1/0?xi(t,o):t*n*o/(n+o*t),Bt=(t,n)=>n*parseFloat(t)/100,rn=(t,n,o,r=.15)=>r===0?Ni(t,n,o):t<n?-wo(n-t,o-n,r)+n:t>o?+wo(t-o,o-n,r)+o:t,Se=(t,{min:n,max:o})=>n!==void 0&&t<n?n:o!==void 0&&t>o?o:t;function Bi(t,n,o){const r=e.ref(0),a=e.computed(()=>t.value.map(c=>typeof c=="string"?Bt(c,o.value):c)),s=e.computed(()=>Math.min(...a.value)),i=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:r,flattenedSnapPoints:a,minSnapPoint:s,maxSnapPoint:i,closestSnapPointIndex:l}}const ko=ne(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:o}){const r=t,a=o,s=Ne.useVModel(r,"modelValue",a,{passive:!0});e.watch(s,U=>{U&&x()}),e.onMounted(()=>{s.value&&x()});const i=e.ref(),l=e.ref(null),c=e.ref(null),d=e.ref(null),u=e.ref(null),f=e.ref(r.expandOnContentDrag),{height:g}=Ne.useWindowSize(),{height:_}=Ne.useElementBounding(i),{height:m}=Ne.useElementBounding(l),{height:y}=Ne.useElementBounding(u),{height:S}=Ne.useElementBounding(c),w=e.computed({get(){return Se(Math.ceil(y.value+m.value+S.value),{max:g.value})},set(U){[m.value,y.value,S.value]=U}}),h=e.ref(0),p=e.ref(0),A=pe.useMotionValue(0),D=pe.useMotionValue(0),{snapPoints:O}=e.toRefs(r),R=e.computed(()=>O.value??[w.value]),{flattenedSnapPoints:M,currentSnapPointIndex:k,closestSnapPointIndex:N,minSnapPoint:B,maxSnapPoint:I}=Bi(R,h,g);let P;function T(U){f.value=!0,C(U)}function C(U){f.value&&U.preventDefault()}const v=U=>{U.key==="Escape"&&F()},$=()=>{r.canBackdropClose&&F()};let b=!1;const x=async()=>{if(b)return;s.value=!0,b=!0,a("opening-started"),await e.nextTick();const U=i.value.$el;_.value=U.getBoundingClientRect().height;const Y=U.querySelector("[data-vsbs-content]"),Q=U.querySelector("[data-vsbs-header]"),le=U.querySelector("[data-vsbs-footer]");if(w.value=[Q.getBoundingClientRect().height,Y.getBoundingClientRect().height,le.getBoundingClientRect().height],await e.nextTick(),k.value=M.value.findIndex(ae=>ae===B.value),r.initialSnapPoint){const ae=r.initialSnapPoint;if(ae<0||ae>=R.value.length)return console.warn("Index out of bounds");h.value=typeof R.value[ae]=="number"?Se(R.value[ae],{max:g.value}):Bt(R.value[ae],g.value)}else h.value=Se(B.value,{max:g.value});p.value=h.value,A.jump(h.value),D.jump(h.value),requestAnimationFrame(()=>{P=pe.animate(A,h.value,{duration:r.duration/1e3,ease:"easeInOut"}),P=pe.animate(D,0,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>{r.blocking&&a("opened")}})}),window.addEventListener("keydown",v),b=!1};let V=!1;const F=()=>{V||(s.value=!1,V=!0,a("closing-started"),window.removeEventListener("keydown",v),setTimeout(()=>{a("closed"),V=!1},r.duration))},G=U=>{if(R.value){if(U<0||U>=R.value.length){console.warn("Index out of bounds");return}k.value=U,h.value=typeof R.value[U]=="number"?Se(R.value[U],{max:g.value}):Bt(R.value[U],g.value),P=pe.animate(A,h.value,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>a("snapped",R.value.indexOf(R.value[U]))})}};function H(U){U>0?a("dragging-down"):U<0&&a("dragging-up")}const X=()=>{h.value=_.value,p.value=D.get(),A.jump(h.value),D.jump(p.value)},te=async(U,Y)=>{await e.nextTick(),i.value&&(p.value<=0&&(h.value-=Y.delta.y),h.value<=B.value&&(h.value=B.value,p.value+=Y.delta.y,D.set(r.canSwipeClose?Se(p.value,{min:0}):Se(rn(p.value,-_.value,0,.5),{min:0}))),A.set(Se(rn(h.value,0,I.value,.25),{min:0,max:g.value})),H(Y.delta.y))},de=()=>{if(r.canSwipeClose){let U=h.value/2;r.swipeCloseThreshold&&typeof r.swipeCloseThreshold=="number"&&(U=r.swipeCloseThreshold),r.swipeCloseThreshold&&typeof r.swipeCloseThreshold=="string"&&r.swipeCloseThreshold.includes("%")&&(U=h.value*(Number(r.swipeCloseThreshold.replace("%",""))/100)),Math.abs(p.value)>U&&(p.value=h.value)}else p.value=0;P=pe.animate(D,p.value,{duration:r.duration/1e3,ease:"easeInOut"}),p.value===h.value&&(p.value=0,F()),k.value=N.value,h.value=typeof R.value[N.value]=="number"?Se(R.value[N.value],{max:g.value}):Bt(R.value[N.value],g.value),P=pe.animate(A,h.value,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>a("snapped",R.value.indexOf(R.value[N.value]))}),P=pe.animate(D,0,{duration:r.duration/1e3,ease:"easeInOut"})},oe=(U,Y)=>{if(h.value=_.value,p.value=D.get(),P&&P.stop(),!d.value)return;const Q=d.value.scrollTop===0,le=Y.delta.y>0,ae=M.value.length===1,ue=.5>Math.abs(h.value-I.value);if(ae){if(!r.expandOnContentDrag)return f.value=!1;D.get()===0&&Q&&le&&(f.value=!0),D.get()===0&&Q&&!le&&(f.value=!1)}else{if(!r.expandOnContentDrag)return f.value=!1;f.value=!0,ue&&(le&&Q&&(f.value=!0),!le&&Q&&(f.value=!1),Q||(f.value=!1))}},Ee=async(U,Y)=>{if(await e.nextTick(),!r.expandOnContentDrag)return f.value=!1;if(!i.value)return;p.value===0&&f.value&&r.expandOnContentDrag&&(h.value-=Y.delta.y),h.value<=B.value&&(h.value=B.value,f.value&&r.expandOnContentDrag&&(p.value+=Y.delta.y),p.value=Se(p.value,{min:0,max:B.value}),D.set(r.canSwipeClose?Se(p.value,{min:0}):Se(rn(p.value,-_.value,0,.5),{min:0}))),h.value>I.value&&(h.value=I.value),h.value=Se(h.value,{max:g.value}),!(M.value.length===1)&&h.value===I.value&&(f.value=!1),A.set(h.value),H(Y.delta.y)},q=()=>{if(!d.value)return;const U=d.value.scrollTop===0;f.value=U},L=Ne.useDebounceFn(U=>G(U),r.duration);return e.watch(R,(U,Y)=>{if(s.value===!1||!U||!Y)return;const Q=U[k.value],le=Y[k.value];typeof Q!="string"&&typeof le!="string"&&(h.value=Se(Q,{max:g.value}),Q!==le&&(P=pe.animate(A,h.value,{duration:r.duration/1e3,ease:"easeInOut"})))}),e.watch(g,()=>L(k.value)),e.watch(w,U=>a("instinctHeight",U)),n({open:x,close:F,snapToPoint:G}),(U,Y)=>(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(s)&&t.blocking?(e.openBlock(),e.createBlock(e.unref(pe.Motion),{key:0,ref:"backdrop","data-vsbs-backdrop":"",onClick:Y[0]||(Y[0]=Q=>$()),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(s)?(e.openBlock(),e.createBlock(e.unref(pe.Motion),{key:0,ref_key:"sheet",ref:i,exit:{y:"100%",height:e.unref(_),opacity:0},initial:!1,style:e.normalizeStyle({y:e.unref(D),z:1,height:e.unref(A)}),"data-vsbs-shadow":!t.blocking,"data-vsbs-sheet-show":e.unref(s),"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:X,onPan:te,onPanEnd:de,onTouchmove:T,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:q},[e.createVNode(e.unref(pe.Motion),{ref:"sheetContentWrapper","data-vsbs-content-wrapper":"",onPanStart:oe,onPan:Ee,onPanEnd:de,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(pe.Motion),{ref_key:"sheetFooter",ref:c,"data-vsbs-footer":"",onPanStart:X,onPan:te,onPanEnd:de,onTouchmove:T,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 He(t,n=null){const o=nt();o.initCacheSingle("defaultImage");const r=e.computed(()=>o.cache.defaultImage||null),a=e.shallowRef(!1),s=e.computed(()=>{var d;return((d=e.toValue(t))==null?void 0:d.toString())||null}),i=Ne.computedAsync(async()=>{const d=s.value;return d?(await o.initCacheSingle(d),o.cache[d]||null):null},null,{evaluating:a}),l=e.computed(()=>a.value&&s.value!==null);return{mediaUrl:e.computed(()=>i.value||e.toValue(n)||r.value||null),isLoading:l}}const vi={class:"card_product_wrapper"},Ai={class:"card_product_modifiers_sheet_body"},$i={class:"card__pictures"},Ti=["src"],Mi=["src"],Pi={class:"card_header_wrapper"},Vi={key:0,class:"card_fire_kkal_wrapper"},Ii={class:"card_content"},Ri={class:"wrapper_size"},Di={key:0,class:"description"},Oi={key:1},Fi=ne(e.defineComponent({__name:"CardProductPage",props:{configPage:{}},setup(t){const n=_e(),o=fe(),{stateCard:r,isOpenWindow:a}=j.storeToRefs(o),{itemThemes:s}=j.storeToRefs(n),i=K.useRouter(),l=K.useRoute(),c=t,{mediaUrl:d}=He(()=>{var g,_;return(g=r.value.openCard)!=null&&g.video_link?`${r.value.openCard.id}_video`:(_=r.value.openCard)!=null&&_.image_link?`${r.value.openCard.id}_image`:null},()=>{var g,_;return((g=r.value.openCard)==null?void 0:g.video_link)||((_=r.value.openCard)==null?void 0:_.image_link)||null}),u=()=>{c.configPage.qr_menu?i.push(`/${l.params.orgId}`):c.configPage.closeProduct()},f=()=>{r.value.isModifiedAmount=!1};return e.watch(()=>c.configPage.data,o.setCurrentCard),e.watchEffect(()=>{a.value||(a.value=c.configPage.is_closeProduct)}),e.onBeforeUnmount(()=>o.reset()),(g,_)=>{var m,y,S,w,h,p;return e.openBlock(),e.createElementBlock("div",vi,[e.createVNode(e.unref(ko),{modelValue:e.unref(r).isSectionModifier,"onUpdate:modelValue":_[1]||(_[1]=A=>e.unref(r).isSectionModifier=A),class:"card_product_modifiers_sheet"},{default:e.withCtx(()=>[e.createElementVNode("div",Ai,[e.createVNode(js,{onClose:_[0]||(_[0]=A=>e.unref(r).isSectionModifier=!1)}),e.createVNode(yo,{isSectionModifier:e.unref(r).isSectionModifier,toggleNotRequire:e.unref(o).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])]),_:1},8,["modelValue"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(r).isModifiedAmount?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wrapper_modified_amount",onClick:e.withModifiers(f,["stop"])},[e.createVNode(Ei)])):e.createCommentVNode("",!0)])),e.createElementVNode("div",$i,[(m=e.unref(r).openCard)!=null&&m.video_link&&e.unref(d)?(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,Ti)])):(e.openBlock(),e.createElementBlock("img",{key:1,class:"card__pictures_images",src:e.unref(d)||"",alt:"Product image"},null,8,Mi)),e.createElementVNode("div",Pi,[e.createVNode(tn,{class:"card_header_back",onClick:u,"aria-label":"Вернуться назад"}),(y=e.unref(r).openCard)!=null&&y.energy_amount?(e.openBlock(),e.createElementBlock("div",Vi,[_[3]||(_[3]=e.createElementVNode("div",{class:"card_fire_kkal"},null,-1)),e.createElementVNode("p",null,[e.createElementVNode("b",null,e.toDisplayString((S=e.unref(r).openCard)==null?void 0:S.energy_amount),1),_[2]||(_[2]=e.createTextVNode(" Ккал ",-1))])])):e.createCommentVNode("",!0)]),e.createElementVNode("h4",null,e.toDisplayString((w=e.unref(r).openCard)==null?void 0:w.name),1),e.createElementVNode("div",{class:"card__pictures__gradient",style:e.normalizeStyle(e.unref(s).gradientStyle)},null,4)]),e.createElementVNode("div",Ii,[e.createElementVNode("div",Ri,[e.createVNode(Ks)]),(h=e.unref(r).openCard)!=null&&h.description?(e.openBlock(),e.createElementBlock("p",Di,e.toDisplayString((p=e.unref(r).openCard)==null?void 0:p.description),1)):e.createCommentVNode("",!0),e.unref(r).groupModifiers.length?(e.openBlock(),e.createElementBlock("div",Oi,[_[4]||(_[4]=e.createElementVNode("p",{class:"title_info_modifiers"},"Настрой, как ты любишь",-1)),e.createVNode(yo,{isSectionModifier:e.unref(r).isSectionModifier,toggleNotRequire:e.unref(o).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])):e.createCommentVNode("",!0),e.createVNode(pi,{qr_menu:t.configPage.qr_menu,closeProduct:t.configPage.closeProduct},null,8,["qr_menu","closeProduct"])])])}}}),[["__scopeId","data-v-732bba57"]]),Li={key:0,class:"popupWindowDefault_overlay"},Co=ne(e.defineComponent({__name:"PopupWindowDefault",props:{visible:{type:Boolean}},emits:["update:visible"],setup(t,{emit:n}){const o=t,r=n,a=()=>{r("update:visible",!1)};return e.watch(()=>o.visible,async s=>{s&&await e.nextTick(),o.isVisible=s}),(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"popupWindowDefaultBlack",appear:"",onAfterLeave:i[0]||(i[0]=()=>{r("update:visible",!1)})},{default:e.withCtx(()=>[o.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:i[1]||(i[1]=()=>{r("update:visible",!1)})},{default:e.withCtx(()=>[o.visible?(e.openBlock(),e.createElementBlock("div",Li,[e.renderSlot(s.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]),_:3})],64))}}),[["__scopeId","data-v-08e0e008"]]),zi={},Ui={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ji(t,n){return e.openBlock(),e.createElementBlock("svg",Ui,[...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 Hi=ne(zi,[["render",ji]]),an=j.defineStore("modals",()=>{const t=new Map,n=(a,s)=>{const i=r(a).value;i.visible=!0,i.context=s},o=a=>{const s=r(a).value;s.visible=!1},r=a=>(t.has(a)||t.set(a,e.ref({visible:!1})),t.get(a));return{state:r,open:n,close:o}}),qi=["src"],Wi={class:"cart_box_content_wrapper"},Gi={class:"cart_box_content_info"},Ki={class:"cart_amount"},Ji={class:"cart_amount_count"},Xi={class:"cart_box_info_more"},Zi={key:1,class:"cart_modifier_info"},Yi={class:"cart_modifier_content"},Qi={class:"wrapper_price_count_cart"},el={class:"count_cart_box"},tl={class:"wrapper_modifiers_discount"},So=ne(e.defineComponent({__name:"CartBox",props:{index:Number,cardItem:Object},emits:["delete"],setup(t,{emit:n}){const o=t,r=ie(),a=_e(),s=an(),{itemThemes:i}=j.storeToRefs(a),l=e.ref(0),c=e.ref(0),d=e.ref(!1),u=e.ref(!1),f=e.ref(!1),{displayNumber:g,update:_}=bo(0,800),m=e.computed(()=>{var B,I;const k=((B=o.cardItem)==null?void 0:B.modifiers)??[],N=(((I=o.cardItem)==null?void 0:I.group_modifiers)??[]).flatMap(P=>P.modifiers??[]);return[...k,...N]}),{mediaUrl:y}=He(()=>{var k;return((k=o.cardItem)==null?void 0:k.id)+"_image"},()=>{var k;return(k=o.cardItem)==null?void 0:k.image_link}),S=e.computed(()=>{var k,N;return((k=o.cardItem)==null?void 0:k.total_new_price)||ot(o.cardItem)*((N=o.cardItem)==null?void 0:N.amount)}),w=()=>s.open("cart-delete-confirm",o.cardItem),h=()=>{f.value=!f.value},p=()=>{r.plusAmount(o.cardItem.idSystem)},A=()=>{o.cardItem.amount>1?r.minusAmount(o.cardItem.idSystem):w()},D=k=>{l.value=k.touches[0].clientX,d.value=!0},O=k=>{d.value&&(c.value=k.touches[0].clientX-l.value,c.value>0&&(c.value=0))},R=()=>{d.value=!1,c.value<-115&&w(),c.value=0};e.onMounted(()=>{o.index===0&&(u.value=!0,setTimeout(()=>{c.value=-90,setTimeout(()=>{c.value=0,u.value=!1},700)},0))});const M=e.computed(()=>{const k=o.index===0&&u.value?1:`${1-Math.abs(c.value)/200}`;return{transform:`translateX(${c.value}px)`,opacity:k,transition:d.value?"none":"transform 0.7s, opacity 0.7s"}});return e.watch(S,_,{immediate:!0}),(k,N)=>{var B,I,P,T;return e.openBlock(),e.createElementBlock("div",{class:"cart_box_wrapper",onTouchstart:D,onTouchmove:O,onTouchend:R,style:e.normalizeStyle(M.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,qi),e.createElementVNode("div",Wi,[e.createElementVNode("div",Gi,[e.createElementVNode("p",null,e.toDisplayString((B=t.cardItem)==null?void 0:B.name),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((I=o.cardItem)==null?void 0:I.discounts)||[],(C,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,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",Ki,[e.createElementVNode("button",{onClick:A},"-"),e.createElementVNode("p",Ji,e.toDisplayString(o.cardItem.amount),1),e.createElementVNode("button",{onClick:p},"+")])]),e.createElementVNode("div",Xi,[e.createElementVNode("div",{class:"cart_box_remove_item",onClick:w},[e.createVNode(Hi)]),(P=o.cardItem)!=null&&P.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(T=o.cardItem)==null?void 0:T.new_price})},e.toDisplayString((o.cardItem.new_price*o.cardItem.amount).toFixed(2)+"₽"),3)):e.createCommentVNode("",!0),e.createElementVNode("p",null,e.toDisplayString(e.unref(g).toFixed(2)+"₽"),1)])]),!f.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_modifier_toggle",onTouchstart:e.withModifiers(h,["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",Zi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,C=>{var v;return e.openBlock(),e.createElementBlock("div",{class:"cart_modifier_item",key:C.id},[e.createElementVNode("div",Yi,[e.createVNode(en,{id:"plus_orange"}),e.createElementVNode("p",null,e.toDisplayString(C.name),1)]),e.createElementVNode("div",Qi,[e.createElementVNode("p",el,e.toDisplayString(`x${C.amount}`),1),e.createElementVNode("div",tl,[C!=null&&C.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(v=C==null?void 0:C.new_price)==null?void 0:v.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(h,["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-e48a9689"]]),nl={},ol={class:"nfc_x",viewBox:"0 0 48 48"};function rl(t,n){return e.openBlock(),e.createElementBlock("svg",ol,[...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 al=ne(nl,[["render",rl]]),sl={},il={style:{},"aria-hidden":"true",viewBox:"0 0 48 48",class:"nfc_ok"};function ll(t,n){return e.openBlock(),e.createElementBlock("svg",il,[...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 cl=ne(sl,[["render",ll]]),dl={key:0,class:"nfc_ok",viewBox:"0 0 48 48","aria-hidden":"true"},ul=e.defineComponent({__name:"CardReaderRetry",props:{styleRetry:{type:Boolean}},setup(t){return(n,o)=>t.styleRetry?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",dl,[...o[0]||(o[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)])]))}}),fl={class:"sheet_header"},ml={class:"sheet_title",id:"sheetTitle"},pl={class:"sheet_body"},hl={class:"sheet_card"},_l={class:"nfc_title"},gl={class:"lead"},yl={class:"wrapper_input_accept"},bl={key:0,class:"card_phone_auth_wrapper"},wl={class:"sr_only","aria-live":"polite"},Eo=e.defineComponent({__name:"CardReader",setup(t){const n=ie(),o=_e(),{is_OpenLoyal:r}=j.storeToRefs(n),{itemThemes:a}=j.storeToRefs(o),s=Le(),i=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:$=>{d.value=$.replace(/\s/g,"")}}),g=e.computed(()=>s.currentState),_=e.computed(()=>s.isDrawerOpen),m=e.computed(()=>{var $;return(($=u[g.value])==null?void 0:$.text)||""}),y=e.computed(()=>{var $;($=u[g.value])!=null&&$.title}),S=e.computed(()=>g.value==="success"?"Добро пожаловать!":a.value.kiosk_show_loyalty_phone_input_button?"Поднесите стикер к считывателю или войдите по номеру телефона":"Поднесите стикер к считывателю или введите номер карты вручную"),w=e.computed(()=>({ok:g.value==="success",warn:g.value==="not_found"})),h=e.computed(()=>{const $=[];return g.value==="wait"&&$.push("pulse","show-x"),g.value==="not_found"&&$.push("pulse","show-x"),g.value==="success"&&$.push("pulse","show-ok"),$}),p=e.computed(()=>g.value==="not_found"),A=e.computed(()=>g.value==="success"),D=e.computed(()=>g.value==="not_found"),O=e.computed(()=>["not_found"].includes(g.value)),R=e.computed(()=>({wait:"Стикер не распознан. Нажмите «Повторить».",success:"Стикер распознан. Нажмите «Продолжить».",not_found:"Стикер не распознан. Нажмите «Повторить»."})[g.value]||""),M=()=>{s.closeDrawer(),r.value=!0},k=async $=>{var b,x;s.error="",c.value=null;try{const V=new Ie;await V.authorizeByCard($.trim()),await V.getProfile(),n.loadCart(),s.setState("success"),s.isDrawerOpen=!1,s.showNotification("Вы успешно авторизовались в программе лояльности!")}catch(V){s.error=((x=(b=V.response)==null?void 0:b.data)==null?void 0:x.user_friendly_message)||"Ошибка",s.setState("not_found"),c.value=f.value,f.value=""}},N=()=>{var $;s.setState("wait"),s.error="",f.value="",c.value=null,($=i.value)==null||$.focus()},B=()=>{s.closeDrawer(),c.value=null,f.value=""},I=()=>{var $,b;s.setState("wait"),(b=($=f.value)==null?void 0:$.trim())!=null&&b.length&&k(f.value.trim())},P=$=>{$.stopPropagation(),document.activeElement!==l.value&&T()},T=()=>{e.nextTick(()=>{l.value&&(l.value.focus(),d.value&&l.value.select())})},C=$=>{const b=document.activeElement===l.value;if(!_.value||b)return;const x=$.key.toLowerCase();if(x==="backspace")return f.value=f.value.slice(0,-1);if(x==="escape")return B();if(x==="r"&&D.value)return N();if(x==="c"&&g.value==="success")return B();if(x==="enter")return I();f.value+=x},v={mounted($){$==null||$.focus()}};return e.onMounted(()=>{document==null||document.addEventListener("keydown",C)}),e.onBeforeUnmount(()=>{document==null||document.removeEventListener("keydown",C)}),e.watchEffect(()=>{_.value&&(s.error="")}),($,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[_.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"backdrop show",onClick:B,"aria-hidden":"true"})):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(["sheet show",{sheet_retry:D.value}]),"aria-modal":"true","aria-labelledby":"sheetTitle",onClick:P},[e.createElementVNode("header",fl,[e.createElementVNode("div",ml,e.toDisplayString(m.value),1),D.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:B,"aria-label":"Закрыть"}," Закрыть ")]),e.createElementVNode("div",pl,[e.createElementVNode("div",hl,[e.createElementVNode("div",{class:e.normalizeClass(["nfc",h.value])},[e.createVNode(ul,{styleRetry:O.value},null,8,["styleRetry"]),p.value?(e.openBlock(),e.createBlock(al,{key:0})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"overlay check",style:e.normalizeStyle({display:A.value?"grid":"none"}),"aria-hidden":"true"},[e.createVNode(cl)],4)],2),e.createElementVNode("h2",_l,e.toDisplayString(y.value),1),e.createElementVNode("p",gl,e.toDisplayString(S.value),1),e.createElementVNode("div",yl,[e.withDirectives(e.createElementVNode("input",{ref_key:"cardInputManualRef",ref:l,"onUpdate:modelValue":b[0]||(b[0]=x=>f.value=x),class:"nfc_title_read_input",type:"text",placeholder:"Введите трек карты","aria-live":"polite",onKeydown:e.withKeys(I,["enter"])},null,544),[[e.vModelText,f.value],[v]]),D.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:b[1]||(b[1]=x=>D.value?B:I())},"Отправить"))]),g.value==="wait"&&e.unref(a).kiosk_show_loyalty_phone_input_button?(e.openBlock(),e.createElementBlock("div",bl,[e.createElementVNode("button",{class:"card_phone_auth_button",onClick:M},"Войти по номеру телефона")])):e.createCommentVNode("",!0)])]),e.createElementVNode("input",{ref_key:"cardInputRef",ref:i,type:"text",class:"sr_only","aria-live":"polite"},null,512),e.createElementVNode("div",wl,e.toDisplayString(R.value),1)],2)):e.createCommentVNode("",!0)],64))}}),kl={class:"start_page"},Cl=["src"],Sl={class:"wrap"},El={class:"wrap_box"},Nl={class:"title_fiscal_order"},xl={class:"wrapper_accept"},Bl={ref:"barRef",class:"bar_complete","aria-hidden":"true"},vl=ne(e.defineComponent({__name:"CartCompleteKioskSuccess",props:{mediaUrl:{},orderNumber:{}},setup(t){const n=ie(),o=Le(),r=fe(),a=_e(),{cartProducts_lib:s}=j.storeToRefs(n),{orderNumber:i,orderCompleted_lib:l}=j.storeToRefs(o),{is_startPage:c}=j.storeToRefs(r),{mediaUrl:d}=He(()=>a.itemThemes.kiosk_preloader?"preloader":null),u=K.useRouter(),f=K.useRoute();let g=null;e.onMounted(()=>{g=setTimeout(()=>{c.value=!0,u.replace(`/${f.params.orgId}`)},1e4)});const _=()=>{Je(["cart","authTokensAccess","authTokensRefresh"]),s.value=[],l.value=null,o.clearCard(),n.profile=null,u.replace(`/${f.params.orgId}`)};return e.onUnmounted(()=>{g&&clearInterval(g)}),(m,y)=>(e.openBlock(),e.createElementBlock("div",kl,[(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,Cl)])),y[4]||(y[4]=e.createElementVNode("div",{class:"start_img_black"},null,-1)),e.createElementVNode("div",Sl,[e.createElementVNode("div",El,[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",Nl,"№ "+e.toDisplayString(e.unref(i)),1),y[3]||(y[3]=e.createElementVNode("p",{class:"title_fiscal_completed"},"Спасибо! Заказ передан в работу.",-1)),e.createElementVNode("div",xl,[e.createElementVNode("button",{class:"btn","aria-label":"Новый заказ",onClick:_},[y[0]||(y[0]=e.createElementVNode("span",{class:"label"},"Новый заказ",-1)),e.createElementVNode("span",Bl,null,512)])])])])]))}}),[["__scopeId","data-v-c07b734f"]]),Al={};function $l(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 Tl=ne(Al,[["render",$l],["__scopeId","data-v-3e03a6dc"]]),Ml={},Pl={class:"center"};function Vl(t,n){return e.openBlock(),e.createElementBlock("div",Pl,[...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 Il=ne(Ml,[["render",Vl],["__scopeId","data-v-f0859fd1"]]),Rl={key:0,class:"wrapper_qr"},Dl={key:1,class:"wrapper_qr"},Ol={key:2,class:"wrapper_qr"},Fl=ne(e.defineComponent({__name:"CartCompletedOrder",props:{orderNumber:{}},setup(t){const n=Le(),o=_e(),{orderNumber:r,orderCompleted_lib:a}=j.storeToRefs(n),{mediaUrl:s}=He(()=>o.itemThemes.kiosk_preloader?"preloader":null);return(i,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)&&e.unref(a)===1?(e.openBlock(),e.createElementBlock("section",Rl,[e.createVNode(Tl)])):e.unref(a)&&e.unref(a)===2?(e.openBlock(),e.createElementBlock("section",Dl,[e.createVNode(Il)])):e.createCommentVNode("",!0),e.unref(a)&&e.unref(a)===3?(e.openBlock(),e.createElementBlock("section",Ol,[e.createVNode(vl,{orderNumber:e.unref(r),mediaUrl:e.unref(s)},null,8,["orderNumber","mediaUrl"])])):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-a3446a00"]]),Ll={},zl={class:"cart_loyal_qr",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Ul(t,n){return e.openBlock(),e.createElementBlock("svg",zl,[...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 jl=ne(Ll,[["render",Ul]]),No=t=>{const n=an(),o=l=>n.open(t,l),r=()=>n.close(t),a=n.state(t),s=e.computed({get:()=>a.value.visible,set:l=>l&&o()||r()}),i=e.computed(()=>a.value.context);return{visible:s,context:i,open:o,close:r}},Hl={class:"cart_deletion_modal_content"},ql={class:"cart_deletion_modal_title"},Wl={class:"cart_deletion_modal_footer"},Gl=ne(e.defineComponent({__name:"CartDeleteConfirm",emits:["confirm"],setup(t,{emit:n}){const o=n,{visible:r,context:a,close:s}=No("cart-delete-confirm"),i=()=>{o("confirm",a.value.idSystem),s()};return(l,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_deletion_modal_overlay",onClick:c[1]||(c[1]=e.withModifiers((...d)=>e.unref(s)&&e.unref(s)(...d),["self"]))},[e.createElementVNode("div",Hl,[e.createElementVNode("div",ql,"Удалить "+e.toDisplayString(e.unref(a).name)+"?",1),c[2]||(c[2]=e.createElementVNode("div",{class:"cart_deletion_modal_body"},"Эта позиция будет полностью удалена из заказа.",-1)),e.createElementVNode("div",Wl,[e.createElementVNode("button",{class:"primary",onClick:i}," Удалить "),e.createElementVNode("button",{onClick:c[0]||(c[0]=(...d)=>e.unref(s)&&e.unref(s)(...d))},"Отмена")])])])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-018f66f3"]]),Kl={class:"cart_wrapper"},Jl={class:"cart_header_content"},Xl={class:"cart_kso_loyal_wrapper"},Zl={key:0},Yl={class:"cart_header_wrapper"},Ql=["src"],ec={class:"cart_header_info"},tc={class:"cart_header_info"},nc={class:"cart_header_info"},oc={class:"cart_header_info"},rc={key:0},ac={key:0,class:"wrapper_comment"},sc={class:"wrapper_limit_in_area"},ic={class:"limit_comment"},lc={class:"cart_cards"},cc={class:"cart_footer_wrapper"},dc={key:0,class:"footer_title"},uc=["disabled","max"],fc={key:1,class:"footer_sales"},mc=["max"],pc={class:"list_price"},hc={key:0},_c={key:1},gc={key:2},yc={class:"accept_field"},bc={class:"accept_field"},wc={key:3},kc={class:"accept_field"},Cc={class:"accept_field"},Sc={class:"accept_field"},Ec={class:"wrapper_footer_cart_btn"},Nc=e.defineComponent({__name:"CartPage",props:{configPage:{},textPaymentBtn:{},config_qr:{type:Boolean}},setup(t){const n=ie(),o=Le(),r=_e(),a=fe(),s=t,{totalPrice_lib:i,countBonus:l,config_lib:c,cartProducts_lib:d,profile:u}=j.storeToRefs(n),{itemThemes:f}=j.storeToRefs(r),{textPaymentBtn_lib:g,isButtonDisabled:_,orderCompleted_lib:m,orderNumber:y,extraDiscount:S,is_notification_lib:w,notificationData_lib:h}=j.storeToRefs(o),{isAddToCard:p}=j.storeToRefs(a),A=K.useRouter(),D=K.useRoute(),O=e.useTemplateRef("stickerLoyality"),R=e.ref(!1),M=e.ref(!1),k=e.ref(""),N=e.ref(!1),B=e.ref(0),I=e.ref(!1),P=e.ref(0),T=e.ref(),{width:C}=Ne.useElementSize(O,{width:0,height:0},{box:"border-box"}),v=e.computed(()=>{const q={energy_amount:0,proteins_amount:0,fat_amount:0,carbohydrates_amount:0};return d.value.reduce((L,U)=>(L.energy_amount+=(U.energy_amount||0)*(U.amount||0),L.proteins_amount+=(U.proteins_amount||0)*(U.amount||0),L.fat_amount+=(U.fat_amount||0)*(U.amount||0),L.carbohydrates_amount+=(U.carbohydrates_amount||0)*(U.amount||0),L),q)}),$=()=>A.push(`/${D.params.orgId}/`),b=q=>{["a","A","+","-",".",","].includes(q.key)&&q.preventDefault()},x=q=>{n.deleteItemFromCart(q)},V=()=>{N.value=!N.value,k.value.length},F=()=>{var L,U,Y;let q=Math.floor(l.value);q<0||!q?q=0:((L=u.value)==null?void 0:L.balance)>i.value?q>i.value-1&&(q=i.value-1):q>((U=u.value)==null?void 0:U.balance)&&(q=(Y=u.value)==null?void 0:Y.balance),q!==l.value&&n.setBonus(q)};e.watchEffect(()=>{F(),n.setBonus(i.value===0?0:Math.floor(l.value))});const G=()=>d.value.map(q=>({id:q.id,front_item_id:q.idSystem,is_fake:!!q.is_fake,removals:q.removals??null,amount:q.amount,size:q.size,modifiers:q.modifiers??[],group_modifiers:q.group_modifiers??[]})),H=async()=>{_.value=!0;try{return await Ie.create().createOrder(G(),s.configPage.tableDataId,s.configPage.kiosk_menu,k.value,!!s.configPage.userData||!!u.value,s.configPage.is_tableservice)}catch(q){throw s.configPage.kiosk_menu?(q.status===403&&(localStorage.removeItem("apiKey"),n.is_showApiKey=!0,A.push(`/${D.params.orgId}/retryPage`)),o.deleteCart("retryPage",s.configPage.kiosk_menu)):s.configPage.is_tableservice?o.showNotification(q.response.data.user_friendly_message):A.push(`/${D.params.orgId}/errorPayment`),_.value=!1,q}},X=()=>{if(!u.value&&s.configPage.qr_menu){A.push(`/${D.params.orgId}/register`);return}p.value=!1,m.value=1,c.value.has_rms_discount?o.makeInitPaymentLinkRequest(T.value,s.configPage.kiosk_menu,s.configPage.is_tableservice).then(()=>T.value=null):H()},te=async()=>{var U;S.value=0,_.value=!0;const q={items:[...G()],combos:[]},L=Ie.create();try{I.value=!0;const Y=await L.calculateDiscount(q,s.configPage.kiosk_menu,!!s.configPage.userData||!!u.value);if(!d.value)return;if(d.value.forEach(Q=>{const le=Y.items.find(ae=>ae.front_item_id===Q.idSystem);if(le&&(Q.group_modifiers.forEach(ae=>{const ue=le.group_modifiers.find(me=>me.group===ae.group);ue&&ae.modifiers.forEach(me=>{const ke=ue.modifiers.find(ce=>ce.id===me.id);if(ke&&Number(me.price)!==Number(ke==null?void 0:ke.new_price)){const ce=(ke.discounts||[]).reduce((Fo,Xd)=>Fo+=+Xd.discount,0);B.value+=ce,me.new_price=me.price,me.price=Number(ke==null?void 0:ke.new_price),me.total_new_price=Number(ke.total_new_price)}})}),Q.modifiers.forEach(ae=>{const ue=le.modifiers.find(me=>me.id===ae.id);if(ue&&Number(ae.price)!==Number(ue==null?void 0:ue.new_price)){const me=(ue.discounts||[]).reduce((ke,ce)=>ke+=+ce.discount,0);B.value+=me,ae.new_price=ae.price,ae.price=Number(ue==null?void 0:ue.new_price),ae.total_new_price=Number(ue.total_new_price)}}),Q.price!==Number(le.new_price))){const ae=(le.discounts||[]).reduce((ue,me)=>ue+=+me.discount,0);B.value=B.value+ae,Q.new_price=Q.price,Q.price=le.new_price,Q.discounts=le.discounts,Q.total_new_price=Number(le.total_new_price)}}),d.value=[...d.value],B.value!==0&&(i.value=Y.total_cart_price),c.value.has_rms_discount){const Q=await H();T.value=(U=Q.data)==null?void 0:U.id}else _.value=!1;M.value=!1}catch(Y){console.log("Ошибка скидок [CartPage calculateDiscount]",Y),o.showNotification("Скидки временно недоступны"),I.value=!1,M.value=c.value.has_rms_discount,_.value=!1}},de=()=>{var q;(q=u.value)!=null&&q.balance?u.value.balance>=1&&(R.value=!R.value):o.showNotification("У Вас пока нет бонусов")},oe=()=>{var q,L;c.value.has_rms_discount&&(s.configPage.kiosk_menu||s.configPage.qr_menu&&u.value)?(T.value=null,M.value=!0):((q=c.value)==null?void 0:q.loyalty)==="IIKO"&&(c.value.has_loyalty_default_user||u.value)&&s.configPage.kiosk_menu||((L=c.value)==null?void 0:L.loyalty)==="IIKO"&&s.configPage.qr_menu&&u.value?M.value=!0:M.value=!1};e.onMounted(async()=>{g.value=s.textPaymentBtn,n.loadCart(),m.value=null,i.value=null,S.value=0,d.value.splice(0,d.value.length,...d.value.map(n.makeProductFullyReactive))}),e.onUnmounted(()=>{T.value=null,m.value=null,i.value=null,S.value=0,d.value.splice(0,d.value.length,...d.value.map(n.makeProductFullyReactive))});const Ee=e.computed(()=>I.value||_.value);return e.watchEffect(()=>{if(d.value.length===0&&!["АВТОРИЗОВАТЬСЯ ДЛЯ ЗАКАЗА"].includes(g.value.toUpperCase())){_.value=!0;return}!c.value.has_rms_discount&&["ОПЛАТИТЬ","СОЗДАТЬ ЗАКАЗ"].includes(g.value.toUpperCase())?_.value=n.cartProducts_lib.length===0||i.value===0:(_.value=!1,m.value=null)}),e.watch([()=>n.cartProducts_lib,u],q=>{if(P.value>0){P.value--;return}q&&!I.value&&(oe(),d.value.splice(0,d.value.length,...d.value.map(n.makeProductFullyReactive)),B.value=0,i.value=null,S.value=0,P.value=1),I.value=!1},{deep:!0}),(q,L)=>{var U,Y,Q,le,ae,ue,me,ke;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Kl,[e.createVNode(Gl,{onConfirm:x}),e.createVNode(Co,{visible:e.unref(o).isDrawerOpen,"onUpdate:visible":L[0]||(L[0]=ce=>e.unref(o).isDrawerOpen=ce)},{default:e.withCtx(()=>[e.createVNode(Eo)]),_:1},8,["visible"]),e.createElementVNode("header",Jl,[e.createElementVNode("div",Xl,[e.createElementVNode("div",{class:e.normalizeClass(["arrow_wrapper",{arrow_wrapper_kso:s.configPage.kiosk_menu}]),onClick:$},[e.createVNode(tn,{class:"cart_header_back_button"}),s.configPage.kiosk_menu?(e.openBlock(),e.createElementBlock("span",Zl,"Назад")):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",Yl,[(e.unref(f).kiosk_show_loyalty_card_button||e.unref(f).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:`${Math.ceil(e.unref(C)/2+10)}px`,paddingRight:(U=e.unref(f).cart_loyalty_button)!=null&&U.cart_loyalty_button_sticker?0:""}),onClick:L[1]||(L[1]=(...ce)=>e.unref(o).openDrawer&&e.unref(o).openDrawer(...ce))},[e.createElementVNode("p",{class:"cart_loyal_program",style:e.normalizeStyle({marginRight:`${Math.ceil(e.unref(C)/2)}px`})},e.toDisplayString(((Y=e.unref(f).cart_loyalty_button)==null?void 0:Y.cart_loyalty_button_text)||"Программа лояльности"),5),(Q=e.unref(f).cart_loyalty_button)!=null&&Q.cart_loyalty_button_sticker?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"stickerLoyality",ref:O,class:"cart_loyal_program_icon",style:e.normalizeStyle({"--sticker-mask":`url(${e.unref(f).cart_loyalty_button.cart_loyalty_button_sticker})`})},[e.createElementVNode("img",{src:e.unref(f).cart_loyalty_button.cart_loyalty_button_sticker},null,8,Ql)],4)):(e.openBlock(),e.createBlock(jl,{key:1,class:"cart_loyal_qr"}))],4)):e.createCommentVNode("",!0),e.unref(f).show_nutrition_in_cart?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cart_header",style:e.normalizeStyle({paddingTop:s.config_qr?0:"10px"})},[e.createElementVNode("div",ec,[e.createElementVNode("p",null,[e.createVNode($e,{price:v.value.energy_amount,duration:800},null,8,["price"]),L[6]||(L[6]=e.createTextVNode(" г",-1))]),L[7]||(L[7]=e.createElementVNode("p",{class:"cart_info_name"},"Килокалории",-1))]),e.createElementVNode("div",tc,[e.createElementVNode("p",null,[e.createVNode($e,{price:v.value.proteins_amount,duration:900},null,8,["price"]),L[8]||(L[8]=e.createTextVNode(" г",-1))]),L[9]||(L[9]=e.createElementVNode("p",{class:"cart_info_name"},"Белки",-1))]),e.createElementVNode("div",nc,[e.createElementVNode("p",null,[e.createVNode($e,{price:v.value.fat_amount,duration:1e3},null,8,["price"]),L[10]||(L[10]=e.createTextVNode(" г",-1))]),L[11]||(L[11]=e.createElementVNode("p",{class:"cart_info_name"},"Жиры",-1))]),e.createElementVNode("div",oc,[e.createElementVNode("p",null,[e.createVNode($e,{price:v.value.carbohydrates_amount,duration:1100},null,8,["price"]),L[12]||(L[12]=e.createTextVNode(" г",-1))]),L[13]||(L[13]=e.createElementVNode("p",{class:"cart_info_name"},"Углеводы",-1))])],4)):e.createCommentVNode("",!0)])]),t.config_qr&&e.unref(f).show_order_comment?(e.openBlock(),e.createElementBlock("div",rc,[N.value?(e.openBlock(),e.createElementBlock("div",ac,[e.createElementVNode("div",sc,[e.withDirectives(e.createElementVNode("textarea",{class:"comment_order",placeholder:"Ваш комментарий к заказу...",name:"comment",maxlength:"50","onUpdate:modelValue":L[2]||(L[2]=ce=>k.value=ce)},null,512),[[e.vModelText,k.value]]),e.createElementVNode("p",ic,e.toDisplayString(k.value.length+" / 50"),1)]),e.createVNode(De,{textButtonDefault:"Сохранить",onClick:V,class:"button_bonus_cart"})])):e.createCommentVNode("",!0),!N.value&&e.unref(d).length>0?(e.openBlock(),e.createBlock(De,{key:1,textButtonDefault:k.value.length>0?"Редактировать":"Комментарий к заказу",onClick:()=>N.value=!N.value,id:"button_comments"},null,8,["textButtonDefault","onClick"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),ce=>(e.openBlock(),e.createBlock(So,{key:ce.idSystem,cardItem:ce,onDelete:Fo=>x(ce.idSystem)},null,8,["cardItem","onDelete"]))),128))]),e.createElementVNode("div",cc,[R.value?(e.openBlock(),e.createElementBlock("p",dc,[L[14]||(L[14]=e.createTextVNode(" Списать ",-1)),e.withDirectives(e.createElementVNode("input",{type:"number",placeholder:"0",style:e.normalizeStyle({maxWidth:`${e.unref(l).toString().length||1}em`}),disabled:e.unref(u)===null||((le=e.unref(u))==null?void 0:le.balance)===0,"onUpdate:modelValue":L[3]||(L[3]=ce=>e.isRef(l)?l.value=ce:null),onInput:F,min:"0",max:((ae=e.unref(u))==null?void 0:ae.balance)>e.unref(i)?Math.floor(e.unref(i)):(ue=e.unref(u))==null?void 0:ue.balance,onKeypress:b},null,44,uc),[[e.vModelText,e.unref(l),void 0,{number:!0}]]),L[15]||(L[15]=e.createTextVNode(" бонусов ",-1))])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("p",fc,"У вас есть "+e.toDisplayString(e.unref(u)?e.unref(u).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":L[4]||(L[4]=ce=>e.isRef(l)?l.value=ce:null),min:0,max:((me=e.unref(u))==null?void 0:me.balance)>e.unref(i)?Math.floor(e.unref(i)-1):(ke=e.unref(u))==null?void 0:ke.balance},null,8,mc)),[[e.vModelText,e.unref(l),void 0,{number:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("ul",pc,[R.value?(e.openBlock(),e.createElementBlock("li",hc,[L[17]||(L[17]=e.createElementVNode("p",null,"Сумма заказа:",-1)),e.createElementVNode("p",null,[e.createVNode($e,{price:e.unref(i),fixedFloat:2},null,8,["price"]),L[16]||(L[16]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("li",_c,[L[19]||(L[19]=e.createElementVNode("p",null,"Будет оплачено бонусами:",-1)),e.createElementVNode("p",null,[e.createVNode($e,{price:e.unref(l),fixedFloat:2},null,8,["price"]),L[18]||(L[18]=e.createTextVNode(" Б",-1))])])):e.createCommentVNode("",!0),e.unref(S)!==0?(e.openBlock(),e.createElementBlock("li",gc,[e.createElementVNode("p",yc,e.toDisplayString(e.unref(S)>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",bc,[e.createVNode($e,{price:Math.abs(e.unref(S)),fixedFloat:2},null,8,["price"]),L[20]||(L[20]=e.createTextVNode(" ₽",-1))])])):B.value!==0?(e.openBlock(),e.createElementBlock("li",wc,[e.createElementVNode("p",kc,e.toDisplayString(B.value>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",Cc,[e.createVNode($e,{price:Math.abs(B.value),fixedFloat:2},null,8,["price"]),L[21]||(L[21]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),e.createElementVNode("li",null,[L[23]||(L[23]=e.createElementVNode("p",{class:"accept_field"},"Итого к оплате:",-1)),e.createElementVNode("p",Sc,[e.createVNode($e,{price:e.unref(i)-e.unref(l),fixedFloat:2},null,8,["price"]),L[22]||(L[22]=e.createTextVNode(" ₽",-1))])])]),e.createElementVNode("div",Ec,[e.unref(u)?(e.openBlock(),e.createBlock(De,{key:0,textButtonDefault:"Бонусы",onClick:de,class:"button_bonus_cart"})):e.createCommentVNode("",!0),e.createVNode(De,{textButtonDefault:M.value?"Рассчитать скидки":e.unref(g),onClick:M.value?te:X,class:"button_payment_cart",disabled:Ee.value},null,8,["textButtonDefault","onClick","disabled"])])])]),t.configPage.kiosk_menu?(e.openBlock(),e.createBlock(Fl,{key:0,orderNumber:e.unref(y),pageNumber:1},null,8,["orderNumber"])):e.createCommentVNode("",!0),e.createVNode(on,{visible:e.unref(w),"onUpdate:visible":L[5]||(L[5]=ce=>e.isRef(w)?w.value=ce:null),textNotificationDefault:e.unref(h).textNotification,backgroundColor:e.unref(f).accent_color?e.unref(f).accent_color:"#FF6D2E",buttonAccept:null},null,8,["visible","textNotificationDefault","backgroundColor"])],64)}}}),xc={},Bc={viewBox:"0 0 24 24"};function vc(t,n){return e.openBlock(),e.createElementBlock("svg",Bc,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Ac=ne(xc,[["render",vc]]),$c={class:"retry_screen"},Tc={class:"retry_all_in_screen"},Mc={class:"retry_content"},Pc={class:"retry_icon_wrap"},Vc={class:"retry_icon_circle"},Ic={class:"retry_error_x"},Rc=e.defineComponent({__name:"RetryPage",setup(t){const n=Le(),o=K.useRouter(),r=K.useRoute(),a=ie(),s=()=>{n.notificationData_lib.textNotification="",n.is_notification_lib=!1,a.openApiKey=!0,o.replace(`/${r.params.orgId}/`)};return(i,l)=>(e.openBlock(),e.createElementBlock("section",$c,[e.createElementVNode("div",Tc,[e.createElementVNode("main",Mc,[e.createElementVNode("div",Pc,[e.createElementVNode("div",Vc,[l[0]||(l[0]=e.createElementVNode("div",{class:"retry_loader_mini"},null,-1)),e.createElementVNode("div",Ic,[e.createVNode(Ac)])])]),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:s,class:"retry_new_order_btn"},"Новый заказ")]),l[4]||(l[4]=e.createElementVNode("p",{class:"retry_bottom_note"},"Если ошибка повторяется — обратитесь к сотруднику зала.",-1))])]))}}),Dc={class:"wrapper_loader"},Oc=e.defineComponent({__name:"Loader",props:{size:{type:String,default:"40px"}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("div",{class:"loader",style:e.normalizeStyle({width:t.size})},null,4)]))}}),Fc=ne(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)}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"opacity-animation",key:t.id},[e.renderSlot(o.$slots,"opacityLoader",{},void 0,!0)]))}}),[["__scopeId","data-v-c6b97942"]]),Lc={key:0},zc={class:"card__main__wrapper"},Uc={key:0,class:"folder_content_top"},jc={key:0,class:"loader_card_main"},Hc={key:1,class:"card__main_content"},qc=["src","alt"],Wc={class:"card_title_price_wrapper"},Gc={class:"title"},Kc={key:0,class:"price"},Jc={key:1,class:"card_button_add_wrapper"},xo=ne(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=_e(),o=ie(),r=fe(),{itemThemes:a}=j.storeToRefs(n),{is_18_above_content:s,is18Allowed:i,notificationData_lib:l}=j.storeToRefs(o),c=t,d=(_,m)=>{var w,h,p;const y={id:_.id,is_fake:_.is_fake||!1,amount:_.amount||1,name:_.name,image_link:_.image_link,price:_.price,old_price:_.price,size:void 0,sizes:[],modifiers:[],groups:_.groups,group_modifiers:[],energy_amount:_.energy_amount??0,proteins_amount:_.proteins_amount??0,fat_amount:_.fat_amount??0,carbohydrates_amount:_.carbohydrates_amount??0},S=!((w=_.modifiers)!=null&&w.length)&&!((h=_.group_modifiers)!=null&&h.length)&&!((p=_.sizes)!=null&&p.length);if(r.isUpSale=!1,_.adult&&!i.value){s.value=!0,S&&(l.value.fastAdd=y);return}if(S){o.addToCart(y);return}if(_.amount||(_.amount=1),c.is_group&&c.selectGroupChild){c.selectGroupChild({..._,parent:c.parent,child:m.child_groups});return}c.takeCurrentCard&&c.takeCurrentCard(m.id)},u=_=>{if(c.is_group&&c.selectGroupChild){_={..._,parent:c.parent,child:_.child_groups},c.selectGroupChild(_);return}if(_.adult&&!i.value){s.value=!0;return}c.takeCurrentCard&&c.takeCurrentCard(_.id)},f=e.computed(()=>c.activeTags.every(_=>c.data.tags.includes(_))),{mediaUrl:g}=He(()=>c.data.id+"_image",()=>c.data.image_link);return(_,m)=>{var y;return((y=c.activeTags)==null?void 0:y.length)===0||f.value||c.is_group?(e.openBlock(),e.createElementBlock("div",Lc,[e.createVNode(Fc,{id:c.data.id},{opacityLoader:e.withCtx(()=>[e.createElementVNode("div",zc,[t.is_group?(e.openBlock(),e.createElementBlock("div",Uc)):e.createCommentVNode("",!0),e.createElementVNode("div",{onClick:m[0]||(m[0]=S=>u(c.data)),class:e.normalizeClass(["card__main",{card__main_folder:t.is_group}])},[t.isLoading?(e.openBlock(),e.createElementBlock("div",jc,[e.createVNode(Oc)])):(e.openBlock(),e.createElementBlock("div",Hc,[e.createElementVNode("img",{src:e.unref(g)||"",class:e.normalizeClass(["img",{card_blur_image:c.data.adult&&!e.unref(i)}]),loading:"lazy",alt:t.data.name},null,10,qc),e.createElementVNode("div",Wc,[e.createElementVNode("p",Gc,e.toDisplayString(t.data.name),1),t.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",Kc,e.toDisplayString(e.unref(ot)(t.data))+" ₽",1))])]))],2),t.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Jc,[e.createElementVNode("div",{onClick:m[1]||(m[1]=S=>d(t.data,c.data)),class:"add_button"},[...m[2]||(m[2]=[e.createElementVNode("div",{class:"image_add_button"},null,-1)])])]))])]),_:1},8,["id"])])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-06431027"]]),Xc=["id","onClick"],Zc=ne(e.defineComponent({__name:"GroupMain",props:{menuGroup:{},idActiveGroup:{},activeTakeGroup:{type:Function}},setup(t){const n=e.ref(null);return(o,r)=>t.menuGroup.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__menu",ref_key:"scrollGroup",ref:n},[e.createVNode(Qt,{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,(s,i)=>(e.openBlock(),e.createElementBlock("li",{key:s.id,id:"scrolling"+s.id,onClick:l=>{t.activeTakeGroup&&t.activeTakeGroup(s.id,i),a(l)},style:e.normalizeStyle(t.idActiveGroup==s.id?{fontFamily:"Bounded"}:{})},e.toDisplayString(s.name),13,Xc))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-33006a7e"]]),Yc=["id","onClick"],Qc=ne(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,o=e.ref(null),r=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,s)=>t.menuTags.length>0?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__filters",ref_key:"scrollTagContainer",ref:o},[e.createVNode(Qt,{axis:"x",behavior:"smooth",container:o.value,autoScroll:!0,idActive:r.value?r.value[t.currentActiveTag.length-1]:null,clearContainer:!1},{default:e.withCtx(({handleTargetClick:i})=>[(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),i(d)},class:e.normalizeClass({main__filter_active:(r.value??[]).includes(l)})},e.toDisplayString(l),11,Yc))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-818940a4"]]),ed=["data-id"],td=["src"],nd=["src"],od=ne(e.defineComponent({__name:"DrumItem",props:{group:{},index:{},active:{type:Boolean}},setup(t){const n=t,{mediaUrl:o}=He(()=>{var r,a;return(r=n.group)!=null&&r.video_link?`${n.group.id}_video`:(a=n.group)!=null&&a.image_link?`${n.group.id}_image`:null});return(r,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.openBlock(),e.createElementBlock("video",{key:e.unref(o),loop:"",autoplay:"",muted:"",playsinline:"",class:"drum_img"},[e.createElementVNode("source",{src:e.unref(o)||"",type:"video/webm"},null,8,td)])):(e.openBlock(),e.createElementBlock("img",{key:1,class:"drum_img",src:e.unref(o)||""},null,8,nd)),e.createElementVNode("p",null,e.toDisplayString(t.group.name),1)],10,ed)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-b948bda1"]]),rd={},ad={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 sd(t,n){return e.openBlock(),e.createElementBlock("svg",ad,[...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 id=ne(rd,[["render",sd]]),ld={class:"recommendation_wrapper"},cd={class:"recommendation_header"},dd={class:"recommendation_info"},ud=ne(e.defineComponent({__name:"Recommendation",props:{closeCurrentCard:{},openCurrentCard:{}},setup(t){const n=fe(),{isUpSale:o,dataUpSale:r}=j.storeToRefs(n),a=()=>{o.value=!1};return e.onUnmounted(()=>{r.value=null}),(s,i)=>(e.openBlock(),e.createElementBlock("div",ld,[e.createElementVNode("div",cd,[i[0]||(i[0]=e.createElementVNode("p",{class:"header_title"},"Часто берут вместе",-1)),e.createElementVNode("div",{class:"header_close",onClick:a},[e.createVNode(id,{class:"close_icon"})])]),e.createElementVNode("div",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),l=>(e.openBlock(),e.createBlock(xo,{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"]]),fd=e.defineComponent({__name:"Blackout",props:{data:{type:Boolean}},setup(t){const n=t;return e.watch(()=>n.data,o=>{document.body.style.overflow=o?"hidden":""}),()=>{}}}),md={class:"wrapper_modal"},pd={class:"card_modal"},hd=ne(e.defineComponent({__name:"ModalWindows",props:{visible:{type:Boolean}},setup(t){const n=t,o=fe(),{isUpSale:r}=j.storeToRefs(o),a=()=>{r.value=!1};return(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(fd,{data:n.visible},null,8,["data"]),e.createElementVNode("div",{class:"black_modal",onClick:a}),e.createElementVNode("div",md,[e.createElementVNode("div",pd,[e.renderSlot(s.$slots,"default",{},void 0,!0)])])],64))}}),[["__scopeId","data-v-ec2b2c4d"]]),sn=j.defineStore("modulesLib",()=>{const t=e.ref(!1),n=e.ref({textNotification:""});return{is_notification_lib:t,notificationData_lib:n}}),vt=Symbol("clickOutside"),_d={mounted(t,n){t[vt]=o=>{t.contains(o.target)||n.value(o)},document.addEventListener("click",t[vt])},unmounted(t){t[vt]&&document.removeEventListener("click",t[vt])}};class gd{constructor(n){ee(this,"value");ee(this,"next");this.value=n}}class yd{constructor(){Tt(this,we);Tt(this,Oe);Tt(this,We);this.clear()}enqueue(n){const o=new gd(n);xe(this,we)?(xe(this,Oe).next=o,Pe(this,Oe,o)):(Pe(this,we,o),Pe(this,Oe,o)),un(this,We)._++}dequeue(){const n=xe(this,we);if(n)return Pe(this,we,xe(this,we).next),un(this,We)._--,xe(this,we)||Pe(this,Oe,void 0),n.value}peek(){if(xe(this,we))return xe(this,we).value}clear(){Pe(this,we,void 0),Pe(this,Oe,void 0),Pe(this,We,0)}get size(){return xe(this,We)}*[Symbol.iterator](){let n=xe(this,we);for(;n;)yield n.value,n=n.next}*drain(){for(;xe(this,we);)yield this.dequeue()}}we=new WeakMap,Oe=new WeakMap,We=new WeakMap;function bd(t){Bo(t);const n=new yd;let o=0;const r=()=>{o<t&&n.size>0&&(o++,n.dequeue()())},a=()=>{o--,r()},s=async(c,d,u)=>{const f=(async()=>c(...u))();d(f);try{await f}catch{}a()},i=(c,d,u)=>{new Promise(f=>{n.enqueue(f)}).then(s.bind(void 0,c,d,u)),o<t&&r()},l=(c,...d)=>new Promise(u=>{i(c,u,d)});return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>n.size},clearQueue:{value(){n.clear()}},concurrency:{get:()=>t,set(c){Bo(c),t=c,queueMicrotask(()=>{for(;o<t&&n.size>0;)r()})}},map:{async value(c,d){const u=Array.from(c,(f,g)=>this(d,f,g));return Promise.all(u)}}}),l}function Bo(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 be=null;const vo=bd(5),wd=async(t,n)=>{be&&Ed();const o=ie(),r=sn(),a=fe(),{displayCards:s}=j.storeToRefs(o),{is_notification_lib:i,notificationData_lib:l}=j.storeToRefs(r),{stateCard:c,openProduct:d}=j.storeToRefs(a),u=Ie.create();await kd(t),be=_t(`wss://${n}/ws/org-unit/${t}/`),be.on("open",()=>console.warn("Realtime WebSocket подключён (pointId:",t,")")),be.on("error",f=>console.warn("WebSocket ошибка:",f)),be.on("close",()=>console.warn("Realtime WebSocket закрыт")),be.on("message",async f=>{if(f.type)return;l.value.textNotification="Мы обновили меню";const g=f.params||f,_=g.active_groups||[],m=g.updated_groups||[],y=g.updated_product_groups||[],S=await Fe(),w=new Set(_.map(k=>k)),h=new Map(s.value.map(k=>[k.id,k])),p=[],A=S.transaction("groups","readwrite");let O=await A.objectStore("groups").openCursor();for(;O;){const k=O.key;!w.has(k)&&k!==t&&(p.push(k),await O.delete(),h.delete(k)),O=await O.continue()}await A.done,s.value=Array.from(h.values()),p.length>0&&await Cd(w);const R=[...m.map(k=>vo(async()=>{const[N,B]=await Promise.all([u.getGroupByID(k),u.loadGroupProducts(k)]);N.products=B,h.set(k,N),await et(k,N),await $o(N,B,!0)})),...y.map(k=>vo(async()=>{const[N,B]=await Promise.all([u.getGroupByID(k),u.loadGroupProducts(k)]);N.products=B,h.set(k,N),await et(k,N),await $o(N,B,!0),await Sd(B,k)}))];await Promise.all(R),s.value=Array.from(h.values()),await ar(t,s),i.value=!0;const M=c.value.openCard;if(M!=null&&M.id){const k=new Set(M.groups??[]),N=new Set;let B=!1;for(const P of h.values()){const T=P==null?void 0:P.products;if(!Array.isArray(T))continue;const C=T.find(v=>(v==null?void 0:v.id)===M.id);if((C==null?void 0:C.adult)===!0){d.value={id:null,visible:!1},a.reset();return}C&&(P==null?void 0:P.id)!=null&&(N.add(P.id),(m.includes(P.id)||y.includes(P.id))&&(B=!0))}if(N.size===0){d.value={id:null,visible:!1},a.reset();return}(!(k.size===N.size&&[...k].every(P=>N.has(P)))||B)&&await u.getSingleProduct(M==null?void 0:M.id)}}),be.connect()},kd=async t=>{try{const n=ie(),o=await Ft(t);o!=null&&o.data&&(n.displayCards=o.data)}catch(n){console.error("Ошибка загрузки кэша групп:",n)}},Ao=async t=>{const n=ie(),o=sn(),r=fe(),{stateCard:a,openProduct:s}=j.storeToRefs(r),{cartProducts_lib:i}=j.storeToRefs(n),l=i.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)&&(s.value={id:null,visible:!1})):d.push(f);if(c.length>0){const f=c.map(g=>g.name).slice(0,3).join(", ");o.notificationData_lib.textNotification=`Некоторые позиции стали недоступны и были убраны из заказа: ${f}${c.length>3?` и ещё ${c.length-3}`:""}`,i.value=d,n.updateCartInLocalStorage()}},Cd=async t=>{await Ao(n=>{var o;return(o=n.groups)!=null&&o.length?!n.groups.some(r=>t.has(r)):!0})},Sd=async(t,n)=>{const o=ie(),r=new Set(t.filter(a=>!a.adult||o.is18Allowed).map(a=>a.id));await Ao(a=>{var s;return(s=a.groups)!=null&&s.includes(n)?!r.has(a.id):!1})},$o=async(t,n,o=!0)=>{if(t.video_link&&At(t.video_link,`${t.id}_video`,o),t.image_link&&At(t.image_link,`${t.id}_image`,o),n!=null&&n.length)for(const r of n)r.video_link&&At(r.video_link,`${r.id}_video`,o),r.image_link&&At(r.image_link,`${r.id}_image`,o)},At=async(t,n,o=!1)=>{try{const r=nt();if(!o){const i=await Ke(n);if(i){r.updateCacheFromBlob(n,i),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:i}}));return}}const a=await fetch(t);if(!a.ok)throw new Error("Network error");const s=await a.blob();if(s.size===0)throw new Error("Empty blob");await Lt(n,s),r.updateCacheFromBlob(n,s),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:s}}))}catch(r){console.warn(`[MediaCache] Failed for ${n}:`,r)}},Ed=()=>{be&&(be.off("open"),be.off("message"),be.off("error"),be.off("close"),be.close(!0),be=null)},Nd={class:"button_price_bg"},xd={class:"wrapper_container_price_bg"},Bd={class:"button_price"},vd={key:0,class:"image_product_container"},Ad=["src"],$d=e.defineComponent({__name:"BasketButton",emits:["goToCart"],setup(t){const n=ie(),o=nt(),{totalPrice_lib:r,cartProducts_lib:a}=j.storeToRefs(n);o.initCacheSingle("defaultImage");const s=e.computed(()=>o.cache.defaultImage||""),i=c=>{const d=`${c}_image`;return o.initCacheSingle(d),o.cache[d]||s.value},l=e.computed(()=>{var c;return(c=a.value)!=null&&c.length,a.value.slice(0,3).map(d=>({id:d.id,url:i(d.id)}))});return(c,d)=>(e.openBlock(),e.createElementBlock("div",Nd,[e.createElementVNode("div",xd,[e.createElementVNode("div",Bd,[e.unref(r)>0&&l.value.length>0?(e.openBlock(),e.createElementBlock("div",vd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,class:"filter_image_product"},[e.createElementVNode("img",{src:u.url,class:"img_product"},null,8,Ad)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"button_default_main",onClick:d[0]||(d[0]=u=>c.$emit("goToCart"))},[d[2]||(d[2]=e.createElementVNode("div",{class:"icont_cart"},null,-1)),e.createElementVNode("p",null,[e.createVNode($e,{price:e.unref(r),fixedFloat:2},null,8,["price"]),d[1]||(d[1]=e.createTextVNode(" ₽",-1))])])])])]))}}),dt=null,{min:qe,max:Te,abs:To,floor:Td}=Math,Mo=(t,n,o)=>qe(o,Te(n,t)),Po=t=>[...t].sort((n,o)=>n-o),Md=typeof queueMicrotask=="function"?queueMicrotask:t=>{Promise.resolve().then(t)},ln=()=>{let t;return[new Promise(n=>{t=n}),t]},Vo=t=>{let n;return()=>(t&&(n=t(),t=void 0),n)},ut=(t,n,o)=>{const r=o?"unshift":"push";for(let a=0;a<n;a++)t[r](-1);return t},Io=(t,n)=>{const o=t.t[n];return o===-1?t.o:o},Pd=(t,n,o)=>{const r=t.t[n]===-1;return t.t[n]=o,t.i=qe(n,t.i),r},$t=(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 o=t.i,r=t.u[o];for(;o<n;)r+=Io(t,o),t.u[++o]=r;return t.i=n,r},Qe=(t,n,o=0,r=t.l-1)=>{let a=o;for(;o<=r;){const s=Td((o+r)/2);$t(t,s)<=n?(a=s,o=s+1):r=s-1}return Mo(a,0,t.l-1)},Ro=(t,n,o)=>{const r=n-t.l;return t.i=o?-1:qe(n-1,t.i),t.l=n,r>0?(ut(t.u,r),ut(t.t,r,o),t.o*r):(t.u.splice(r),(o?t.t.splice(0,-r):t.t.splice(r)).reduce((a,s)=>a-(s===-1?t.o:s),0))},Vd=t=>t.documentElement,Id=t=>t.ownerDocument,Rd=t=>t.defaultView,Do=Vo(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>0),Dd=Vo(()=>"scrollBehavior"in Vd(document).style),Od=(t,n=40,o=0,r,a=!1)=>{let s=!!o,i=1,l=0,c=0,d=0,u=0,f=0,g=0,_=0,m=0,y=dt,S=[0,s?Te(o-1,0):-1],w=0,h=!1;const p=((P,T,C)=>({o:T,t:C?ut(C.slice(0,qe(P,C.length)),Te(0,P-C.length)):ut([],P),l:P,i:-1,u:ut([],P+1)}))(t,r?r[1]:n,r&&r[0]),A=new Set,D=()=>d-c,O=()=>D()+f+u,R=(P,T)=>((C,v,$,b)=>{if(b=qe(b,C.l-1),$t(C,b)<=v){const x=Qe(C,$,b);return[Qe(C,v,b,x),x]}{const x=Qe(C,v,void 0,b);return[x,Qe(C,$,x)]}})(p,P,T,S[0]),M=()=>$t(p,p.l),k=(P,T)=>{const C=$t(p,P)-f;return T?M()-C-N(P):C},N=P=>Io(p,P),B=(P,T=-1)=>p.t[P]===T,I=P=>{P&&(Do()&&_!==0||y&&m===1?f+=P:u+=P)};return{p:()=>{A.clear()},h:()=>i,m:()=>(P=>[P.t.slice(),P.o])(p),v:(P=200)=>{if(!h||s)return S;let T,C;if(g)[T,C]=S;else{let v=Te(0,O()),$=v+l;a||(P=Te(0,P),_!==1&&(v-=P),_!==2&&($+=P)),[T,C]=S=R(Te(0,v),Te(0,$)),y&&(T=qe(T,y[0]),C=Te(C,y[1]))}return[Te(T,0),qe(C,p.l-1)]},S:P=>Qe(p,P-c),I:B,O:k,k:N,j:()=>p.l,N:()=>d,B:()=>_!==0,T:()=>l,q:()=>c,M,P:()=>(g=u,u=0,[g,m===2]),R:(P,T)=>{const C=[P,T];return A.add(C),()=>{A.delete(C)}},A:(P,T)=>{let C,v,$=0;switch(P){case 1:{if(T===d&&m===0)break;const b=g;g=0;const x=T-d,V=To(x);b&&V<To(b)+1||m!==0||(_=x<0?2:1),s&&(s=!1),d=T,$=4;const F=D();F>=-l&&F<=M()&&($+=1,v=V>l);break}case 2:$=8,_!==0&&(C=!0,$+=1),_=0,m=0,y=dt;break;case 3:{const b=T.filter(([x,V])=>!B(x,V));if(!b.length)break;I(b.reduce((x,[V,F])=>((m===2||(y&&m===1?V<y[0]:k(V+(_===0&&m===0?1:0))<D()))&&(x+=F-N(V)),x),0));for(const[x,V]of b){const F=N(x),G=Pd(p,x,V);a&&(w+=G?V:V-F)}a&&l&&w>l&&(I(((x,V)=>{let F=0;const G=[];x.t.forEach((Ee,q)=>{Ee!==-1&&(G.push(Ee),q<V&&F++)}),x.i=-1;const H=Po(G),X=H.length,te=X/2|0,de=X%2==0?(H[te-1]+H[te])/2:H[te],oe=x.o;return((x.o=de)-oe)*Te(V-F,0)})(p,Qe(p,O()))),a=!1),$=3,v=!0;break}case 4:l!==T&&(l||(h=v=!0),l=T,$=3);break;case 5:T[1]?(I(Ro(p,T[0],!0)),m=2,$=1):(Ro(p,T[0]),$=1);break;case 6:c=T;break;case 7:m=1;break;case 8:y=R(T,T+l),$=1}$&&(i=1+(2147483647&i),C&&f&&(u+=f,f=0),A.forEach(([b,x])=>{$&b&&x(v)}))}}},cn=setTimeout,dn=(t,n)=>n?-t:t,Fd=(t,n,o,r,a,s)=>{const i=Date.now;let l=0,c=!1,d=!1,u=!1,f=!1;const g=(()=>{let w;const h=()=>{w!=dt&&clearTimeout(w)},p=()=>{h(),w=cn(()=>{w=dt,(()=>{if(c||d)return c=!1,void g();u=!1,t.A(2)})()},150)};return p.C=h,p})(),_=()=>{l=i(),u&&(f=!0),t.A(1,r()),g()},m=w=>{if(c||!t.B()||w.ctrlKey)return;const h=i()-l;150>h&&50<h&&(o?w.deltaX:w.deltaY)&&(c=!0)},y=()=>{d=!0,u=f=!1},S=()=>{d=!1,Do()&&(u=!0)};return n.addEventListener("scroll",_),n.addEventListener("wheel",m,{passive:!0}),n.addEventListener("touchstart",y,{passive:!0}),n.addEventListener("touchend",S,{passive:!0}),{H:()=>{n.removeEventListener("scroll",_),n.removeEventListener("wheel",m),n.removeEventListener("touchstart",y),n.removeEventListener("touchend",S),g.C()},V:()=>{const[w,h]=t.P();w&&(a(w,h,f),f=!1,h&&t.T()>t.M()&&t.A(1,r()))}}},Ld=(t,n,o)=>{let r;return[async(a,s)=>{if(!await n())return;r&&r();const i=()=>{const[l,c]=ln();return r=()=>{c(!1)},t.T()&&cn(r,150),[l,t.R(2,()=>{c(!0)})]};if(s&&Dd())t.A(8,a()),Md(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]=i();try{if(!await c)return}finally{d()}}t.A(7),o(a(),s)});else for(;;){const[l,c]=i();try{if(t.A(7),o(a()),!await l)return}finally{c()}}},()=>{r&&r()}]},zd=t=>{let n;return{F(o){(n||(n=new(Rd(Id(o))).ResizeObserver(t))).observe(o)},J(o){n.unobserve(o)},H(){n&&n.disconnect()}}},Ud=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(),o=e.computed(()=>t.L.value&&t.W.O(t.D,t.K)),r=e.computed(()=>t.L.value&&t.W.I(t.D));return e.watch(()=>n.value&&t.D,(a,s,i)=>{i(t.Y(n.value,t.D))},{flush:"post"}),()=>{var a;const{X:s,U:i,G:l,Z:c}=t,d=r.value,{style:u,...f}=(a=t.ee)!==null&&a!==void 0?a:{},g={contain:"layout style",position:d&&l?void 0:"absolute",[i?"height":"width"]:"100%",[i?"top":"left"]:"0px",[i?"left":"top"]:o.value+"px",visibility:!d||l?void 0:"hidden",...u};return i&&(g.display="inline-flex"),e.createVNode(c,e.mergeProps({ref:n,style:g},f),typeof(_=s)=="function"||Object.prototype.toString.call(_)==="[object Object]"&&!e.isVNode(_)?s:{default:()=>[s],_:2},16,["style"]);var _}}}),jd=(t,n)=>{const o=t.key;return o??"_"+n},Hd=(t,n)=>t[0]===n[0]&&t[1]===n[1],Oo=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:o,slots:r}){let a=!!t.ssrCount;const s=t.horizontal,i=e.ref(),l=Od(t.data.length,t.itemSize,t.ssrCount,t.cache,!t.itemSize),c=((m,y)=>{let S;const w=y?"width":"height",h=new WeakMap,p=zd(A=>{const D=[];for(const{target:O,contentRect:R}of A)if(O.offsetParent)if(O===S)m.A(4,R[w]);else{const M=h.get(O);M!=dt&&D.push([M,R[w]])}D.length&&m.A(3,D)});return{te(A){p.F(S=A)},re:(A,D)=>(h.set(A,D),p.F(A),()=>{h.delete(A),p.J(A)}),p:p.H}})(l,s),d=((m,y)=>{let S,w,h=ln(),p=!1;const A=y?"scrollLeft":"scrollTop",D=y?"overflowX":"overflowY",[O,R]=Ld(m,()=>h[0],(M,k)=>{M=dn(M,p),k?S.scrollTo({[y?"left":"top"]:M,behavior:"smooth"}):S[A]=M});return{oe(M){S=M,y&&(p=getComputedStyle(M).direction==="rtl"),w=Fd(m,M,y,()=>dn(M[A],p),(k,N,B)=>{if(B){const I=M.style,P=I[D];I[D]="hidden",cn(()=>{I[D]=P})}M[A]=dn(m.N()+k,p),N&&R()}),h[1](!0)},p(){w&&w.H(),h[1](!1),h=ln()},ne:()=>p,se(M){O(()=>M)},ie(M){M+=m.N(),O(()=>M)},le(M,{align:k,smooth:N,offset:B=0}={}){if(M=Mo(M,0,m.j()-1),k==="nearest"){const I=m.O(M),P=m.N();if(I<P)k="start";else{if(!(I+m.k(M)>P+m.T()))return;k="end"}}O(()=>B+m.q()+m.O(M)+(k==="end"?m.k(M)-m.T():k==="center"?(m.k(M)-m.T())/2:0),N)},ce:()=>{w&&w.V()}}})(l,s),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(m=>{u.value;const y=l.v(t.bufferSize);return m&&Hd(m,y)?m:y}),g=e.computed(()=>u.value&&l.B()),_=e.computed(()=>u.value&&l.M());return e.onMounted(()=>{a=!1;const m=requestAnimationFrame(()=>{const y=S=>{c.te(S),d.oe(S)};t.scrollRef?y(t.scrollRef):y(i.value.parentElement)});e.onUnmounted(()=>{cancelAnimationFrame(m)})}),e.onUnmounted(()=>{l.p(),c.p(),d.p()}),e.watch(()=>t.data.length,m=>{l.A(5,[m,t.shift])}),e.watch(()=>t.startMargin,m=>{l.A(6,m)},{immediate:!0}),e.watch([u],()=>{d.ce()},{flush:"post"}),o({get cache(){return l.m()},get scrollOffset(){return l.N()},get scrollSize(){return(m=>Te(m.M(),m.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 m=t.as,y=t.item,S=_.value,w=d.ne(),h=!s&&w?"unshift":"push",p=[],A=O=>{var R;const M=r.default({item:t.data[O],index:O})[0];return e.createVNode(Ud,{key:jd(M,O),L:u,W:l,Y:c.re,D:O,X:M,U:s,K:w,G:a,Z:y,ee:(R=t.itemProps)===null||R===void 0?void 0:R.call(t,{item:t.data[O],index:O})},null,8,["L","W","Y","D","X","U","K","G","Z","ee"])};if(t.keepMounted){const O=new Set(t.keepMounted);for(let[R,M]=f.value;R<=M;R++)O.add(R);Po([...O]).forEach(R=>{p[h](A(R))})}else for(let[O,R]=f.value;O<=R;O++)p[h](A(O));return e.createVNode(m,{ref:i,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:s?S+"px":"100%",height:s?"100%":S+"px",pointerEvents:g.value?"none":void 0}},typeof(D=p)=="function"||Object.prototype.toString.call(D)==="[object Object]"&&!e.isVNode(D)?p:{default:()=>[p],_:2},8,["style"]);var D}}}),qd=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:o,slots:r}){const a=t.horizontal,s=c=>{n("scroll",c)},i=()=>{n("scrollEnd")},l=e.ref();return o({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(Oo,{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:s,onScrollEnd:i},(c=r,typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!e.isVNode(c)?r:{default:()=>[r],_:2}),8,["data","bufferSize","itemSize","itemProps","shift","ssrCount","horizontal","keepMounted","cache","onScroll","onScrollEnd"])],4);var c}}}),Wd=(t,n=10)=>new Promise(o=>{let r=0,a=0,s=0;const i=()=>{const l=t.scrollSize;l===s&&l>0?r++:(r=0)&&(s=l),a++,r>=2||a>=n?o():requestAnimationFrame(i)};requestAnimationFrame(i)});function Gd(t,n){const o=(n==null?void 0:n.align)??"start";let r=!1;const a=e.ref(null),s=e.ref(!1),i=e.ref("measure"),l=e.computed(()=>e.toValue(t).length),c=e.computed(()=>i.value==="measure"?1:5),d=e.computed(()=>Array.from({length:l.value*c.value},(S,w)=>w)),u=async()=>{if(a.value&&(i.value="measure",r=!1,s.value=!1,await e.nextTick(),i.value==="measure")){if(await Wd(a.value),s.value=a.value.scrollSize>a.value.viewportSize,!s.value){r=!1;return}r=!0,i.value="loop",await e.nextTick(),a.value.scrollToIndex(l.value*3,{align:o})}},f=S=>i.value==="measure"?S:l.value===0?0:S%l.value,g=(S,w)=>{a.value&&a.value.scrollToIndex(S,w)},_=(S,w)=>!r||i.value!=="loop"?w:w+Math.round((S-w)/l.value)*l.value,m=S=>{if(!r||i.value!=="loop"||!a.value)return;const w=l.value-1,h=l.value*4;if(S<w)return g(l.value*3-1,{align:"start"});if(S>=h)return g(l.value*3,{align:"start"})},y=()=>{if(!a.value||!r)return;const S=a.value.findItemIndex(a.value.scrollOffset);m(S)};return e.onMounted(u),e.onUnmounted(()=>a.value=null),e.watch(l,()=>e.nextTick(u)),{listRef:a,items:d,hasScroll:s,realIndex:f,findNearestIndex:_,scrollToIndex:g,init:u,onScroll:y}}const Kd={pinch:!0,doubleTap:!0,wheel:!0,buttons:["+","-","=","0"]},Jd=t=>{var o;const n=Object.assign({},Kd,t);if(n.pinch&&(document.addEventListener("touchstart",r=>r.touches.length>1&&r.preventDefault(),{passive:!1}),document.addEventListener("gesturestart",r=>r.preventDefault(),{passive:!1})),n.doubleTap){let r=0;document.addEventListener("touchend",a=>{const s=Date.now();s-r<=250&&a.preventDefault(),r=s},{passive:!1})}n.wheel&&document.addEventListener("wheel",r=>(r.ctrlKey||r.metaKey)&&r.preventDefault(),{passive:!1}),(o=n.buttons)!=null&&o.length&&document.addEventListener("keydown",r=>(r.ctrlKey||r.metaKey)&&n.buttons.includes(r.key)&&r.preventDefault())};Object.defineProperty(z,"useRoute",{enumerable:!0,get:()=>K.useRoute}),Object.defineProperty(z,"useRouter",{enumerable:!0,get:()=>K.useRouter}),z.BasketButton=$d,z.BottomSheet=ko,z.ButtonDefault=De,z.CardMain=xo,z.CardProductPage=Fi,z.CardReader=Eo,z.CartBox=So,z.CartPage=Nc,z.DrumItem=od,z.GroupMain=Zc,z.InitConnection=Ie,z.ModalWindows=hd,z.NotificationWindow=on,z.PopupWindowDefault=Co,z.Recommendation=ud,z.RetryPage=Rc,z.TagsMain=Qc,z.VList=qd,z.Virtualizer=Oo,z.clearAllProductDB=ir,z.clearLocalStorage=Je,z.getCachedGroup=Ft,z.getCachedProduct=bn,z.getWebSocketInstance=_t,z.initPinia=jo,z.initRouter=qo,z.preventZoom=Jd,z.updateIndexedDB=wd,z.useCachedMedia=He,z.useCardLibStore=fe,z.useCartLibStore=Le,z.useImageCacheStore=nt,z.useMainLibStore=ie,z.useModal=No,z.useModalStore=an,z.useModulesLibStore=sn,z.useThemeStore=_e,z.useVirtuaLoop=Gd,z.vClickOutside=_d,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(z,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):(z=typeof globalThis<"u"?globalThis:z||self,K(z.InnoCloudsLib={},z.VueRouter,z.Pinia,z.Vue,z.VueuseCore,z.motionV))})(this,function(z,K,U,e,Ee,pe){"use strict";var Xd=Object.defineProperty;var Fo=z=>{throw TypeError(z)};var Zd=(z,K,U)=>K in z?Xd(z,K,{enumerable:!0,configurable:!0,writable:!0,value:U}):z[K]=U;var ee=(z,K,U)=>Zd(z,typeof K!="symbol"?K+"":K,U),Lo=(z,K,U)=>K.has(z)||Fo("Cannot "+U);var Ne=(z,K,U)=>(Lo(z,K,"read from private field"),U?U.call(z):K.get(z)),$t=(z,K,U)=>K.has(z)?Fo("Cannot add the same private member more than once"):K instanceof WeakSet?K.add(z):K.set(z,U),Me=(z,K,U,e)=>(Lo(z,K,"write to private field"),e?e.call(z,U):K.set(z,U),U);var dn=(z,K,U,e)=>({set _(Ee){Me(z,K,Ee,U)},get _(){return Ne(z,K,e)}});var we,De,qe;function Uo(t){return t}const jo=[];function Ho(){return K.createRouter({history:K.createWebHistory(),routes:jo})}const Tt=(t,n)=>n.some(o=>t instanceof o);let un,fn;function qo(){return un||(un=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Wo(){return fn||(fn=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Mt=new WeakMap,Pt=new WeakMap,ut=new WeakMap;function Go(t){const n=new Promise((o,r)=>{const a=()=>{t.removeEventListener("success",s),t.removeEventListener("error",i)},s=()=>{o(Ie(t.result)),a()},i=()=>{r(t.error),a()};t.addEventListener("success",s),t.addEventListener("error",i)});return ut.set(n,t),n}function Ko(t){if(Mt.has(t))return;const n=new Promise((o,r)=>{const a=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",i),t.removeEventListener("abort",i)},s=()=>{o(),a()},i=()=>{r(t.error||new DOMException("AbortError","AbortError")),a()};t.addEventListener("complete",s),t.addEventListener("error",i),t.addEventListener("abort",i)});Mt.set(t,n)}let Vt={get(t,n,o){if(t instanceof IDBTransaction){if(n==="done")return Mt.get(t);if(n==="store")return o.objectStoreNames[1]?void 0:o.objectStore(o.objectStoreNames[0])}return Ie(t[n])},set(t,n,o){return t[n]=o,!0},has(t,n){return t instanceof IDBTransaction&&(n==="done"||n==="store")?!0:n in t}};function mn(t){Vt=t(Vt)}function Jo(t){return Wo().includes(t)?function(...n){return t.apply(It(this),n),Ie(this.request)}:function(...n){return Ie(t.apply(It(this),n))}}function Xo(t){return typeof t=="function"?Jo(t):(t instanceof IDBTransaction&&Ko(t),Tt(t,qo())?new Proxy(t,Vt):t)}function Ie(t){if(t instanceof IDBRequest)return Go(t);if(Pt.has(t))return Pt.get(t);const n=Xo(t);return n!==t&&(Pt.set(t,n),ut.set(n,t)),n}const It=t=>ut.get(t);function Zo(t,n,{blocked:o,upgrade:r,blocking:a,terminated:s}={}){const i=indexedDB.open(t,n),l=Ie(i);return r&&i.addEventListener("upgradeneeded",c=>{r(Ie(i.result),c.oldVersion,c.newVersion,Ie(i.transaction),c)}),o&&i.addEventListener("blocked",c=>o(c.oldVersion,c.newVersion,c)),l.then(c=>{s&&c.addEventListener("close",()=>s()),a&&c.addEventListener("versionchange",d=>a(d.oldVersion,d.newVersion,d))}).catch(()=>{}),l}function Yo(t,{blocked:n}={}){const o=indexedDB.deleteDatabase(t);return n&&o.addEventListener("blocked",r=>n(r.oldVersion,r)),Ie(o).then(()=>{})}const Qo=["get","getKey","getAll","getAllKeys","count"],er=["put","add","delete","clear"],Rt=new Map;function pn(t,n){if(!(t instanceof IDBDatabase&&!(n in t)&&typeof n=="string"))return;if(Rt.get(n))return Rt.get(n);const o=n.replace(/FromIndex$/,""),r=n!==o,a=er.includes(o);if(!(o in(r?IDBIndex:IDBObjectStore).prototype)||!(a||Qo.includes(o)))return;const s=async function(i,...l){const c=this.transaction(i,a?"readwrite":"readonly");let d=c.store;return r&&(d=d.index(l.shift())),(await Promise.all([d[o](...l),a&&c.done]))[0]};return Rt.set(n,s),s}mn(t=>({...t,get:(n,o,r)=>pn(n,o)||t.get(n,o,r),has:(n,o)=>!!pn(n,o)||t.has(n,o)}));const tr=["continue","continuePrimaryKey","advance"],hn={},Dt=new WeakMap,_n=new WeakMap,nr={get(t,n){if(!tr.includes(n))return t[n];let o=hn[n];return o||(o=hn[n]=function(...r){Dt.set(this,_n.get(this)[n](...r))}),o}};async function*or(...t){let n=this;if(n instanceof IDBCursor||(n=await n.openCursor(...t)),!n)return;n=n;const o=new Proxy(n,nr);for(_n.set(o,n),ut.set(o,It(n));n;)yield o,n=await(Dt.get(o)||n.continue()),Dt.delete(o)}function gn(t,n){return n===Symbol.asyncIterator&&Tt(t,[IDBIndex,IDBObjectStore,IDBCursor])||n==="iterate"&&Tt(t,[IDBIndex,IDBObjectStore])}mn(t=>({...t,get(n,o,r){return gn(n,o)?or:t.get(n,o,r)},has(n,o){return gn(n,o)||t.has(n,o)}}));let We;async function Oe(){return We||(We=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"})}})),We}async function Ot(t){return(await Oe()).transaction("groups","readonly").objectStore("groups").get(t)}async function Qe(t,n){const r=(await Oe()).transaction("groups","readwrite");await r.objectStore("groups").put({id:t,data:n,timestamp:Date.now()}),await r.done}async function rr(t,n){const o=JSON.parse(JSON.stringify(e.toRaw(n.value)));await Qe(t,o)}async function Ft(t,n){const r=(await Oe()).transaction("media","readwrite");await r.objectStore("media").put({id:t,blob:n,timestamp:Date.now()}),await r.done}async function Ge(t){const a=await(await Oe()).transaction("media","readonly").objectStore("media").get(t);return a==null?void 0:a.blob}async function ar(t){const o=(await Oe()).transaction("products","readwrite"),r=o.objectStore("products"),a=t.id;await r.put({id:a,product:t,timestamp:Date.now()}),await o.done}async function yn(t){const a=await(await Oe()).transaction("products","readonly").objectStore("products").get(t);return a==null?void 0:a.product}async function sr(){if(We){const t=await We.catch(()=>null);t&&t.close(),We=void 0}try{await Yo("data",{blocked(){console.warn("Удаление заблокировано. открыты другие вкладки с сайтом.")}})}catch(t){console.error("Не удалось удалить базу: [lib, indexedDB]",t)}}function ft(t){"@babel/helpers - typeof";return ft=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},ft(t)}var ir=/^\s+/,lr=/\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 o=cr(t);this._originalInput=t,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||o.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=o.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(),o,r,a,s,i,l;return o=n.r/255,r=n.g/255,a=n.b/255,o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),a<=.03928?l=a/12.92:l=Math.pow((a+.055)/1.055,2.4),.2126*s+.7152*i+.0722*l},setAlpha:function(n){return this._a=En(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=wn(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=wn(this._r,this._g,this._b),o=Math.round(n.h*360),r=Math.round(n.s*100),a=Math.round(n.v*100);return this._a==1?"hsv("+o+", "+r+"%, "+a+"%)":"hsva("+o+", "+r+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var n=bn(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=bn(this._r,this._g,this._b),o=Math.round(n.h*360),r=Math.round(n.s*100),a=Math.round(n.l*100);return this._a==1?"hsl("+o+", "+r+"%, "+a+"%)":"hsla("+o+", "+r+"%, "+a+"%, "+this._roundA+")"},toHex:function(n){return kn(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return mr(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(le(this._r,255)*100)+"%",g:Math.round(le(this._g,255)*100)+"%",b:Math.round(le(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(le(this._r,255)*100)+"%, "+Math.round(le(this._g,255)*100)+"%, "+Math.round(le(this._b,255)*100)+"%)":"rgba("+Math.round(le(this._r,255)*100)+"%, "+Math.round(le(this._g,255)*100)+"%, "+Math.round(le(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Nr[kn(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var o="#"+Cn(this._r,this._g,this._b,this._a),r=o,a=this._gradientType?"GradientType = 1, ":"";if(n){var s=q(n);r="#"+Cn(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+o+",endColorstr="+r+")"},toString:function(n){var o=!!n;n=n||this._format;var r=!1,a=this._a<1&&this._a>=0,s=!o&&a&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return s?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(r=this.toRgbString()),n==="prgb"&&(r=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(r=this.toHexString()),n==="hex3"&&(r=this.toHexString(!0)),n==="hex4"&&(r=this.toHex8String(!0)),n==="hex8"&&(r=this.toHex8String()),n==="name"&&(r=this.toName()),n==="hsl"&&(r=this.toHslString()),n==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(n,o){var r=n.apply(null,[this].concat([].slice.call(o)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(gr,arguments)},brighten:function(){return this._applyModification(yr,arguments)},darken:function(){return this._applyModification(br,arguments)},desaturate:function(){return this._applyModification(pr,arguments)},saturate:function(){return this._applyModification(hr,arguments)},greyscale:function(){return this._applyModification(_r,arguments)},spin:function(){return this._applyModification(wr,arguments)},_applyCombination:function(n,o){return n.apply(null,[this].concat([].slice.call(o)))},analogous:function(){return this._applyCombination(Sr,arguments)},complement:function(){return this._applyCombination(kr,arguments)},monochromatic:function(){return this._applyCombination(Er,arguments)},splitcomplement:function(){return this._applyCombination(Cr,arguments)},triad:function(){return this._applyCombination(Sn,[3])},tetrad:function(){return this._applyCombination(Sn,[4])}},q.fromRatio=function(t,n){if(ft(t)=="object"){var o={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?o[r]=t[r]:o[r]=et(t[r]));t=o}return q(t,n)};function cr(t){var n={r:0,g:0,b:0},o=1,r=null,a=null,s=null,i=!1,l=!1;return typeof t=="string"&&(t=vr(t)),ft(t)=="object"&&(Pe(t.r)&&Pe(t.g)&&Pe(t.b)?(n=dr(t.r,t.g,t.b),i=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Pe(t.h)&&Pe(t.s)&&Pe(t.v)?(r=et(t.s),a=et(t.v),n=fr(t.h,r,a),i=!0,l="hsv"):Pe(t.h)&&Pe(t.s)&&Pe(t.l)&&(r=et(t.s),s=et(t.l),n=ur(t.h,r,s),i=!0,l="hsl"),t.hasOwnProperty("a")&&(o=t.a)),o=En(o),{ok:i,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:o}}function dr(t,n,o){return{r:le(t,255)*255,g:le(n,255)*255,b:le(o,255)*255}}function bn(t,n,o){t=le(t,255),n=le(n,255),o=le(o,255);var r=Math.max(t,n,o),a=Math.min(t,n,o),s,i,l=(r+a)/2;if(r==a)s=i=0;else{var c=r-a;switch(i=l>.5?c/(2-r-a):c/(r+a),r){case t:s=(n-o)/c+(n<o?6:0);break;case n:s=(o-t)/c+2;break;case o:s=(t-n)/c+4;break}s/=6}return{h:s,s:i,l}}function ur(t,n,o){var r,a,s;t=le(t,360),n=le(n,100),o=le(o,100);function i(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)r=a=s=o;else{var l=o<.5?o*(1+n):o+n-o*n,c=2*o-l;r=i(c,l,t+1/3),a=i(c,l,t),s=i(c,l,t-1/3)}return{r:r*255,g:a*255,b:s*255}}function wn(t,n,o){t=le(t,255),n=le(n,255),o=le(o,255);var r=Math.max(t,n,o),a=Math.min(t,n,o),s,i,l=r,c=r-a;if(i=r===0?0:c/r,r==a)s=0;else{switch(r){case t:s=(n-o)/c+(n<o?6:0);break;case n:s=(o-t)/c+2;break;case o:s=(t-n)/c+4;break}s/=6}return{h:s,s:i,v:l}}function fr(t,n,o){t=le(t,360)*6,n=le(n,100),o=le(o,100);var r=Math.floor(t),a=t-r,s=o*(1-n),i=o*(1-a*n),l=o*(1-(1-a)*n),c=r%6,d=[o,i,s,s,l,o][c],u=[l,o,o,i,s,s][c],f=[s,s,l,o,o,i][c];return{r:d*255,g:u*255,b:f*255}}function kn(t,n,o,r){var a=[xe(Math.round(t).toString(16)),xe(Math.round(n).toString(16)),xe(Math.round(o).toString(16))];return r&&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 mr(t,n,o,r,a){var s=[xe(Math.round(t).toString(16)),xe(Math.round(n).toString(16)),xe(Math.round(o).toString(16)),xe(Nn(r))];return a&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function Cn(t,n,o,r){var a=[xe(Nn(r)),xe(Math.round(t).toString(16)),xe(Math.round(n).toString(16)),xe(Math.round(o).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 pr(t,n){n=n===0?0:n||10;var o=q(t).toHsl();return o.s-=n/100,o.s=mt(o.s),q(o)}function hr(t,n){n=n===0?0:n||10;var o=q(t).toHsl();return o.s+=n/100,o.s=mt(o.s),q(o)}function _r(t){return q(t).desaturate(100)}function gr(t,n){n=n===0?0:n||10;var o=q(t).toHsl();return o.l+=n/100,o.l=mt(o.l),q(o)}function yr(t,n){n=n===0?0:n||10;var o=q(t).toRgb();return o.r=Math.max(0,Math.min(255,o.r-Math.round(255*-(n/100)))),o.g=Math.max(0,Math.min(255,o.g-Math.round(255*-(n/100)))),o.b=Math.max(0,Math.min(255,o.b-Math.round(255*-(n/100)))),q(o)}function br(t,n){n=n===0?0:n||10;var o=q(t).toHsl();return o.l-=n/100,o.l=mt(o.l),q(o)}function wr(t,n){var o=q(t).toHsl(),r=(o.h+n)%360;return o.h=r<0?360+r:r,q(o)}function kr(t){var n=q(t).toHsl();return n.h=(n.h+180)%360,q(n)}function Sn(t,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var o=q(t).toHsl(),r=[q(t)],a=360/n,s=1;s<n;s++)r.push(q({h:(o.h+s*a)%360,s:o.s,l:o.l}));return r}function Cr(t){var n=q(t).toHsl(),o=n.h;return[q(t),q({h:(o+72)%360,s:n.s,l:n.l}),q({h:(o+216)%360,s:n.s,l:n.l})]}function Sr(t,n,o){n=n||6,o=o||30;var r=q(t).toHsl(),a=360/o,s=[q(t)];for(r.h=(r.h-(a*n>>1)+720)%360;--n;)r.h=(r.h+a)%360,s.push(q(r));return s}function Er(t,n){n=n||6;for(var o=q(t).toHsv(),r=o.h,a=o.s,s=o.v,i=[],l=1/n;n--;)i.push(q({h:r,s:a,v:s})),s=(s+l)%1;return i}q.mix=function(t,n,o){o=o===0?0:o||50;var r=q(t).toRgb(),a=q(n).toRgb(),s=o/100,i={r:(a.r-r.r)*s+r.r,g:(a.g-r.g)*s+r.g,b:(a.b-r.b)*s+r.b,a:(a.a-r.a)*s+r.a};return q(i)},q.readability=function(t,n){var o=q(t),r=q(n);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},q.isReadable=function(t,n,o){var r=q.readability(t,n),a,s;switch(s=!1,a=$r(o),a.level+a.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s},q.mostReadable=function(t,n,o){var r=null,a=0,s,i,l,c;o=o||{},i=o.includeFallbackColors,l=o.level,c=o.size;for(var d=0;d<n.length;d++)s=q.readability(t,n[d]),s>a&&(a=s,r=q(n[d]));return q.isReadable(t,r,{level:l,size:c})||!i?r:(o.includeFallbackColors=!1,q.mostReadable(t,["#fff","#000"],o))};var Lt=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"},Nr=q.hexNames=xr(Lt);function xr(t){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[t[o]]=o);return n}function En(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function le(t,n){Br(t)&&(t="100%");var o=Ar(t);return t=Math.min(n,Math.max(0,parseFloat(t))),o&&(t=parseInt(t*n,10)/100),Math.abs(t-n)<1e-6?1:t%n/parseFloat(n)}function mt(t){return Math.min(1,Math.max(0,t))}function Ce(t){return parseInt(t,16)}function Br(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function Ar(t){return typeof t=="string"&&t.indexOf("%")!=-1}function xe(t){return t.length==1?"0"+t:""+t}function et(t){return t<=1&&(t=t*100+"%"),t}function Nn(t){return Math.round(parseFloat(t)*255).toString(16)}function xn(t){return Ce(t)/255}var Be=function(){var t="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",o="(?:"+n+")|(?:"+t+")",r="[\\s|\\(]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")\\s*\\)?",a="[\\s|\\(]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")[,|\\s]+("+o+")\\s*\\)?";return{CSS_UNIT:new RegExp(o),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+r),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 Pe(t){return!!Be.CSS_UNIT.exec(t)}function vr(t){t=t.replace(ir,"").replace(lr,"").toLowerCase();var n=!1;if(Lt[t])t=Lt[t],n=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var o;return(o=Be.rgb.exec(t))?{r:o[1],g:o[2],b:o[3]}:(o=Be.rgba.exec(t))?{r:o[1],g:o[2],b:o[3],a:o[4]}:(o=Be.hsl.exec(t))?{h:o[1],s:o[2],l:o[3]}:(o=Be.hsla.exec(t))?{h:o[1],s:o[2],l:o[3],a:o[4]}:(o=Be.hsv.exec(t))?{h:o[1],s:o[2],v:o[3]}:(o=Be.hsva.exec(t))?{h:o[1],s:o[2],v:o[3],a:o[4]}:(o=Be.hex8.exec(t))?{r:Ce(o[1]),g:Ce(o[2]),b:Ce(o[3]),a:xn(o[4]),format:n?"name":"hex8"}:(o=Be.hex6.exec(t))?{r:Ce(o[1]),g:Ce(o[2]),b:Ce(o[3]),format:n?"name":"hex"}:(o=Be.hex4.exec(t))?{r:Ce(o[1]+""+o[1]),g:Ce(o[2]+""+o[2]),b:Ce(o[3]+""+o[3]),a:xn(o[4]+""+o[4]),format:n?"name":"hex8"}:(o=Be.hex3.exec(t))?{r:Ce(o[1]+""+o[1]),g:Ce(o[2]+""+o[2]),b:Ce(o[3]+""+o[3]),format:n?"name":"hex"}:!1}function $r(t){var n,o;return t=t||{level:"AA",size:"small"},n=(t.level||"AA").toUpperCase(),o=(t.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),o!=="small"&&o!=="large"&&(o="small"),{level:n,size:o}}const tt=U.defineStore("imageCache",()=>{const t=e.ref({});let n=!1;function o(c,d){const u=String(c);t.value[u]&&URL.revokeObjectURL(t.value[u]);const f=URL.createObjectURL(d);t.value={...t.value,[u]:f}}async function r(c){if(!c){console.warn("initCacheSingle called with null/undefined id");return}const d=String(c);if(t.value[d])return;const u=await Ge(d);u&&(o(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&&o(d,u)}function s(){typeof window>"u"||n||(window.addEventListener("image-cached",a),n=!0)}function i(){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"&&s(),{cache:t,initCacheSingle:r,updateCacheFromBlob:o,cleanup:l,setupEventListener:s,removeEventListener:i}}),_e=U.defineStore("themeLib",()=>{const t=tt(),{initCacheSingle:n}=t,o=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,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:"",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},show_order_comment:null,show_nutrition_in_cart:null,apply_custom_size_picker_fonts:null,size_picker_unselected_font_size:null,size_picker_selected_font_size:null}),r=async s=>{if(!s)return;o.value={...s};const i=await Ge("banner"),l=await Ge("preloader"),c=await Ge("defaultImage");i||a(s.kiosk_banner,"banner"),l||a(s.kiosk_preloader,"preloader"),c||a(s.fallback_image,"defaultImage"),document.documentElement.style.setProperty("--primaryColor",s.primary_color),document.documentElement.style.setProperty("--accentColor",s.accent_color),document.documentElement.style.setProperty("--accentLightColor",s.accent_light_color),document.documentElement.style.setProperty("--accentDarkColor",s.accent_dark_color),document.documentElement.style.setProperty("--bgButtonColor",s.bg_button_color),document.documentElement.style.setProperty("--inactiveButtonColor",s.inactive_button_color),document.documentElement.style.setProperty("--cardsColor",s.cards_color),document.documentElement.style.setProperty("--textColor",s.text_color),document.documentElement.style.setProperty("--nonworkingBgColor",s.nonworking_bg_color),s.apply_custom_size_picker_fonts&&s.size_picker_unselected_font_size&&s.size_picker_unselected_font_size>0&&document.documentElement.style.setProperty("--sizePickerUnselectedFontSize",`${s.size_picker_unselected_font_size}rem`),s.apply_custom_size_picker_fonts&&s.size_picker_selected_font_size&&s.size_picker_selected_font_size>0&&document.documentElement.style.setProperty("--sizePickerSelectedFontSize",`${s.size_picker_selected_font_size}rem`);const d=o.value.primary_color||"#F2F7FF",u=q(d).setAlpha(.7).toRgbString(),f=`linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`,g=`-webkit-linear-gradient(to bottom, transparent 10%, ${u} 50%, ${d} 85%)`;return o.value.gradientStyle={background:f,backgroundColor:g},o.value},a=async(s,i)=>{if(s){const l=await fetch(s);if(!l.ok)throw new Error("Network error");const c=await l.blob();Ft(i,c),n(i)}};return{itemThemes:o,updateColor:r}}),nt=t=>{if(!t)return 0;if((t.price===0||t.price===null)&&t.sizes&&t.sizes.length>0){const n=t.sizes.find(o=>o.is_default===!0);return n?n.price:t.sizes.length>1&&t.sizes[1].price||t.sizes[0].price}return t.price};class ot extends Error{}ot.prototype.name="InvalidTokenError";function Tr(t){return decodeURIComponent(atob(t).replace(/(.)/g,(n,o)=>{let r=o.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function Mr(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 Tr(n)}catch{return atob(n)}}function Bn(t,n){if(typeof t!="string")throw new ot("Invalid token specified: must be a string");n||(n={});const o=n.header===!0?0:1,r=t.split(".")[o];if(typeof r!="string")throw new ot(`Invalid token specified: missing part #${o+1}`);let a;try{a=Mr(r)}catch(s){throw new ot(`Invalid token specified: invalid base64 for part #${o+1} (${s.message})`)}try{return JSON.parse(a)}catch(s){throw new ot(`Invalid token specified: invalid json for part #${o+1} (${s.message})`)}}const Pr=(t,n)=>{if(typeof window<"u"){const o=localStorage.getItem(t);return o?JSON.parse(o):n}return n},Vr=(t,n)=>{if(typeof window<"u"){const o=localStorage.getItem(t);if(o)try{return Bn(JSON.parse(o))}catch(r){return console.error("Failed to decode JWT:",r),n}}return n},An=(t,n,o="normal")=>{const r=e.ref(o==="jwt"?Vr(t,n):Pr(t,n));return e.watchEffect(()=>{r.value===null||r.value===void 0?localStorage.removeItem(t):o!=="jwt"&&localStorage.setItem(t,JSON.stringify(r.value))}),r},Ke=t=>{t.forEach(n=>{try{localStorage.removeItem(n)}catch(o){console.error(`Ошибка при удалении ключа "${n}":`,o)}})};class Ir{constructor(n,o={}){ee(this,"url");ee(this,"options");ee(this,"ws");ee(this,"reconnectInterval");ee(this,"listeners");ee(this,"isConnected");ee(this,"heartbeat");ee(this,"pingTimeout");ee(this,"pingResponseTimeout");ee(this,"_shouldReconnect",!0);this.url=n,this.options=o,this.ws=null,this.reconnectInterval=5e3,this.pingResponseTimeout=5e3,this.listeners=new Map,this.isConnected=e.ref(!1)}connect(){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),this.ws.onopen=()=>{console.warn("WebSocket connected"),this.isConnected.value=!0,this.emit("open"),this.heartbeat=setInterval(()=>this.sendPing(),3e5)},this.ws.onmessage=o=>{try{const r=JSON.parse(o.data);this.emit("message",r),r!=null&&r.type&&r.type!=="ping"&&clearTimeout(this.pingTimeout)}catch(r){console.error("Error parsing WebSocket message:",r)}},this.ws.onerror=o=>{console.error("WebSocket error:",o),this.emit("error",o),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 o;this.isConnected.value&&((o=this.ws)==null?void 0:o.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,o){this.listeners.has(n)||this.listeners.set(n,[]),this.listeners.get(n).push(o)}off(n,o){const r=this.listeners.get(n);r&&this.listeners.set(n,r.filter(a=>a!==o))}emit(n,o=null){const r=this.listeners.get(n);r&&r.forEach(a=>a(o))}getConnectionStatus(){return this.isConnected}}let pt=new Map;function ht(t,n={}){var r;if(pt.has(t)){const a=pt.get(t);if(a.isConnected.value&&((r=a.ws)==null?void 0:r.readyState)===WebSocket.OPEN)return a;a.close(!0),pt.delete(t)}const o=new Ir(t,n);return pt.set(t,o),o}const ce=U.defineStore("mainLib",()=>{const t=e.ref(),n=e.ref(!1),o=e.ref(localStorage.getItem("kiosk_timeout")),r=e.ref(0),a=e.ref(!1),s=e.ref(sessionStorage.getItem("is_adult")==="true"),i=e.ref([]),l=e.ref([]),c=e.ref(),d=e.ref(""),u=e.ref(0),f=e.ref(!1),g=e.ref(!1),_=e.ref(!0),m=e.ref(localStorage.getItem("apiKey")===null),y=e.ref(!1),S=e.ref({textNotification:""}),w=e.ref([]);let h=null;const p=b=>{const x=`wss://${c.value.area}/ws/device/${b}/`;h=ht(x);function V(){console.log("WebSocket connection opened")}function L(H){if(H.error)y.value=!0,S.value.textNotification=H.error,h==null||h.close(!0);else{if(!(H!=null&&H.params))return;typeof H.params.components.shift.is_ok!==null?_.value=H.params.components.shift.is_ok:_.value=!0}}function W(H){console.error("WebSocket error:",H),h.close(!0)}h.on("open",V),h.on("message",L),h.on("error",W),h.connect()},v=b=>{r.value=b,localStorage.setItem("kiosk_timeout",b)},D=b=>{n.value=b},O=e.ref(null),R=e.computed(()=>i.value.reduce((b,x)=>{let V=0,L=0;return x.group_modifiers&&(V=x.group_modifiers.reduce((W,H)=>H.modifiers?W+H.modifiers.reduce((X,te)=>X+te.old_price*te.amount,0):0,0)*x.amount),x.modifiers&&(L=x.modifiers.reduce((W,H)=>W+H.old_price*H.amount,0)*x.amount),b+x.old_price*x.amount+V+L},0)),M=e.computed({get:()=>i.value.length===0?0:O.value&&O.value!==0?O.value:i.value.reduce((b,x)=>{const V=nt(x)*x.amount;let L=0,W=0;return x.group_modifiers&&(L=x.group_modifiers.reduce((H,X)=>X.modifiers?H+X.modifiers.reduce((te,ue)=>te+ue.price*ue.amount,0):0,0)*x.amount),x.modifiers&&(W=x.modifiers.reduce((H,X)=>H+X.price*X.amount,0)*x.amount),b+V+L+W},0),set(b){O.value=b}}),k=b=>{u.value=b,localStorage.removeItem("bonus"),An("bonus",u.value)},N=b=>{Ke(b)},B=b=>{b={...b,idSystem:crypto.randomUUID()};const x=P(b);i.value.push(x),I()},I=()=>{try{if(!i.value||i.value.length===0){localStorage.removeItem("cart");return}localStorage.setItem("cart",JSON.stringify(e.toRaw(i.value)))}catch(b){console.error("Failed to update cart in localStorage:",b)}},P=b=>e.reactive({...b,amount:b.amount??1,price:b.old_price,new_price:null,total_new_price:null,discounts:[],modifiers:(b.modifiers||[]).map(x=>e.reactive({...x,price:x.old_price,new_price:null,total_new_price:null})),group_modifiers:(b.group_modifiers||[]).map(x=>e.reactive({...x,modifiers:(x.modifiers||[]).map(V=>e.reactive({...V,price:V.old_price,new_price:null,total_new_price:null}))}))}),T=b=>{const x=i.value.find(V=>V.idSystem===b);x&&(x.amount+=1),I()},C=b=>{const x=i.value.find(V=>V.idSystem===b);x&&(x.amount>=1&&(x.amount-=1),I())},A=()=>{try{const b=localStorage.getItem("cart");if(b){const x=JSON.parse(b);i.value.splice(0,i.value.length,...x.map(P)),O.value=null}}catch(b){console.error("Failed to load cart from localStorage:",b)}};return A(),{cartProducts_lib:i,activeScrolling_lib:l,config_lib:c,totalPrice_lib:M,initialCartPrice_lib:R,is_notification_lib:y,notificationData_lib:S,xApiKey_lib:d,countBonus:u,toggleDrum:n,is_showApiKey:m,openApiKey:f,kiosk_timeout:o,kiosk_FirstTimeout:r,is_OpenLoyal:g,profile:t,is_18_above_content:a,is18Allowed:s,healthState:_,displayCards:w,removeFromLocalStorage:N,setKioskTimeout:v,setBonus:k,setStateDrum:D,addToCart:B,plusAmount:T,minusAmount:C,loadCart:A,deleteItemFromCart:b=>{if(b){const x=i.value.findIndex(V=>V.idSystem===b);if(x===-1)return;i.value.splice(x,1),I(),O.value=null}else i.value=[],I()},updateCartInLocalStorage:I,makeProductFullyReactive:P,checkHeartbeatApp:p}}),Fe=U.defineStore("cartLib",()=>{const t=K.useRouter(),n=K.useRoute(),o=_e(),r=ce(),{config_lib:a,countBonus:s,totalPrice_lib:i,initialCartPrice_lib:l,is18Allowed:c}=U.storeToRefs(r),{itemThemes:d}=U.storeToRefs(o),u=e.ref(!1),f=e.ref(""),g=e.ref(null),_=e.ref("wait"),m=e.ref(0),y=e.ref(null),S=e.ref(["failed_payment","failed_after_paid","failed","failed_after_sent","failed_after_sent_fiscalization","payment_initiation_retry"]),w=e.ref("Оплатить"),h=e.ref(null),p=e.ref(!1),v=e.ref(null),D=e.ref(0),O=e.ref(!1),R=e.ref({textNotification:""});let M=null;const k=V=>{O.value=!0,R.value.textNotification=V},N=async(V,L,W=!1)=>{if(!V)return console.warn("makeInitPaymentLinkRequest","orderId is empry");try{const X=await Ve.create().initPaymentLink(V,L);x(null,L),W?(M==null||M.close(!0),b(),x("profile",L)):L||window.location.replace(X.url)}catch(H){v.value=null,r.loadCart(),H.response.data.user_friendly_message?(k(H.response.data.user_friendly_message),M==null||M.close(!0),L&&S.value.includes(H.response.status)?x("retryPage",L):W?(b(),x("",L)):(s.value=0,L||t.push(`/${n.params.orgId}/errorPayment`))):W?b():L||(s.value=0,t.push(`/${n.params.orgId}/errorPayment`))}},B=(V,L,W=!1)=>{M&&(M.off("open",X),M.off("message",te),M.off("error",ue),M.close(!0));const H=`wss://${a.value.area}/ws/order/${V}/`;M=ht(H);function X(){console.log("WebSocket connection opened")}function te(oe){if(oe!=null&&oe.params)if(h.value=oe,oe.error)k(oe.error),v.value=null,M==null||M.close(!0);else if(oe.params.status==="sent"){if(a.value.has_rms_discount)return oe.params.new_discounts&&(m.value=Number(oe.params.new_total_cost)-l.value,i.value=Number(oe.params.new_total_cost),k("К заказу были добавлены скидки")),p.value=!1;N(V,L,W)}else oe.params.status==="payment_initiation_retry"||oe.params.status==="fiscalized"?(v.value=2,Ve.create().orderPay(V).then(F=>{y.value=F.data.order_number}).catch(F=>{F.response.data.user_friendly_message&&(k(F.response.data.user_friendly_message),M.close(!0),L?S.value.includes(F.response.status)&&(x("retryPage",L),v.value=null):(s.value=0,t.push(`/${n.params.orgId}/errorPayment`),v.value=null))}).finally(()=>{p.value=!1})):oe.params.status==="paid"?(v.value=3,M.close(!0),localStorage.removeItem("cart")):S.value.includes(oe.params.status)&&(L?(x("retryPage",L),v.value=null):W?(b(),k("Ошибка создания заказа. Пожалуйста попробуйте еще раз")):(s.value=0,t.push(`/${n.params.orgId}/errorPayment`),v.value=null))}function ue(oe){console.error("WebSocket error:",oe),M.close(!0),p.value=!1,v.value=null}M.on("open",X),M.on("message",te),M.on("error",ue),M.connect()},I=e.computed(()=>!!g.value),P=V=>{_.value=V},T=V=>g.value=V,C=()=>{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?r.is_OpenLoyal=!0:u.value=!0,_.value="wait",f.value=""},A=()=>{u.value=!1,_.value="wait",f.value=""},$=()=>{g.value=null,f.value="",_.value="wait",A()},b=()=>{s.value=0,p.value=!1,v.value=null},x=(V=null,L=!1)=>{r.cartProducts_lib=[],Ke(["cart"]),L&&(Ke(["authTokensAccess","authTokensRefresh","user"]),r.profile=null,sessionStorage.removeItem("is_adult"),c.value=!1),V&&t.push(`/${n.params.orgId}/${V}`)};return{statusWSCreate:h,isButtonDisabled:p,orderCompleted_lib:v,extraDiscount:m,orderNumber:y,is_notification_lib:O,notificationData_lib:R,textPaymentBtn_lib:w,count:D,guestInfo:g,error:f,isDrawerOpen:u,currentState:_,isAuthorized:I,orderSocket:B,deleteCart:x,setGuestInfo:T,setState:P,openDrawer:C,closeDrawer:A,clearCard:$,makeInitPaymentLinkRequest:N,showNotification:k}}),me=U.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()),o=()=>n.value=t(),r=e.ref(!1),a=e.ref(!1),s=e.ref(!1),i=e.ref(),l=e.ref([]),c=e.ref({id:null,visible:!1}),d=e.ref(!0),u=e.computed(()=>{const k=n.value.groupModifiersSelected.findIndex(N=>N.group===n.value.groupCurrentOpen.id);return f(k)}),f=k=>k===-1?0:(n.value.groupModifiersSelected[k].modifiers||[]).reduce((B,I)=>B+(I.amount||0),0),g=e.computed(()=>{var N;const k=(N=n.value.openCard)==null?void 0:N.group_modifiers.findIndex(B=>B.id===n.value.groupCurrentOpen.id);return k===-1||!n.value.openCard?0:n.value.openCard.modifiers.length>0&&k===0?n.value.openCard.modifiers.reduce((B,I)=>B+I.max_amount,0):n.value.groupModifiers[k].max_amount}),_=e.computed(()=>{var N;const k=(n.value.addedProducts??[]).reduce((B,I)=>B+I.price,0);if(n.value.openCard){const B=n.value.openCard,I=nt(B)||0,P=B.amount||1;return(n.value.groupModifiersSelected.reduce((C,A)=>(A.modifiers.forEach($=>{var b,x;$.sizes&&($.price=((x=(b=$.sizes)==null?void 0:b.find(V=>V.id===n.value.selectedSize.id))==null?void 0:x.price)??$.price),C+=$.price*$.amount}),C),0)+I)*P+k}return(N=n.value.addedProducts)!=null&&N.length?k:0}),m=e.computed(()=>{const k=n.value.groupModifiers,N=n.value.groupModifiersSelected;for(let B=0;B<k.length;B++){const I=k[B],P=N[B];if(I.min_amount>0&&f(B)<I.min_amount)return n.value.textErrorRequaired=`В группе "${I.name}" должно содержаться не меньше ${I.min_amount} модификатора(ов)`,{haveRequaire:!0,group:I};for(const T of I.group_modifiers)if(T.min_amount>0){const C=P.modifiers.find(A=>A.id===T.id);if(!C||C.amount<T.min_amount)return n.value.textErrorRequaired=`В группе "${I.name}" выберите все обязательные модификаторы`,{haveRequaire:!0,group:I}}}return{haveRequaire:!1,group:k[0]}}),y=()=>{n.value.groupModifiers.forEach((k,N)=>{n.value.groupCurrentOpen={...k,index:N},k.group_modifiers.forEach(B=>{B.default_amount>0&&(B.amount=B.default_amount,R(B,!0))})})},S=k=>{n.value.addedProducts.push(k)},w=k=>{n.value.openCard=k},h=k=>{l.value=[...k]},p=(k,N)=>{var I,P;const B=k.id!==((I=n.value.groupCurrentOpen)==null?void 0:I.id);n.value.groupCurrentOpen={...k,index:N},B?n.value.isSectionModifier=!0:n.value.isSectionModifier=!n.value.isSectionModifier,document.body.style.overflow=n.value.isSectionModifier?"hidden":"",(P=n.value.plusButtonsRefs[N])==null||P.scrollIntoView({behavior:"smooth",block:"start"})},v=()=>{n.value.modalCount>n.value.currentModifier.min_amount&&n.value.modalCount>=2&&(n.value.modalCount-=1)},D=()=>{n.value.groupCurrentOpen&&n.value.modalCount+u.value<g.value&&(n.value.currentModifier.max_amount===0||n.value.currentModifier.max_amount>n.value.modalCount)&&(n.value.modalCount+=1)},O=(k,N)=>{var I;const B=(I=n.value.groupCurrentOpen)==null?void 0:I.id.toUpperCase();if(!k&&!n.value.isModifiedAmount&&N.max_amount!==1){if(B==="Добавки2000"&&N.max_amount>1)return!0;if(Math.abs(g.value-u.value)>1&&B!=="Добавки2000")return!0}return!1},R=(k,N=!1)=>{n.value.modalCount=1,n.value.currentModifier=k;const B=n.value.groupModifiersSelected.findIndex(I=>I.group===n.value.groupCurrentOpen.id);M(B,k,N)},M=(k,N,B)=>{let I=n.value.groupModifiersSelected;if(N.sizes.length>0&&N.sizes.find(P=>{var T;return P.id===((T=n.value.selectedSize)==null?void 0:T.id)}),k===-1)O(B,N)?n.value.isModifiedAmount=!0:I[n.value.groupCurrentOpen.index]={group:n.value.groupCurrentOpen.id,modifier_count:0,modifiers:[{...N,amount:(N==null?void 0:N.amount)??1}]};else{const P=n.value.groupModifiers[k].group_modifiers.findIndex(C=>C.id===N.id);if(I[k].modifiers.findIndex(C=>C.id===N.id)===-1){if(g.value===1)I[k].modifiers=[];else if(u.value>=g.value)return;O(B,N)?n.value.isModifiedAmount=!0:(I[k].modifiers.push({...N,amount:(N==null?void 0:N.amount)??1}),I[k].modifier_count=I[k].modifiers.reduce((C,A)=>C+=A.amount,0),n.value.isAnimationFly=!0)}else I[k].modifiers=I[k].modifiers.filter(C=>C.id!==N.id),I[k].modifier_count=I[k].modifiers.reduce((C,A)=>C+=A.amount,0),n.value.groupModifiers[k].group_modifiers[P].amount=1,n.value.groupModifiers[k].group_modifiers[P].default_amount=0,n.value.isAnimationFly=!1}n.value.groupModifiersSelected=I};return{stateCard:n,totalPrice_libCard:_,recountGroupTotalAmount:u,groupTotalAmount:g,isOpenWindow:r,isUpSale:a,checkedRequiredBtn:m,dataUpSale:i,productCards:l,isAddToCard:s,openProduct:c,is_startPage:d,setProduct:h,summModifierAmount:f,setAddedProducts:S,setCurrentCard:w,minusAmount:v,plusAmount:D,toggleNotRequire:p,modifierSelect:R,defaultAmountModifiers:y,reset:o}});function vn(t,n){return function(){return t.apply(n,arguments)}}const{toString:Rr}=Object.prototype,{getPrototypeOf:zt}=Object,{iterator:_t,toStringTag:$n}=Symbol,gt=(t=>n=>{const o=Rr.call(n);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Ae=t=>(t=t.toLowerCase(),n=>gt(n)===t),yt=t=>n=>typeof n===t,{isArray:Je}=Array,Xe=yt("undefined");function rt(t){return t!==null&&!Xe(t)&&t.constructor!==null&&!Xe(t.constructor)&&ge(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Tn=Ae("ArrayBuffer");function Dr(t){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(t):n=t&&t.buffer&&Tn(t.buffer),n}const Or=yt("string"),ge=yt("function"),Mn=yt("number"),at=t=>t!==null&&typeof t=="object",Fr=t=>t===!0||t===!1,bt=t=>{if(gt(t)!=="object")return!1;const n=zt(t);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!($n in t)&&!(_t in t)},Lr=t=>{if(!at(t)||rt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},zr=Ae("Date"),Ur=Ae("File"),jr=Ae("Blob"),Hr=Ae("FileList"),qr=t=>at(t)&&ge(t.pipe),Wr=t=>{let n;return t&&(typeof FormData=="function"&&t instanceof FormData||ge(t.append)&&((n=gt(t))==="formdata"||n==="object"&&ge(t.toString)&&t.toString()==="[object FormData]"))},Gr=Ae("URLSearchParams"),[Kr,Jr,Xr,Zr]=["ReadableStream","Request","Response","Headers"].map(Ae),Yr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function st(t,n,{allOwnKeys:o=!1}={}){if(t===null||typeof t>"u")return;let r,a;if(typeof t!="object"&&(t=[t]),Je(t))for(r=0,a=t.length;r<a;r++)n.call(null,t[r],r,t);else{if(rt(t))return;const s=o?Object.getOwnPropertyNames(t):Object.keys(t),i=s.length;let l;for(r=0;r<i;r++)l=s[r],n.call(null,t[l],l,t)}}function Pn(t,n){if(rt(t))return null;n=n.toLowerCase();const o=Object.keys(t);let r=o.length,a;for(;r-- >0;)if(a=o[r],n===a.toLowerCase())return a;return null}const Le=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Vn=t=>!Xe(t)&&t!==Le;function Ut(){const{caseless:t,skipUndefined:n}=Vn(this)&&this||{},o={},r=(a,s)=>{const i=t&&Pn(o,s)||s;bt(o[i])&&bt(a)?o[i]=Ut(o[i],a):bt(a)?o[i]=Ut({},a):Je(a)?o[i]=a.slice():(!n||!Xe(a))&&(o[i]=a)};for(let a=0,s=arguments.length;a<s;a++)arguments[a]&&st(arguments[a],r);return o}const Qr=(t,n,o,{allOwnKeys:r}={})=>(st(n,(a,s)=>{o&&ge(a)?t[s]=vn(a,o):t[s]=a},{allOwnKeys:r}),t),ea=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ta=(t,n,o,r)=>{t.prototype=Object.create(n.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:n.prototype}),o&&Object.assign(t.prototype,o)},na=(t,n,o,r)=>{let a,s,i;const l={};if(n=n||{},t==null)return n;do{for(a=Object.getOwnPropertyNames(t),s=a.length;s-- >0;)i=a[s],(!r||r(i,t,n))&&!l[i]&&(n[i]=t[i],l[i]=!0);t=o!==!1&&zt(t)}while(t&&(!o||o(t,n))&&t!==Object.prototype);return n},oa=(t,n,o)=>{t=String(t),(o===void 0||o>t.length)&&(o=t.length),o-=n.length;const r=t.indexOf(n,o);return r!==-1&&r===o},ra=t=>{if(!t)return null;if(Je(t))return t;let n=t.length;if(!Mn(n))return null;const o=new Array(n);for(;n-- >0;)o[n]=t[n];return o},aa=(t=>n=>t&&n instanceof t)(typeof Uint8Array<"u"&&zt(Uint8Array)),sa=(t,n)=>{const r=(t&&t[_t]).call(t);let a;for(;(a=r.next())&&!a.done;){const s=a.value;n.call(t,s[0],s[1])}},ia=(t,n)=>{let o;const r=[];for(;(o=t.exec(n))!==null;)r.push(o);return r},la=Ae("HTMLFormElement"),ca=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,r,a){return r.toUpperCase()+a}),In=(({hasOwnProperty:t})=>(n,o)=>t.call(n,o))(Object.prototype),da=Ae("RegExp"),Rn=(t,n)=>{const o=Object.getOwnPropertyDescriptors(t),r={};st(o,(a,s)=>{let i;(i=n(a,s,t))!==!1&&(r[s]=i||a)}),Object.defineProperties(t,r)},ua=t=>{Rn(t,(n,o)=>{if(ge(t)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const r=t[o];if(ge(r)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},fa=(t,n)=>{const o={},r=a=>{a.forEach(s=>{o[s]=!0})};return Je(t)?r(t):r(String(t).split(n)),o},ma=()=>{},pa=(t,n)=>t!=null&&Number.isFinite(t=+t)?t:n;function ha(t){return!!(t&&ge(t.append)&&t[$n]==="FormData"&&t[_t])}const _a=t=>{const n=new Array(10),o=(r,a)=>{if(at(r)){if(n.indexOf(r)>=0)return;if(rt(r))return r;if(!("toJSON"in r)){n[a]=r;const s=Je(r)?[]:{};return st(r,(i,l)=>{const c=o(i,a+1);!Xe(c)&&(s[l]=c)}),n[a]=void 0,s}}return r};return o(t,0)},ga=Ae("AsyncFunction"),ya=t=>t&&(at(t)||ge(t))&&ge(t.then)&&ge(t.catch),Dn=((t,n)=>t?setImmediate:n?((o,r)=>(Le.addEventListener("message",({source:a,data:s})=>{a===Le&&s===o&&r.length&&r.shift()()},!1),a=>{r.push(a),Le.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",ge(Le.postMessage)),ba=typeof queueMicrotask<"u"?queueMicrotask.bind(Le):typeof process<"u"&&process.nextTick||Dn,E={isArray:Je,isArrayBuffer:Tn,isBuffer:rt,isFormData:Wr,isArrayBufferView:Dr,isString:Or,isNumber:Mn,isBoolean:Fr,isObject:at,isPlainObject:bt,isEmptyObject:Lr,isReadableStream:Kr,isRequest:Jr,isResponse:Xr,isHeaders:Zr,isUndefined:Xe,isDate:zr,isFile:Ur,isBlob:jr,isRegExp:da,isFunction:ge,isStream:qr,isURLSearchParams:Gr,isTypedArray:aa,isFileList:Hr,forEach:st,merge:Ut,extend:Qr,trim:Yr,stripBOM:ea,inherits:ta,toFlatObject:na,kindOf:gt,kindOfTest:Ae,endsWith:oa,toArray:ra,forEachEntry:sa,matchAll:ia,isHTMLForm:la,hasOwnProperty:In,hasOwnProp:In,reduceDescriptors:Rn,freezeMethods:ua,toObjectSet:fa,toCamelCase:ca,noop:ma,toFiniteNumber:pa,findKey:Pn,global:Le,isContextDefined:Vn,isSpecCompliantForm:ha,toJSONObject:_a,isAsyncFn:ga,isThenable:ya,setImmediate:Dn,asap:ba,isIterable:t=>t!=null&&ge(t[_t])};function J(t,n,o,r,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),o&&(this.config=o),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}E.inherits(J,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:E.toJSONObject(this.config),code:this.code,status:this.status}}});const On=J.prototype,Fn={};["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=>{Fn[t]={value:t}}),Object.defineProperties(J,Fn),Object.defineProperty(On,"isAxiosError",{value:!0}),J.from=(t,n,o,r,a,s)=>{const i=Object.create(On);E.toFlatObject(t,i,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 J.call(i,l,c,o,r,a),t&&i.cause==null&&Object.defineProperty(i,"cause",{value:t,configurable:!0}),i.name=t&&t.name||"Error",s&&Object.assign(i,s),i};const wa=null;function jt(t){return E.isPlainObject(t)||E.isArray(t)}function Ln(t){return E.endsWith(t,"[]")?t.slice(0,-2):t}function zn(t,n,o){return t?t.concat(n).map(function(a,s){return a=Ln(a),!o&&s?"["+a+"]":a}).join(o?".":""):n}function ka(t){return E.isArray(t)&&!t.some(jt)}const Ca=E.toFlatObject(E,{},null,function(n){return/^is[A-Z]/.test(n)});function wt(t,n,o){if(!E.isObject(t))throw new TypeError("target must be an object");n=n||new FormData,o=E.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,S){return!E.isUndefined(S[y])});const r=o.metaTokens,a=o.visitor||u,s=o.dots,i=o.indexes,c=(o.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(n);if(!E.isFunction(a))throw new TypeError("visitor must be a function");function d(m){if(m===null)return"";if(E.isDate(m))return m.toISOString();if(E.isBoolean(m))return m.toString();if(!c&&E.isBlob(m))throw new J("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(m)||E.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function u(m,y,S){let w=m;if(m&&!S&&typeof m=="object"){if(E.endsWith(y,"{}"))y=r?y:y.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&ka(m)||(E.isFileList(m)||E.endsWith(y,"[]"))&&(w=E.toArray(m)))return y=Ln(y),w.forEach(function(p,v){!(E.isUndefined(p)||p===null)&&n.append(i===!0?zn([y],v,s):i===null?y:y+"[]",d(p))}),!1}return jt(m)?!0:(n.append(zn(S,y,s),d(m)),!1)}const f=[],g=Object.assign(Ca,{defaultVisitor:u,convertValue:d,isVisitable:jt});function _(m,y){if(!E.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(m),E.forEach(m,function(w,h){(!(E.isUndefined(w)||w===null)&&a.call(n,w,E.isString(h)?h.trim():h,y,g))===!0&&_(w,y?y.concat(h):[h])}),f.pop()}}if(!E.isObject(t))throw new TypeError("data must be an object");return _(t),n}function Un(t){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return n[r]})}function Ht(t,n){this._pairs=[],t&&wt(t,this,n)}const jn=Ht.prototype;jn.append=function(n,o){this._pairs.push([n,o])},jn.toString=function(n){const o=n?function(r){return n.call(this,r,Un)}:Un;return this._pairs.map(function(a){return o(a[0])+"="+o(a[1])},"").join("&")};function Sa(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Hn(t,n,o){if(!n)return t;const r=o&&o.encode||Sa;E.isFunction(o)&&(o={serialize:o});const a=o&&o.serialize;let s;if(a?s=a(n,o):s=E.isURLSearchParams(n)?n.toString():new Ht(n,o).toString(r),s){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class qn{constructor(){this.handlers=[]}use(n,o,r){return this.handlers.push({fulfilled:n,rejected:o,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){E.forEach(this.handlers,function(r){r!==null&&n(r)})}}const Wn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ea={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ht,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},qt=typeof window<"u"&&typeof document<"u",Wt=typeof navigator=="object"&&navigator||void 0,Na=qt&&(!Wt||["ReactNative","NativeScript","NS"].indexOf(Wt.product)<0),xa=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ba=qt&&window.location.href||"http://localhost",he={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qt,hasStandardBrowserEnv:Na,hasStandardBrowserWebWorkerEnv:xa,navigator:Wt,origin:Ba},Symbol.toStringTag,{value:"Module"})),...Ea};function Aa(t,n){return wt(t,new he.classes.URLSearchParams,{visitor:function(o,r,a,s){return he.isNode&&E.isBuffer(o)?(this.append(r,o.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...n})}function va(t){return E.matchAll(/\w+|\[(\w*)]/g,t).map(n=>n[0]==="[]"?"":n[1]||n[0])}function $a(t){const n={},o=Object.keys(t);let r;const a=o.length;let s;for(r=0;r<a;r++)s=o[r],n[s]=t[s];return n}function Gn(t){function n(o,r,a,s){let i=o[s++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),c=s>=o.length;return i=!i&&E.isArray(a)?a.length:i,c?(E.hasOwnProp(a,i)?a[i]=[a[i],r]:a[i]=r,!l):((!a[i]||!E.isObject(a[i]))&&(a[i]=[]),n(o,r,a[i],s)&&E.isArray(a[i])&&(a[i]=$a(a[i])),!l)}if(E.isFormData(t)&&E.isFunction(t.entries)){const o={};return E.forEachEntry(t,(r,a)=>{n(va(r),a,o,0)}),o}return null}function Ta(t,n,o){if(E.isString(t))try{return(n||JSON.parse)(t),E.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(o||JSON.stringify)(t)}const it={transitional:Wn,adapter:["xhr","http","fetch"],transformRequest:[function(n,o){const r=o.getContentType()||"",a=r.indexOf("application/json")>-1,s=E.isObject(n);if(s&&E.isHTMLForm(n)&&(n=new FormData(n)),E.isFormData(n))return a?JSON.stringify(Gn(n)):n;if(E.isArrayBuffer(n)||E.isBuffer(n)||E.isStream(n)||E.isFile(n)||E.isBlob(n)||E.isReadableStream(n))return n;if(E.isArrayBufferView(n))return n.buffer;if(E.isURLSearchParams(n))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Aa(n,this.formSerializer).toString();if((l=E.isFileList(n))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return wt(l?{"files[]":n}:n,c&&new c,this.formSerializer)}}return s||a?(o.setContentType("application/json",!1),Ta(n)):n}],transformResponse:[function(n){const o=this.transitional||it.transitional,r=o&&o.forcedJSONParsing,a=this.responseType==="json";if(E.isResponse(n)||E.isReadableStream(n))return n;if(n&&E.isString(n)&&(r&&!this.responseType||a)){const i=!(o&&o.silentJSONParsing)&&a;try{return JSON.parse(n,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?J.from(l,J.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:he.classes.FormData,Blob:he.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],t=>{it.headers[t]={}});const Ma=E.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"]),Pa=t=>{const n={};let o,r,a;return t&&t.split(`
|
|
2
|
+
`).forEach(function(i){a=i.indexOf(":"),o=i.substring(0,a).trim().toLowerCase(),r=i.substring(a+1).trim(),!(!o||n[o]&&Ma[o])&&(o==="set-cookie"?n[o]?n[o].push(r):n[o]=[r]:n[o]=n[o]?n[o]+", "+r:r)}),n},Kn=Symbol("internals");function lt(t){return t&&String(t).trim().toLowerCase()}function kt(t){return t===!1||t==null?t:E.isArray(t)?t.map(kt):String(t)}function Va(t){const n=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(t);)n[r[1]]=r[2];return n}const Ia=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Gt(t,n,o,r,a){if(E.isFunction(r))return r.call(this,n,o);if(a&&(n=o),!!E.isString(n)){if(E.isString(r))return n.indexOf(r)!==-1;if(E.isRegExp(r))return r.test(n)}}function Ra(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,o,r)=>o.toUpperCase()+r)}function Da(t,n){const o=E.toCamelCase(" "+n);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+o,{value:function(a,s,i){return this[r].call(this,n,a,s,i)},configurable:!0})})}let ye=class{constructor(n){n&&this.set(n)}set(n,o,r){const a=this;function s(l,c,d){const u=lt(c);if(!u)throw new Error("header name must be a non-empty string");const f=E.findKey(a,u);(!f||a[f]===void 0||d===!0||d===void 0&&a[f]!==!1)&&(a[f||c]=kt(l))}const i=(l,c)=>E.forEach(l,(d,u)=>s(d,u,c));if(E.isPlainObject(n)||n instanceof this.constructor)i(n,o);else if(E.isString(n)&&(n=n.trim())&&!Ia(n))i(Pa(n),o);else if(E.isObject(n)&&E.isIterable(n)){let l={},c,d;for(const u of n){if(!E.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?E.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(l,o)}else n!=null&&s(o,n,r);return this}get(n,o){if(n=lt(n),n){const r=E.findKey(this,n);if(r){const a=this[r];if(!o)return a;if(o===!0)return Va(a);if(E.isFunction(o))return o.call(this,a,r);if(E.isRegExp(o))return o.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,o){if(n=lt(n),n){const r=E.findKey(this,n);return!!(r&&this[r]!==void 0&&(!o||Gt(this,this[r],r,o)))}return!1}delete(n,o){const r=this;let a=!1;function s(i){if(i=lt(i),i){const l=E.findKey(r,i);l&&(!o||Gt(r,r[l],l,o))&&(delete r[l],a=!0)}}return E.isArray(n)?n.forEach(s):s(n),a}clear(n){const o=Object.keys(this);let r=o.length,a=!1;for(;r--;){const s=o[r];(!n||Gt(this,this[s],s,n,!0))&&(delete this[s],a=!0)}return a}normalize(n){const o=this,r={};return E.forEach(this,(a,s)=>{const i=E.findKey(r,s);if(i){o[i]=kt(a),delete o[s];return}const l=n?Ra(s):String(s).trim();l!==s&&delete o[s],o[l]=kt(a),r[l]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const o=Object.create(null);return E.forEach(this,(r,a)=>{r!=null&&r!==!1&&(o[a]=n&&E.isArray(r)?r.join(", "):r)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,o])=>n+": "+o).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,...o){const r=new this(n);return o.forEach(a=>r.set(a)),r}static accessor(n){const r=(this[Kn]=this[Kn]={accessors:{}}).accessors,a=this.prototype;function s(i){const l=lt(i);r[l]||(Da(a,i),r[l]=!0)}return E.isArray(n)?n.forEach(s):s(n),this}};ye.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),E.reduceDescriptors(ye.prototype,({value:t},n)=>{let o=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(r){this[o]=r}}}),E.freezeMethods(ye);function Kt(t,n){const o=this||it,r=n||o,a=ye.from(r.headers);let s=r.data;return E.forEach(t,function(l){s=l.call(o,s,a.normalize(),n?n.status:void 0)}),a.normalize(),s}function Jn(t){return!!(t&&t.__CANCEL__)}function Ze(t,n,o){J.call(this,t??"canceled",J.ERR_CANCELED,n,o),this.name="CanceledError"}E.inherits(Ze,J,{__CANCEL__:!0});function Xn(t,n,o){const r=o.config.validateStatus;!o.status||!r||r(o.status)?t(o):n(new J("Request failed with status code "+o.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function Oa(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function Fa(t,n){t=t||10;const o=new Array(t),r=new Array(t);let a=0,s=0,i;return n=n!==void 0?n:1e3,function(c){const d=Date.now(),u=r[s];i||(i=d),o[a]=c,r[a]=d;let f=s,g=0;for(;f!==a;)g+=o[f++],f=f%t;if(a=(a+1)%t,a===s&&(s=(s+1)%t),d-i<n)return;const _=u&&d-u;return _?Math.round(g*1e3/_):void 0}}function La(t,n){let o=0,r=1e3/n,a,s;const i=(d,u=Date.now())=>{o=u,a=null,s&&(clearTimeout(s),s=null),t(...d)};return[(...d)=>{const u=Date.now(),f=u-o;f>=r?i(d,u):(a=d,s||(s=setTimeout(()=>{s=null,i(a)},r-f)))},()=>a&&i(a)]}const Ct=(t,n,o=3)=>{let r=0;const a=Fa(50,250);return La(s=>{const i=s.loaded,l=s.lengthComputable?s.total:void 0,c=i-r,d=a(c),u=i<=l;r=i;const f={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-i)/d:void 0,event:s,lengthComputable:l!=null,[n?"download":"upload"]:!0};t(f)},o)},Zn=(t,n)=>{const o=t!=null;return[r=>n[0]({lengthComputable:o,total:t,loaded:r}),n[1]]},Yn=t=>(...n)=>E.asap(()=>t(...n)),za=he.hasStandardBrowserEnv?((t,n)=>o=>(o=new URL(o,he.origin),t.protocol===o.protocol&&t.host===o.host&&(n||t.port===o.port)))(new URL(he.origin),he.navigator&&/(msie|trident)/i.test(he.navigator.userAgent)):()=>!0,Ua=he.hasStandardBrowserEnv?{write(t,n,o,r,a,s,i){if(typeof document>"u")return;const l=[`${t}=${encodeURIComponent(n)}`];E.isNumber(o)&&l.push(`expires=${new Date(o).toUTCString()}`),E.isString(r)&&l.push(`path=${r}`),E.isString(a)&&l.push(`domain=${a}`),s===!0&&l.push("secure"),E.isString(i)&&l.push(`SameSite=${i}`),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 ja(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ha(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function Qn(t,n,o){let r=!ja(n);return t&&(r||o==!1)?Ha(t,n):n}const eo=t=>t instanceof ye?{...t}:t;function ze(t,n){n=n||{};const o={};function r(d,u,f,g){return E.isPlainObject(d)&&E.isPlainObject(u)?E.merge.call({caseless:g},d,u):E.isPlainObject(u)?E.merge({},u):E.isArray(u)?u.slice():u}function a(d,u,f,g){if(E.isUndefined(u)){if(!E.isUndefined(d))return r(void 0,d,f,g)}else return r(d,u,f,g)}function s(d,u){if(!E.isUndefined(u))return r(void 0,u)}function i(d,u){if(E.isUndefined(u)){if(!E.isUndefined(d))return r(void 0,d)}else return r(void 0,u)}function l(d,u,f){if(f in n)return r(d,u);if(f in t)return r(void 0,d)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(d,u,f)=>a(eo(d),eo(u),f,!0)};return E.forEach(Object.keys({...t,...n}),function(u){const f=c[u]||a,g=f(t[u],n[u],u);E.isUndefined(g)&&f!==l||(o[u]=g)}),o}const to=t=>{const n=ze({},t);let{data:o,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:s,headers:i,auth:l}=n;if(n.headers=i=ye.from(i),n.url=Hn(Qn(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),E.isFormData(o)){if(he.hasStandardBrowserEnv||he.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(E.isFunction(o.getHeaders)){const c=o.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,f])=>{d.includes(u.toLowerCase())&&i.set(u,f)})}}if(he.hasStandardBrowserEnv&&(r&&E.isFunction(r)&&(r=r(n)),r||r!==!1&&za(n.url))){const c=a&&s&&Ua.read(s);c&&i.set(a,c)}return n},qa=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(o,r){const a=to(t);let s=a.data;const i=ye.from(a.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=a,u,f,g,_,m;function y(){_&&_(),m&&m(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let S=new XMLHttpRequest;S.open(a.method.toUpperCase(),a.url,!0),S.timeout=a.timeout;function w(){if(!S)return;const p=ye.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),D={data:!l||l==="text"||l==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:p,config:t,request:S};Xn(function(R){o(R),y()},function(R){r(R),y()},D),S=null}"onloadend"in S?S.onloadend=w:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(w)},S.onabort=function(){S&&(r(new J("Request aborted",J.ECONNABORTED,t,S)),S=null)},S.onerror=function(v){const D=v&&v.message?v.message:"Network Error",O=new J(D,J.ERR_NETWORK,t,S);O.event=v||null,r(O),S=null},S.ontimeout=function(){let v=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const D=a.transitional||Wn;a.timeoutErrorMessage&&(v=a.timeoutErrorMessage),r(new J(v,D.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,t,S)),S=null},s===void 0&&i.setContentType(null),"setRequestHeader"in S&&E.forEach(i.toJSON(),function(v,D){S.setRequestHeader(D,v)}),E.isUndefined(a.withCredentials)||(S.withCredentials=!!a.withCredentials),l&&l!=="json"&&(S.responseType=a.responseType),d&&([g,m]=Ct(d,!0),S.addEventListener("progress",g)),c&&S.upload&&([f,_]=Ct(c),S.upload.addEventListener("progress",f),S.upload.addEventListener("loadend",_)),(a.cancelToken||a.signal)&&(u=p=>{S&&(r(!p||p.type?new Ze(null,t,S):p),S.abort(),S=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const h=Oa(a.url);if(h&&he.protocols.indexOf(h)===-1){r(new J("Unsupported protocol "+h+":",J.ERR_BAD_REQUEST,t));return}S.send(s||null)})},Wa=(t,n)=>{const{length:o}=t=t?t.filter(Boolean):[];if(n||o){let r=new AbortController,a;const s=function(d){if(!a){a=!0,l();const u=d instanceof Error?d:this.reason;r.abort(u instanceof J?u:new Ze(u instanceof Error?u.message:u))}};let i=n&&setTimeout(()=>{i=null,s(new J(`timeout ${n} of ms exceeded`,J.ETIMEDOUT))},n);const l=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),t=null)};t.forEach(d=>d.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>E.asap(l),c}},Ga=function*(t,n){let o=t.byteLength;if(o<n){yield t;return}let r=0,a;for(;r<o;)a=r+n,yield t.slice(r,a),r=a},Ka=async function*(t,n){for await(const o of Ja(t))yield*Ga(o,n)},Ja=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const n=t.getReader();try{for(;;){const{done:o,value:r}=await n.read();if(o)break;yield r}}finally{await n.cancel()}},no=(t,n,o,r)=>{const a=Ka(t,n);let s=0,i,l=c=>{i||(i=!0,r&&r(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(o){let g=s+=f;o(g)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),a.return()}},{highWaterMark:2})},oo=64*1024,{isFunction:St}=E,Xa=(({Request:t,Response:n})=>({Request:t,Response:n}))(E.global),{ReadableStream:ro,TextEncoder:ao}=E.global,so=(t,...n)=>{try{return!!t(...n)}catch{return!1}},Za=t=>{t=E.merge.call({skipUndefined:!0},Xa,t);const{fetch:n,Request:o,Response:r}=t,a=n?St(n):typeof fetch=="function",s=St(o),i=St(r);if(!a)return!1;const l=a&&St(ro),c=a&&(typeof ao=="function"?(m=>y=>m.encode(y))(new ao):async m=>new Uint8Array(await new o(m).arrayBuffer())),d=s&&l&&so(()=>{let m=!1;const y=new o(he.origin,{body:new ro,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!y}),u=i&&l&&so(()=>E.isReadableStream(new r("").body)),f={stream:u&&(m=>m.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(y,S)=>{let w=y&&y[m];if(w)return w.call(y);throw new J(`Response type '${m}' is not supported`,J.ERR_NOT_SUPPORT,S)})});const g=async m=>{if(m==null)return 0;if(E.isBlob(m))return m.size;if(E.isSpecCompliantForm(m))return(await new o(he.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(E.isArrayBufferView(m)||E.isArrayBuffer(m))return m.byteLength;if(E.isURLSearchParams(m)&&(m=m+""),E.isString(m))return(await c(m)).byteLength},_=async(m,y)=>{const S=E.toFiniteNumber(m.getContentLength());return S??g(y)};return async m=>{let{url:y,method:S,data:w,signal:h,cancelToken:p,timeout:v,onDownloadProgress:D,onUploadProgress:O,responseType:R,headers:M,withCredentials:k="same-origin",fetchOptions:N}=to(m),B=n||fetch;R=R?(R+"").toLowerCase():"text";let I=Wa([h,p&&p.toAbortSignal()],v),P=null;const T=I&&I.unsubscribe&&(()=>{I.unsubscribe()});let C;try{if(O&&d&&S!=="get"&&S!=="head"&&(C=await _(M,w))!==0){let L=new o(y,{method:"POST",body:w,duplex:"half"}),W;if(E.isFormData(w)&&(W=L.headers.get("content-type"))&&M.setContentType(W),L.body){const[H,X]=Zn(C,Ct(Yn(O)));w=no(L.body,oo,H,X)}}E.isString(k)||(k=k?"include":"omit");const A=s&&"credentials"in o.prototype,$={...N,signal:I,method:S.toUpperCase(),headers:M.normalize().toJSON(),body:w,duplex:"half",credentials:A?k:void 0};P=s&&new o(y,$);let b=await(s?B(P,N):B(y,$));const x=u&&(R==="stream"||R==="response");if(u&&(D||x&&T)){const L={};["status","statusText","headers"].forEach(te=>{L[te]=b[te]});const W=E.toFiniteNumber(b.headers.get("content-length")),[H,X]=D&&Zn(W,Ct(Yn(D),!0))||[];b=new r(no(b.body,oo,H,()=>{X&&X(),T&&T()}),L)}R=R||"text";let V=await f[E.findKey(f,R)||"text"](b,m);return!x&&T&&T(),await new Promise((L,W)=>{Xn(L,W,{data:V,headers:ye.from(b.headers),status:b.status,statusText:b.statusText,config:m,request:P})})}catch(A){throw T&&T(),A&&A.name==="TypeError"&&/Load failed|fetch/i.test(A.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,m,P),{cause:A.cause||A}):J.from(A,A&&A.code,m,P)}}},Ya=new Map,io=t=>{let n=t&&t.env||{};const{fetch:o,Request:r,Response:a}=n,s=[r,a,o];let i=s.length,l=i,c,d,u=Ya;for(;l--;)c=s[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:Za(n)),u=d;return d};io();const Jt={http:wa,xhr:qa,fetch:{get:io}};E.forEach(Jt,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const lo=t=>`- ${t}`,Qa=t=>E.isFunction(t)||t===null||t===!1;function es(t,n){t=E.isArray(t)?t:[t];const{length:o}=t;let r,a;const s={};for(let i=0;i<o;i++){r=t[i];let l;if(a=r,!Qa(r)&&(a=Jt[(l=String(r)).toLowerCase()],a===void 0))throw new J(`Unknown adapter '${l}'`);if(a&&(E.isFunction(a)||(a=a.get(n))))break;s[l||"#"+i]=a}if(!a){const i=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=o?i.length>1?`since :
|
|
4
|
+
`+i.map(lo).join(`
|
|
5
|
+
`):" "+lo(i[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a}const co={getAdapter:es,adapters:Jt};function Xt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ze(null,t)}function uo(t){return Xt(t),t.headers=ye.from(t.headers),t.data=Kt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),co.getAdapter(t.adapter||it.adapter,t)(t).then(function(r){return Xt(t),r.data=Kt.call(t,t.transformResponse,r),r.headers=ye.from(r.headers),r},function(r){return Jn(r)||(Xt(t),r&&r.response&&(r.response.data=Kt.call(t,t.transformResponse,r.response),r.response.headers=ye.from(r.response.headers))),Promise.reject(r)})}const fo="1.13.2",Et={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{Et[t]=function(r){return typeof r===t||"a"+(n<1?"n ":" ")+t}});const mo={};Et.transitional=function(n,o,r){function a(s,i){return"[Axios v"+fo+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,l)=>{if(n===!1)throw new J(a(i," has been removed"+(o?" in "+o:"")),J.ERR_DEPRECATED);return o&&!mo[i]&&(mo[i]=!0,console.warn(a(i," has been deprecated since v"+o+" and will be removed in the near future"))),n?n(s,i,l):!0}},Et.spelling=function(n){return(o,r)=>(console.warn(`${r} is likely a misspelling of ${n}`),!0)};function ts(t,n,o){if(typeof t!="object")throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let a=r.length;for(;a-- >0;){const s=r[a],i=n[s];if(i){const l=t[s],c=l===void 0||i(l,s,t);if(c!==!0)throw new J("option "+s+" must be "+c,J.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new J("Unknown option "+s,J.ERR_BAD_OPTION)}}const Nt={assertOptions:ts,validators:Et},Te=Nt.validators;let Ue=class{constructor(n){this.defaults=n||{},this.interceptors={request:new qn,response:new qn}}async request(n,o){try{return await this._request(n,o)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const s=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
+
`+s):r.stack=s}catch{}}throw r}}_request(n,o){typeof n=="string"?(o=o||{},o.url=n):o=n||{},o=ze(this.defaults,o);const{transitional:r,paramsSerializer:a,headers:s}=o;r!==void 0&&Nt.assertOptions(r,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),a!=null&&(E.isFunction(a)?o.paramsSerializer={serialize:a}:Nt.assertOptions(a,{encode:Te.function,serialize:Te.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Nt.assertOptions(o,{baseUrl:Te.spelling("baseURL"),withXsrfToken:Te.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let i=s&&E.merge(s.common,s[o.method]);s&&E.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),o.headers=ye.concat(i,s);const l=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(o)===!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,g;if(!c){const m=[uo.bind(this),void 0];for(m.unshift(...l),m.push(...d),g=m.length,u=Promise.resolve(o);f<g;)u=u.then(m[f++],m[f++]);return u}g=l.length;let _=o;for(;f<g;){const m=l[f++],y=l[f++];try{_=m(_)}catch(S){y.call(this,S);break}}try{u=uo.call(this,_)}catch(m){return Promise.reject(m)}for(f=0,g=d.length;f<g;)u=u.then(d[f++],d[f++]);return u}getUri(n){n=ze(this.defaults,n);const o=Qn(n.baseURL,n.url,n.allowAbsoluteUrls);return Hn(o,n.params,n.paramsSerializer)}};E.forEach(["delete","get","head","options"],function(n){Ue.prototype[n]=function(o,r){return this.request(ze(r||{},{method:n,url:o,data:(r||{}).data}))}}),E.forEach(["post","put","patch"],function(n){function o(r){return function(s,i,l){return this.request(ze(l||{},{method:n,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Ue.prototype[n]=o(),Ue.prototype[n+"Form"]=o(!0)});let ns=class zo{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(s){o=s});const r=this;this.promise.then(a=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](a);r._listeners=null}),this.promise.then=a=>{let s;const i=new Promise(l=>{r.subscribe(l),s=l}).then(a);return i.cancel=function(){r.unsubscribe(s)},i},n(function(s,i,l){r.reason||(r.reason=new Ze(s,i,l),o(r.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 o=this._listeners.indexOf(n);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const n=new AbortController,o=r=>{n.abort(r)};return this.subscribe(o),n.signal.unsubscribe=()=>this.unsubscribe(o),n.signal}static source(){let n;return{token:new zo(function(a){n=a}),cancel:n}}};function os(t){return function(o){return t.apply(null,o)}}function rs(t){return E.isObject(t)&&t.isAxiosError===!0}const Zt={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(Zt).forEach(([t,n])=>{Zt[n]=t});function po(t){const n=new Ue(t),o=vn(Ue.prototype.request,n);return E.extend(o,Ue.prototype,n,{allOwnKeys:!0}),E.extend(o,n,null,{allOwnKeys:!0}),o.create=function(a){return po(ze(t,a))},o}const ae=po(it);ae.Axios=Ue,ae.CanceledError=Ze,ae.CancelToken=ns,ae.isCancel=Jn,ae.VERSION=fo,ae.toFormData=wt,ae.AxiosError=J,ae.Cancel=ae.CanceledError,ae.all=function(n){return Promise.all(n)},ae.spread=os,ae.isAxiosError=rs,ae.mergeConfig=ze,ae.AxiosHeaders=ye,ae.formToJSON=t=>Gn(E.isHTMLForm(t)?new FormData(t):t),ae.getAdapter=co.getAdapter,ae.HttpStatusCode=Zt,ae.default=ae;const{Axios:ru,AxiosError:au,CanceledError:su,isCancel:iu,CancelToken:lu,VERSION:cu,all:du,Cancel:uu,isAxiosError:fu,spread:mu,toFormData:pu,AxiosHeaders:hu,HttpStatusCode:_u,formToJSON:gu,getAdapter:yu,mergeConfig:bu}=ae;var as=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ss(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ho={exports:{}};(function(t,n){(function(o,r){t.exports=r()})(as,function(){var o=1e3,r=6e4,a=36e5,s="millisecond",i="second",l="minute",c="hour",d="day",u="week",f="month",g="quarter",_="year",m="date",y="Invalid Date",S=/^(\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,h={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(T){var C=["th","st","nd","rd"],A=T%100;return"["+T+(C[(A-20)%10]||C[A]||C[0])+"]"}},p=function(T,C,A){var $=String(T);return!$||$.length>=C?T:""+Array(C+1-$.length).join(A)+T},v={s:p,z:function(T){var C=-T.utcOffset(),A=Math.abs(C),$=Math.floor(A/60),b=A%60;return(C<=0?"+":"-")+p($,2,"0")+":"+p(b,2,"0")},m:function T(C,A){if(C.date()<A.date())return-T(A,C);var $=12*(A.year()-C.year())+(A.month()-C.month()),b=C.clone().add($,f),x=A-b<0,V=C.clone().add($+(x?-1:1),f);return+(-($+(A-b)/(x?b-V:V-b))||0)},a:function(T){return T<0?Math.ceil(T)||0:Math.floor(T)},p:function(T){return{M:f,y:_,w:u,d,D:m,h:c,m:l,s:i,ms:s,Q:g}[T]||String(T||"").toLowerCase().replace(/s$/,"")},u:function(T){return T===void 0}},D="en",O={};O[D]=h;var R="$isDayjsObject",M=function(T){return T instanceof I||!(!T||!T[R])},k=function T(C,A,$){var b;if(!C)return D;if(typeof C=="string"){var x=C.toLowerCase();O[x]&&(b=x),A&&(O[x]=A,b=x);var V=C.split("-");if(!b&&V.length>1)return T(V[0])}else{var L=C.name;O[L]=C,b=L}return!$&&b&&(D=b),b||!$&&D},N=function(T,C){if(M(T))return T.clone();var A=typeof C=="object"?C:{};return A.date=T,A.args=arguments,new I(A)},B=v;B.l=k,B.i=M,B.w=function(T,C){return N(T,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var I=function(){function T(A){this.$L=k(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[R]=!0}var C=T.prototype;return C.parse=function(A){this.$d=function($){var b=$.date,x=$.utc;if(b===null)return new Date(NaN);if(B.u(b))return new Date;if(b instanceof Date)return new Date(b);if(typeof b=="string"&&!/Z$/i.test(b)){var V=b.match(S);if(V){var L=V[2]-1||0,W=(V[7]||"0").substring(0,3);return x?new Date(Date.UTC(V[1],L,V[3]||1,V[4]||0,V[5]||0,V[6]||0,W)):new Date(V[1],L,V[3]||1,V[4]||0,V[5]||0,V[6]||0,W)}}return new Date(b)}(A),this.init()},C.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},C.$utils=function(){return B},C.isValid=function(){return this.$d.toString()!==y},C.isSame=function(A,$){var b=N(A);return this.startOf($)<=b&&b<=this.endOf($)},C.isAfter=function(A,$){return N(A)<this.startOf($)},C.isBefore=function(A,$){return this.endOf($)<N(A)},C.$g=function(A,$,b){return B.u(A)?this[$]:this.set(b,A)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(A,$){var b=this,x=!!B.u($)||$,V=B.p(A),L=function(F,Q){var j=B.w(b.$u?Date.UTC(b.$y,Q,F):new Date(b.$y,Q,F),b);return x?j:j.endOf(d)},W=function(F,Q){return B.w(b.toDate()[F].apply(b.toDate("s"),(x?[0,0,0,0]:[23,59,59,999]).slice(Q)),b)},H=this.$W,X=this.$M,te=this.$D,ue="set"+(this.$u?"UTC":"");switch(V){case _:return x?L(1,0):L(31,11);case f:return x?L(1,X):L(0,X+1);case u:var oe=this.$locale().weekStart||0,G=(H<oe?H+7:H)-oe;return L(x?te-G:te+(6-G),X);case d:case m:return W(ue+"Hours",0);case c:return W(ue+"Minutes",1);case l:return W(ue+"Seconds",2);case i:return W(ue+"Milliseconds",3);default:return this.clone()}},C.endOf=function(A){return this.startOf(A,!1)},C.$set=function(A,$){var b,x=B.p(A),V="set"+(this.$u?"UTC":""),L=(b={},b[d]=V+"Date",b[m]=V+"Date",b[f]=V+"Month",b[_]=V+"FullYear",b[c]=V+"Hours",b[l]=V+"Minutes",b[i]=V+"Seconds",b[s]=V+"Milliseconds",b)[x],W=x===d?this.$D+($-this.$W):$;if(x===f||x===_){var H=this.clone().set(m,1);H.$d[L](W),H.init(),this.$d=H.set(m,Math.min(this.$D,H.daysInMonth())).$d}else L&&this.$d[L](W);return this.init(),this},C.set=function(A,$){return this.clone().$set(A,$)},C.get=function(A){return this[B.p(A)]()},C.add=function(A,$){var b,x=this;A=Number(A);var V=B.p($),L=function(X){var te=N(x);return B.w(te.date(te.date()+Math.round(X*A)),x)};if(V===f)return this.set(f,this.$M+A);if(V===_)return this.set(_,this.$y+A);if(V===d)return L(1);if(V===u)return L(7);var W=(b={},b[l]=r,b[c]=a,b[i]=o,b)[V]||1,H=this.$d.getTime()+A*W;return B.w(H,this)},C.subtract=function(A,$){return this.add(-1*A,$)},C.format=function(A){var $=this,b=this.$locale();if(!this.isValid())return b.invalidDate||y;var x=A||"YYYY-MM-DDTHH:mm:ssZ",V=B.z(this),L=this.$H,W=this.$m,H=this.$M,X=b.weekdays,te=b.months,ue=b.meridiem,oe=function(Q,j,Y,re){return Q&&(Q[j]||Q($,x))||Y[j].slice(0,re)},G=function(Q){return B.s(L%12||12,Q,"0")},F=ue||function(Q,j,Y){var re=Q<12?"AM":"PM";return Y?re.toLowerCase():re};return x.replace(w,function(Q,j){return j||function(Y){switch(Y){case"YY":return String($.$y).slice(-2);case"YYYY":return B.s($.$y,4,"0");case"M":return H+1;case"MM":return B.s(H+1,2,"0");case"MMM":return oe(b.monthsShort,H,te,3);case"MMMM":return oe(te,H);case"D":return $.$D;case"DD":return B.s($.$D,2,"0");case"d":return String($.$W);case"dd":return oe(b.weekdaysMin,$.$W,X,2);case"ddd":return oe(b.weekdaysShort,$.$W,X,3);case"dddd":return X[$.$W];case"H":return String(L);case"HH":return B.s(L,2,"0");case"h":return G(1);case"hh":return G(2);case"a":return F(L,W,!0);case"A":return F(L,W,!1);case"m":return String(W);case"mm":return B.s(W,2,"0");case"s":return String($.$s);case"ss":return B.s($.$s,2,"0");case"SSS":return B.s($.$ms,3,"0");case"Z":return V}return null}(Q)||V.replace(":","")})},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(A,$,b){var x,V=this,L=B.p($),W=N(A),H=(W.utcOffset()-this.utcOffset())*r,X=this-W,te=function(){return B.m(V,W)};switch(L){case _:x=te()/12;break;case f:x=te();break;case g:x=te()/3;break;case u:x=(X-H)/6048e5;break;case d:x=(X-H)/864e5;break;case c:x=X/a;break;case l:x=X/r;break;case i:x=X/o;break;default:x=X}return b?x:B.a(x)},C.daysInMonth=function(){return this.endOf(f).$D},C.$locale=function(){return O[this.$L]},C.locale=function(A,$){if(!A)return this.$L;var b=this.clone(),x=k(A,$,!0);return x&&(b.$L=x),b},C.clone=function(){return B.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()},T}(),P=I.prototype;return N.prototype=P,[["$ms",s],["$s",i],["$m",l],["$H",c],["$W",d],["$M",f],["$y",_],["$D",m]].forEach(function(T){P[T[1]]=function(C){return this.$g(C,T[0],T[1])}}),N.extend=function(T,C){return T.$i||(T(C,I,N),T.$i=!0),N},N.locale=k,N.isDayjs=M,N.unix=function(T){return N(1e3*T)},N.en=O[D],N.Ls=O,N.p={},N})})(ho);var is=ho.exports;const _o=ss(is),ls=t=>{const n=K.useRouter(),o=K.useRoute(),r=`${t.domain}/api/`,a=ae.create({baseURL:r}),s=ae.create({baseURL:r}),i=ae.create({baseURL:r}),l=ae.create({baseURL:r}),c=ae.create({baseURL:r}),d=ae.create({baseURL:r}),u=ae.create({baseURL:r}),f=p=>{try{const v=JSON.parse(localStorage.getItem("authTokensAccess")||"");v.length>0&&(p.headers.Authorization=`Bearer ${v}`)}catch{console.warn("accessToken is undefined [useAxios]")}return p},g=p=>{const v=localStorage.getItem("apiKey"),D=(v==null?void 0:v.replace(/^.(.*).$/,"$1"))||"";return p.headers={"Content-Type":"application/json","x-api-key":D},p},_=async p=>{if(!t.user)return p;const v=t.user.exp??0;if(!(_o.unix(v).diff(_o())<3e3))return p;const O=An("authTokensRefresh",null,"string");try{const R=await ae.post(`${r}user/token/refresh/`,{refresh:O.value});if(!R.data.access)return h(),p;localStorage.setItem("authTokensAccess",JSON.stringify(R.data.access)),S(R.data),w(Bn(R.data.access)),p.headers={...p.headers,Authorization:`Bearer ${R.data.access}`}}catch(R){console.error("Failed to refresh token:",R),h()}return p},m=p=>{p.interceptors.request.use(v=>_(f(v)),v=>Promise.reject(v))};m(i),m(c),m(u);const y=p=>{p.interceptors.request.use(v=>g(v))};y(d),y(s),y(u);const S=(p,v=!1)=>{localStorage.setItem("authTokensAccess",JSON.stringify(p.access)),v&&localStorage.setItem("authTokensRefresh",JSON.stringify(p.refresh))},w=p=>{t.user=p,localStorage.setItem("user",JSON.stringify(p))},h=()=>{t.user=null,Ke(["authTokensAccess","authTokensRefresh","user","cart","bonus"]),sessionStorage.removeItem("is_adult"),n.push(`/${o.params.orgId}/`),window.location.reload()};return{axiosInstanceAuthenticationGet:i,axiosInstanceAuthenticationPost:c,axiosInstanceAuthenticationPostApiKey:u,axiosInstancePost:l,axiosInstanceGet:a,axiosInstanceGetApiKey:s,axiosInstancePostApiKey:d}},Z=class Z{constructor(){ee(this,"axiosInstanceGet");ee(this,"axiosInstancePost");ee(this,"axiosInstanceAuthenticationGet");ee(this,"axiosInstanceAuthenticationPost");ee(this,"axiosInstanceGetApiKey");ee(this,"axiosInstancePostApiKey");ee(this,"axiosInstanceAuthenticationPostApiKey");ee(this,"currentUpsaleController",null);ee(this,"controller",new AbortController);this.axiosInstanceGet=Z._axiosGet,this.axiosInstancePost=Z._axiosPost,this.axiosInstanceGetApiKey=Z._axiosPostApiKey,this.axiosInstancePostApiKey=Z._axiosPostApiKey,this.axiosInstanceAuthenticationPostApiKey=Z._axiosAuthPostApiKey,this.axiosInstanceAuthenticationGet=Z._axiosAuthGet,this.axiosInstanceAuthenticationPost=Z._axiosAuthPost}static create(n){return n&&!Z._config&&Z._initialize(n),Z._config||console.warn("InitConnection не инициализирован"),new Z}static _initialize(n,o=null){const r=ce(),a=me(),{config_lib:s}=U.storeToRefs(r),{stateCard:i,recountGroupTotalAmount:l}=U.storeToRefs(a);Z._config=n,Z._cardStore=a,Z._stateCard=i,Z._recountGroupTotalAmount=l,s.value=n;const c=ls(n);Z._axiosPostApiKey=c.axiosInstanceGetApiKey,Z._axiosPostApiKey=c.axiosInstancePostApiKey,Z._axiosAuthPostApiKey=c.axiosInstanceAuthenticationPostApiKey,Z._axiosGet=c.axiosInstanceGet,Z._axiosPost=c.axiosInstancePost,Z._axiosAuthGet=c.axiosInstanceAuthenticationGet,Z._axiosAuthPost=c.axiosInstanceAuthenticationPost}get config(){return Z._config}get cardStore(){return Z._cardStore}get stateCard(){return Z._stateCard}get recountGroupTotalAmount(){return Z._recountGroupTotalAmount}async updateTheme(){var s,i;const n=JSON.parse(localStorage.getItem("themeConfig"))??null,o=_e();if(n!==null){o.updateColor(n);return}const r=ce(),a=await((i=this.axiosInstanceGet)==null?void 0:i.get(`org/organizations/${(s=this.config)==null?void 0:s.orgId}/design/`));r.setStateDrum(a==null?void 0:a.data.hide_barban),r.setKioskTimeout(a==null?void 0:a.data.kiosk_timeout),localStorage.setItem("themeConfig",JSON.stringify(a.data)),o.updateColor(a.data)}async getGroupByID(n){var o,r;try{const a=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.pointId}/group/${n}`));return a==null?void 0:a.data}catch(a){throw console.error("Ошибка в request.ts[getGroupByID]",a),a}}async loadGroupProducts(n){var o,r;try{const a=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.pointId}/products/?group=${n}`)),s=(a==null?void 0:a.data)||[];for(const i of s)i&&await ar(i);return await this.cacheImagesInBackground(s),s}catch(a){return console.error("Ошибка загрузки группы:",a),[]}}async getGroup(){var n,o;try{const r=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${(n=this.config)==null?void 0:n.pointId}/groups/`));return r==null?void 0:r.data}catch(r){return console.error("Error fetching products:",r),[]}}async fetchAndCacheAllPages(){var n,o;try{const r=((n=this.config)==null?void 0:n.pointId)||"",a=await Ot(r);if(a)return a.data;const s=await((o=this.axiosInstanceGet)==null?void 0:o.get(`${r}/group/`)),i=(s==null?void 0:s.data)||[],l=[];for(const c of i){c.products=c.products||[],await Qe(c.id,c),l.push(c);const d=await this.loadGroupProducts(c.id);c.products=d}return await this.cacheImagesInBackground(i),await Qe(r,i),l}catch(r){return console.error("fetchAndCacheAllPages error:",r),[]}}cacheImagesInBackground(n){n.forEach(o=>{var r;o.video_link&&this.loadAndCacheMedia(o.video_link,o.id+"_video"),o.image_link&&this.loadAndCacheMedia(o.image_link,o.id+"_image"),(r=o.products)==null||r.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,o){const r=await Ge(o);if(r){this.dispatchImageCachedEvent(o,r);return}try{const a=await fetch(n);if(!a.ok)throw new Error("Network error");const s=await a.blob();if(s.size===0)throw new Error("Empty blob");await Ft(o,s),this.dispatchImageCachedEvent(o,s)}catch(a){console.warn(`[ImageCache] Failed for ${o}:`,a)}}dispatchImageCachedEvent(n,o){window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:o}}))}async getProduct(n=null){var o,r;if(!n)return[];try{const a=await((r=this.axiosInstanceGet)==null?void 0:r.get(`${(o=this.config)==null?void 0:o.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 o=ce(),{config_lib:r}=U.storeToRefs(o);try{let s=await yn(n);if(s)this._fullCardProduct(s);else{const i=await((a=this.axiosInstanceGet)==null?void 0:a.get(`${r.value.pointId}/products/${n}`));(i==null?void 0:i.status)===200&&this._fullCardProduct(i.data)}}catch(s){throw console.log("store card[getFetchProducts]:",s),s}}_fullCardProduct(n){const o=me();o.stateCard.openCard={...n,amount:1},o.stateCard.groupModifiers=n.group_modifiers,n.modifiers.length>0&&o.stateCard.groupModifiers.unshift({default_amount:0,description:"",group_modifiers:n.modifiers,id:"Добавки2000",image_link:null,max_amount:1,min_amount:n.modifiers.reduce((r,a)=>r+=a.min_amount,0),name:"Добавки",required:!1}),o.stateCard.groupModifiersSelected=new Array(o.stateCard.groupModifiers.length).fill({group:"",modifiers:[],modifier_count:0}),o.stateCard.productSizes=n.sizes,o.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 o,r;try{const a=await((r=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:r.post(`${(o=this.config)==null?void 0:o.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 o,r;try{const a=await((r=this.axiosInstancePostApiKey)==null?void 0:r.post(`${(o=this.config)==null?void 0:o.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,o){var r,a;try{const s=await((a=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:a.post(`${(r=this.config)==null?void 0:r.domain}/api/device/auth/`,{code:n,phone:o}));return s==null?void 0:s.data}catch(s){throw console.error("Ошибка отправки sms-code:",s),s}}async callStaff(n,o){var r,a,s,i;try{const l=await((s=this.axiosInstancePost)==null?void 0:s.post(`${(r=this.config)==null?void 0:r.domain}/api/org_unit/${(a=this.config)==null?void 0:a.pointId}/table/${n}/call-staff/`,{reason:o}));return(i=l==null?void 0:l.data)==null?void 0:i.response_text}catch(l){throw console.error("Ошибка[callWaiter]",l),l}}async createOrder(n,o,r=!0,a,s=!1,i=!1){var _,m,y;const l=Fe(),c=s?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,d=r?c:this.axiosInstanceAuthenticationPost,u=r?"/device/order/create":"/order/create",f=r?(_=this.config)==null?void 0:_.pointId:(m=this.config)==null?void 0:m.pointId,g=await(d==null?void 0:d.post(`${(y=this.config)==null?void 0:y.domain}/api/org_unit/${f}${u}`,{items:n,table:o||null,comment:a}));return(g==null?void 0:g.status)===201&&l.orderSocket(g==null?void 0:g.data.id,r,i),g}async initPaymentLink(n,o=!0){const r=o?this.axiosInstancePost:this.axiosInstanceAuthenticationPost,a=ce(),s=o?"TERMINAL":"YOOKASSA",i=await(r==null?void 0:r.post("payment/init",{by_bonuses:a.countBonus,order:n,provider_type:s}));return i==null?void 0:i.data}async orderPay(n){var o;return(o=this.axiosInstanceAuthenticationPostApiKey)==null?void 0:o.post(`order/${n}/pay/`,{order_id:n})}async getProfile(){var o,r;const n=await((r=this.axiosInstanceAuthenticationGet)==null?void 0:r.get(`user/current?organization=${(o=this.config)==null?void 0:o.orgId}`));if((n==null?void 0:n.status)===200){const a=ce();return a.profile=n.data,a.is18Allowed=sessionStorage.getItem("is_adult")==="true",n.data}else return n}async calculateDiscount(n,o=!0,r=!1){var c,d;const a=r?this.axiosInstanceAuthenticationPostApiKey:this.axiosInstancePostApiKey,s=o?a:this.axiosInstanceAuthenticationPost,i=o?(c=this.config)==null?void 0:c.pointId:(d=this.config)==null?void 0:d.pointId,l=await(s==null?void 0:s.post(`/org_unit/${i}/cart/calculate-discount/`,n));return(l==null?void 0:l.status)===200?l.data:l}async getDeviceInfo(){var o;const n=await((o=this.axiosInstanceGetApiKey)==null?void 0:o.get("/device/current/"));return(n==null?void 0:n.status)===200?n.data:n}async productUpsale(n){var s,i,l;const o=me(),{dataUpSale:r}=U.storeToRefs(o);(s=this.currentUpsaleController)==null||s.abort();const a=new AbortController;this.currentUpsaleController=a;try{const c=await((l=this.axiosInstanceGet)==null?void 0:l.get(`/${(i=this.config)==null?void 0:i.pointId}/products/${n}/recommendation/`,{signal:a.signal}));a.signal.aborted||(r.value=c==null?void 0:c.data)}catch(c){if(c.name==="AbortError"||c.name==="CanceledError"){console.log("Upsale отменён — пришёл новый запрос");return}throw console.error("Ошибка upsale:",c),c}finally{this.currentUpsaleController===a&&(this.currentUpsaleController=null)}}};ee(Z,"_config",null),ee(Z,"_axiosGet"),ee(Z,"_axiosGetApiKey"),ee(Z,"_axiosPostApiKey"),ee(Z,"_axiosAuthPostApiKey"),ee(Z,"_axiosPost"),ee(Z,"_axiosAuthGet"),ee(Z,"_axiosAuthPost"),ee(Z,"_cardStore",null),ee(Z,"_stateCard",null),ee(Z,"_recountGroupTotalAmount",null);let Ve=Z;const cs=e.defineComponent({__name:"UseScrollCenter",props:{axis:{},behavior:{},autoScroll:{type:Boolean},container:{},idActive:{},clearContainer:{type:Boolean}},setup(t,{expose:n}){const o=t,r=ce(),a=e.ref(null),s=async l=>{if(!a.value||!l)return;let c=window;o.container&&(c=typeof o.container=="string"?document.querySelector(o.container)||window:o.container);const d={behavior:o.behavior};if(o.axis==="x"){const u=c===window?window.innerWidth:c.clientWidth,f=l.offsetWidth;let g=l.offsetLeft;if(c!==window){const _=c.getBoundingClientRect();g=l.getBoundingClientRect().left-_.left+c.scrollLeft}g-=(u-f)/2,d.left=Math.max(0,g)}else{const u=c===window?window.innerHeight:c.clientHeight,f=l.offsetHeight;let g=l.offsetTop;if(c!==window){const _=c.getBoundingClientRect();g=l.getBoundingClientRect().top-_.top+c.scrollTop}g-=(u-f)/2,d.top=Math.max(0,g)}try{c===window?window.scrollTo(d):c.scrollTo(d)}catch(u){console.error("Scroll error:",u)}};e.onMounted(async()=>{if(o.autoScroll){let l=null;if(await e.nextTick(),r.activeScrolling_lib){const c=r.activeScrolling_lib.findIndex(d=>d.id===o.idActive);o.idActive?(l=document.getElementById(`scrolling${o.idActive}`),l&&c!==-1&&(r.activeScrolling_lib[c]=l)):r.activeScrolling_lib[c]&&(l=r.activeScrolling_lib[c]),s(l)}}});const i=async l=>{o.clearContainer&&(r.activeScrolling_lib=[]);const c=l.currentTarget;await e.nextTick(),r.activeScrolling_lib.includes(c)||r.activeScrolling_lib.push(c),s(c)};return n({scrollToElement:s}),(l,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:a,class:"scroll-to-wrapper"},[e.renderSlot(l.$slots,"default",{handleTargetClick:i},void 0,!0)],512))}}),ne=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Yt=ne(cs,[["__scopeId","data-v-b510c3f1"]]),ds={},us={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 fs(t,n){return e.openBlock(),e.createElementBlock("svg",us,[...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 Qt=ne(ds,[["render",fs]]),ms=["id","onClick"],ps={class:"modified_plus_btn"},hs=["src"],_s={key:2,class:"wrapper_modifier_item"},gs={key:0,class:"modifier_item_n_wrapper"},ys=["src"],bs={key:1,class:"modifier_plus_item"},ws=["src"],ks=["src"],go=ne(e.defineComponent({__name:"PlusModifier",props:{isSectionModifier:{type:Boolean},toggleNotRequire:{type:Function}},setup(t){const n=me(),o=_e(),{stateCard:r}=U.storeToRefs(n),{itemThemes:a}=U.storeToRefs(o),s=e.ref([]),i=e.ref([]),l=e.ref(null),c=e.ref(null),d=f=>{f instanceof HTMLElement&&!s.value.includes(f)&&s.value.push(f)},u=f=>{c.value=f};return e.onMounted(async()=>{await e.nextTick(),r.value.plusButtonsRefs=s.value}),e.watchEffect(()=>{i.value=r.value.groupModifiersSelected,document.body.style.overflow=""}),e.onBeforeUnmount(()=>{s.value=[],r.value.plusButtonsRefs=[]}),(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({card_modified_wrapper_many:e.unref(r).groupModifiers.length>=5})},[e.unref(r).groupModifiersSelected?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["card_modified_wrapper",[e.unref(r).groupModifiers.length<=4?"card_modified_wrapper_center":""]]),ref_key:"scrollPlusContainer",ref:l},[e.createVNode(Yt,{axis:"x",behavior:"smooth",container:l.value,autoScroll:!0,idActive:c.value,clearContainer:!0},{default:e.withCtx(({handleTargetClick:_})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).groupModifiers,(m,y)=>{var S,w;return e.openBlock(),e.createElementBlock("div",{class:"button_modified",key:m.id,ref_for:!0,ref:d,id:"scrolling"+m.id,"data-clickable":"true",onClick:h=>{t.toggleNotRequire&&t.toggleNotRequire(m,y),u(m.id),_(h)}},[e.createElementVNode("div",ps,[i.value[y].modifiers.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{modified_plus_btn_active:m.id===((S=e.unref(r).groupCurrentOpen)==null?void 0:S.id)&&t.isSectionModifier},"modified_plus_active"])},[e.createVNode(Qt,{"aria-label":`Открыть группу модификаторов ${m.name}`},null,8,["aria-label"])],2)):i.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:m.id===((w=e.unref(r).groupCurrentOpen)==null?void 0:w.id)&&t.isSectionModifier}])},[e.createElementVNode("img",{src:i.value[y].modifiers[0].image_link||e.unref(a).fallback_image||"",alt:"Модификатор"},null,8,hs)],2)):(e.openBlock(),e.createElementBlock("div",_s,[i.value[y].modifiers.length>2?(e.openBlock(),e.createElementBlock("div",gs,[i.value[y].modifiers.length===3?(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_plus_item modifier_item_three",src:i.value[y].modifiers[2].image_link||e.unref(a).fallback_image||""},null,8,ys)):(e.openBlock(),e.createElementBlock("p",bs," + "+e.toDisplayString(i.value[y].modifiers.length-2),1))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[i.value[y].modifiers.length>0?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.value[y].modifiers[0].image_link||e.unref(a).fallback_image||"",class:"modifier_plus_item modifier_item_first"},null,8,ws)):e.createCommentVNode("",!0),i.value[y].modifiers.length>1?(e.openBlock(),e.createElementBlock("img",{key:1,src:i.value[y].modifiers[1].image_link||e.unref(a).fallback_image||"",class:"modifier_plus_item modifier_item_second"},null,8,ks)):e.createCommentVNode("",!0)])]))]),e.createElementVNode("p",null,e.toDisplayString(m.name),1)],8,ms)}),128))]),_:1},8,["container","idActive"])],2)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-589e71ca"]]),Cs={},Ss={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 Es(t,n){return e.openBlock(),e.createElementBlock("svg",Ss,[...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 en=ne(Cs,[["render",Es]]),Ns={class:"wrapper_modifiers"},xs={class:"wrapper_nutritional_value"},Bs={class:"nutritional_scheme"},As={key:0,class:"nutritional_parameters"},vs={key:1,class:"nutritional_parameters"},$s={key:2,class:"nutritional_parameters"},Ts={key:3,class:"nutritional_parameters"},Ms={ref:"modifierBody",class:"modifier_shadow"},Ps={class:"wrapper_modifiers_title"},Vs={class:"wrapper_text_count_modifiers"},Is=["id","aria-label","onClick","onKeydown"],Rs={key:0,class:"counter_modifier"},Ds={class:"hide_image_corners"},Os=["src","alt"],Fs={key:1,loop:"",autoplay:"",muted:"",playsinline:"",class:"card__video"},Ls=["src"],zs={class:"modifier_title"},Us=ne(e.defineComponent({__name:"SectionModifiers",emits:["close"],setup(t,{emit:n}){const o=n,r=_e(),a=me(),{itemThemes:s}=U.storeToRefs(r),{stateCard:i,recountGroupTotalAmount:l,groupTotalAmount:c}=U.storeToRefs(a),d=e.ref(null),u=Ee.useTemplateRefsList(),f=g=>{if(!g)return;const _=i.value.groupModifiers.findIndex(h=>h.id===i.value.groupCurrentOpen.id),m=i.value.plusButtonsRefs[_]||i.value.plusButtonsRefs[0];if(!m)return;const y=g.getBoundingClientRect(),S=m.getBoundingClientRect(),w=g.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 h=S.left+S.width/3-(y.left+y.width/2),p=S.top+S.height/4-(y.top+y.height/2),v=S.width/y.width*.2;w.style.transform=`translate(${h}px, ${p}px) scale(${v})`,w.style.opacity="0.4",w.style.transition="transform 0.5s ease, opacity 0.5s ease"}),w.addEventListener("transitionend",()=>{w.remove(),d.value=null,m.classList.add("bump"),setTimeout(()=>m.classList.remove("bump"),300)},{once:!0})};return e.watch(()=>i.value.isAnimationFly,g=>{g===!0&&i.value.currentModifier&&(f(u.value.find(_=>_.id===i.value.currentModifier.id)),i.value.isAnimationFly=!1)}),(g,_)=>{var m,y,S,w,h,p,v,D,O,R,M,k;return e.openBlock(),e.createElementBlock("div",Ns,[e.createElementVNode("div",xs,[e.createElementVNode("div",{class:e.normalizeClass(["card_header_inner_back",[(m=e.unref(i).openCard)!=null&&m.proteins_amount?"card_header_inner_back_nutrients":""]]),"aria-label":"Закрыть выбор модификаторов",onClick:_[0]||(_[0]=N=>o("close"))},[e.createVNode(en,{class:"arrow_bottom"})],2),e.createElementVNode("div",Bs,[(y=e.unref(i).openCard)!=null&&y.energy_amount?(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("b",null,e.toDisplayString((S=e.unref(i).openCard)==null?void 0:S.energy_amount),1),_[1]||(_[1]=e.createElementVNode("p",null,"Килокалории",-1))])):e.createCommentVNode("",!0),(w=e.unref(i).openCard)!=null&&w.proteins_amount?(e.openBlock(),e.createElementBlock("div",vs,[e.createElementVNode("b",null,e.toDisplayString((h=e.unref(i).openCard)==null?void 0:h.proteins_amount),1),_[2]||(_[2]=e.createElementVNode("p",null,"Белки",-1))])):e.createCommentVNode("",!0),(p=e.unref(i).openCard)!=null&&p.fat_amount?(e.openBlock(),e.createElementBlock("div",$s,[e.createElementVNode("b",null,e.toDisplayString((v=e.unref(i).openCard)==null?void 0:v.fat_amount),1),_[3]||(_[3]=e.createElementVNode("p",null,"Жиры",-1))])):e.createCommentVNode("",!0),(D=e.unref(i).openCard)!=null&&D.carbohydrates_amount?(e.openBlock(),e.createElementBlock("div",Ts,[e.createElementVNode("b",null,e.toDisplayString((O=e.unref(i).openCard)==null?void 0:O.carbohydrates_amount),1),_[4]||(_[4]=e.createElementVNode("p",null,"Углеводы",-1))])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ms,[e.createElementVNode("p",Ps,e.toDisplayString((R=e.unref(i).groupCurrentOpen)==null?void 0:R.name),1),e.createElementVNode("p",Vs,"Выбрано "+e.toDisplayString(e.unref(l))+" из "+e.toDisplayString(e.unref(c)),1),e.createElementVNode("div",{class:e.normalizeClass((M=e.unref(i).groupModifiers.find(N=>{var B;return N.id===((B=e.unref(i).groupCurrentOpen)==null?void 0:B.id)}))!=null&&M.group_modifiers.length?"wrapper_modifiers_card":"wrapper_modifiers_card_column")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((k=e.unref(i).groupCurrentOpen)==null?void 0:k.group_modifiers)||[],N=>{var B,I,P;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&&((B=e.unref(i).groupCurrentOpen)==null?void 0:B.id)==="Добавки2000"&&N.min_amount===0&&N.max_amount===0}]),tabindex:"0",role:"button","data-clickable":"true","aria-label":`Выбрать модификатор группы ${N.name}`,onClick:T=>e.unref(a).modifierSelect(N),onKeydown:e.withKeys(T=>e.unref(a).modifierSelect(N),["enter"])},[e.createElementVNode("div",{class:e.normalizeClass([{modifier_card_active:e.unref(i).groupModifiersSelected.some(T=>{var C;return T.group===((C=e.unref(i).groupCurrentOpen)==null?void 0:C.id)&&T.modifiers.some(A=>A.id===N.id)})},"wrapper_image_corners"])},[N.amount>1?(e.openBlock(),e.createElementBlock("div",Rs,e.toDisplayString(N.amount),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ds,[N.video_link?(e.openBlock(),e.createElementBlock("video",Fs,[e.createElementVNode("source",{src:N.video_link||"",type:"video/webm"},null,8,Ls)])):(e.openBlock(),e.createElementBlock("img",{key:0,class:"modifier_image",src:N.image_link||e.unref(s).fallback_image||"",alt:N.name},null,8,Os)),e.createElementVNode("div",{class:e.normalizeClass(["wrapper_modifier_title",{wrapper_modifier_title_required:N.min_amount>0||N.required}])},[e.createElementVNode("h3",zs,e.toDisplayString(N.name),1),e.createElementVNode("p",null,"+"+e.toDisplayString(((P=(I=N.sizes)==null?void 0:I.find(T=>T.id===e.unref(i).selectedSize.id))==null?void 0:P.price)||N.price||0)+"₽",1)],2)])],2)],42,Is)}),128))],2)],512)])}}}),[["__scopeId","data-v-22d945f1"]]),js={key:0,class:"card_size_place"},Hs=["onClick","onKeydown","aria-label"],qs={key:1,class:"card_size static"},Ws=["onClick","onKeydown","aria-label"],tn=3,Gs=ne(e.defineComponent({__name:"SizeModifier",setup(t){const n=me(),{stateCard:o}=U.storeToRefs(n),r=e.ref(null),a=e.ref(50),s=e.ref(),i=e.ref(0),l=e.ref(0),c=e.ref(null),d=e.computed(()=>{var p;if(o.value.productSizes.length<=3)return o.value.productSizes[s.value.index]||o.value.productSizes[0];const w=i.value+1,h=((p=f.value[w])==null?void 0:p.originalIndex)??1;return o.value.productSizes[h]}),u=()=>{c.value&&o.value.productSizes.length>=3&&(l.value=c.value.offsetWidth/tn)},f=e.computed(()=>{if(o.value.productSizes.length<=3)return o.value.productSizes;const w=o.value.productSizes;return[...w.map((h,p)=>({...h,originalIndex:p})),...w.map((h,p)=>({...h,originalIndex:p})),...w.map((h,p)=>({...h,originalIndex:p}))]}),g=(w,h)=>{if(s.value={id:w.id,title:w.name,index:h,is_default:w.is_default},w.price!==null&&o.value.openCard&&(o.value.openCard={...o.value.openCard,price:w.price}),o.value.selectedSize=w,o.value.productSizes.length>3){u();const p=i.value+1;h<p?_():h>p&&m()}else{const p=o.value.productSizes.length,v=(h+.5)*(100/p);a.value=v}},_=()=>{var w;if(!(o.value.productSizes.length<=3)){if(i.value--,i.value<o.value.productSizes.length-tn+1){i.value+=o.value.productSizes.length;const h=(w=c.value)==null?void 0:w.querySelector(".card_size");h&&(h.style.transition="none",h.style.transform=`translateX(-${i.value*l.value}px)`,h.offsetHeight,h.style.transition="transform 0.2s ease-in-out")}y()}},m=()=>{var w;if(!(o.value.productSizes.length<=3)){if(i.value++,i.value>=o.value.productSizes.length*2){i.value-=o.value.productSizes.length;const h=(w=c.value)==null?void 0:w.querySelector(".card_size");h&&(h.style.transition="none",h.style.transform=`translateX(-${i.value*l.value}px)`,h.offsetHeight,h.style.transition="transform 0.2s ease-in-out")}y()}},y=()=>{var v;if(o.value.productSizes.length<=3)return;const w=i.value+1,h=((v=f.value[w])==null?void 0:v.originalIndex)??0,p=o.value.productSizes[h];s.value={id:p.id,title:p.name,index:h,is_default:p.is_default}};e.watch(()=>[o.value.productSizes,c.value],([w=[],h])=>{if(Array.isArray(w)&&w.length>0&&h!==null){let p=w.findIndex(v=>v.is_default===!0);w.length<3&&r.value&&parseInt(r.value.style.minWidth)<767&&(r.value.style.width="100px"),p>-1?(i.value=p,g(w[p],p),l.value=120/tn):w.length===2||w.length===1?(g(w[0],0),a.value=(0+.5)*(100/2)):(g(w[1],1),a.value=(1+.5)*(100/3))}}),e.watch(()=>{var w;return[(w=o.value.selectedSize)==null?void 0:w.id,o.value.groupModifiersSelected]},([w,h])=>{if(!w||!Array.isArray(h))return;const p=h.map(v=>({...v,modifiers:v.modifiers.map(D=>{if(!D.sizes||D.sizes.length===0)return D;const O=D.sizes.find(R=>R.id===w);return O?{...D,size:O,price:O.price??D.price}:D})}));JSON.stringify(p)!==JSON.stringify(o.value.groupModifiersSelected)&&(o.value.groupModifiersSelected=p)},{deep:!0});const S={mounted:u};return e.onBeforeUnmount(()=>{window.removeEventListener("resize",u)}),(w,h)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"slider_container",ref_key:"slider_container",ref:r},[e.createElementVNode("div",{class:"card_size_place_wrapper",ref_key:"sliderWrapper",ref:c},[e.unref(o).productSizes.length>1&&s.value?(e.openBlock(),e.createElementBlock("div",js,[e.unref(o).productSizes.length>3?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"card_size",style:e.normalizeStyle({transform:`translateX(-${i.value*l.value}px)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(p,v)=>(e.openBlock(),e.createElementBlock("li",{key:`${p.id}-${v}`,onClick:D=>g(p,v),onKeydown:e.withKeys(D=>g(p,v),["enter"]),class:e.normalizeClass({active:s.value.id===p.id&&s.value.index===p.originalIndex}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${p.name}`},e.toDisplayString(p.alt_name?p.alt_name:p.name),43,Hs))),128))],4)):(e.openBlock(),e.createElementBlock("ul",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).productSizes,(p,v)=>(e.openBlock(),e.createElementBlock("li",{key:`${p.id}-${v}`,onClick:D=>g(p,v),onKeydown:e.withKeys(D=>g(p,v),["enter"]),class:e.normalizeClass({active:s.value.id===p.id&&s.value.index===v}),tabindex:"0",role:"button","aria-label":`Выбрать размер ${p.name}`},e.toDisplayString(p.alt_name?p.alt_name:p.name),43,Ws))),128))])),d.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:2,class:"size_active",style:e.normalizeStyle(e.unref(o).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)),[[S]]):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)],512)),[[e.vShow,e.unref(o).productSizes.length>1&&s.value]])}}),[["__scopeId","data-v-bc00f0e8"]]),Ks="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",Js={class:"counter_container"},Xs={class:"card_size_place_wrapper",ref:"sliderWrapper"},Zs={class:"cart_amount_counter"},Ys={class:"button_circle_number"},Qs=ne(e.defineComponent({__name:"NumberModifier",setup(t){const n=me(),{stateCard:o}=U.storeToRefs(n),r=()=>{var s,i;(s=o.value.openCard)!=null&&s.amount&&((i=o.value.openCard)==null?void 0:i.amount)>1&&(o.value.openCard.amount-=1)},a=()=>{var s;(s=o.value.openCard)!=null&&s.amount&&(o.value.openCard.amount+=1)};return(s,i)=>{var l,c;return e.openBlock(),e.createElementBlock("div",Js,[e.createElementVNode("div",Xs,[e.createElementVNode("div",Zs,[e.createElementVNode("p",{class:e.normalizeClass(["cart_circle_minus",[((l=e.unref(o).openCard)==null?void 0:l.amount)===1?"card_circle_minus_alone":""]]),"aria-label":"Уменьшить количество продукта","data-clickable":"true",onClick:e.withModifiers(r,["stop","prevent"])},[...i[0]||(i[0]=[e.createElementVNode("span",null,null,-1)])],2),e.createElementVNode("p",Ys,e.toDisplayString((c=e.unref(o).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 yo(t,n=800){const o=e.ref(t),r=e.ref(t);let a=null,s=null,i=t;const l=c=>{s||(s=c);const d=c-s,u=Math.min(d/n,1),f=u<.5?4*u*u*u:1-Math.pow(-2*u+2,3)/2;o.value=Math.round(i+(r.value-i)*f),u<1?a=requestAnimationFrame(l):(o.value=r.value,a=null)};return e.watch(r,()=>{a&&cancelAnimationFrame(a),i=o.value,s=null,a=requestAnimationFrame(l)},{immediate:!0}),e.onUnmounted(()=>{a&&cancelAnimationFrame(a)}),{displayNumber:o,targetNumber:r,update:c=>{r.value=c}}}const ve=e.defineComponent({__name:"RecountNumber",props:{price:{type:Number,required:!0},duration:{type:Number},fixedFloat:{type:Number,require:!1}},setup(t){const n=t,{displayNumber:o,update:r}=yo(n.price||0,n.duration||800);return e.watchEffect(()=>{r(n.price)}),(a,s)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(e.unref(o).toFixed(t.fixedFloat)),1))}}),ei=["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,o=()=>{n.onClick()};return(r,a)=>(e.openBlock(),e.createElementBlock("button",{class:"buttonDefaultWrapper",disabled:t.disabled,onClick:o,id:t.disabled?"buttonDefaultDisabled":""},e.toDisplayString(t.textButtonDefault),9,ei))}}),ti={class:"notification_info"},ni={key:0,class:"notification_18plus"},oi={class:"notification_18plus_image"},ri=["src"],ai={class:"notification_18plus_text"},si={class:"notification_18plus_accept"},ii={key:1,class:"notification_text"},li={key:0,class:"wrapper_button_accept"},nn=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,o=_e(),r=ce(),{is18Allowed:a,notificationData_lib:s}=U.storeToRefs(r),{itemThemes:i}=U.storeToRefs(o),l=e.computed(()=>n.backgroundColor||"rgba(50, 50, 50, 0.9)"),c=e.useModel(t,"visible"),d=()=>{s.value.fastAdd&&(r.addToCart(s.value.fastAdd),s.value.fastAdd=null),sessionStorage.setItem("is_adult","true"),a.value=!0,c.value=!1},u=()=>{c.value=!1};return(f,g)=>(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 _;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",ti,[t.type?(e.openBlock(),e.createElementBlock("div",ni,[e.createElementVNode("div",oi,[e.createElementVNode("img",{src:e.unref(i).adult_disclaimer_image||e.unref(i).fallback_image,alt:"Дисклеймер"},null,8,ri)]),e.createElementVNode("div",ai,e.toDisplayString(e.unref(i).adult_disclaimer_text),1),e.createElementVNode("div",si,[g[0]||(g[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",ii,[e.createTextVNode(e.toDisplayString(t.textNotificationDefault)+" ",1),(_=t.buttonAccept)!=null&&_.state?(e.openBlock(),e.createElementBlock("div",li,[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))}}),ci={class:"button_price button_price_modifiers"},di=["src"],ui={class:"button_text_container"},fi={class:"button_text_price"},mi=ne(e.defineComponent({__name:"ButtonPriceCount",props:{qr_menu:{type:Boolean,default:!1},closeProduct:{}},setup(t){const n=K.useRouter(),o=K.useRoute(),r=me(),a=ce(),s=_e(),i=e.ref([]),l=e.ref([]),c=t,{stateCard:d,totalPrice_libCard:u,isOpenWindow:f,isAddToCard:g}=U.storeToRefs(r),{itemThemes:_}=U.storeToRefs(s),m=e.ref(!0),y=e.ref(!1),S=()=>{var h,p,v,D,O,R;if(m.value){r.setCurrentCard(d.value.openCard),y.value=!0;const M=d.value.groupModifiers.findIndex(k=>r.checkedRequiredBtn.group.id===k.id);r.checkedRequiredBtn.haveRequaire&&r.toggleNotRequire(r.checkedRequiredBtn.group,M);return}const w=d.value.groupModifiersSelected||[];if(i.value=[],l.value=[],Array.isArray(w)&&w.length>0&&w.forEach(M=>{const k=M.group,N=M.modifiers||[];k==="Добавки2000"?i.value=N.map(B=>{var I;return{...B,old_price:B.price,size:Array.isArray(B.size)?B.size.map(P=>P.id).filter(Boolean):(I=B.size)!=null&&I.id?B.size.id:void 0}}):N.length>0&&l.value.push({group:k,modifiers:N.map(B=>{var I;return{...B,old_price:B.price,size:Array.isArray(B.size)?B.size.map(P=>P.id).filter(Boolean):(I=B.size)!=null&&I.id?B.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:((h=d.value.selectedSize)==null?void 0:h.id)??((v=(p=d.value.openCard.sizes)==null?void 0:p.find(k=>k.is_default))==null?void 0:v.id),sizes:((D=d.value.selectedSize)==null?void 0:D.id)??((R=(O=d.value.openCard.sizes)==null?void 0:O.find(k=>k.is_default))==null?void 0:R.id),modifiers:i.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),g.value=!0}f.value=!1,n.push(`/${o.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(()=>{r.checkedRequiredBtn.haveRequaire?m.value=!0:m.value=!1}),e.onMounted(()=>{g.value=!1}),(w,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(nn,{visible:y.value,textNotificationDefault:e.unref(d).textErrorRequaired,backgroundColor:e.unref(_).accent_color?e.unref(_).accent_color:"#FF6D2E",buttonAccept:null,"onUpdate:visible":h[0]||(h[0]=p=>y.value=p)},null,8,["visible","textNotificationDefault","backgroundColor"]),e.createElementVNode("div",{class:"button_price_bg_product",onTouchstart:h[3]||(h[3]=e.withModifiers(()=>{},["stop"])),onPointerdown:h[4]||(h[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ci,[e.createVNode(Qs),e.createElementVNode("div",{class:e.normalizeClass(["card_product_button_buy",{buy_active:!m.value}]),"data-clickable":"true",onClick:S,onTouchstart:h[1]||(h[1]=e.withModifiers(()=>{},["stop"])),onPointerdown:h[2]||(h[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{src:e.unref(Ks),class:"card_product_button_icon"},null,8,di),e.createElementVNode("div",ui,[e.createElementVNode("p",fi,[e.createVNode(ve,{price:+e.unref(u),fixedFloat:2},null,8,["price"]),h[5]||(h[5]=e.createTextVNode(" ₽ ",-1))])])],34)])],32)],64))}}),[["__scopeId","data-v-dbbf98fb"]]),pi={class:"modified_amount"},hi={class:"hide_image_corners"},_i=["src"],gi={class:"wrapper_modifier_title"},yi={class:"amount_title"},bi={class:"wrapper_amount_counter"},wi={class:"amount_count"},ki={class:"amount_wrapper"},Ci={class:"add_counter_amount"},Si=ne(e.defineComponent({__name:"ModalAmount",setup(t){const n=me(),o=_e(),{itemThemes:r}=U.storeToRefs(o),{stateCard:a}=U.storeToRefs(n),s=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)??nt(a.value.currentModifier)}),i=()=>{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",pi,[e.createElementVNode("div",hi,[e.createElementVNode("img",{class:"modifier_image",src:((u=e.unref(a).currentModifier)==null?void 0:u.image_link)||e.unref(r).fallback_image||""},null,8,_i),e.createElementVNode("div",gi,[e.createElementVNode("p",yi,e.toDisplayString((f=e.unref(a).currentModifier)==null?void 0:f.name),1),e.createElementVNode("p",null,"+ "+e.toDisplayString(s.value)+"₽",1)])])]),e.createElementVNode("div",bi,[e.createElementVNode("div",{class:"amount_mines",onClick:d[0]||(d[0]=e.withModifiers((...g)=>e.unref(n).minusAmount&&e.unref(n).minusAmount(...g),["stop"]))},[...d[1]||(d[1]=[e.createElementVNode("div",null,null,-1)])]),e.createElementVNode("p",wi,e.toDisplayString(e.unref(a).modalCount),1),e.createElementVNode("div",ki,[e.createVNode(Qt,{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",Ci,[e.createVNode(Re,{textButtonDefault:"Добавить",onClick:i,class:"button_add_group_modifiers"})])],64)}}}),[["__scopeId","data-v-6b4f039c"]]),Ei=(t,n,o)=>Math.max(n,Math.min(t,o)),Ni=(t,n)=>Math.pow(t,n*5),bo=(t,n,o)=>n===0||Math.abs(n)===1/0?Ni(t,o):t*n*o/(n+o*t),xt=(t,n)=>n*parseFloat(t)/100,on=(t,n,o,r=.15)=>r===0?Ei(t,n,o):t<n?-bo(n-t,o-n,r)+n:t>o?+bo(t-o,o-n,r)+o:t,Se=(t,{min:n,max:o})=>n!==void 0&&t<n?n:o!==void 0&&t>o?o:t;function xi(t,n,o){const r=e.ref(0),a=e.computed(()=>t.value.map(c=>typeof c=="string"?xt(c,o.value):c)),s=e.computed(()=>Math.min(...a.value)),i=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:r,flattenedSnapPoints:a,minSnapPoint:s,maxSnapPoint:i,closestSnapPointIndex:l}}const wo=ne(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:o}){const r=t,a=o,s=Ee.useVModel(r,"modelValue",a,{passive:!0});e.watch(s,j=>{j&&x()}),e.onMounted(()=>{s.value&&x()});const i=e.ref(),l=e.ref(null),c=e.ref(null),d=e.ref(null),u=e.ref(null),f=e.ref(r.expandOnContentDrag),{height:g}=Ee.useWindowSize(),{height:_}=Ee.useElementBounding(i),{height:m}=Ee.useElementBounding(l),{height:y}=Ee.useElementBounding(u),{height:S}=Ee.useElementBounding(c),w=e.computed({get(){return Se(Math.ceil(y.value+m.value+S.value),{max:g.value})},set(j){[m.value,y.value,S.value]=j}}),h=e.ref(0),p=e.ref(0),v=pe.useMotionValue(0),D=pe.useMotionValue(0),{snapPoints:O}=e.toRefs(r),R=e.computed(()=>O.value??[w.value]),{flattenedSnapPoints:M,currentSnapPointIndex:k,closestSnapPointIndex:N,minSnapPoint:B,maxSnapPoint:I}=xi(R,h,g);let P;function T(j){f.value=!0,C(j)}function C(j){f.value&&j.preventDefault()}const A=j=>{j.key==="Escape"&&L()},$=()=>{r.canBackdropClose&&L()};let b=!1;const x=async()=>{if(b)return;s.value=!0,b=!0,a("opening-started"),await e.nextTick();const j=i.value.$el;_.value=j.getBoundingClientRect().height;const Y=j.querySelector("[data-vsbs-content]"),re=j.querySelector("[data-vsbs-header]"),ie=j.querySelector("[data-vsbs-footer]");if(w.value=[re.getBoundingClientRect().height,Y.getBoundingClientRect().height,ie.getBoundingClientRect().height],await e.nextTick(),k.value=M.value.findIndex(se=>se===B.value),r.initialSnapPoint){const se=r.initialSnapPoint;if(se<0||se>=R.value.length)return console.warn("Index out of bounds");h.value=typeof R.value[se]=="number"?Se(R.value[se],{max:g.value}):xt(R.value[se],g.value)}else h.value=Se(B.value,{max:g.value});p.value=h.value,v.jump(h.value),D.jump(h.value),requestAnimationFrame(()=>{P=pe.animate(v,h.value,{duration:r.duration/1e3,ease:"easeInOut"}),P=pe.animate(D,0,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>{r.blocking&&a("opened")}})}),window.addEventListener("keydown",A),b=!1};let V=!1;const L=()=>{V||(s.value=!1,V=!0,a("closing-started"),window.removeEventListener("keydown",A),setTimeout(()=>{a("closed"),V=!1},r.duration))},W=j=>{if(R.value){if(j<0||j>=R.value.length){console.warn("Index out of bounds");return}k.value=j,h.value=typeof R.value[j]=="number"?Se(R.value[j],{max:g.value}):xt(R.value[j],g.value),P=pe.animate(v,h.value,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>a("snapped",R.value.indexOf(R.value[j]))})}};function H(j){j>0?a("dragging-down"):j<0&&a("dragging-up")}const X=()=>{h.value=_.value,p.value=D.get(),v.jump(h.value),D.jump(p.value)},te=async(j,Y)=>{await e.nextTick(),i.value&&(p.value<=0&&(h.value-=Y.delta.y),h.value<=B.value&&(h.value=B.value,p.value+=Y.delta.y,D.set(r.canSwipeClose?Se(p.value,{min:0}):Se(on(p.value,-_.value,0,.5),{min:0}))),v.set(Se(on(h.value,0,I.value,.25),{min:0,max:g.value})),H(Y.delta.y))},ue=()=>{if(r.canSwipeClose){let j=h.value/2;r.swipeCloseThreshold&&typeof r.swipeCloseThreshold=="number"&&(j=r.swipeCloseThreshold),r.swipeCloseThreshold&&typeof r.swipeCloseThreshold=="string"&&r.swipeCloseThreshold.includes("%")&&(j=h.value*(Number(r.swipeCloseThreshold.replace("%",""))/100)),Math.abs(p.value)>j&&(p.value=h.value)}else p.value=0;P=pe.animate(D,p.value,{duration:r.duration/1e3,ease:"easeInOut"}),p.value===h.value&&(p.value=0,L()),k.value=N.value,h.value=typeof R.value[N.value]=="number"?Se(R.value[N.value],{max:g.value}):xt(R.value[N.value],g.value),P=pe.animate(v,h.value,{duration:r.duration/1e3,ease:"easeInOut",onComplete:()=>a("snapped",R.value.indexOf(R.value[N.value]))}),P=pe.animate(D,0,{duration:r.duration/1e3,ease:"easeInOut"})},oe=(j,Y)=>{if(h.value=_.value,p.value=D.get(),P&&P.stop(),!d.value)return;const re=d.value.scrollTop===0,ie=Y.delta.y>0,se=M.value.length===1,fe=.5>Math.abs(h.value-I.value);if(se){if(!r.expandOnContentDrag)return f.value=!1;D.get()===0&&re&&ie&&(f.value=!0),D.get()===0&&re&&!ie&&(f.value=!1)}else{if(!r.expandOnContentDrag)return f.value=!1;f.value=!0,fe&&(ie&&re&&(f.value=!0),!ie&&re&&(f.value=!1),re||(f.value=!1))}},G=async(j,Y)=>{if(await e.nextTick(),!r.expandOnContentDrag)return f.value=!1;if(!i.value)return;p.value===0&&f.value&&r.expandOnContentDrag&&(h.value-=Y.delta.y),h.value<=B.value&&(h.value=B.value,f.value&&r.expandOnContentDrag&&(p.value+=Y.delta.y),p.value=Se(p.value,{min:0,max:B.value}),D.set(r.canSwipeClose?Se(p.value,{min:0}):Se(on(p.value,-_.value,0,.5),{min:0}))),h.value>I.value&&(h.value=I.value),h.value=Se(h.value,{max:g.value}),!(M.value.length===1)&&h.value===I.value&&(f.value=!1),v.set(h.value),H(Y.delta.y)},F=()=>{if(!d.value)return;const j=d.value.scrollTop===0;f.value=j},Q=Ee.useDebounceFn(j=>W(j),r.duration);return e.watch(R,(j,Y)=>{if(s.value===!1||!j||!Y)return;const re=j[k.value],ie=Y[k.value];typeof re!="string"&&typeof ie!="string"&&(h.value=Se(re,{max:g.value}),re!==ie&&(P=pe.animate(v,h.value,{duration:r.duration/1e3,ease:"easeInOut"})))}),e.watch(g,()=>Q(k.value)),e.watch(w,j=>a("instinctHeight",j)),n({open:x,close:L,snapToPoint:W}),(j,Y)=>(e.openBlock(),e.createBlock(e.Teleport,{to:t.teleportTo,defer:t.teleportDefer},[e.createElementVNode("div",e.mergeProps(j.$attrs,{"data-vsbs-container":""}),[e.createVNode(e.unref(pe.AnimatePresence),null,{default:e.withCtx(()=>[e.unref(s)&&t.blocking?(e.openBlock(),e.createBlock(e.unref(pe.Motion),{key:0,ref:"backdrop","data-vsbs-backdrop":"",onClick:Y[0]||(Y[0]=re=>$()),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(s)?(e.openBlock(),e.createBlock(e.unref(pe.Motion),{key:0,ref_key:"sheet",ref:i,exit:{y:"100%",height:e.unref(_),opacity:0},initial:!1,style:e.normalizeStyle({y:e.unref(D),z:1,height:e.unref(v)}),"data-vsbs-shadow":!t.blocking,"data-vsbs-sheet-show":e.unref(s),"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:X,onPan:te,onPanEnd:ue,onTouchmove:T,class:e.normalizeClass(t.headerClass)},{default:e.withCtx(()=>[e.renderSlot(j.$slots,"header",{},void 0,!0)]),_:3},8,["class"]),e.createElementVNode("div",{ref_key:"sheetScroll",ref:d,"data-vsbs-scroll":"",onScrollend:F},[e.createVNode(e.unref(pe.Motion),{ref:"sheetContentWrapper","data-vsbs-content-wrapper":"",onPanStart:oe,onPan:G,onPanEnd:ue,onTouchmove:C},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"sheetContent",ref:u,"data-vsbs-content":"",class:e.normalizeClass(t.contentClass)},[e.renderSlot(j.$slots,"default",{},void 0,!0)],2)]),_:3},512)],544),e.createVNode(e.unref(pe.Motion),{ref_key:"sheetFooter",ref:c,"data-vsbs-footer":"",onPanStart:X,onPan:te,onPanEnd:ue,onTouchmove:T,class:e.normalizeClass(t.footerClass)},{default:e.withCtx(()=>[e.renderSlot(j.$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 je(t,n=null){const o=tt();o.initCacheSingle("defaultImage");const r=e.computed(()=>o.cache.defaultImage||null),a=e.shallowRef(!1),s=e.computed(()=>{var d;return((d=e.toValue(t))==null?void 0:d.toString())||null}),i=Ee.computedAsync(async()=>{const d=s.value;return d?(await o.initCacheSingle(d),o.cache[d]||null):null},null,{evaluating:a}),l=e.computed(()=>a.value&&s.value!==null);return{mediaUrl:e.computed(()=>i.value||e.toValue(n)||r.value||null),isLoading:l}}const Bi={class:"card_product_wrapper"},Ai={class:"card_product_modifiers_sheet_body"},vi={class:"card__pictures"},$i=["src"],Ti=["src"],Mi={class:"card_header_wrapper"},Pi={key:0,class:"card_fire_kkal_wrapper"},Vi={class:"card_content"},Ii={class:"wrapper_size"},Ri={key:0,class:"description"},Di={key:1},Oi=ne(e.defineComponent({__name:"CardProductPage",props:{configPage:{}},setup(t){const n=_e(),o=me(),{stateCard:r,isOpenWindow:a}=U.storeToRefs(o),{itemThemes:s}=U.storeToRefs(n),i=K.useRouter(),l=K.useRoute(),c=t,{mediaUrl:d}=je(()=>{var g,_;return(g=r.value.openCard)!=null&&g.video_link?`${r.value.openCard.id}_video`:(_=r.value.openCard)!=null&&_.image_link?`${r.value.openCard.id}_image`:null},()=>{var g,_;return((g=r.value.openCard)==null?void 0:g.video_link)||((_=r.value.openCard)==null?void 0:_.image_link)||null}),u=()=>{c.configPage.qr_menu?i.push(`/${l.params.orgId}`):c.configPage.closeProduct()},f=()=>{r.value.isModifiedAmount=!1};return e.watch(()=>c.configPage.data,o.setCurrentCard),e.watchEffect(()=>{a.value||(a.value=c.configPage.is_closeProduct)}),e.onBeforeUnmount(()=>o.reset()),(g,_)=>{var m,y,S,w,h,p;return e.openBlock(),e.createElementBlock("div",Bi,[e.createVNode(e.unref(wo),{modelValue:e.unref(r).isSectionModifier,"onUpdate:modelValue":_[1]||(_[1]=v=>e.unref(r).isSectionModifier=v),class:"card_product_modifiers_sheet"},{default:e.withCtx(()=>[e.createElementVNode("div",Ai,[e.createVNode(Us,{onClose:_[0]||(_[0]=v=>e.unref(r).isSectionModifier=!1)}),e.createVNode(go,{isSectionModifier:e.unref(r).isSectionModifier,toggleNotRequire:e.unref(o).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])]),_:1},8,["modelValue"]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(r).isModifiedAmount?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wrapper_modified_amount",onClick:e.withModifiers(f,["stop"])},[e.createVNode(Si)])):e.createCommentVNode("",!0)])),e.createElementVNode("div",vi,[(m=e.unref(r).openCard)!=null&&m.video_link&&e.unref(d)?(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,$i)])):(e.openBlock(),e.createElementBlock("img",{key:1,class:"card__pictures_images",src:e.unref(d)||"",alt:"Product image"},null,8,Ti)),e.createElementVNode("div",Mi,[e.createVNode(en,{class:"card_header_back",onClick:u,"aria-label":"Вернуться назад"}),(y=e.unref(r).openCard)!=null&&y.energy_amount?(e.openBlock(),e.createElementBlock("div",Pi,[_[3]||(_[3]=e.createElementVNode("div",{class:"card_fire_kkal"},null,-1)),e.createElementVNode("p",null,[e.createElementVNode("b",null,e.toDisplayString((S=e.unref(r).openCard)==null?void 0:S.energy_amount),1),_[2]||(_[2]=e.createTextVNode(" Ккал ",-1))])])):e.createCommentVNode("",!0)]),e.createElementVNode("h4",null,e.toDisplayString((w=e.unref(r).openCard)==null?void 0:w.name),1),e.createElementVNode("div",{class:"card__pictures__gradient",style:e.normalizeStyle(e.unref(s).gradientStyle)},null,4)]),e.createElementVNode("div",Vi,[e.createElementVNode("div",Ii,[e.createVNode(Gs)]),(h=e.unref(r).openCard)!=null&&h.description?(e.openBlock(),e.createElementBlock("p",Ri,e.toDisplayString((p=e.unref(r).openCard)==null?void 0:p.description),1)):e.createCommentVNode("",!0),e.unref(r).groupModifiers.length?(e.openBlock(),e.createElementBlock("div",Di,[_[4]||(_[4]=e.createElementVNode("p",{class:"title_info_modifiers"},"Настрой, как ты любишь",-1)),e.createVNode(go,{isSectionModifier:e.unref(r).isSectionModifier,toggleNotRequire:e.unref(o).toggleNotRequire},null,8,["isSectionModifier","toggleNotRequire"])])):e.createCommentVNode("",!0),e.createVNode(mi,{qr_menu:t.configPage.qr_menu,closeProduct:t.configPage.closeProduct},null,8,["qr_menu","closeProduct"])])])}}}),[["__scopeId","data-v-732bba57"]]),Fi={key:0,class:"popupWindowDefault_overlay"},ko=ne(e.defineComponent({__name:"PopupWindowDefault",props:{visible:{type:Boolean}},emits:["update:visible"],setup(t,{emit:n}){const o=t,r=n,a=()=>{r("update:visible",!1)};return e.watch(()=>o.visible,async s=>{s&&await e.nextTick(),o.isVisible=s}),(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"popupWindowDefaultBlack",appear:"",onAfterLeave:i[0]||(i[0]=()=>{r("update:visible",!1)})},{default:e.withCtx(()=>[o.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:i[1]||(i[1]=()=>{r("update:visible",!1)})},{default:e.withCtx(()=>[o.visible?(e.openBlock(),e.createElementBlock("div",Fi,[e.renderSlot(s.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]),_:3})],64))}}),[["__scopeId","data-v-08e0e008"]]),Li={},zi={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ui(t,n){return e.openBlock(),e.createElementBlock("svg",zi,[...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 ji=ne(Li,[["render",Ui]]),rn=U.defineStore("modals",()=>{const t=new Map,n=(a,s)=>{const i=r(a).value;i.visible=!0,i.context=s},o=a=>{const s=r(a).value;s.visible=!1},r=a=>(t.has(a)||t.set(a,e.ref({visible:!1})),t.get(a));return{state:r,open:n,close:o}}),Hi=["src"],qi={class:"cart_box_content_wrapper"},Wi={class:"cart_box_content_info"},Gi={class:"cart_amount"},Ki={class:"cart_amount_count"},Ji={class:"cart_box_info_more"},Xi={key:1,class:"cart_modifier_info"},Zi={class:"cart_modifier_content"},Yi={class:"wrapper_price_count_cart"},Qi={class:"count_cart_box"},el={class:"wrapper_modifiers_discount"},Co=ne(e.defineComponent({__name:"CartBox",props:{index:Number,cardItem:Object},emits:["delete"],setup(t,{emit:n}){const o=t,r=ce(),a=_e(),s=rn(),{itemThemes:i}=U.storeToRefs(a),l=e.ref(0),c=e.ref(0),d=e.ref(!1),u=e.ref(!1),f=e.ref(!1),{displayNumber:g,update:_}=yo(0,800),m=e.computed(()=>{var B,I;const k=((B=o.cardItem)==null?void 0:B.modifiers)??[],N=(((I=o.cardItem)==null?void 0:I.group_modifiers)??[]).flatMap(P=>P.modifiers??[]);return[...k,...N]}),{mediaUrl:y}=je(()=>{var k;return((k=o.cardItem)==null?void 0:k.id)+"_image"},()=>{var k;return(k=o.cardItem)==null?void 0:k.image_link}),S=e.computed(()=>{var k,N;return((k=o.cardItem)==null?void 0:k.total_new_price)||nt(o.cardItem)*((N=o.cardItem)==null?void 0:N.amount)}),w=()=>s.open("cart-delete-confirm",o.cardItem),h=()=>{f.value=!f.value},p=()=>{r.plusAmount(o.cardItem.idSystem)},v=()=>{o.cardItem.amount>1?r.minusAmount(o.cardItem.idSystem):w()},D=k=>{l.value=k.touches[0].clientX,d.value=!0},O=k=>{d.value&&(c.value=k.touches[0].clientX-l.value,c.value>0&&(c.value=0))},R=()=>{d.value=!1,c.value<-115&&w(),c.value=0};e.onMounted(()=>{o.index===0&&(u.value=!0,setTimeout(()=>{c.value=-90,setTimeout(()=>{c.value=0,u.value=!1},700)},0))});const M=e.computed(()=>{const k=o.index===0&&u.value?1:`${1-Math.abs(c.value)/200}`;return{transform:`translateX(${c.value}px)`,opacity:k,transition:d.value?"none":"transform 0.7s, opacity 0.7s"}});return e.watch(S,_,{immediate:!0}),(k,N)=>{var B,I,P,T;return e.openBlock(),e.createElementBlock("div",{class:"cart_box_wrapper",onTouchstart:D,onTouchmove:O,onTouchend:R,style:e.normalizeStyle(M.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,Hi),e.createElementVNode("div",qi,[e.createElementVNode("div",Wi,[e.createElementVNode("p",null,e.toDisplayString((B=t.cardItem)==null?void 0:B.name),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((I=o.cardItem)==null?void 0:I.discounts)||[],(C,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,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",Gi,[e.createElementVNode("button",{onClick:v},"-"),e.createElementVNode("p",Ki,e.toDisplayString(o.cardItem.amount),1),e.createElementVNode("button",{onClick:p},"+")])]),e.createElementVNode("div",Ji,[e.createElementVNode("div",{class:"cart_box_remove_item",onClick:w},[e.createVNode(ji)]),(P=o.cardItem)!=null&&P.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(T=o.cardItem)==null?void 0:T.new_price})},e.toDisplayString((o.cardItem.new_price*o.cardItem.amount).toFixed(2)+"₽"),3)):e.createCommentVNode("",!0),e.createElementVNode("p",null,e.toDisplayString(e.unref(g).toFixed(2)+"₽"),1)])]),!f.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_modifier_toggle",onTouchstart:e.withModifiers(h,["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",Xi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,C=>{var A;return e.openBlock(),e.createElementBlock("div",{class:"cart_modifier_item",key:C.id},[e.createElementVNode("div",Zi,[e.createVNode(Qt,{id:"plus_orange"}),e.createElementVNode("p",null,e.toDisplayString(C.name),1)]),e.createElementVNode("div",Yi,[e.createElementVNode("p",Qi,e.toDisplayString(`x${C.amount}`),1),e.createElementVNode("div",el,[C!=null&&C.new_price?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass({discount_new_price:(A=C==null?void 0:C.new_price)==null?void 0:A.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(h,["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-e48a9689"]]),tl={},nl={class:"nfc_x",viewBox:"0 0 48 48"};function ol(t,n){return e.openBlock(),e.createElementBlock("svg",nl,[...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 rl=ne(tl,[["render",ol]]),al={},sl={style:{},"aria-hidden":"true",viewBox:"0 0 48 48",class:"nfc_ok"};function il(t,n){return e.openBlock(),e.createElementBlock("svg",sl,[...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 ll=ne(al,[["render",il]]),cl={key:0,class:"nfc_ok",viewBox:"0 0 48 48","aria-hidden":"true"},dl=e.defineComponent({__name:"CardReaderRetry",props:{styleRetry:{type:Boolean}},setup(t){return(n,o)=>t.styleRetry?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",cl,[...o[0]||(o[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)])]))}}),ul={class:"sheet_header"},fl={class:"sheet_title",id:"sheetTitle"},ml={class:"sheet_body"},pl={class:"sheet_card"},hl={class:"nfc_title"},_l={class:"lead"},gl={class:"wrapper_input_accept"},yl={key:0,class:"card_phone_auth_wrapper"},bl={class:"sr_only","aria-live":"polite"},So=e.defineComponent({__name:"CardReader",setup(t){const n=ce(),o=_e(),{is_OpenLoyal:r}=U.storeToRefs(n),{itemThemes:a}=U.storeToRefs(o),s=Fe(),i=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:$=>{d.value=$.replace(/\s/g,"")}}),g=e.computed(()=>s.currentState),_=e.computed(()=>s.isDrawerOpen),m=e.computed(()=>{var $;return(($=u[g.value])==null?void 0:$.text)||""}),y=e.computed(()=>{var $;($=u[g.value])!=null&&$.title}),S=e.computed(()=>g.value==="success"?"Добро пожаловать!":a.value.kiosk_show_loyalty_phone_input_button?"Поднесите стикер к считывателю или войдите по номеру телефона":"Поднесите стикер к считывателю или введите номер карты вручную"),w=e.computed(()=>({ok:g.value==="success",warn:g.value==="not_found"})),h=e.computed(()=>{const $=[];return g.value==="wait"&&$.push("pulse","show-x"),g.value==="not_found"&&$.push("pulse","show-x"),g.value==="success"&&$.push("pulse","show-ok"),$}),p=e.computed(()=>g.value==="not_found"),v=e.computed(()=>g.value==="success"),D=e.computed(()=>g.value==="not_found"),O=e.computed(()=>["not_found"].includes(g.value)),R=e.computed(()=>({wait:"Стикер не распознан. Нажмите «Повторить».",success:"Стикер распознан. Нажмите «Продолжить».",not_found:"Стикер не распознан. Нажмите «Повторить»."})[g.value]||""),M=()=>{s.closeDrawer(),r.value=!0},k=async $=>{var b,x;s.error="",c.value=null;try{const V=new Ve;await V.authorizeByCard($.trim()),await V.getProfile(),n.loadCart(),s.setState("success"),s.isDrawerOpen=!1,s.showNotification("Вы успешно авторизовались в программе лояльности!")}catch(V){s.error=((x=(b=V.response)==null?void 0:b.data)==null?void 0:x.user_friendly_message)||"Ошибка",s.setState("not_found"),c.value=f.value,f.value=""}},N=()=>{var $;s.setState("wait"),s.error="",f.value="",c.value=null,($=i.value)==null||$.focus()},B=()=>{s.closeDrawer(),c.value=null,f.value=""},I=()=>{var $,b;s.setState("wait"),(b=($=f.value)==null?void 0:$.trim())!=null&&b.length&&k(f.value.trim())},P=$=>{$.stopPropagation(),document.activeElement!==l.value&&T()},T=()=>{e.nextTick(()=>{l.value&&(l.value.focus(),d.value&&l.value.select())})},C=$=>{const b=document.activeElement===l.value;if(!_.value||b)return;const x=$.key.toLowerCase();if(x==="backspace")return f.value=f.value.slice(0,-1);if(x==="escape")return B();if(x==="r"&&D.value)return N();if(x==="c"&&g.value==="success")return B();if(x==="enter")return I();f.value+=x},A={mounted($){$==null||$.focus()}};return e.onMounted(()=>{document==null||document.addEventListener("keydown",C)}),e.onBeforeUnmount(()=>{document==null||document.removeEventListener("keydown",C)}),e.watchEffect(()=>{_.value&&(s.error="")}),($,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[_.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"backdrop show",onClick:B,"aria-hidden":"true"})):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass(["sheet show",{sheet_retry:D.value}]),"aria-modal":"true","aria-labelledby":"sheetTitle",onClick:P},[e.createElementVNode("header",ul,[e.createElementVNode("div",fl,e.toDisplayString(m.value),1),D.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:B,"aria-label":"Закрыть"}," Закрыть ")]),e.createElementVNode("div",ml,[e.createElementVNode("div",pl,[e.createElementVNode("div",{class:e.normalizeClass(["nfc",h.value])},[e.createVNode(dl,{styleRetry:O.value},null,8,["styleRetry"]),p.value?(e.openBlock(),e.createBlock(rl,{key:0})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"overlay check",style:e.normalizeStyle({display:v.value?"grid":"none"}),"aria-hidden":"true"},[e.createVNode(ll)],4)],2),e.createElementVNode("h2",hl,e.toDisplayString(y.value),1),e.createElementVNode("p",_l,e.toDisplayString(S.value),1),e.createElementVNode("div",gl,[e.withDirectives(e.createElementVNode("input",{ref_key:"cardInputManualRef",ref:l,"onUpdate:modelValue":b[0]||(b[0]=x=>f.value=x),class:"nfc_title_read_input",type:"text",placeholder:"Введите трек карты","aria-live":"polite",onKeydown:e.withKeys(I,["enter"])},null,544),[[e.vModelText,f.value],[A]]),D.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:b[1]||(b[1]=x=>D.value?B:I())},"Отправить"))]),g.value==="wait"&&e.unref(a).kiosk_show_loyalty_phone_input_button?(e.openBlock(),e.createElementBlock("div",yl,[e.createElementVNode("button",{class:"card_phone_auth_button",onClick:M},"Войти по номеру телефона")])):e.createCommentVNode("",!0)])]),e.createElementVNode("input",{ref_key:"cardInputRef",ref:i,type:"text",class:"sr_only","aria-live":"polite"},null,512),e.createElementVNode("div",bl,e.toDisplayString(R.value),1)],2)):e.createCommentVNode("",!0)],64))}}),wl={class:"start_page"},kl=["src"],Cl={class:"wrap"},Sl={class:"wrap_box"},El={class:"title_fiscal_order"},Nl={class:"wrapper_accept"},xl={ref:"barRef",class:"bar_complete","aria-hidden":"true"},Bl=ne(e.defineComponent({__name:"CartCompleteKioskSuccess",props:{mediaUrl:{},orderNumber:{}},setup(t){const n=ce(),o=Fe(),r=me(),a=_e(),{cartProducts_lib:s}=U.storeToRefs(n),{orderNumber:i,orderCompleted_lib:l}=U.storeToRefs(o),{is_startPage:c}=U.storeToRefs(r),{mediaUrl:d}=je(()=>a.itemThemes.kiosk_preloader?"preloader":null),u=K.useRouter(),f=K.useRoute();let g=null;e.onMounted(()=>{g=setTimeout(()=>{c.value=!0,u.replace(`/${f.params.orgId}`)},1e4)});const _=()=>{Ke(["cart","authTokensAccess","authTokensRefresh"]),s.value=[],l.value=null,o.clearCard(),n.profile=null,u.replace(`/${f.params.orgId}`)};return e.onUnmounted(()=>{g&&clearInterval(g)}),(m,y)=>(e.openBlock(),e.createElementBlock("div",wl,[(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,kl)])),y[4]||(y[4]=e.createElementVNode("div",{class:"start_img_black"},null,-1)),e.createElementVNode("div",Cl,[e.createElementVNode("div",Sl,[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",El,"№ "+e.toDisplayString(e.unref(i)),1),y[3]||(y[3]=e.createElementVNode("p",{class:"title_fiscal_completed"},"Спасибо! Заказ передан в работу.",-1)),e.createElementVNode("div",Nl,[e.createElementVNode("button",{class:"btn","aria-label":"Новый заказ",onClick:_},[y[0]||(y[0]=e.createElementVNode("span",{class:"label"},"Новый заказ",-1)),e.createElementVNode("span",xl,null,512)])])])])]))}}),[["__scopeId","data-v-c07b734f"]]),Al={};function vl(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 $l=ne(Al,[["render",vl],["__scopeId","data-v-3e03a6dc"]]),Tl={},Ml={class:"center"};function Pl(t,n){return e.openBlock(),e.createElementBlock("div",Ml,[...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 Vl=ne(Tl,[["render",Pl],["__scopeId","data-v-f0859fd1"]]),Il={key:0,class:"wrapper_qr"},Rl={key:1,class:"wrapper_qr"},Dl={key:2,class:"wrapper_qr"},Ol=ne(e.defineComponent({__name:"CartCompletedOrder",props:{orderNumber:{}},setup(t){const n=Fe(),o=_e(),{orderNumber:r,orderCompleted_lib:a}=U.storeToRefs(n),{mediaUrl:s}=je(()=>o.itemThemes.kiosk_preloader?"preloader":null);return(i,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(a)&&e.unref(a)===1?(e.openBlock(),e.createElementBlock("section",Il,[e.createVNode($l)])):e.unref(a)&&e.unref(a)===2?(e.openBlock(),e.createElementBlock("section",Rl,[e.createVNode(Vl)])):e.createCommentVNode("",!0),e.unref(a)&&e.unref(a)===3?(e.openBlock(),e.createElementBlock("section",Dl,[e.createVNode(Bl,{orderNumber:e.unref(r),mediaUrl:e.unref(s)},null,8,["orderNumber","mediaUrl"])])):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-a3446a00"]]),Fl={},Ll={class:"cart_loyal_qr",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function zl(t,n){return e.openBlock(),e.createElementBlock("svg",Ll,[...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 Ul=ne(Fl,[["render",zl]]),Eo=t=>{const n=rn(),o=l=>n.open(t,l),r=()=>n.close(t),a=n.state(t),s=e.computed({get:()=>a.value.visible,set:l=>l&&o()||r()}),i=e.computed(()=>a.value.context);return{visible:s,context:i,open:o,close:r}},jl={class:"cart_deletion_modal_content"},Hl={class:"cart_deletion_modal_title"},ql={class:"cart_deletion_modal_footer"},Wl=ne(e.defineComponent({__name:"CartDeleteConfirm",emits:["confirm"],setup(t,{emit:n}){const o=n,{visible:r,context:a,close:s}=Eo("cart-delete-confirm"),i=()=>{o("confirm",a.value.idSystem),s()};return(l,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cart_deletion_modal_overlay",onClick:c[1]||(c[1]=e.withModifiers((...d)=>e.unref(s)&&e.unref(s)(...d),["self"]))},[e.createElementVNode("div",jl,[e.createElementVNode("div",Hl,"Удалить "+e.toDisplayString(e.unref(a).name)+"?",1),c[2]||(c[2]=e.createElementVNode("div",{class:"cart_deletion_modal_body"},"Эта позиция будет полностью удалена из заказа.",-1)),e.createElementVNode("div",ql,[e.createElementVNode("button",{class:"primary",onClick:i}," Удалить "),e.createElementVNode("button",{onClick:c[0]||(c[0]=(...d)=>e.unref(s)&&e.unref(s)(...d))},"Отмена")])])])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-018f66f3"]]),Gl={class:"cart_wrapper"},Kl={class:"cart_header_content"},Jl={class:"cart_kso_loyal_wrapper"},Xl={key:0},Zl={class:"cart_header_wrapper"},Yl=["src"],Ql={class:"cart_header_info"},ec={class:"cart_header_info"},tc={class:"cart_header_info"},nc={class:"cart_header_info"},oc={key:0},rc={key:0,class:"wrapper_comment"},ac={class:"wrapper_limit_in_area"},sc={class:"limit_comment"},ic={class:"cart_cards"},lc={class:"cart_footer_wrapper"},cc={key:0,class:"footer_title"},dc=["disabled","max"],uc={key:1,class:"footer_sales"},fc=["max"],mc={class:"list_price"},pc={key:0},hc={key:1},_c={key:2},gc={class:"accept_field"},yc={class:"accept_field"},bc={key:3},wc={class:"accept_field"},kc={class:"accept_field"},Cc={class:"accept_field"},Sc={class:"wrapper_footer_cart_btn"},Ec=e.defineComponent({__name:"CartPage",props:{configPage:{},textPaymentBtn:{},config_qr:{type:Boolean}},setup(t){const n=ce(),o=Fe(),r=_e(),a=me(),s=t,{totalPrice_lib:i,countBonus:l,config_lib:c,cartProducts_lib:d,profile:u}=U.storeToRefs(n),{itemThemes:f}=U.storeToRefs(r),{textPaymentBtn_lib:g,isButtonDisabled:_,orderCompleted_lib:m,orderNumber:y,extraDiscount:S,is_notification_lib:w,notificationData_lib:h}=U.storeToRefs(o),{isAddToCard:p}=U.storeToRefs(a),v=K.useRouter(),D=K.useRoute(),O=e.useTemplateRef("stickerLoyality"),R=e.ref(!1),M=e.ref(!1),k=e.ref(""),N=e.ref(!1),B=e.ref(0),I=e.ref(!1),P=e.ref(0),T=e.ref(),{width:C}=Ee.useElementSize(O,{width:0,height:0},{box:"border-box"}),A=e.computed(()=>{const G={energy_amount:0,proteins_amount:0,fat_amount:0,carbohydrates_amount:0};return d.value.reduce((F,Q)=>(F.energy_amount+=(Q.energy_amount||0)*(Q.amount||0),F.proteins_amount+=(Q.proteins_amount||0)*(Q.amount||0),F.fat_amount+=(Q.fat_amount||0)*(Q.amount||0),F.carbohydrates_amount+=(Q.carbohydrates_amount||0)*(Q.amount||0),F),G)}),$=()=>v.push(`/${D.params.orgId}/`),b=G=>{["a","A","+","-",".",","].includes(G.key)&&G.preventDefault()},x=G=>{n.deleteItemFromCart(G)},V=()=>{N.value=!N.value,k.value.length},L=()=>{var F,Q,j;let G=Math.floor(l.value);G<0||!G?G=0:((F=u.value)==null?void 0:F.balance)>i.value?G>i.value-1&&(G=i.value-1):G>((Q=u.value)==null?void 0:Q.balance)&&(G=(j=u.value)==null?void 0:j.balance),G!==l.value&&n.setBonus(G)};e.watchEffect(()=>{L(),n.setBonus(i.value===0?0:Math.floor(l.value))});const W=()=>d.value.map(G=>({id:G.id,front_item_id:G.idSystem,is_fake:!!G.is_fake,removals:G.removals??null,amount:G.amount,size:G.size,modifiers:G.modifiers??[],group_modifiers:G.group_modifiers??[]})),H=async()=>{_.value=!0;try{return await Ve.create().createOrder(W(),s.configPage.tableDataId,s.configPage.kiosk_menu,k.value,!!s.configPage.userData||!!u.value,s.configPage.is_tableservice)}catch(G){throw s.configPage.kiosk_menu?(G.status===403&&(localStorage.removeItem("apiKey"),n.is_showApiKey=!0,v.push(`/${D.params.orgId}/retryPage`)),o.deleteCart("retryPage",s.configPage.kiosk_menu)):s.configPage.is_tableservice?o.showNotification(G.response.data.user_friendly_message):v.push(`/${D.params.orgId}/errorPayment`),_.value=!1,G}},X=()=>{if(!u.value&&s.configPage.qr_menu){v.push(`/${D.params.orgId}/register`);return}p.value=!1,m.value=1,c.value.has_rms_discount?o.makeInitPaymentLinkRequest(T.value,s.configPage.kiosk_menu,s.configPage.is_tableservice).then(()=>T.value=null):H()},te=async()=>{var Q;S.value=0,_.value=!0;const G={items:[...W()],combos:[]},F=Ve.create();try{I.value=!0;const j=await F.calculateDiscount(G,s.configPage.kiosk_menu,!!s.configPage.userData||!!u.value);if(!d.value)return;if(d.value.forEach(Y=>{const re=j.items.find(ie=>ie.front_item_id===Y.idSystem);if(re&&(Y.group_modifiers.forEach(ie=>{const se=re.group_modifiers.find(fe=>fe.group===ie.group);se&&ie.modifiers.forEach(fe=>{const ke=se.modifiers.find(de=>de.id===fe.id);if(ke&&Number(fe.price)!==Number(ke==null?void 0:ke.new_price)){const de=(ke.discounts||[]).reduce((Oo,Jd)=>Oo+=+Jd.discount,0);B.value+=de,fe.new_price=fe.price,fe.price=Number(ke==null?void 0:ke.new_price),fe.total_new_price=Number(ke.total_new_price)}})}),Y.modifiers.forEach(ie=>{const se=re.modifiers.find(fe=>fe.id===ie.id);if(se&&Number(ie.price)!==Number(se==null?void 0:se.new_price)){const fe=(se.discounts||[]).reduce((ke,de)=>ke+=+de.discount,0);B.value+=fe,ie.new_price=ie.price,ie.price=Number(se==null?void 0:se.new_price),ie.total_new_price=Number(se.total_new_price)}}),Y.price!==Number(re.new_price))){const ie=(re.discounts||[]).reduce((se,fe)=>se+=+fe.discount,0);B.value=B.value+ie,Y.new_price=Y.price,Y.price=re.new_price,Y.discounts=re.discounts,Y.total_new_price=Number(re.total_new_price)}}),d.value=[...d.value],B.value!==0&&(i.value=j.total_cart_price),c.value.has_rms_discount){const Y=await H();T.value=(Q=Y.data)==null?void 0:Q.id}else _.value=!1;M.value=!1}catch(j){console.log("Ошибка скидок [CartPage calculateDiscount]",j),o.showNotification("Скидки временно недоступны"),I.value=!1,M.value=c.value.has_rms_discount,_.value=!1}},ue=()=>{var G;(G=u.value)!=null&&G.balance?u.value.balance>=1&&(R.value=!R.value):o.showNotification("У Вас пока нет бонусов")},oe=()=>{var G,F;c.value.has_rms_discount&&(s.configPage.kiosk_menu||s.configPage.qr_menu&&u.value)?(T.value=null,M.value=!0):((G=c.value)==null?void 0:G.loyalty)==="IIKO"&&(c.value.has_loyalty_default_user||u.value)&&s.configPage.kiosk_menu||((F=c.value)==null?void 0:F.loyalty)==="IIKO"&&s.configPage.qr_menu&&u.value?M.value=!0:M.value=!1};return e.onMounted(async()=>{g.value=s.textPaymentBtn,n.loadCart(),m.value=null,i.value=null,S.value=0,d.value.splice(0,d.value.length,...d.value.map(n.makeProductFullyReactive))}),e.onUnmounted(()=>{T.value=null,m.value=null,i.value=null,S.value=0,d.value.splice(0,d.value.length,...d.value.map(n.makeProductFullyReactive))}),e.watchEffect(()=>{!c.value.has_rms_discount&&["ОПЛАТИТЬ","СОЗДАТЬ ЗАКАЗ"].includes(g.value.toUpperCase())?_.value=n.cartProducts_lib.length===0||i.value===0:(_.value=!1,m.value=null)}),e.watch([()=>n.cartProducts_lib,u],G=>{if(P.value>0){P.value--;return}G&&!I.value&&(oe(),d.value.splice(0,d.value.length,...d.value.map(n.makeProductFullyReactive)),B.value=0,i.value=null,S.value=0,P.value=1),I.value=!1},{deep:!0}),(G,F)=>{var Q,j,Y,re,ie,se,fe,ke;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Gl,[e.createVNode(Wl,{onConfirm:x}),e.createVNode(ko,{visible:e.unref(o).isDrawerOpen,"onUpdate:visible":F[0]||(F[0]=de=>e.unref(o).isDrawerOpen=de)},{default:e.withCtx(()=>[e.createVNode(So)]),_:1},8,["visible"]),e.createElementVNode("header",Kl,[e.createElementVNode("div",Jl,[e.createElementVNode("div",{class:e.normalizeClass(["arrow_wrapper",{arrow_wrapper_kso:s.configPage.kiosk_menu}]),onClick:$},[e.createVNode(en,{class:"cart_header_back_button"}),s.configPage.kiosk_menu?(e.openBlock(),e.createElementBlock("span",Xl,"Назад")):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",Zl,[(e.unref(f).kiosk_show_loyalty_card_button||e.unref(f).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:`${Math.ceil(e.unref(C)/2+10)}px`,paddingRight:(Q=e.unref(f).cart_loyalty_button)!=null&&Q.cart_loyalty_button_sticker?0:""}),onClick:F[1]||(F[1]=(...de)=>e.unref(o).openDrawer&&e.unref(o).openDrawer(...de))},[e.createElementVNode("p",{class:"cart_loyal_program",style:e.normalizeStyle({marginRight:`${Math.ceil(e.unref(C)/2)}px`})},e.toDisplayString(((j=e.unref(f).cart_loyalty_button)==null?void 0:j.cart_loyalty_button_text)||"Программа лояльности"),5),(Y=e.unref(f).cart_loyalty_button)!=null&&Y.cart_loyalty_button_sticker?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"stickerLoyality",ref:O,class:"cart_loyal_program_icon",style:e.normalizeStyle({"--sticker-mask":`url(${e.unref(f).cart_loyalty_button.cart_loyalty_button_sticker})`})},[e.createElementVNode("img",{src:e.unref(f).cart_loyalty_button.cart_loyalty_button_sticker},null,8,Yl)],4)):(e.openBlock(),e.createBlock(Ul,{key:1,class:"cart_loyal_qr"}))],4)):e.createCommentVNode("",!0),e.unref(f).show_nutrition_in_cart?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cart_header",style:e.normalizeStyle({paddingTop:s.config_qr?0:"10px"})},[e.createElementVNode("div",Ql,[e.createElementVNode("p",null,[e.createVNode(ve,{price:A.value.energy_amount,duration:800},null,8,["price"]),F[6]||(F[6]=e.createTextVNode(" г",-1))]),F[7]||(F[7]=e.createElementVNode("p",{class:"cart_info_name"},"Килокалории",-1))]),e.createElementVNode("div",ec,[e.createElementVNode("p",null,[e.createVNode(ve,{price:A.value.proteins_amount,duration:900},null,8,["price"]),F[8]||(F[8]=e.createTextVNode(" г",-1))]),F[9]||(F[9]=e.createElementVNode("p",{class:"cart_info_name"},"Белки",-1))]),e.createElementVNode("div",tc,[e.createElementVNode("p",null,[e.createVNode(ve,{price:A.value.fat_amount,duration:1e3},null,8,["price"]),F[10]||(F[10]=e.createTextVNode(" г",-1))]),F[11]||(F[11]=e.createElementVNode("p",{class:"cart_info_name"},"Жиры",-1))]),e.createElementVNode("div",nc,[e.createElementVNode("p",null,[e.createVNode(ve,{price:A.value.carbohydrates_amount,duration:1100},null,8,["price"]),F[12]||(F[12]=e.createTextVNode(" г",-1))]),F[13]||(F[13]=e.createElementVNode("p",{class:"cart_info_name"},"Углеводы",-1))])],4)):e.createCommentVNode("",!0)])]),t.config_qr&&e.unref(f).show_order_comment?(e.openBlock(),e.createElementBlock("div",oc,[N.value?(e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("div",ac,[e.withDirectives(e.createElementVNode("textarea",{class:"comment_order",placeholder:"Ваш комментарий к заказу...",name:"comment",maxlength:"50","onUpdate:modelValue":F[2]||(F[2]=de=>k.value=de)},null,512),[[e.vModelText,k.value]]),e.createElementVNode("p",sc,e.toDisplayString(k.value.length+" / 50"),1)]),e.createVNode(Re,{textButtonDefault:"Сохранить",onClick:V,class:"button_bonus_cart"})])):e.createCommentVNode("",!0),!N.value&&e.unref(d).length>0?(e.openBlock(),e.createBlock(Re,{key:1,textButtonDefault:k.value.length>0?"Редактировать":"Комментарий к заказу",onClick:()=>N.value=!N.value,id:"button_comments"},null,8,["textButtonDefault","onClick"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),de=>(e.openBlock(),e.createBlock(Co,{key:de.idSystem,cardItem:de,onDelete:Oo=>x(de.idSystem)},null,8,["cardItem","onDelete"]))),128))]),e.createElementVNode("div",lc,[R.value?(e.openBlock(),e.createElementBlock("p",cc,[F[14]||(F[14]=e.createTextVNode(" Списать ",-1)),e.withDirectives(e.createElementVNode("input",{type:"number",placeholder:"0",style:e.normalizeStyle({maxWidth:`${e.unref(l).toString().length||1}em`}),disabled:e.unref(u)===null||((re=e.unref(u))==null?void 0:re.balance)===0,"onUpdate:modelValue":F[3]||(F[3]=de=>e.isRef(l)?l.value=de:null),onInput:L,min:"0",max:((ie=e.unref(u))==null?void 0:ie.balance)>e.unref(i)?Math.floor(e.unref(i)):(se=e.unref(u))==null?void 0:se.balance,onKeypress:b},null,44,dc),[[e.vModelText,e.unref(l),void 0,{number:!0}]]),F[15]||(F[15]=e.createTextVNode(" бонусов ",-1))])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("p",uc,"У вас есть "+e.toDisplayString(e.unref(u)?e.unref(u).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":F[4]||(F[4]=de=>e.isRef(l)?l.value=de:null),min:0,max:((fe=e.unref(u))==null?void 0:fe.balance)>e.unref(i)?Math.floor(e.unref(i)-1):(ke=e.unref(u))==null?void 0:ke.balance},null,8,fc)),[[e.vModelText,e.unref(l),void 0,{number:!0}]]):e.createCommentVNode("",!0),e.createElementVNode("ul",mc,[R.value?(e.openBlock(),e.createElementBlock("li",pc,[F[17]||(F[17]=e.createElementVNode("p",null,"Сумма заказа:",-1)),e.createElementVNode("p",null,[e.createVNode(ve,{price:e.unref(i),fixedFloat:2},null,8,["price"]),F[16]||(F[16]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createElementBlock("li",hc,[F[19]||(F[19]=e.createElementVNode("p",null,"Будет оплачено бонусами:",-1)),e.createElementVNode("p",null,[e.createVNode(ve,{price:e.unref(l),fixedFloat:2},null,8,["price"]),F[18]||(F[18]=e.createTextVNode(" Б",-1))])])):e.createCommentVNode("",!0),e.unref(S)!==0?(e.openBlock(),e.createElementBlock("li",_c,[e.createElementVNode("p",gc,e.toDisplayString(e.unref(S)>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",yc,[e.createVNode(ve,{price:Math.abs(e.unref(S)),fixedFloat:2},null,8,["price"]),F[20]||(F[20]=e.createTextVNode(" ₽",-1))])])):B.value!==0?(e.openBlock(),e.createElementBlock("li",bc,[e.createElementVNode("p",wc,e.toDisplayString(B.value>0?"Надбавка":"Скидка")+": ",1),e.createElementVNode("p",kc,[e.createVNode(ve,{price:Math.abs(B.value),fixedFloat:2},null,8,["price"]),F[21]||(F[21]=e.createTextVNode(" ₽",-1))])])):e.createCommentVNode("",!0),e.createElementVNode("li",null,[F[23]||(F[23]=e.createElementVNode("p",{class:"accept_field"},"Итого к оплате:",-1)),e.createElementVNode("p",Cc,[e.createVNode(ve,{price:e.unref(i)-e.unref(l),fixedFloat:2},null,8,["price"]),F[22]||(F[22]=e.createTextVNode(" ₽",-1))])])]),e.createElementVNode("div",Sc,[e.unref(u)?(e.openBlock(),e.createBlock(Re,{key:0,textButtonDefault:"Бонусы",onClick:ue,class:"button_bonus_cart"})):e.createCommentVNode("",!0),e.createVNode(Re,{textButtonDefault:M.value?"Рассчитать скидки":e.unref(g),onClick:M.value?te:X,class:"button_payment_cart",disabled:e.unref(_)},null,8,["textButtonDefault","onClick","disabled"])])])]),t.configPage.kiosk_menu?(e.openBlock(),e.createBlock(Ol,{key:0,orderNumber:e.unref(y),pageNumber:1},null,8,["orderNumber"])):e.createCommentVNode("",!0),e.createVNode(nn,{visible:e.unref(w),"onUpdate:visible":F[5]||(F[5]=de=>e.isRef(w)?w.value=de:null),textNotificationDefault:e.unref(h).textNotification,backgroundColor:e.unref(f).accent_color?e.unref(f).accent_color:"#FF6D2E",buttonAccept:null},null,8,["visible","textNotificationDefault","backgroundColor"])],64)}}}),Nc={},xc={viewBox:"0 0 24 24"};function Bc(t,n){return e.openBlock(),e.createElementBlock("svg",xc,[...n[0]||(n[0]=[e.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Ac=ne(Nc,[["render",Bc]]),vc={class:"retry_screen"},$c={class:"retry_all_in_screen"},Tc={class:"retry_content"},Mc={class:"retry_icon_wrap"},Pc={class:"retry_icon_circle"},Vc={class:"retry_error_x"},Ic=e.defineComponent({__name:"RetryPage",setup(t){const n=Fe(),o=K.useRouter(),r=K.useRoute(),a=ce(),s=()=>{n.notificationData_lib.textNotification="",n.is_notification_lib=!1,a.openApiKey=!0,o.replace(`/${r.params.orgId}/`)};return(i,l)=>(e.openBlock(),e.createElementBlock("section",vc,[e.createElementVNode("div",$c,[e.createElementVNode("main",Tc,[e.createElementVNode("div",Mc,[e.createElementVNode("div",Pc,[l[0]||(l[0]=e.createElementVNode("div",{class:"retry_loader_mini"},null,-1)),e.createElementVNode("div",Vc,[e.createVNode(Ac)])])]),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:s,class:"retry_new_order_btn"},"Новый заказ")]),l[4]||(l[4]=e.createElementVNode("p",{class:"retry_bottom_note"},"Если ошибка повторяется — обратитесь к сотруднику зала.",-1))])]))}}),Rc={class:"wrapper_loader"},Dc=e.defineComponent({__name:"Loader",props:{size:{type:String,default:"40px"}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",Rc,[e.createElementVNode("div",{class:"loader",style:e.normalizeStyle({width:t.size})},null,4)]))}}),Oc=ne(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)}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"opacity-animation",key:t.id},[e.renderSlot(o.$slots,"opacityLoader",{},void 0,!0)]))}}),[["__scopeId","data-v-c6b97942"]]),Fc={key:0},Lc={class:"card__main__wrapper"},zc={key:0,class:"folder_content_top"},Uc={key:0,class:"loader_card_main"},jc={key:1,class:"card__main_content"},Hc=["src","alt"],qc={class:"card_title_price_wrapper"},Wc={class:"title"},Gc={key:0,class:"price"},Kc={key:1,class:"card_button_add_wrapper"},No=ne(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=_e(),o=ce(),r=me(),{itemThemes:a}=U.storeToRefs(n),{is_18_above_content:s,is18Allowed:i,notificationData_lib:l}=U.storeToRefs(o),c=t,d=(_,m)=>{var w,h,p;const y={id:_.id,is_fake:_.is_fake||!1,amount:_.amount||1,name:_.name,image_link:_.image_link,price:_.price,old_price:_.price,size:void 0,sizes:[],modifiers:[],groups:_.groups,group_modifiers:[],energy_amount:_.energy_amount??0,proteins_amount:_.proteins_amount??0,fat_amount:_.fat_amount??0,carbohydrates_amount:_.carbohydrates_amount??0},S=!((w=_.modifiers)!=null&&w.length)&&!((h=_.group_modifiers)!=null&&h.length)&&!((p=_.sizes)!=null&&p.length);if(r.isUpSale=!1,_.adult&&!i.value){s.value=!0,S&&(l.value.fastAdd=y);return}if(S){o.addToCart(y);return}if(_.amount||(_.amount=1),c.is_group&&c.selectGroupChild){c.selectGroupChild({..._,parent:c.parent,child:m.child_groups});return}c.takeCurrentCard&&c.takeCurrentCard(m.id)},u=_=>{if(c.is_group&&c.selectGroupChild){_={..._,parent:c.parent,child:_.child_groups},c.selectGroupChild(_);return}if(_.adult&&!i.value){s.value=!0;return}c.takeCurrentCard&&c.takeCurrentCard(_.id)},f=e.computed(()=>c.activeTags.every(_=>c.data.tags.includes(_))),{mediaUrl:g}=je(()=>c.data.id+"_image",()=>c.data.image_link);return(_,m)=>{var y;return((y=c.activeTags)==null?void 0:y.length)===0||f.value||c.is_group?(e.openBlock(),e.createElementBlock("div",Fc,[e.createVNode(Oc,{id:c.data.id},{opacityLoader:e.withCtx(()=>[e.createElementVNode("div",Lc,[t.is_group?(e.openBlock(),e.createElementBlock("div",zc)):e.createCommentVNode("",!0),e.createElementVNode("div",{onClick:m[0]||(m[0]=S=>u(c.data)),class:e.normalizeClass(["card__main",{card__main_folder:t.is_group}])},[t.isLoading?(e.openBlock(),e.createElementBlock("div",Uc,[e.createVNode(Dc)])):(e.openBlock(),e.createElementBlock("div",jc,[e.createElementVNode("img",{src:e.unref(g)||"",class:e.normalizeClass(["img",{card_blur_image:c.data.adult&&!e.unref(i)}]),loading:"lazy",alt:t.data.name},null,10,Hc),e.createElementVNode("div",qc,[e.createElementVNode("p",Wc,e.toDisplayString(t.data.name),1),t.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",Gc,e.toDisplayString(e.unref(nt)(t.data))+" ₽",1))])]))],2),t.is_group?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Kc,[e.createElementVNode("div",{onClick:m[1]||(m[1]=S=>d(t.data,c.data)),class:"add_button"},[...m[2]||(m[2]=[e.createElementVNode("div",{class:"image_add_button"},null,-1)])])]))])]),_:1},8,["id"])])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-06431027"]]),Jc=["id","onClick"],Xc=ne(e.defineComponent({__name:"GroupMain",props:{menuGroup:{},idActiveGroup:{},activeTakeGroup:{type:Function}},setup(t){const n=e.ref(null);return(o,r)=>t.menuGroup.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__menu",ref_key:"scrollGroup",ref:n},[e.createVNode(Yt,{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,(s,i)=>(e.openBlock(),e.createElementBlock("li",{key:s.id,id:"scrolling"+s.id,onClick:l=>{t.activeTakeGroup&&t.activeTakeGroup(s.id,i),a(l)},style:e.normalizeStyle(t.idActiveGroup==s.id?{fontFamily:"Bounded"}:{})},e.toDisplayString(s.name),13,Jc))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-33006a7e"]]),Zc=["id","onClick"],Yc=ne(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,o=e.ref(null),r=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,s)=>t.menuTags.length>0?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"main__filters",ref_key:"scrollTagContainer",ref:o},[e.createVNode(Yt,{axis:"x",behavior:"smooth",container:o.value,autoScroll:!0,idActive:r.value?r.value[t.currentActiveTag.length-1]:null,clearContainer:!1},{default:e.withCtx(({handleTargetClick:i})=>[(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),i(d)},class:e.normalizeClass({main__filter_active:(r.value??[]).includes(l)})},e.toDisplayString(l),11,Zc))),128))]),_:1},8,["container","idActive"])],512)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-818940a4"]]),Qc=["data-id"],ed=["src"],td=["src"],nd=ne(e.defineComponent({__name:"DrumItem",props:{group:{},index:{},active:{type:Boolean}},setup(t){const n=t,{mediaUrl:o}=je(()=>{var r,a;return(r=n.group)!=null&&r.video_link?`${n.group.id}_video`:(a=n.group)!=null&&a.image_link?`${n.group.id}_image`:null});return(r,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.openBlock(),e.createElementBlock("video",{key:e.unref(o),loop:"",autoplay:"",muted:"",playsinline:"",class:"drum_img"},[e.createElementVNode("source",{src:e.unref(o)||"",type:"video/webm"},null,8,ed)])):(e.openBlock(),e.createElementBlock("img",{key:1,class:"drum_img",src:e.unref(o)||""},null,8,td)),e.createElementVNode("p",null,e.toDisplayString(t.group.name),1)],10,Qc)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-b948bda1"]]),od={},rd={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 ad(t,n){return e.openBlock(),e.createElementBlock("svg",rd,[...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 sd=ne(od,[["render",ad]]),id={class:"recommendation_wrapper"},ld={class:"recommendation_header"},cd={class:"recommendation_info"},dd=ne(e.defineComponent({__name:"Recommendation",props:{closeCurrentCard:{},openCurrentCard:{}},setup(t){const n=me(),{isUpSale:o,dataUpSale:r}=U.storeToRefs(n),a=()=>{o.value=!1};return e.onUnmounted(()=>{r.value=null}),(s,i)=>(e.openBlock(),e.createElementBlock("div",id,[e.createElementVNode("div",ld,[i[0]||(i[0]=e.createElementVNode("p",{class:"header_title"},"Часто берут вместе",-1)),e.createElementVNode("div",{class:"header_close",onClick:a},[e.createVNode(sd,{class:"close_icon"})])]),e.createElementVNode("div",cd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),l=>(e.openBlock(),e.createBlock(No,{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"]]),ud=e.defineComponent({__name:"Blackout",props:{data:{type:Boolean}},setup(t){const n=t;return e.watch(()=>n.data,o=>{document.body.style.overflow=o?"hidden":""}),()=>{}}}),fd={class:"wrapper_modal"},md={class:"card_modal"},pd=ne(e.defineComponent({__name:"ModalWindows",props:{visible:{type:Boolean}},setup(t){const n=t,o=me(),{isUpSale:r}=U.storeToRefs(o),a=()=>{r.value=!1};return(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(ud,{data:n.visible},null,8,["data"]),e.createElementVNode("div",{class:"black_modal",onClick:a}),e.createElementVNode("div",fd,[e.createElementVNode("div",md,[e.renderSlot(s.$slots,"default",{},void 0,!0)])])],64))}}),[["__scopeId","data-v-ec2b2c4d"]]),an=U.defineStore("modulesLib",()=>{const t=e.ref(!1),n=e.ref({textNotification:""});return{is_notification_lib:t,notificationData_lib:n}}),Bt=Symbol("clickOutside"),hd={mounted(t,n){t[Bt]=o=>{t.contains(o.target)||n.value(o)},document.addEventListener("click",t[Bt])},unmounted(t){t[Bt]&&document.removeEventListener("click",t[Bt])}};class _d{constructor(n){ee(this,"value");ee(this,"next");this.value=n}}class gd{constructor(){$t(this,we);$t(this,De);$t(this,qe);this.clear()}enqueue(n){const o=new _d(n);Ne(this,we)?(Ne(this,De).next=o,Me(this,De,o)):(Me(this,we,o),Me(this,De,o)),dn(this,qe)._++}dequeue(){const n=Ne(this,we);if(n)return Me(this,we,Ne(this,we).next),dn(this,qe)._--,Ne(this,we)||Me(this,De,void 0),n.value}peek(){if(Ne(this,we))return Ne(this,we).value}clear(){Me(this,we,void 0),Me(this,De,void 0),Me(this,qe,0)}get size(){return Ne(this,qe)}*[Symbol.iterator](){let n=Ne(this,we);for(;n;)yield n.value,n=n.next}*drain(){for(;Ne(this,we);)yield this.dequeue()}}we=new WeakMap,De=new WeakMap,qe=new WeakMap;function yd(t){xo(t);const n=new gd;let o=0;const r=()=>{o<t&&n.size>0&&(o++,n.dequeue()())},a=()=>{o--,r()},s=async(c,d,u)=>{const f=(async()=>c(...u))();d(f);try{await f}catch{}a()},i=(c,d,u)=>{new Promise(f=>{n.enqueue(f)}).then(s.bind(void 0,c,d,u)),o<t&&r()},l=(c,...d)=>new Promise(u=>{i(c,u,d)});return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>n.size},clearQueue:{value(){n.clear()}},concurrency:{get:()=>t,set(c){xo(c),t=c,queueMicrotask(()=>{for(;o<t&&n.size>0;)r()})}},map:{async value(c,d){const u=Array.from(c,(f,g)=>this(d,f,g));return Promise.all(u)}}}),l}function xo(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 be=null;const Bo=yd(5),bd=async(t,n)=>{be&&Sd();const o=ce(),r=an(),a=me(),{displayCards:s}=U.storeToRefs(o),{is_notification_lib:i,notificationData_lib:l}=U.storeToRefs(r),{stateCard:c,openProduct:d}=U.storeToRefs(a),u=Ve.create();await wd(t),be=ht(`wss://${n}/ws/org-unit/${t}/`),be.on("open",()=>console.warn("Realtime WebSocket подключён (pointId:",t,")")),be.on("error",f=>console.warn("WebSocket ошибка:",f)),be.on("close",()=>console.warn("Realtime WebSocket закрыт")),be.on("message",async f=>{if(f.type)return;l.value.textNotification="Мы обновили меню";const g=f.params||f,_=g.active_groups||[],m=g.updated_groups||[],y=g.updated_product_groups||[],S=await Oe(),w=new Set(_.map(k=>k)),h=new Map(s.value.map(k=>[k.id,k])),p=[],v=S.transaction("groups","readwrite");let O=await v.objectStore("groups").openCursor();for(;O;){const k=O.key;!w.has(k)&&k!==t&&(p.push(k),await O.delete(),h.delete(k)),O=await O.continue()}await v.done,s.value=Array.from(h.values()),p.length>0&&await kd(w);const R=[...m.map(k=>Bo(async()=>{const[N,B]=await Promise.all([u.getGroupByID(k),u.loadGroupProducts(k)]);N.products=B,h.set(k,N),await Qe(k,N),await vo(N,B,!0)})),...y.map(k=>Bo(async()=>{const[N,B]=await Promise.all([u.getGroupByID(k),u.loadGroupProducts(k)]);N.products=B,h.set(k,N),await Qe(k,N),await vo(N,B,!0),await Cd(B,k)}))];await Promise.all(R),s.value=Array.from(h.values()),await rr(t,s),i.value=!0;const M=c.value.openCard;if(M!=null&&M.id){const k=new Set(M.groups??[]),N=new Set;let B=!1;for(const P of h.values()){const T=P==null?void 0:P.products;if(!Array.isArray(T))continue;const C=T.find(A=>(A==null?void 0:A.id)===M.id);if((C==null?void 0:C.adult)===!0){d.value={id:null,visible:!1},a.reset();return}C&&(P==null?void 0:P.id)!=null&&(N.add(P.id),(m.includes(P.id)||y.includes(P.id))&&(B=!0))}if(N.size===0){d.value={id:null,visible:!1},a.reset();return}(!(k.size===N.size&&[...k].every(P=>N.has(P)))||B)&&await u.getSingleProduct(M==null?void 0:M.id)}}),be.connect()},wd=async t=>{try{const n=ce(),o=await Ot(t);o!=null&&o.data&&(n.displayCards=o.data)}catch(n){console.error("Ошибка загрузки кэша групп:",n)}},Ao=async t=>{const n=ce(),o=an(),r=me(),{stateCard:a,openProduct:s}=U.storeToRefs(r),{cartProducts_lib:i}=U.storeToRefs(n),l=i.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)&&(s.value={id:null,visible:!1})):d.push(f);if(c.length>0){const f=c.map(g=>g.name).slice(0,3).join(", ");o.notificationData_lib.textNotification=`Некоторые позиции стали недоступны и были убраны из заказа: ${f}${c.length>3?` и ещё ${c.length-3}`:""}`,i.value=d,n.updateCartInLocalStorage()}},kd=async t=>{await Ao(n=>{var o;return(o=n.groups)!=null&&o.length?!n.groups.some(r=>t.has(r)):!0})},Cd=async(t,n)=>{const o=ce(),r=new Set(t.filter(a=>!a.adult||o.is18Allowed).map(a=>a.id));await Ao(a=>{var s;return(s=a.groups)!=null&&s.includes(n)?!r.has(a.id):!1})},vo=async(t,n,o=!0)=>{if(t.video_link&&At(t.video_link,`${t.id}_video`,o),t.image_link&&At(t.image_link,`${t.id}_image`,o),n!=null&&n.length)for(const r of n)r.video_link&&At(r.video_link,`${r.id}_video`,o),r.image_link&&At(r.image_link,`${r.id}_image`,o)},At=async(t,n,o=!1)=>{try{const r=tt();if(!o){const i=await Ge(n);if(i){r.updateCacheFromBlob(n,i),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:i}}));return}}const a=await fetch(t);if(!a.ok)throw new Error("Network error");const s=await a.blob();if(s.size===0)throw new Error("Empty blob");await Ft(n,s),r.updateCacheFromBlob(n,s),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:n,blob:s}}))}catch(r){console.warn(`[MediaCache] Failed for ${n}:`,r)}},Sd=()=>{be&&(be.off("open"),be.off("message"),be.off("error"),be.off("close"),be.close(!0),be=null)},Ed={class:"button_price_bg"},Nd={class:"wrapper_container_price_bg"},xd={class:"button_price"},Bd={key:0,class:"image_product_container"},Ad=["src"],vd=e.defineComponent({__name:"BasketButton",emits:["goToCart"],setup(t){const n=ce(),o=tt(),{totalPrice_lib:r,cartProducts_lib:a}=U.storeToRefs(n);o.initCacheSingle("defaultImage");const s=e.computed(()=>o.cache.defaultImage||""),i=c=>{const d=`${c}_image`;return o.initCacheSingle(d),o.cache[d]||s.value},l=e.computed(()=>{var c;return(c=a.value)!=null&&c.length,a.value.slice(0,3).map(d=>({id:d.id,url:i(d.id)}))});return(c,d)=>(e.openBlock(),e.createElementBlock("div",Ed,[e.createElementVNode("div",Nd,[e.createElementVNode("div",xd,[e.unref(r)>0&&l.value.length>0?(e.openBlock(),e.createElementBlock("div",Bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,class:"filter_image_product"},[e.createElementVNode("img",{src:u.url,class:"img_product"},null,8,Ad)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"button_default_main",onClick:d[0]||(d[0]=u=>c.$emit("goToCart"))},[d[2]||(d[2]=e.createElementVNode("div",{class:"icont_cart"},null,-1)),e.createElementVNode("p",null,[e.createVNode(ve,{price:e.unref(r),fixedFloat:2},null,8,["price"]),d[1]||(d[1]=e.createTextVNode(" ₽",-1))])])])])]))}}),ct=null,{min:He,max:$e,abs:$o,floor:$d}=Math,To=(t,n,o)=>He(o,$e(n,t)),Mo=t=>[...t].sort((n,o)=>n-o),Td=typeof queueMicrotask=="function"?queueMicrotask:t=>{Promise.resolve().then(t)},sn=()=>{let t;return[new Promise(n=>{t=n}),t]},Po=t=>{let n;return()=>(t&&(n=t(),t=void 0),n)},dt=(t,n,o)=>{const r=o?"unshift":"push";for(let a=0;a<n;a++)t[r](-1);return t},Vo=(t,n)=>{const o=t.t[n];return o===-1?t.o:o},Md=(t,n,o)=>{const r=t.t[n]===-1;return t.t[n]=o,t.i=He(n,t.i),r},vt=(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 o=t.i,r=t.u[o];for(;o<n;)r+=Vo(t,o),t.u[++o]=r;return t.i=n,r},Ye=(t,n,o=0,r=t.l-1)=>{let a=o;for(;o<=r;){const s=$d((o+r)/2);vt(t,s)<=n?(a=s,o=s+1):r=s-1}return To(a,0,t.l-1)},Io=(t,n,o)=>{const r=n-t.l;return t.i=o?-1:He(n-1,t.i),t.l=n,r>0?(dt(t.u,r),dt(t.t,r,o),t.o*r):(t.u.splice(r),(o?t.t.splice(0,-r):t.t.splice(r)).reduce((a,s)=>a-(s===-1?t.o:s),0))},Pd=t=>t.documentElement,Vd=t=>t.ownerDocument,Id=t=>t.defaultView,Ro=Po(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>0),Rd=Po(()=>"scrollBehavior"in Pd(document).style),Dd=(t,n=40,o=0,r,a=!1)=>{let s=!!o,i=1,l=0,c=0,d=0,u=0,f=0,g=0,_=0,m=0,y=ct,S=[0,s?$e(o-1,0):-1],w=0,h=!1;const p=((P,T,C)=>({o:T,t:C?dt(C.slice(0,He(P,C.length)),$e(0,P-C.length)):dt([],P),l:P,i:-1,u:dt([],P+1)}))(t,r?r[1]:n,r&&r[0]),v=new Set,D=()=>d-c,O=()=>D()+f+u,R=(P,T)=>((C,A,$,b)=>{if(b=He(b,C.l-1),vt(C,b)<=A){const x=Ye(C,$,b);return[Ye(C,A,b,x),x]}{const x=Ye(C,A,void 0,b);return[x,Ye(C,$,x)]}})(p,P,T,S[0]),M=()=>vt(p,p.l),k=(P,T)=>{const C=vt(p,P)-f;return T?M()-C-N(P):C},N=P=>Vo(p,P),B=(P,T=-1)=>p.t[P]===T,I=P=>{P&&(Ro()&&_!==0||y&&m===1?f+=P:u+=P)};return{p:()=>{v.clear()},h:()=>i,m:()=>(P=>[P.t.slice(),P.o])(p),v:(P=200)=>{if(!h||s)return S;let T,C;if(g)[T,C]=S;else{let A=$e(0,O()),$=A+l;a||(P=$e(0,P),_!==1&&(A-=P),_!==2&&($+=P)),[T,C]=S=R($e(0,A),$e(0,$)),y&&(T=He(T,y[0]),C=$e(C,y[1]))}return[$e(T,0),He(C,p.l-1)]},S:P=>Ye(p,P-c),I:B,O:k,k:N,j:()=>p.l,N:()=>d,B:()=>_!==0,T:()=>l,q:()=>c,M,P:()=>(g=u,u=0,[g,m===2]),R:(P,T)=>{const C=[P,T];return v.add(C),()=>{v.delete(C)}},A:(P,T)=>{let C,A,$=0;switch(P){case 1:{if(T===d&&m===0)break;const b=g;g=0;const x=T-d,V=$o(x);b&&V<$o(b)+1||m!==0||(_=x<0?2:1),s&&(s=!1),d=T,$=4;const L=D();L>=-l&&L<=M()&&($+=1,A=V>l);break}case 2:$=8,_!==0&&(C=!0,$+=1),_=0,m=0,y=ct;break;case 3:{const b=T.filter(([x,V])=>!B(x,V));if(!b.length)break;I(b.reduce((x,[V,L])=>((m===2||(y&&m===1?V<y[0]:k(V+(_===0&&m===0?1:0))<D()))&&(x+=L-N(V)),x),0));for(const[x,V]of b){const L=N(x),W=Md(p,x,V);a&&(w+=W?V:V-L)}a&&l&&w>l&&(I(((x,V)=>{let L=0;const W=[];x.t.forEach((G,F)=>{G!==-1&&(W.push(G),F<V&&L++)}),x.i=-1;const H=Mo(W),X=H.length,te=X/2|0,ue=X%2==0?(H[te-1]+H[te])/2:H[te],oe=x.o;return((x.o=ue)-oe)*$e(V-L,0)})(p,Ye(p,O()))),a=!1),$=3,A=!0;break}case 4:l!==T&&(l||(h=A=!0),l=T,$=3);break;case 5:T[1]?(I(Io(p,T[0],!0)),m=2,$=1):(Io(p,T[0]),$=1);break;case 6:c=T;break;case 7:m=1;break;case 8:y=R(T,T+l),$=1}$&&(i=1+(2147483647&i),C&&f&&(u+=f,f=0),v.forEach(([b,x])=>{$&b&&x(A)}))}}},ln=setTimeout,cn=(t,n)=>n?-t:t,Od=(t,n,o,r,a,s)=>{const i=Date.now;let l=0,c=!1,d=!1,u=!1,f=!1;const g=(()=>{let w;const h=()=>{w!=ct&&clearTimeout(w)},p=()=>{h(),w=ln(()=>{w=ct,(()=>{if(c||d)return c=!1,void g();u=!1,t.A(2)})()},150)};return p.C=h,p})(),_=()=>{l=i(),u&&(f=!0),t.A(1,r()),g()},m=w=>{if(c||!t.B()||w.ctrlKey)return;const h=i()-l;150>h&&50<h&&(o?w.deltaX:w.deltaY)&&(c=!0)},y=()=>{d=!0,u=f=!1},S=()=>{d=!1,Ro()&&(u=!0)};return n.addEventListener("scroll",_),n.addEventListener("wheel",m,{passive:!0}),n.addEventListener("touchstart",y,{passive:!0}),n.addEventListener("touchend",S,{passive:!0}),{H:()=>{n.removeEventListener("scroll",_),n.removeEventListener("wheel",m),n.removeEventListener("touchstart",y),n.removeEventListener("touchend",S),g.C()},V:()=>{const[w,h]=t.P();w&&(a(w,h,f),f=!1,h&&t.T()>t.M()&&t.A(1,r()))}}},Fd=(t,n,o)=>{let r;return[async(a,s)=>{if(!await n())return;r&&r();const i=()=>{const[l,c]=sn();return r=()=>{c(!1)},t.T()&&ln(r,150),[l,t.R(2,()=>{c(!0)})]};if(s&&Rd())t.A(8,a()),Td(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]=i();try{if(!await c)return}finally{d()}}t.A(7),o(a(),s)});else for(;;){const[l,c]=i();try{if(t.A(7),o(a()),!await l)return}finally{c()}}},()=>{r&&r()}]},Ld=t=>{let n;return{F(o){(n||(n=new(Id(Vd(o))).ResizeObserver(t))).observe(o)},J(o){n.unobserve(o)},H(){n&&n.disconnect()}}},zd=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(),o=e.computed(()=>t.L.value&&t.W.O(t.D,t.K)),r=e.computed(()=>t.L.value&&t.W.I(t.D));return e.watch(()=>n.value&&t.D,(a,s,i)=>{i(t.Y(n.value,t.D))},{flush:"post"}),()=>{var a;const{X:s,U:i,G:l,Z:c}=t,d=r.value,{style:u,...f}=(a=t.ee)!==null&&a!==void 0?a:{},g={contain:"layout style",position:d&&l?void 0:"absolute",[i?"height":"width"]:"100%",[i?"top":"left"]:"0px",[i?"left":"top"]:o.value+"px",visibility:!d||l?void 0:"hidden",...u};return i&&(g.display="inline-flex"),e.createVNode(c,e.mergeProps({ref:n,style:g},f),typeof(_=s)=="function"||Object.prototype.toString.call(_)==="[object Object]"&&!e.isVNode(_)?s:{default:()=>[s],_:2},16,["style"]);var _}}}),Ud=(t,n)=>{const o=t.key;return o??"_"+n},jd=(t,n)=>t[0]===n[0]&&t[1]===n[1],Do=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:o,slots:r}){let a=!!t.ssrCount;const s=t.horizontal,i=e.ref(),l=Dd(t.data.length,t.itemSize,t.ssrCount,t.cache,!t.itemSize),c=((m,y)=>{let S;const w=y?"width":"height",h=new WeakMap,p=Ld(v=>{const D=[];for(const{target:O,contentRect:R}of v)if(O.offsetParent)if(O===S)m.A(4,R[w]);else{const M=h.get(O);M!=ct&&D.push([M,R[w]])}D.length&&m.A(3,D)});return{te(v){p.F(S=v)},re:(v,D)=>(h.set(v,D),p.F(v),()=>{h.delete(v),p.J(v)}),p:p.H}})(l,s),d=((m,y)=>{let S,w,h=sn(),p=!1;const v=y?"scrollLeft":"scrollTop",D=y?"overflowX":"overflowY",[O,R]=Fd(m,()=>h[0],(M,k)=>{M=cn(M,p),k?S.scrollTo({[y?"left":"top"]:M,behavior:"smooth"}):S[v]=M});return{oe(M){S=M,y&&(p=getComputedStyle(M).direction==="rtl"),w=Od(m,M,y,()=>cn(M[v],p),(k,N,B)=>{if(B){const I=M.style,P=I[D];I[D]="hidden",ln(()=>{I[D]=P})}M[v]=cn(m.N()+k,p),N&&R()}),h[1](!0)},p(){w&&w.H(),h[1](!1),h=sn()},ne:()=>p,se(M){O(()=>M)},ie(M){M+=m.N(),O(()=>M)},le(M,{align:k,smooth:N,offset:B=0}={}){if(M=To(M,0,m.j()-1),k==="nearest"){const I=m.O(M),P=m.N();if(I<P)k="start";else{if(!(I+m.k(M)>P+m.T()))return;k="end"}}O(()=>B+m.q()+m.O(M)+(k==="end"?m.k(M)-m.T():k==="center"?(m.k(M)-m.T())/2:0),N)},ce:()=>{w&&w.V()}}})(l,s),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(m=>{u.value;const y=l.v(t.bufferSize);return m&&jd(m,y)?m:y}),g=e.computed(()=>u.value&&l.B()),_=e.computed(()=>u.value&&l.M());return e.onMounted(()=>{a=!1;const m=requestAnimationFrame(()=>{const y=S=>{c.te(S),d.oe(S)};t.scrollRef?y(t.scrollRef):y(i.value.parentElement)});e.onUnmounted(()=>{cancelAnimationFrame(m)})}),e.onUnmounted(()=>{l.p(),c.p(),d.p()}),e.watch(()=>t.data.length,m=>{l.A(5,[m,t.shift])}),e.watch(()=>t.startMargin,m=>{l.A(6,m)},{immediate:!0}),e.watch([u],()=>{d.ce()},{flush:"post"}),o({get cache(){return l.m()},get scrollOffset(){return l.N()},get scrollSize(){return(m=>$e(m.M(),m.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 m=t.as,y=t.item,S=_.value,w=d.ne(),h=!s&&w?"unshift":"push",p=[],v=O=>{var R;const M=r.default({item:t.data[O],index:O})[0];return e.createVNode(zd,{key:Ud(M,O),L:u,W:l,Y:c.re,D:O,X:M,U:s,K:w,G:a,Z:y,ee:(R=t.itemProps)===null||R===void 0?void 0:R.call(t,{item:t.data[O],index:O})},null,8,["L","W","Y","D","X","U","K","G","Z","ee"])};if(t.keepMounted){const O=new Set(t.keepMounted);for(let[R,M]=f.value;R<=M;R++)O.add(R);Mo([...O]).forEach(R=>{p[h](v(R))})}else for(let[O,R]=f.value;O<=R;O++)p[h](v(O));return e.createVNode(m,{ref:i,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:s?S+"px":"100%",height:s?"100%":S+"px",pointerEvents:g.value?"none":void 0}},typeof(D=p)=="function"||Object.prototype.toString.call(D)==="[object Object]"&&!e.isVNode(D)?p:{default:()=>[p],_:2},8,["style"]);var D}}}),Hd=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:o,slots:r}){const a=t.horizontal,s=c=>{n("scroll",c)},i=()=>{n("scrollEnd")},l=e.ref();return o({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(Do,{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:s,onScrollEnd:i},(c=r,typeof c=="function"||Object.prototype.toString.call(c)==="[object Object]"&&!e.isVNode(c)?r:{default:()=>[r],_:2}),8,["data","bufferSize","itemSize","itemProps","shift","ssrCount","horizontal","keepMounted","cache","onScroll","onScrollEnd"])],4);var c}}}),qd=(t,n=10)=>new Promise(o=>{let r=0,a=0,s=0;const i=()=>{const l=t.scrollSize;l===s&&l>0?r++:(r=0)&&(s=l),a++,r>=2||a>=n?o():requestAnimationFrame(i)};requestAnimationFrame(i)});function Wd(t,n){const o=(n==null?void 0:n.align)??"start";let r=!1;const a=e.ref(null),s=e.ref(!1),i=e.ref("measure"),l=e.computed(()=>e.toValue(t).length),c=e.computed(()=>i.value==="measure"?1:5),d=e.computed(()=>Array.from({length:l.value*c.value},(S,w)=>w)),u=async()=>{if(a.value&&(i.value="measure",r=!1,s.value=!1,await e.nextTick(),i.value==="measure")){if(await qd(a.value),s.value=a.value.scrollSize>a.value.viewportSize,!s.value){r=!1;return}r=!0,i.value="loop",await e.nextTick(),a.value.scrollToIndex(l.value*3,{align:o})}},f=S=>i.value==="measure"?S:l.value===0?0:S%l.value,g=(S,w)=>{a.value&&a.value.scrollToIndex(S,w)},_=(S,w)=>!r||i.value!=="loop"?w:w+Math.round((S-w)/l.value)*l.value,m=S=>{if(!r||i.value!=="loop"||!a.value)return;const w=l.value-1,h=l.value*4;if(S<w)return g(l.value*3-1,{align:"start"});if(S>=h)return g(l.value*3,{align:"start"})},y=()=>{if(!a.value||!r)return;const S=a.value.findItemIndex(a.value.scrollOffset);m(S)};return e.onMounted(u),e.onUnmounted(()=>a.value=null),e.watch(l,()=>e.nextTick(u)),{listRef:a,items:d,hasScroll:s,realIndex:f,findNearestIndex:_,scrollToIndex:g,init:u,onScroll:y}}const Gd={pinch:!0,doubleTap:!0,wheel:!0,buttons:["+","-","=","0"]},Kd=t=>{var o;const n=Object.assign({},Gd,t);if(n.pinch&&(document.addEventListener("touchstart",r=>r.touches.length>1&&r.preventDefault(),{passive:!1}),document.addEventListener("gesturestart",r=>r.preventDefault(),{passive:!1})),n.doubleTap){let r=0;document.addEventListener("touchend",a=>{const s=Date.now();s-r<=250&&a.preventDefault(),r=s},{passive:!1})}n.wheel&&document.addEventListener("wheel",r=>(r.ctrlKey||r.metaKey)&&r.preventDefault(),{passive:!1}),(o=n.buttons)!=null&&o.length&&document.addEventListener("keydown",r=>(r.ctrlKey||r.metaKey)&&n.buttons.includes(r.key)&&r.preventDefault())};Object.defineProperty(z,"useRoute",{enumerable:!0,get:()=>K.useRoute}),Object.defineProperty(z,"useRouter",{enumerable:!0,get:()=>K.useRouter}),z.BasketButton=vd,z.BottomSheet=wo,z.ButtonDefault=Re,z.CardMain=No,z.CardProductPage=Oi,z.CardReader=So,z.CartBox=Co,z.CartPage=Ec,z.DrumItem=nd,z.GroupMain=Xc,z.InitConnection=Ve,z.ModalWindows=pd,z.NotificationWindow=nn,z.PopupWindowDefault=ko,z.Recommendation=dd,z.RetryPage=Ic,z.TagsMain=Yc,z.VList=Hd,z.Virtualizer=Do,z.clearAllProductDB=sr,z.clearLocalStorage=Ke,z.getCachedGroup=Ot,z.getCachedProduct=yn,z.getWebSocketInstance=ht,z.initPinia=Uo,z.initRouter=Ho,z.preventZoom=Kd,z.updateIndexedDB=bd,z.useCachedMedia=je,z.useCardLibStore=me,z.useCartLibStore=Fe,z.useImageCacheStore=tt,z.useMainLibStore=ce,z.useModal=Eo,z.useModalStore=rn,z.useModulesLibStore=an,z.useThemeStore=_e,z.useVirtuaLoop=Wd,z.vClickOutside=hd,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|