@orderingstack/front-hooks 3.9.0 → 3.10.0

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.
package/dist/index.cjs.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var G=require("react"),Pt=require("@orderingstack/ordering-core-react"),Mn=require("react-i18next");function Le(e,r){const t=G.useRef(),[n,a]=G.useState(null);return G.useEffect(()=>{t.current=e},[e]),G.useEffect(()=>{function i(){var s;(s=t.current)==null||s.call(t)}if(r!==null){const s=setInterval(i,r);return a(s),()=>{a(null),clearInterval(s)}}},[r]),()=>{n&&clearInterval(n)}}var X=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Fn=Object.prototype;function Bn(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Fn;return e===t}var Re=Bn;function Hn(e,r){return function(t){return e(r(t))}}var Ut=Hn,Gn=Ut,qn=Gn(Object.keys,Object),Kn=qn,Yn=Re,Wn=Kn,kn=Object.prototype,Vn=kn.hasOwnProperty;function Jn(e){if(!Yn(e))return Wn(e);var r=[];for(var t in Object(e))Vn.call(e,t)&&t!="constructor"&&r.push(t);return r}var Mt=Jn,zn=typeof X=="object"&&X&&X.Object===Object&&X,Ft=zn,Zn=Ft,Xn=typeof self=="object"&&self&&self.Object===Object&&self,Qn=Zn||Xn||Function("return this")(),W=Qn,ea=W,ra=ea.Symbol,xe=ra,Dr=xe,Bt=Object.prototype,ta=Bt.hasOwnProperty,na=Bt.toString,he=Dr?Dr.toStringTag:void 0;function aa(e){var r=ta.call(e,he),t=e[he];try{e[he]=void 0;var n=!0}catch{}var a=na.call(e);return n&&(r?e[he]=t:delete e[he]),a}var ia=aa,sa=Object.prototype,oa=sa.toString;function ua(e){return oa.call(e)}var fa=ua,jr=xe,ca=ia,la=fa,da="[object Null]",ha="[object Undefined]",Lr=jr?jr.toStringTag:void 0;function pa(e){return e==null?e===void 0?ha:da:Lr&&Lr in Object(e)?ca(e):la(e)}var Ne=pa;function va(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var ye=va,ga=Ne,ya=ye,$a="[object AsyncFunction]",ma="[object Function]",ba="[object GeneratorFunction]",_a="[object Proxy]";function Aa(e){if(!ya(e))return!1;var r=ga(e);return r==ma||r==ba||r==$a||r==_a}var Ht=Aa,Ea=W,Oa=Ea["__core-js_shared__"],Ta=Oa,Ye=Ta,Rr=function(){var e=/[^.]+$/.exec(Ye&&Ye.keys&&Ye.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Sa(e){return!!Rr&&Rr in e}var wa=Sa,Ca=Function.prototype,Ia=Ca.toString;function Da(e){if(e!=null){try{return Ia.call(e)}catch{}try{return e+""}catch{}}return""}var Gt=Da,ja=Ht,La=wa,Ra=ye,xa=Gt,Na=/[\\^$.*+?()[\]{}|]/g,Pa=/^\[object .+?Constructor\]$/,Ua=Function.prototype,Ma=Object.prototype,Fa=Ua.toString,Ba=Ma.hasOwnProperty,Ha=RegExp("^"+Fa.call(Ba).replace(Na,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ga(e){if(!Ra(e)||La(e))return!1;var r=ja(e)?Ha:Pa;return r.test(xa(e))}var qa=Ga;function Ka(e,r){return e==null?void 0:e[r]}var Ya=Ka,Wa=qa,ka=Ya;function Va(e,r){var t=ka(e,r);return Wa(t)?t:void 0}var Q=Va,Ja=Q,za=W,Za=Ja(za,"DataView"),Xa=Za,Qa=Q,ei=W,ri=Qa(ei,"Map"),lr=ri,ti=Q,ni=W,ai=ti(ni,"Promise"),ii=ai,si=Q,oi=W,ui=si(oi,"Set"),fi=ui,ci=Q,li=W,di=ci(li,"WeakMap"),hi=di,Xe=Xa,Qe=lr,er=ii,rr=fi,tr=hi,qt=Ne,ie=Gt,xr="[object Map]",pi="[object Object]",Nr="[object Promise]",Pr="[object Set]",Ur="[object WeakMap]",Mr="[object DataView]",vi=ie(Xe),gi=ie(Qe),yi=ie(er),$i=ie(rr),mi=ie(tr),Z=qt;(Xe&&Z(new Xe(new ArrayBuffer(1)))!=Mr||Qe&&Z(new Qe)!=xr||er&&Z(er.resolve())!=Nr||rr&&Z(new rr)!=Pr||tr&&Z(new tr)!=Ur)&&(Z=function(e){var r=qt(e),t=r==pi?e.constructor:void 0,n=t?ie(t):"";if(n)switch(n){case vi:return Mr;case gi:return xr;case yi:return Nr;case $i:return Pr;case mi:return Ur}return r});var $e=Z;function bi(e){return e!=null&&typeof e=="object"}var se=bi,_i=Ne,Ai=se,Ei="[object Arguments]";function Oi(e){return Ai(e)&&_i(e)==Ei}var Ti=Oi,Fr=Ti,Si=se,Kt=Object.prototype,wi=Kt.hasOwnProperty,Ci=Kt.propertyIsEnumerable,Ii=Fr(function(){return arguments}())?Fr:function(e){return Si(e)&&wi.call(e,"callee")&&!Ci.call(e,"callee")},Yt=Ii,Di=Array.isArray,me=Di,ji=9007199254740991;function Li(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ji}var Wt=Li,Ri=Ht,xi=Wt;function Ni(e){return e!=null&&xi(e.length)&&!Ri(e)}var dr=Ni,ae={exports:{}};function Pi(){return!1}var Ui=Pi;(function(e,r){var t=W,n=Ui,a=r&&!r.nodeType&&r,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,f=s?t.Buffer:void 0,o=f?f.isBuffer:void 0,v=o||n;e.exports=v})(ae,ae.exports);var Mi=Ne,Fi=Wt,Bi=se,Hi="[object Arguments]",Gi="[object Array]",qi="[object Boolean]",Ki="[object Date]",Yi="[object Error]",Wi="[object Function]",ki="[object Map]",Vi="[object Number]",Ji="[object Object]",zi="[object RegExp]",Zi="[object Set]",Xi="[object String]",Qi="[object WeakMap]",es="[object ArrayBuffer]",rs="[object DataView]",ts="[object Float32Array]",ns="[object Float64Array]",as="[object Int8Array]",is="[object Int16Array]",ss="[object Int32Array]",os="[object Uint8Array]",us="[object Uint8ClampedArray]",fs="[object Uint16Array]",cs="[object Uint32Array]",P={};P[ts]=P[ns]=P[as]=P[is]=P[ss]=P[os]=P[us]=P[fs]=P[cs]=!0;P[Hi]=P[Gi]=P[es]=P[qi]=P[rs]=P[Ki]=P[Yi]=P[Wi]=P[ki]=P[Vi]=P[Ji]=P[zi]=P[Zi]=P[Xi]=P[Qi]=!1;function ls(e){return Bi(e)&&Fi(e.length)&&!!P[Mi(e)]}var ds=ls;function hs(e){return function(r){return e(r)}}var hr=hs,ve={exports:{}};(function(e,r){var t=Ft,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&t.process,f=function(){try{var o=a&&a.require&&a.require("util").types;return o||s&&s.binding&&s.binding("util")}catch{}}();e.exports=f})(ve,ve.exports);var ps=ds,vs=hr,Br=ve.exports,Hr=Br&&Br.isTypedArray,gs=Hr?vs(Hr):ps,pr=gs,ys=Mt,$s=$e,ms=Yt,bs=me,_s=dr,As=ae.exports,Es=Re,Os=pr,Ts="[object Map]",Ss="[object Set]",ws=Object.prototype,Cs=ws.hasOwnProperty;function Is(e){if(e==null)return!0;if(_s(e)&&(bs(e)||typeof e=="string"||typeof e.splice=="function"||As(e)||Os(e)||ms(e)))return!e.length;var r=$s(e);if(r==Ts||r==Ss)return!e.size;if(Es(e))return!ys(e).length;for(var t in e)if(Cs.call(e,t))return!1;return!0}var vr=Is,kt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t="minute",n=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(i,s,f){var o=s.prototype;f.utc=function(p){var O={date:p,utc:!0,args:arguments};return new s(O)},o.utc=function(p){var O=f(this.toDate(),{locale:this.$L,utc:!0});return p?O.add(this.utcOffset(),t):O},o.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var v=o.parse;o.parse=function(p){p.utc&&(this.$u=!0),this.$utils().u(p.$offset)||(this.$offset=p.$offset),v.call(this,p)};var m=o.init;o.init=function(){if(this.$u){var p=this.$d;this.$y=p.getUTCFullYear(),this.$M=p.getUTCMonth(),this.$D=p.getUTCDate(),this.$W=p.getUTCDay(),this.$H=p.getUTCHours(),this.$m=p.getUTCMinutes(),this.$s=p.getUTCSeconds(),this.$ms=p.getUTCMilliseconds()}else m.call(this)};var y=o.utcOffset;o.utcOffset=function(p,O){var j=this.$utils().u;if(j(p))return this.$u?0:j(this.$offset)?y.call(this):this.$offset;if(typeof p=="string"&&(p=function(d){d===void 0&&(d="");var $=d.match(n);if(!$)return null;var w=(""+$[0]).match(a)||["-",0,0],T=w[0],C=60*+w[1]+ +w[2];return C===0?0:T==="+"?C:-C}(p),p===null))return this;var u=Math.abs(p)<=16?60*p:p,c=this;if(O)return c.$offset=u,c.$u=p===0,c;if(p!==0){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(c=this.local().add(u+l,t)).$offset=u,c.$x.$localOffset=l}else c=this.utc();return c};var h=o.format;o.format=function(p){var O=p||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,O)},o.valueOf=function(){var p=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*p},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var g=o.toDate;o.toDate=function(p){return p==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var A=o.diff;o.diff=function(p,O,j){if(p&&this.$u===p.$u)return A.call(this,p,O,j);var u=this.local(),c=f(p).local();return A.call(u,c,O,j)}}})})(kt);var Ds=kt.exports,Vt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(a,i,s){var f,o=function(h,g,A){A===void 0&&(A={});var p=new Date(h),O=function(j,u){u===void 0&&(u={});var c=u.timeZoneName||"short",l=j+"|"+c,d=n[l];return d||(d=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:j,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:c}),n[l]=d),d}(g,A);return O.formatToParts(p)},v=function(h,g){for(var A=o(h,g),p=[],O=0;O<A.length;O+=1){var j=A[O],u=j.type,c=j.value,l=t[u];l>=0&&(p[l]=parseInt(c,10))}var d=p[3],$=d===24?0:d,w=p[0]+"-"+p[1]+"-"+p[2]+" "+$+":"+p[4]+":"+p[5]+":000",T=+h;return(s.utc(w).valueOf()-(T-=T%1e3))/6e4},m=i.prototype;m.tz=function(h,g){h===void 0&&(h=f);var A=this.utcOffset(),p=this.toDate(),O=p.toLocaleString("en-US",{timeZone:h}),j=Math.round((p-new Date(O))/1e3/60),u=s(O).$set("millisecond",this.$ms).utcOffset(15*-Math.round(p.getTimezoneOffset()/15)-j,!0);if(g){var c=u.utcOffset();u=u.add(A-c,"minute")}return u.$x.$timezone=h,u},m.offsetName=function(h){var g=this.$x.$timezone||s.tz.guess(),A=o(this.valueOf(),g,{timeZoneName:h}).find(function(p){return p.type.toLowerCase()==="timezonename"});return A&&A.value};var y=m.startOf;m.startOf=function(h,g){if(!this.$x||!this.$x.$timezone)return y.call(this,h,g);var A=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return y.call(A,h,g).tz(this.$x.$timezone,!0)},s.tz=function(h,g,A){var p=A&&g,O=A||g||f,j=v(+s(),O);if(typeof h!="string")return s(h).tz(O);var u=function($,w,T){var C=$-60*w*1e3,R=v(C,T);if(w===R)return[C,w];var V=v(C-=60*(R-w)*1e3,T);return R===V?[C,R]:[$-60*Math.min(R,V)*1e3,Math.max(R,V)]}(s.utc(h,p).valueOf(),j,O),c=u[0],l=u[1],d=s(c).utcOffset(l);return d.$x.$timezone=O,d},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(h){f=h}}})})(Vt);var js=Vt.exports,Jt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t=1e3,n=6e4,a=36e5,i="millisecond",s="second",f="minute",o="hour",v="day",m="week",y="month",h="quarter",g="year",A="date",p="Invalid Date",O=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,j=/\[([^\]]+)]|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,u={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("_")},c=function(L,E,b){var S=String(L);return!S||S.length>=E?L:""+Array(E+1-S.length).join(b)+L},l={s:c,z:function(L){var E=-L.utcOffset(),b=Math.abs(E),S=Math.floor(b/60),_=b%60;return(E<=0?"+":"-")+c(S,2,"0")+":"+c(_,2,"0")},m:function L(E,b){if(E.date()<b.date())return-L(b,E);var S=12*(b.year()-E.year())+(b.month()-E.month()),_=E.clone().add(S,y),D=b-_<0,I=E.clone().add(S+(D?-1:1),y);return+(-(S+(b-_)/(D?_-I:I-_))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:y,y:g,w:m,d:v,D:A,h:o,m:f,s,ms:i,Q:h}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},d="en",$={};$[d]=u;var w=function(L){return L instanceof V},T=function L(E,b,S){var _;if(!E)return d;if(typeof E=="string"){var D=E.toLowerCase();$[D]&&(_=D),b&&($[D]=b,_=D);var I=E.split("-");if(!_&&I.length>1)return L(I[0])}else{var x=E.name;$[x]=E,_=x}return!S&&_&&(d=_),_||!S&&d},C=function(L,E){if(w(L))return L.clone();var b=typeof E=="object"?E:{};return b.date=L,b.args=arguments,new V(b)},R=l;R.l=T,R.i=w,R.w=function(L,E){return C(L,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var V=function(){function L(b){this.$L=T(b.locale,null,!0),this.parse(b)}var E=L.prototype;return E.parse=function(b){this.$d=function(S){var _=S.date,D=S.utc;if(_===null)return new Date(NaN);if(R.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var I=_.match(O);if(I){var x=I[2]-1||0,M=(I[7]||"0").substring(0,3);return D?new Date(Date.UTC(I[1],x,I[3]||1,I[4]||0,I[5]||0,I[6]||0,M)):new Date(I[1],x,I[3]||1,I[4]||0,I[5]||0,I[6]||0,M)}}return new Date(_)}(b),this.$x=b.x||{},this.init()},E.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},E.$utils=function(){return R},E.isValid=function(){return this.$d.toString()!==p},E.isSame=function(b,S){var _=C(b);return this.startOf(S)<=_&&_<=this.endOf(S)},E.isAfter=function(b,S){return C(b)<this.startOf(S)},E.isBefore=function(b,S){return this.endOf(S)<C(b)},E.$g=function(b,S,_){return R.u(b)?this[S]:this.set(_,b)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(b,S){var _=this,D=!!R.u(S)||S,I=R.p(b),x=function(re,q){var z=R.w(_.$u?Date.UTC(_.$y,q,re):new Date(_.$y,q,re),_);return D?z:z.endOf(v)},M=function(re,q){return R.w(_.toDate()[re].apply(_.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(q)),_)},U=this.$W,B=this.$M,J=this.$D,k="set"+(this.$u?"UTC":"");switch(I){case g:return D?x(1,0):x(31,11);case y:return D?x(1,B):x(0,B+1);case m:var le=this.$locale().weekStart||0,de=(U<le?U+7:U)-le;return x(D?J-de:J+(6-de),B);case v:case A:return M(k+"Hours",0);case o:return M(k+"Minutes",1);case f:return M(k+"Seconds",2);case s:return M(k+"Milliseconds",3);default:return this.clone()}},E.endOf=function(b){return this.startOf(b,!1)},E.$set=function(b,S){var _,D=R.p(b),I="set"+(this.$u?"UTC":""),x=(_={},_[v]=I+"Date",_[A]=I+"Date",_[y]=I+"Month",_[g]=I+"FullYear",_[o]=I+"Hours",_[f]=I+"Minutes",_[s]=I+"Seconds",_[i]=I+"Milliseconds",_)[D],M=D===v?this.$D+(S-this.$W):S;if(D===y||D===g){var U=this.clone().set(A,1);U.$d[x](M),U.init(),this.$d=U.set(A,Math.min(this.$D,U.daysInMonth())).$d}else x&&this.$d[x](M);return this.init(),this},E.set=function(b,S){return this.clone().$set(b,S)},E.get=function(b){return this[R.p(b)]()},E.add=function(b,S){var _,D=this;b=Number(b);var I=R.p(S),x=function(B){var J=C(D);return R.w(J.date(J.date()+Math.round(B*b)),D)};if(I===y)return this.set(y,this.$M+b);if(I===g)return this.set(g,this.$y+b);if(I===v)return x(1);if(I===m)return x(7);var M=(_={},_[f]=n,_[o]=a,_[s]=t,_)[I]||1,U=this.$d.getTime()+b*M;return R.w(U,this)},E.subtract=function(b,S){return this.add(-1*b,S)},E.format=function(b){var S=this,_=this.$locale();if(!this.isValid())return _.invalidDate||p;var D=b||"YYYY-MM-DDTHH:mm:ssZ",I=R.z(this),x=this.$H,M=this.$m,U=this.$M,B=_.weekdays,J=_.months,k=function(q,z,Ke,_e){return q&&(q[z]||q(S,D))||Ke[z].slice(0,_e)},le=function(q){return R.s(x%12||12,q,"0")},de=_.meridiem||function(q,z,Ke){var _e=q<12?"AM":"PM";return Ke?_e.toLowerCase():_e},re={YY:String(this.$y).slice(-2),YYYY:this.$y,M:U+1,MM:R.s(U+1,2,"0"),MMM:k(_.monthsShort,U,J,3),MMMM:k(J,U),D:this.$D,DD:R.s(this.$D,2,"0"),d:String(this.$W),dd:k(_.weekdaysMin,this.$W,B,2),ddd:k(_.weekdaysShort,this.$W,B,3),dddd:B[this.$W],H:String(x),HH:R.s(x,2,"0"),h:le(1),hh:le(2),a:de(x,M,!0),A:de(x,M,!1),m:String(M),mm:R.s(M,2,"0"),s:String(this.$s),ss:R.s(this.$s,2,"0"),SSS:R.s(this.$ms,3,"0"),Z:I};return D.replace(j,function(q,z){return z||re[q]||I.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(b,S,_){var D,I=R.p(S),x=C(b),M=(x.utcOffset()-this.utcOffset())*n,U=this-x,B=R.m(this,x);return B=(D={},D[g]=B/12,D[y]=B,D[h]=B/3,D[m]=(U-M)/6048e5,D[v]=(U-M)/864e5,D[o]=U/a,D[f]=U/n,D[s]=U/t,D)[I]||U,_?B:R.a(B)},E.daysInMonth=function(){return this.endOf(y).$D},E.$locale=function(){return $[this.$L]},E.locale=function(b,S){if(!b)return this.$L;var _=this.clone(),D=T(b,S,!0);return D&&(_.$L=D),_},E.clone=function(){return R.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},L}(),Ir=V.prototype;return C.prototype=Ir,[["$ms",i],["$s",s],["$m",f],["$H",o],["$W",v],["$M",y],["$y",g],["$D",A]].forEach(function(L){Ir[L[1]]=function(E){return this.$g(E,L[0],L[1])}}),C.extend=function(L,E){return L.$i||(L(E,V,C),L.$i=!0),C},C.locale=T,C.isDayjs=w,C.unix=function(L){return C(1e3*L)},C.en=$[d],C.Ls=$,C.p={},C})})(Jt);var ge=Jt.exports;ge.extend(Ds);ge.extend(js);const zt=["SUN","MON","TUE","WED","THU","FRI","SAT"],Ce=e=>{const[r,t]=e.split(":");return{hour:parseInt(r||"0",10),minutes:parseInt(t||"0",10)}};function nr(e,r,t){const{availability:n}=e;if(!n)return!0;if(vr(n))return!1;const a=t?ge(t).tz(r):ge().tz(r),i=a.day(),s=n[zt[i]];if(!Array.isArray(s)||s.length!==2)return!1;const f=a.hour(),o=a.minute(),v=Ce(s[0]),m=Ce(s[1]);return f<v.hour||f===v.hour&&o<v.minutes?!1:!(f>m.hour||f===m.hour&&o>m.minutes)}const ar=(e,r=void 0,t=void 0,n=!1)=>n?e.map(i=>{let s;return Array.isArray(i.items)&&(s=ar(i.items,r,t,n)),{...i,items:s,outsideAvailabilitySlot:!nr(i,r,t)||(s==null?void 0:s.every(f=>f.outsideAvailabilitySlot))||!1}}):e.filter(i=>nr(i,r,t)).map(i=>Array.isArray(i.items)?{...i,items:ar(i.items,r,t)}:i),Gr=(e,r=void 0,t=void 0,n=!1)=>{let a=[];return e.forEach(i=>{if(!Array.isArray(i.items)){a.push(i);return}const s=ar(i.items,r,t,n);s.length>0&&a.push({...i,items:s})}),n&&(a=a.map(i=>!i.items||!Array.isArray(i.items)?i:{...i,outsideAvailabilitySlot:!nr(i,r,t)||i.items.every(s=>s.outsideAvailabilitySlot)})),a};function pe(e){const r=e==null?void 0:e.week;if(!e||!e.active||!r)return!1;const t=ge(),n=t.day(),a=r[zt[n]];return a?a.some(i=>Ls(t,i)):!1}function Ls(e,r){const t=e.hour(),n=e.minute(),a=Ce(r.from),i=Ce(r.to);return t<a.hour||t===a.hour&&n<a.minutes?!1:!(t>i.hour||t===i.hour&&n>i.minutes)}function Rs(){this.__data__=[],this.size=0}var xs=Rs;function Ns(e,r){return e===r||e!==e&&r!==r}var gr=Ns,Ps=gr;function Us(e,r){for(var t=e.length;t--;)if(Ps(e[t][0],r))return t;return-1}var Pe=Us,Ms=Pe,Fs=Array.prototype,Bs=Fs.splice;function Hs(e){var r=this.__data__,t=Ms(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Bs.call(r,t,1),--this.size,!0}var Gs=Hs,qs=Pe;function Ks(e){var r=this.__data__,t=qs(r,e);return t<0?void 0:r[t][1]}var Ys=Ks,Ws=Pe;function ks(e){return Ws(this.__data__,e)>-1}var Vs=ks,Js=Pe;function zs(e,r){var t=this.__data__,n=Js(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}var Zs=zs,Xs=xs,Qs=Gs,eo=Ys,ro=Vs,to=Zs;function oe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}oe.prototype.clear=Xs;oe.prototype.delete=Qs;oe.prototype.get=eo;oe.prototype.has=ro;oe.prototype.set=to;var Ue=oe,no=Ue;function ao(){this.__data__=new no,this.size=0}var io=ao;function so(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}var oo=so;function uo(e){return this.__data__.get(e)}var fo=uo;function co(e){return this.__data__.has(e)}var lo=co,ho=Q,po=ho(Object,"create"),Me=po,qr=Me;function vo(){this.__data__=qr?qr(null):{},this.size=0}var go=vo;function yo(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var $o=yo,mo=Me,bo="__lodash_hash_undefined__",_o=Object.prototype,Ao=_o.hasOwnProperty;function Eo(e){var r=this.__data__;if(mo){var t=r[e];return t===bo?void 0:t}return Ao.call(r,e)?r[e]:void 0}var Oo=Eo,To=Me,So=Object.prototype,wo=So.hasOwnProperty;function Co(e){var r=this.__data__;return To?r[e]!==void 0:wo.call(r,e)}var Io=Co,Do=Me,jo="__lodash_hash_undefined__";function Lo(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Do&&r===void 0?jo:r,this}var Ro=Lo,xo=go,No=$o,Po=Oo,Uo=Io,Mo=Ro;function ue(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}ue.prototype.clear=xo;ue.prototype.delete=No;ue.prototype.get=Po;ue.prototype.has=Uo;ue.prototype.set=Mo;var Fo=ue,Kr=Fo,Bo=Ue,Ho=lr;function Go(){this.size=0,this.__data__={hash:new Kr,map:new(Ho||Bo),string:new Kr}}var qo=Go;function Ko(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var Yo=Ko,Wo=Yo;function ko(e,r){var t=e.__data__;return Wo(r)?t[typeof r=="string"?"string":"hash"]:t.map}var Fe=ko,Vo=Fe;function Jo(e){var r=Vo(this,e).delete(e);return this.size-=r?1:0,r}var zo=Jo,Zo=Fe;function Xo(e){return Zo(this,e).get(e)}var Qo=Xo,eu=Fe;function ru(e){return eu(this,e).has(e)}var tu=ru,nu=Fe;function au(e,r){var t=nu(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}var iu=au,su=qo,ou=zo,uu=Qo,fu=tu,cu=iu;function fe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}fe.prototype.clear=su;fe.prototype.delete=ou;fe.prototype.get=uu;fe.prototype.has=fu;fe.prototype.set=cu;var Zt=fe,lu=Ue,du=lr,hu=Zt,pu=200;function vu(e,r){var t=this.__data__;if(t instanceof lu){var n=t.__data__;if(!du||n.length<pu-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new hu(n)}return t.set(e,r),this.size=t.size,this}var gu=vu,yu=Ue,$u=io,mu=oo,bu=fo,_u=lo,Au=gu;function ce(e){var r=this.__data__=new yu(e);this.size=r.size}ce.prototype.clear=$u;ce.prototype.delete=mu;ce.prototype.get=bu;ce.prototype.has=_u;ce.prototype.set=Au;var Xt=ce,Eu="__lodash_hash_undefined__";function Ou(e){return this.__data__.set(e,Eu),this}var Tu=Ou;function Su(e){return this.__data__.has(e)}var wu=Su,Cu=Zt,Iu=Tu,Du=wu;function Ie(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new Cu;++r<t;)this.add(e[r])}Ie.prototype.add=Ie.prototype.push=Iu;Ie.prototype.has=Du;var ju=Ie;function Lu(e,r){for(var t=-1,n=e==null?0:e.length;++t<n;)if(r(e[t],t,e))return!0;return!1}var Ru=Lu;function xu(e,r){return e.has(r)}var Nu=xu,Pu=ju,Uu=Ru,Mu=Nu,Fu=1,Bu=2;function Hu(e,r,t,n,a,i){var s=t&Fu,f=e.length,o=r.length;if(f!=o&&!(s&&o>f))return!1;var v=i.get(e),m=i.get(r);if(v&&m)return v==r&&m==e;var y=-1,h=!0,g=t&Bu?new Pu:void 0;for(i.set(e,r),i.set(r,e);++y<f;){var A=e[y],p=r[y];if(n)var O=s?n(p,A,y,r,e,i):n(A,p,y,e,r,i);if(O!==void 0){if(O)continue;h=!1;break}if(g){if(!Uu(r,function(j,u){if(!Mu(g,u)&&(A===j||a(A,j,t,n,i)))return g.push(u)})){h=!1;break}}else if(!(A===p||a(A,p,t,n,i))){h=!1;break}}return i.delete(e),i.delete(r),h}var Qt=Hu,Gu=W,qu=Gu.Uint8Array,en=qu;function Ku(e){var r=-1,t=Array(e.size);return e.forEach(function(n,a){t[++r]=[a,n]}),t}var Yu=Ku;function Wu(e){var r=-1,t=Array(e.size);return e.forEach(function(n){t[++r]=n}),t}var ku=Wu,Yr=xe,Wr=en,Vu=gr,Ju=Qt,zu=Yu,Zu=ku,Xu=1,Qu=2,ef="[object Boolean]",rf="[object Date]",tf="[object Error]",nf="[object Map]",af="[object Number]",sf="[object RegExp]",of="[object Set]",uf="[object String]",ff="[object Symbol]",cf="[object ArrayBuffer]",lf="[object DataView]",kr=Yr?Yr.prototype:void 0,We=kr?kr.valueOf:void 0;function df(e,r,t,n,a,i,s){switch(t){case lf:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case cf:return!(e.byteLength!=r.byteLength||!i(new Wr(e),new Wr(r)));case ef:case rf:case af:return Vu(+e,+r);case tf:return e.name==r.name&&e.message==r.message;case sf:case uf:return e==r+"";case nf:var f=zu;case of:var o=n&Xu;if(f||(f=Zu),e.size!=r.size&&!o)return!1;var v=s.get(e);if(v)return v==r;n|=Qu,s.set(e,r);var m=Ju(f(e),f(r),n,a,i,s);return s.delete(e),m;case ff:if(We)return We.call(e)==We.call(r)}return!1}var hf=df;function pf(e,r){for(var t=-1,n=r.length,a=e.length;++t<n;)e[a+t]=r[t];return e}var rn=pf,vf=rn,gf=me;function yf(e,r,t){var n=r(e);return gf(e)?n:vf(n,t(e))}var tn=yf;function $f(e,r){for(var t=-1,n=e==null?0:e.length,a=0,i=[];++t<n;){var s=e[t];r(s,t,e)&&(i[a++]=s)}return i}var mf=$f;function bf(){return[]}var nn=bf,_f=mf,Af=nn,Ef=Object.prototype,Of=Ef.propertyIsEnumerable,Vr=Object.getOwnPropertySymbols,Tf=Vr?function(e){return e==null?[]:(e=Object(e),_f(Vr(e),function(r){return Of.call(e,r)}))}:Af,yr=Tf;function Sf(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var wf=Sf,Cf=9007199254740991,If=/^(?:0|[1-9]\d*)$/;function Df(e,r){var t=typeof e;return r=r==null?Cf:r,!!r&&(t=="number"||t!="symbol"&&If.test(e))&&e>-1&&e%1==0&&e<r}var jf=Df,Lf=wf,Rf=Yt,xf=me,Nf=ae.exports,Pf=jf,Uf=pr,Mf=Object.prototype,Ff=Mf.hasOwnProperty;function Bf(e,r){var t=xf(e),n=!t&&Rf(e),a=!t&&!n&&Nf(e),i=!t&&!n&&!a&&Uf(e),s=t||n||a||i,f=s?Lf(e.length,String):[],o=f.length;for(var v in e)(r||Ff.call(e,v))&&!(s&&(v=="length"||a&&(v=="offset"||v=="parent")||i&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||Pf(v,o)))&&f.push(v);return f}var an=Bf,Hf=an,Gf=Mt,qf=dr;function Kf(e){return qf(e)?Hf(e):Gf(e)}var $r=Kf,Yf=tn,Wf=yr,kf=$r;function Vf(e){return Yf(e,kf,Wf)}var sn=Vf,Jr=sn,Jf=1,zf=Object.prototype,Zf=zf.hasOwnProperty;function Xf(e,r,t,n,a,i){var s=t&Jf,f=Jr(e),o=f.length,v=Jr(r),m=v.length;if(o!=m&&!s)return!1;for(var y=o;y--;){var h=f[y];if(!(s?h in r:Zf.call(r,h)))return!1}var g=i.get(e),A=i.get(r);if(g&&A)return g==r&&A==e;var p=!0;i.set(e,r),i.set(r,e);for(var O=s;++y<o;){h=f[y];var j=e[h],u=r[h];if(n)var c=s?n(u,j,h,r,e,i):n(j,u,h,e,r,i);if(!(c===void 0?j===u||a(j,u,t,n,i):c)){p=!1;break}O||(O=h=="constructor")}if(p&&!O){var l=e.constructor,d=r.constructor;l!=d&&"constructor"in e&&"constructor"in r&&!(typeof l=="function"&&l instanceof l&&typeof d=="function"&&d instanceof d)&&(p=!1)}return i.delete(e),i.delete(r),p}var Qf=Xf,ke=Xt,ec=Qt,rc=hf,tc=Qf,zr=$e,Zr=me,Xr=ae.exports,nc=pr,ac=1,Qr="[object Arguments]",et="[object Array]",Ae="[object Object]",ic=Object.prototype,rt=ic.hasOwnProperty;function sc(e,r,t,n,a,i){var s=Zr(e),f=Zr(r),o=s?et:zr(e),v=f?et:zr(r);o=o==Qr?Ae:o,v=v==Qr?Ae:v;var m=o==Ae,y=v==Ae,h=o==v;if(h&&Xr(e)){if(!Xr(r))return!1;s=!0,m=!1}if(h&&!m)return i||(i=new ke),s||nc(e)?ec(e,r,t,n,a,i):rc(e,r,o,t,n,a,i);if(!(t&ac)){var g=m&&rt.call(e,"__wrapped__"),A=y&&rt.call(r,"__wrapped__");if(g||A){var p=g?e.value():e,O=A?r.value():r;return i||(i=new ke),a(p,O,t,n,i)}}return h?(i||(i=new ke),tc(e,r,t,n,a,i)):!1}var oc=sc,uc=oc,tt=se;function on(e,r,t,n,a){return e===r?!0:e==null||r==null||!tt(e)&&!tt(r)?e!==e&&r!==r:uc(e,r,t,n,on,a)}var fc=on,cc=fc;function lc(e,r){return cc(e,r)}var un=lc;function fn(e){let r=0;return e==null||e.forEach(t=>r+=Number(t.discountPrice)),r}function dc(e){return fn(e.discounts)}function hc(e,r,t=",",n=2){return`${Number(e).toFixed(n).replace(".",t)}${r?"\xA0"+r:""}`}function cn(e,r){var a;const t=(a=e._)==null?void 0:a.enableKey;return t?!r||!Array.isArray(r)||r.length===0?!1:t.replace(/\s/g,"").split(",").some(i=>r.includes(i)):!0}function pc(e){var t,n,a,i,s,f;const r=(n=(t=e.details)==null?void 0:t.literals)==null?void 0:n.name.split(" ").filter(o=>o!=="");return r?r.length===1?((f=(s=(i=(a=e.details)==null?void 0:a.literals)==null?void 0:i.name)==null?void 0:s.slice)==null?void 0:f.call(s,0,2))||"":r.length>1?`${r[0][0]}${r[1][0]}`:"":""}function ln(e,r=!1,t=void 0,n=60){const[a,i]=G.useState(e&&Gr(e,t,void 0,r));Le(s,n*1e3);function s(){const f=e&&Gr(e,t,void 0,r);un(f,a)||(console.log("menu has changed",f),i(f))}return G.useEffect(s,[a,e]),a}function dn(e,r){return e.__||(e.__={}),e.__.isHiddenByEnableKey=!cn(e,r),e.items&&e.items.length>0&&(e.items=e.items.map(t=>dn(t,r))),e}function vc(e,r){if(!!e)return e.map(t=>dn(t,r))}function gc({originalMenu:e,markOnly:r=!1,timeZone:t,interval:n=60,enableKeys:a=[]}){const i=ln(e,r,t,n);return vc(i,a)}var nt;(function(e){e.UNINITIALIZED="UNINITIALIZED",e.PROCESSING="PROCESSING",e.PAID="PAID",e.FAILED="FAILED",e.PRINTING_RECEIPT="PRINTING_RECEIPT",e.PRINTING_RECEIPT_SUCCESS="PRINTING_RECEIPT_SUCCESS",e.SENDING_RECEIPT="SENDING_RECEIPT",e.SENDING_RECEIPT_SUCCESS="SENDING_RECEIPT_SUCCESS",e.ERROR="ERROR"})(nt||(nt={}));var at;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(at||(at={}));var ir;(function(e){e.GROUP="3e/group",e.PRODUCT="3e/product",e.CATEGORY="3e/group/category",e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.STATIC="3e/static",e.REF="3e/ref",e.QUERY="3e/query"})(ir||(ir={}));var it;(function(e){e.GROUP="group",e.PRODUCT="product"})(it||(it={}));var st;(function(e){e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.DINE_IN="DINE_IN",e.DINE_IN_OPEN="DINE_IN_OPEN",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.GLOVO_TAKE_AWAY="GLOVO_TAKE_AWAY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.JUSTEAT_TAKE_AWAY="JUSTEAT_TAKE_AWAY",e.UBER_DELIVERY="UBER_DELIVERY",e.UBER_TAKE_AWAY="UBER_TAKE_AWAY",e.UBER_DINE_IN="UBER_DINE_IN",e.BOLT_DELIVERY="BOLT_DELIVERY",e.BOLT_TAKE_AWAY="BOLT_TAKE_AWAY",e.WOLT_DELIVERY="WOLT_DELIVERY",e.WOLT_TAKE_AWAY="WOLT_TAKE_AWAY",e.WOLT_DINE_IN="WOLT_DINE_IN"})(st||(st={}));var ot;(function(e){e.NEW="NEW",e.COMPLETED="COMPLETED",e.VERIFIED="VERIFIED",e.DELIVER="DELIVER",e.DELIVERED="DELIVERED",e.CLOSED="CLOSED",e.ABANDONED="ABANDONED",e.CANCELLED="CANCELLED",e.PICKED="PICKED"})(ot||(ot={}));var ut;(function(e){e.CASH="CASH",e.CARD="CARD",e.COD="COD",e.TERMINAL="TERMINAL",e.EPAYMENT="EPAYMENT",e.COUPON="COUPON",e.WALLET="WALLET",e.PREAUTHORIZED="PREAUTHORIZED",e.RETURN="RETURN",e.EXTERNAL="EXTERNAL"})(ut||(ut={}));var ft;(function(e){e.KIOSK="KIOSK",e.WEB="WEB",e.JUST_EAT_TAKE_AWAY="JUSTEATTAKEAWAY",e.GLOVO="GLOVO",e.PYSZNE="PYSZNE",e.WOLT="WOLT",e.UBER="UBER",e.BOLT="BOLT"})(ft||(ft={}));var ct;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(ct||(ct={}));var lt;(function(e){e.GROUP="group",e.PRODUCT="product"})(lt||(lt={}));var dt;(function(e){e.DINE_IN="DINE_IN",e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.GLOVO="GLOVO",e.JUSTEAT="JUSTEAT",e.UBER="UBER",e.BOLT="BOLT",e.WOLT="WOLT"})(dt||(dt={}));var ht;(function(e){e.ORDER_EVENT_ERROR="OrderEventError",e.ORDER_APPLIED_EVENTS="OrderAppliedEvents",e.ORDER_EVENT_FISCAL="OrderEventFiscal",e.ORDER_UPSELL="OrderUpsell"})(ht||(ht={}));function yc(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var $c=yc,mc=Q,bc=function(){try{var e=mc(Object,"defineProperty");return e({},"",{}),e}catch{}}(),_c=bc,pt=_c;function Ac(e,r,t){r=="__proto__"&&pt?pt(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var hn=Ac,Ec=hn,Oc=gr,Tc=Object.prototype,Sc=Tc.hasOwnProperty;function wc(e,r,t){var n=e[r];(!(Sc.call(e,r)&&Oc(n,t))||t===void 0&&!(r in e))&&Ec(e,r,t)}var pn=wc,Cc=pn,Ic=hn;function Dc(e,r,t,n){var a=!t;t||(t={});for(var i=-1,s=r.length;++i<s;){var f=r[i],o=n?n(t[f],e[f],f,t,e):void 0;o===void 0&&(o=e[f]),a?Ic(t,f,o):Cc(t,f,o)}return t}var Be=Dc,jc=Be,Lc=$r;function Rc(e,r){return e&&jc(r,Lc(r),e)}var xc=Rc;function Nc(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var Pc=Nc,Uc=ye,Mc=Re,Fc=Pc,Bc=Object.prototype,Hc=Bc.hasOwnProperty;function Gc(e){if(!Uc(e))return Fc(e);var r=Mc(e),t=[];for(var n in e)n=="constructor"&&(r||!Hc.call(e,n))||t.push(n);return t}var qc=Gc,Kc=an,Yc=qc,Wc=dr;function kc(e){return Wc(e)?Kc(e,!0):Yc(e)}var mr=kc,Vc=Be,Jc=mr;function zc(e,r){return e&&Vc(r,Jc(r),e)}var Zc=zc,sr={exports:{}};(function(e,r){var t=W,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?t.Buffer:void 0,f=s?s.allocUnsafe:void 0;function o(v,m){if(m)return v.slice();var y=v.length,h=f?f(y):new v.constructor(y);return v.copy(h),h}e.exports=o})(sr,sr.exports);function Xc(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var Qc=Xc,el=Be,rl=yr;function tl(e,r){return el(e,rl(e),r)}var nl=tl,al=Ut,il=al(Object.getPrototypeOf,Object),vn=il,sl=rn,ol=vn,ul=yr,fl=nn,cl=Object.getOwnPropertySymbols,ll=cl?function(e){for(var r=[];e;)sl(r,ul(e)),e=ol(e);return r}:fl,gn=ll,dl=Be,hl=gn;function pl(e,r){return dl(e,hl(e),r)}var vl=pl,gl=tn,yl=gn,$l=mr;function ml(e){return gl(e,$l,yl)}var bl=ml,_l=Object.prototype,Al=_l.hasOwnProperty;function El(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&Al.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var Ol=El,vt=en;function Tl(e){var r=new e.constructor(e.byteLength);return new vt(r).set(new vt(e)),r}var br=Tl,Sl=br;function wl(e,r){var t=r?Sl(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var Cl=wl,Il=/\w*$/;function Dl(e){var r=new e.constructor(e.source,Il.exec(e));return r.lastIndex=e.lastIndex,r}var jl=Dl,gt=xe,yt=gt?gt.prototype:void 0,$t=yt?yt.valueOf:void 0;function Ll(e){return $t?Object($t.call(e)):{}}var Rl=Ll,xl=br;function Nl(e,r){var t=r?xl(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Pl=Nl,Ul=br,Ml=Cl,Fl=jl,Bl=Rl,Hl=Pl,Gl="[object Boolean]",ql="[object Date]",Kl="[object Map]",Yl="[object Number]",Wl="[object RegExp]",kl="[object Set]",Vl="[object String]",Jl="[object Symbol]",zl="[object ArrayBuffer]",Zl="[object DataView]",Xl="[object Float32Array]",Ql="[object Float64Array]",ed="[object Int8Array]",rd="[object Int16Array]",td="[object Int32Array]",nd="[object Uint8Array]",ad="[object Uint8ClampedArray]",id="[object Uint16Array]",sd="[object Uint32Array]";function od(e,r,t){var n=e.constructor;switch(r){case zl:return Ul(e);case Gl:case ql:return new n(+e);case Zl:return Ml(e,t);case Xl:case Ql:case ed:case rd:case td:case nd:case ad:case id:case sd:return Hl(e,t);case Kl:return new n;case Yl:case Vl:return new n(e);case Wl:return Fl(e);case kl:return new n;case Jl:return Bl(e)}}var ud=od,fd=ye,mt=Object.create,cd=function(){function e(){}return function(r){if(!fd(r))return{};if(mt)return mt(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}(),ld=cd,dd=ld,hd=vn,pd=Re;function vd(e){return typeof e.constructor=="function"&&!pd(e)?dd(hd(e)):{}}var gd=vd,yd=$e,$d=se,md="[object Map]";function bd(e){return $d(e)&&yd(e)==md}var _d=bd,Ad=_d,Ed=hr,bt=ve.exports,_t=bt&&bt.isMap,Od=_t?Ed(_t):Ad,Td=Od,Sd=$e,wd=se,Cd="[object Set]";function Id(e){return wd(e)&&Sd(e)==Cd}var Dd=Id,jd=Dd,Ld=hr,At=ve.exports,Et=At&&At.isSet,Rd=Et?Ld(Et):jd,xd=Rd,Nd=Xt,Pd=$c,Ud=pn,Md=xc,Fd=Zc,Bd=sr.exports,Hd=Qc,Gd=nl,qd=vl,Kd=sn,Yd=bl,Wd=$e,kd=Ol,Vd=ud,Jd=gd,zd=me,Zd=ae.exports,Xd=Td,Qd=ye,eh=xd,rh=$r,th=mr,nh=1,ah=2,ih=4,yn="[object Arguments]",sh="[object Array]",oh="[object Boolean]",uh="[object Date]",fh="[object Error]",$n="[object Function]",ch="[object GeneratorFunction]",lh="[object Map]",dh="[object Number]",mn="[object Object]",hh="[object RegExp]",ph="[object Set]",vh="[object String]",gh="[object Symbol]",yh="[object WeakMap]",$h="[object ArrayBuffer]",mh="[object DataView]",bh="[object Float32Array]",_h="[object Float64Array]",Ah="[object Int8Array]",Eh="[object Int16Array]",Oh="[object Int32Array]",Th="[object Uint8Array]",Sh="[object Uint8ClampedArray]",wh="[object Uint16Array]",Ch="[object Uint32Array]",N={};N[yn]=N[sh]=N[$h]=N[mh]=N[oh]=N[uh]=N[bh]=N[_h]=N[Ah]=N[Eh]=N[Oh]=N[lh]=N[dh]=N[mn]=N[hh]=N[ph]=N[vh]=N[gh]=N[Th]=N[Sh]=N[wh]=N[Ch]=!0;N[fh]=N[$n]=N[yh]=!1;function Te(e,r,t,n,a,i){var s,f=r&nh,o=r&ah,v=r&ih;if(t&&(s=a?t(e,n,a,i):t(e)),s!==void 0)return s;if(!Qd(e))return e;var m=zd(e);if(m){if(s=kd(e),!f)return Hd(e,s)}else{var y=Wd(e),h=y==$n||y==ch;if(Zd(e))return Bd(e,f);if(y==mn||y==yn||h&&!a){if(s=o||h?{}:Jd(e),!f)return o?qd(e,Fd(s,e)):Gd(e,Md(s,e))}else{if(!N[y])return a?e:{};s=Vd(e,y,f)}}i||(i=new Nd);var g=i.get(e);if(g)return g;i.set(e,s),eh(e)?e.forEach(function(O){s.add(Te(O,r,t,O,e,i))}):Xd(e)&&e.forEach(function(O,j){s.set(j,Te(O,r,t,j,e,i))});var A=v?o?Yd:Kd:o?th:rh,p=m?void 0:A(e);return Pd(p||e,function(O,j){p&&(j=O,O=e[j]),Ud(s,j,Te(O,r,t,j,e,i))}),s}var Ih=Te,Dh=Ih,jh=1,Lh=4;function Rh(e){return Dh(e,jh|Lh)}var xh=Rh;function Nh(e,r){if(!r||!r.filter||!e||!e.filter||e.kind!==ir.CONFIG)return!0;if(e.filter&&e.items){const t=Object.values(e.filter).flat().filter(n=>{var a,i,s,f;return r.filter[(i=(a=e.items)==null?void 0:a[0])==null?void 0:i.fltCtx]&&Object.values(r.filter[(f=(s=e.items)==null?void 0:s[0])==null?void 0:f.fltCtx]).includes(n)});if(Array.isArray(t)&&t.length===0)return!1}return!0}const De=(e,r,t=0)=>{if(!e)return 0;let n=parseFloat(e.price)||0;const{items:a}=e,i=xh(r);return Nh(e,i)&&Array.isArray(a)&&a.forEach(s=>{let f=0;if(s.kind!=="3e/product")f=De(s,i,t+1);else{const{selected:o={}}=i,{selCtx:v,id:m}=s;v in o&&m in o[v]&&(f=De(s,i,t+1)*o[v][m],delete i.selected[v][m])}n+=f}),Math.round(100*n)/100},Ph=({product:e,state:r,selected:t,cheapestGroupOptionsProduct:n})=>{var o;const a=r?De(e,r):0,i=e.state&&!vr((o=e==null?void 0:e.state)==null?void 0:o.selected)?De(e,e.state):0,s=e.minPrice&&parseFloat(e.price)===a;let f=t||!!n||parseFloat(e.price)===0?a||i:parseFloat(e.price);return n!==void 0&&(f-=n),s&&e.minPrice&&(f=parseFloat(e.minPrice)),{displayPrice:f,showAsMinPrice:s,calculatedPriceDefaultProductState:i}};function _r(e){const r=[];return e.reduce((t,n)=>{if(t[n.hash]||(t[n.hash]={...n,quantity:0,discounted:0,discounts:[],firstProductQuantity:n.quantity,itemsToRemove:[]},r.push(t[n.hash])),t[n.hash].quantity+=n.quantity,t[n.hash].itemsToRemove.push(n.id),n.discounts){t[n.hash].discounts||(t[n.hash].discounts=[]),t[n.hash].discounts=t[n.hash].discounts.concat(n.discounts),t[n.hash].discounted=0;for(let a=0;a<t[n.hash].discounts.length;a+=1)t[n.hash].discounts[a]&&(t[n.hash].discounted+=parseFloat(t[n.hash].discounts[a].discountPrice))}return t},{}),r}function Uh(e){return _r(e)}function Mh(e){return!e||e.length===0?null:_r(e.flatMap(r=>r.lines))}var Ar={exports:{}},bn=function(r,t){return function(){for(var a=new Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return r.apply(t,a)}},Fh=bn,ee=Object.prototype.toString;function Er(e){return ee.call(e)==="[object Array]"}function or(e){return typeof e=="undefined"}function Bh(e){return e!==null&&!or(e)&&e.constructor!==null&&!or(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Hh(e){return ee.call(e)==="[object ArrayBuffer]"}function Gh(e){return typeof FormData!="undefined"&&e instanceof FormData}function qh(e){var r;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&e.buffer instanceof ArrayBuffer,r}function Kh(e){return typeof e=="string"}function Yh(e){return typeof e=="number"}function _n(e){return e!==null&&typeof e=="object"}function Se(e){if(ee.call(e)!=="[object Object]")return!1;var r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function Wh(e){return ee.call(e)==="[object Date]"}function kh(e){return ee.call(e)==="[object File]"}function Vh(e){return ee.call(e)==="[object Blob]"}function An(e){return ee.call(e)==="[object Function]"}function Jh(e){return _n(e)&&An(e.pipe)}function zh(e){return typeof URLSearchParams!="undefined"&&e instanceof URLSearchParams}function Zh(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Xh(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function Or(e,r){if(!(e===null||typeof e=="undefined"))if(typeof e!="object"&&(e=[e]),Er(e))for(var t=0,n=e.length;t<n;t++)r.call(null,e[t],t,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.call(null,e[a],a,e)}function ur(){var e={};function r(a,i){Se(e[i])&&Se(a)?e[i]=ur(e[i],a):Se(a)?e[i]=ur({},a):Er(a)?e[i]=a.slice():e[i]=a}for(var t=0,n=arguments.length;t<n;t++)Or(arguments[t],r);return e}function Qh(e,r,t){return Or(r,function(a,i){t&&typeof a=="function"?e[i]=Fh(a,t):e[i]=a}),e}function ep(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var K={isArray:Er,isArrayBuffer:Hh,isBuffer:Bh,isFormData:Gh,isArrayBufferView:qh,isString:Kh,isNumber:Yh,isObject:_n,isPlainObject:Se,isUndefined:or,isDate:Wh,isFile:kh,isBlob:Vh,isFunction:An,isStream:Jh,isURLSearchParams:zh,isStandardBrowserEnv:Xh,forEach:Or,merge:ur,extend:Qh,trim:Zh,stripBOM:ep},te=K;function Ot(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var En=function(r,t,n){if(!t)return r;var a;if(n)a=n(t);else if(te.isURLSearchParams(t))a=t.toString();else{var i=[];te.forEach(t,function(o,v){o===null||typeof o=="undefined"||(te.isArray(o)?v=v+"[]":o=[o],te.forEach(o,function(y){te.isDate(y)?y=y.toISOString():te.isObject(y)&&(y=JSON.stringify(y)),i.push(Ot(v)+"="+Ot(y))}))}),a=i.join("&")}if(a){var s=r.indexOf("#");s!==-1&&(r=r.slice(0,s)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r},rp=K;function He(){this.handlers=[]}He.prototype.use=function(r,t,n){return this.handlers.push({fulfilled:r,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};He.prototype.eject=function(r){this.handlers[r]&&(this.handlers[r]=null)};He.prototype.forEach=function(r){rp.forEach(this.handlers,function(n){n!==null&&r(n)})};var tp=He,np=K,ap=function(r,t){np.forEach(r,function(a,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(r[t]=a,delete r[i])})},On=function(r,t,n,a,i){return r.config=t,n&&(r.code=n),r.request=a,r.response=i,r.isAxiosError=!0,r.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:this.config,code:this.code}},r},ip=On,Tn=function(r,t,n,a,i){var s=new Error(r);return ip(s,t,n,a,i)},sp=Tn,op=function(r,t,n){var a=n.config.validateStatus;!n.status||!a||a(n.status)?r(n):t(sp("Request failed with status code "+n.status,n.config,null,n.request,n))},Ee=K,up=Ee.isStandardBrowserEnv()?function(){return{write:function(t,n,a,i,s,f){var o=[];o.push(t+"="+encodeURIComponent(n)),Ee.isNumber(a)&&o.push("expires="+new Date(a).toGMTString()),Ee.isString(i)&&o.push("path="+i),Ee.isString(s)&&o.push("domain="+s),f===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),fp=function(r){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(r)},cp=function(r,t){return t?r.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):r},lp=fp,dp=cp,hp=function(r,t){return r&&!lp(t)?dp(r,t):t},Ve=K,pp=["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"],vp=function(r){var t={},n,a,i;return r&&Ve.forEach(r.split(`
2
- `),function(f){if(i=f.indexOf(":"),n=Ve.trim(f.substr(0,i)).toLowerCase(),a=Ve.trim(f.substr(i+1)),n){if(t[n]&&pp.indexOf(n)>=0)return;n==="set-cookie"?t[n]=(t[n]?t[n]:[]).concat([a]):t[n]=t[n]?t[n]+", "+a:a}}),t},Tt=K,gp=Tt.isStandardBrowserEnv()?function(){var r=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),n;function a(i){var s=i;return r&&(t.setAttribute("href",s),s=t.href),t.setAttribute("href",s),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=a(window.location.href),function(s){var f=Tt.isString(s)?a(s):s;return f.protocol===n.protocol&&f.host===n.host}}():function(){return function(){return!0}}(),Oe=K,yp=op,$p=up,mp=En,bp=hp,_p=vp,Ap=gp,Je=Tn,St=function(r){return new Promise(function(n,a){var i=r.data,s=r.headers,f=r.responseType;Oe.isFormData(i)&&delete s["Content-Type"];var o=new XMLHttpRequest;if(r.auth){var v=r.auth.username||"",m=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";s.Authorization="Basic "+btoa(v+":"+m)}var y=bp(r.baseURL,r.url);o.open(r.method.toUpperCase(),mp(y,r.params,r.paramsSerializer),!0),o.timeout=r.timeout;function h(){if(!!o){var A="getAllResponseHeaders"in o?_p(o.getAllResponseHeaders()):null,p=!f||f==="text"||f==="json"?o.responseText:o.response,O={data:p,status:o.status,statusText:o.statusText,headers:A,config:r,request:o};yp(n,a,O),o=null}}if("onloadend"in o?o.onloadend=h:o.onreadystatechange=function(){!o||o.readyState!==4||o.status===0&&!(o.responseURL&&o.responseURL.indexOf("file:")===0)||setTimeout(h)},o.onabort=function(){!o||(a(Je("Request aborted",r,"ECONNABORTED",o)),o=null)},o.onerror=function(){a(Je("Network Error",r,null,o)),o=null},o.ontimeout=function(){var p="timeout of "+r.timeout+"ms exceeded";r.timeoutErrorMessage&&(p=r.timeoutErrorMessage),a(Je(p,r,r.transitional&&r.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",o)),o=null},Oe.isStandardBrowserEnv()){var g=(r.withCredentials||Ap(y))&&r.xsrfCookieName?$p.read(r.xsrfCookieName):void 0;g&&(s[r.xsrfHeaderName]=g)}"setRequestHeader"in o&&Oe.forEach(s,function(p,O){typeof i=="undefined"&&O.toLowerCase()==="content-type"?delete s[O]:o.setRequestHeader(O,p)}),Oe.isUndefined(r.withCredentials)||(o.withCredentials=!!r.withCredentials),f&&f!=="json"&&(o.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&o.addEventListener("progress",r.onDownloadProgress),typeof r.onUploadProgress=="function"&&o.upload&&o.upload.addEventListener("progress",r.onUploadProgress),r.cancelToken&&r.cancelToken.promise.then(function(p){!o||(o.abort(),a(p),o=null)}),i||(i=null),o.send(i)})},F=K,wt=ap,Ep=On,Op={"Content-Type":"application/x-www-form-urlencoded"};function Ct(e,r){!F.isUndefined(e)&&F.isUndefined(e["Content-Type"])&&(e["Content-Type"]=r)}function Tp(){var e;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(e=St),e}function Sp(e,r,t){if(F.isString(e))try{return(r||JSON.parse)(e),F.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(e)}var Ge={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:Tp(),transformRequest:[function(r,t){return wt(t,"Accept"),wt(t,"Content-Type"),F.isFormData(r)||F.isArrayBuffer(r)||F.isBuffer(r)||F.isStream(r)||F.isFile(r)||F.isBlob(r)?r:F.isArrayBufferView(r)?r.buffer:F.isURLSearchParams(r)?(Ct(t,"application/x-www-form-urlencoded;charset=utf-8"),r.toString()):F.isObject(r)||t&&t["Content-Type"]==="application/json"?(Ct(t,"application/json"),Sp(r)):r}],transformResponse:[function(r){var t=this.transitional,n=t&&t.silentJSONParsing,a=t&&t.forcedJSONParsing,i=!n&&this.responseType==="json";if(i||a&&F.isString(r)&&r.length)try{return JSON.parse(r)}catch(s){if(i)throw s.name==="SyntaxError"?Ep(s,this,"E_JSON_PARSE"):s}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(r){return r>=200&&r<300}};Ge.headers={common:{Accept:"application/json, text/plain, */*"}};F.forEach(["delete","get","head"],function(r){Ge.headers[r]={}});F.forEach(["post","put","patch"],function(r){Ge.headers[r]=F.merge(Op)});var Tr=Ge,wp=K,Cp=Tr,Ip=function(r,t,n){var a=this||Cp;return wp.forEach(n,function(s){r=s.call(a,r,t)}),r},Sn=function(r){return!!(r&&r.__CANCEL__)},It=K,ze=Ip,Dp=Sn,jp=Tr;function Ze(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var Lp=function(r){Ze(r),r.headers=r.headers||{},r.data=ze.call(r,r.data,r.headers,r.transformRequest),r.headers=It.merge(r.headers.common||{},r.headers[r.method]||{},r.headers),It.forEach(["delete","get","head","post","put","patch","common"],function(a){delete r.headers[a]});var t=r.adapter||jp.adapter;return t(r).then(function(a){return Ze(r),a.data=ze.call(r,a.data,a.headers,r.transformResponse),a},function(a){return Dp(a)||(Ze(r),a&&a.response&&(a.response.data=ze.call(r,a.response.data,a.response.headers,r.transformResponse))),Promise.reject(a)})},H=K,wn=function(r,t){t=t||{};var n={},a=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],f=["validateStatus"];function o(h,g){return H.isPlainObject(h)&&H.isPlainObject(g)?H.merge(h,g):H.isPlainObject(g)?H.merge({},g):H.isArray(g)?g.slice():g}function v(h){H.isUndefined(t[h])?H.isUndefined(r[h])||(n[h]=o(void 0,r[h])):n[h]=o(r[h],t[h])}H.forEach(a,function(g){H.isUndefined(t[g])||(n[g]=o(void 0,t[g]))}),H.forEach(i,v),H.forEach(s,function(g){H.isUndefined(t[g])?H.isUndefined(r[g])||(n[g]=o(void 0,r[g])):n[g]=o(void 0,t[g])}),H.forEach(f,function(g){g in t?n[g]=o(r[g],t[g]):g in r&&(n[g]=o(void 0,r[g]))});var m=a.concat(i).concat(s).concat(f),y=Object.keys(r).concat(Object.keys(t)).filter(function(g){return m.indexOf(g)===-1});return H.forEach(y,v),n};const Rp="axios",xp="0.21.4",Np="Promise based HTTP client for the browser and node.js",Pp="index.js",Up={test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},Mp={type:"git",url:"https://github.com/axios/axios.git"},Fp=["xhr","http","ajax","promise","node"],Bp="Matt Zabriskie",Hp="MIT",Gp={url:"https://github.com/axios/axios/issues"},qp="https://axios-http.com",Kp={coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},Yp={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},Wp="dist/axios.min.js",kp="dist/axios.min.js",Vp="./index.d.ts",Jp={"follow-redirects":"^1.14.0"},zp=[{path:"./dist/axios.min.js",threshold:"5kB"}];var Zp={name:Rp,version:xp,description:Np,main:Pp,scripts:Up,repository:Mp,keywords:Fp,author:Bp,license:Hp,bugs:Gp,homepage:qp,devDependencies:Kp,browser:Yp,jsdelivr:Wp,unpkg:kp,typings:Vp,dependencies:Jp,bundlesize:zp},Cn=Zp,Sr={};["object","boolean","number","function","string","symbol"].forEach(function(e,r){Sr[e]=function(n){return typeof n===e||"a"+(r<1?"n ":" ")+e}});var Dt={},Xp=Cn.version.split(".");function In(e,r){for(var t=r?r.split("."):Xp,n=e.split("."),a=0;a<3;a++){if(t[a]>n[a])return!0;if(t[a]<n[a])return!1}return!1}Sr.transitional=function(r,t,n){var a=t&&In(t);function i(s,f){return"[Axios v"+Cn.version+"] Transitional option '"+s+"'"+f+(n?". "+n:"")}return function(s,f,o){if(r===!1)throw new Error(i(f," has been removed in "+t));return a&&!Dt[f]&&(Dt[f]=!0,console.warn(i(f," has been deprecated since v"+t+" and will be removed in the near future"))),r?r(s,f,o):!0}};function Qp(e,r,t){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),a=n.length;a-- >0;){var i=n[a],s=r[i];if(s){var f=e[i],o=f===void 0||s(f,i,e);if(o!==!0)throw new TypeError("option "+i+" must be "+o);continue}if(t!==!0)throw Error("Unknown option "+i)}}var ev={isOlderVersion:In,assertOptions:Qp,validators:Sr},Dn=K,rv=En,jt=tp,Lt=Lp,qe=wn,jn=ev,ne=jn.validators;function be(e){this.defaults=e,this.interceptors={request:new jt,response:new jt}}be.prototype.request=function(r){typeof r=="string"?(r=arguments[1]||{},r.url=arguments[0]):r=r||{},r=qe(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var t=r.transitional;t!==void 0&&jn.assertOptions(t,{silentJSONParsing:ne.transitional(ne.boolean,"1.0.0"),forcedJSONParsing:ne.transitional(ne.boolean,"1.0.0"),clarifyTimeoutError:ne.transitional(ne.boolean,"1.0.0")},!1);var n=[],a=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(a=a&&h.synchronous,n.unshift(h.fulfilled,h.rejected))});var i=[];this.interceptors.response.forEach(function(h){i.push(h.fulfilled,h.rejected)});var s;if(!a){var f=[Lt,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(i),s=Promise.resolve(r);f.length;)s=s.then(f.shift(),f.shift());return s}for(var o=r;n.length;){var v=n.shift(),m=n.shift();try{o=v(o)}catch(y){m(y);break}}try{s=Lt(o)}catch(y){return Promise.reject(y)}for(;i.length;)s=s.then(i.shift(),i.shift());return s};be.prototype.getUri=function(r){return r=qe(this.defaults,r),rv(r.url,r.params,r.paramsSerializer).replace(/^\?/,"")};Dn.forEach(["delete","get","head","options"],function(r){be.prototype[r]=function(t,n){return this.request(qe(n||{},{method:r,url:t,data:(n||{}).data}))}});Dn.forEach(["post","put","patch"],function(r){be.prototype[r]=function(t,n,a){return this.request(qe(a||{},{method:r,url:t,data:n}))}});var tv=be;function wr(e){this.message=e}wr.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};wr.prototype.__CANCEL__=!0;var Ln=wr,nv=Ln;function je(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(a){r=a});var t=this;e(function(a){t.reason||(t.reason=new nv(a),r(t.reason))})}je.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};je.source=function(){var r,t=new je(function(a){r=a});return{token:t,cancel:r}};var av=je,iv=function(r){return function(n){return r.apply(null,n)}},sv=function(r){return typeof r=="object"&&r.isAxiosError===!0},Rt=K,ov=bn,we=tv,uv=wn,fv=Tr;function Rn(e){var r=new we(e),t=ov(we.prototype.request,r);return Rt.extend(t,we.prototype,r),Rt.extend(t,r),t}var Y=Rn(fv);Y.Axios=we;Y.create=function(r){return Rn(uv(Y.defaults,r))};Y.Cancel=Ln;Y.CancelToken=av;Y.isCancel=Sn;Y.all=function(r){return Promise.all(r)};Y.spread=iv;Y.isAxiosError=sv;Ar.exports=Y;Ar.exports.default=Y;var cv=Ar.exports;const lv=(e,r)=>{var t,n,a;return e&&((t=e==null?void 0:e.url)==null?void 0:t.length)>0&&(((n=e.url.find(i=>i.locale===r))==null?void 0:n.value)||((a=e.url.find(i=>i.locale==="*"))==null?void 0:a.value))||null},dv=(e,r)=>{var t,n;return((t=e==null?void 0:e.find)==null?void 0:t.call(e,a=>a.venue===r))||((n=e==null?void 0:e.find)==null?void 0:n.call(e,a=>a.venue==="*"))};function Cr(e,r=600,t=!0,n,a){var j,u;if(!n||!a)throw new Error("baseUrl or tenant was not provided");const i=`${e}_${a}_${n}`,s=`${n.endsWith("/")?n.slice(0,-1):n}/cms-api/content/${a}/${e}`,f=((j=O())==null?void 0:j.value)||null,[o,v]=G.useState(((u=O())==null?void 0:u.timestamp)||0),[m,y]=G.useState(f||null),[h,g]=G.useState(!1);async function A(c){return cv.get(s,{signal:c}).then(l=>{if(vr(l.data))throw new Error(`CMS data '${e}' is an empty object`);un(l.data,m)||y(l.data),h&&g(!1),t&&p(l.data)}).catch(l=>{l.code!=="ERR_CANCELED"&&(console.error(l),g(!0))})}function p(c){const l=new Date().valueOf(),d=JSON.stringify({value:c,timestamp:l});localStorage.setItem(i,d),v(l)}function O(){try{const c=localStorage.getItem(i);if(c)return JSON.parse(c)}catch(c){console.warn(c)}return null}return G.useEffect(()=>{if(console.log("CMS ID",e),new Date().valueOf()-o>r*1e3){const l=new AbortController;return A(l.signal),()=>l.abort()}const c=O();if(c!=null&&c.value)y(c.value),v(c.timestamp);else{const l=new AbortController;return A(l.signal),()=>l.abort()}},[e]),Le(A,r*1e3),{value:m,isError:h,isLoading:!h&&!m}}function xn(e,r=600,t=!0,n,a,i){var f,o,v,m;if(!n||!a||!i)throw new Error("baseUrl, tenant or venue was not provided");const s=Cr(e,r,t,n,a);return{value:((o=(f=s.value)==null?void 0:f.find)==null?void 0:o.call(f,y=>y.venue===i))||((m=(v=s.value)==null?void 0:v.find)==null?void 0:m.call(v,y=>y.venue==="*"))||null,isError:s.isError}}function hv(e,r,t,n=300,a=!0){var m,y,h,g;const i=G.useContext(Pt.ConfigContext);if(!i)throw new Error("Hook was used outside config context");const{value:s,isError:f}=xn(e,n,a,i.baseUrl,i.tenant,r);let o=null,v=null;return s&&((m=s==null?void 0:s.url)==null?void 0:m.length)>0&&(o=((y=s.url.find(A=>A.locale===t))==null?void 0:y.value)||((h=s.url.find(A=>A.locale==="*"))==null?void 0:h.value)||null),!o&&s&&((g=s==null?void 0:s.url)==null?void 0:g.length)>0&&(v=s.url[0].value),{url:o,fallbackUrl:v,isError:f,mediaType:s==null?void 0:s.mediaType}}function Nn({kioskMediaId:e,kioskMediaType:r,intervalSeconds:t=600,withLocalStorage:n=!0,baseUrl:a,tenant:i,venue:s,locale:f}){var p;const{value:o,isError:v,isLoading:m}=Cr(e,t,n,a,i),y=(o==null?void 0:o[r])||[],h=dv(y,s),g=lv(h,f),A=!g&&h&&((p=h==null?void 0:h.url)==null?void 0:p.length)>0?h.url[0].value:null;return{url:g,fallbackUrl:A,mediaType:h==null?void 0:h.mediaType,isError:v,isLoading:m}}function pv({kioskMediaId:e,kioskMediaType:r,venue:t,intervalSeconds:n=600,withLocalStorage:a=!0}){const i=G.useContext(Pt.ConfigContext);if(!i)throw new Error("Missing config context");const{i18n:{language:s}}=Mn.useTranslation();return Nn({kioskMediaId:e,kioskMediaType:r,intervalSeconds:n,withLocalStorage:a,venue:t,baseUrl:i.baseUrl,tenant:i.tenant,locale:s})}function vv(e,r){G.useEffect(()=>{const t=n=>{!e.current||e.current.contains(n.target)||r(n)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}},[e,r])}function gv(e){const[r,t]=G.useState(pe(e==null?void 0:e.DINE_IN)),[n,a]=G.useState(pe(e==null?void 0:e.TAKE_AWAY));function i(){const s=pe(e==null?void 0:e.DINE_IN),f=pe(e==null?void 0:e.TAKE_AWAY);s!==r&&(console.log("dine in open changed",r,"=>",s),t(s)),f!==n&&(console.log("take away open changed",n,"=>",f),a(f))}return G.useEffect(()=>{i()},[e]),Le(i,6e4),{dineInOpen:r,takeAwayOpen:n,loaded:!!e}}var fr={},yv=e=>encodeURIComponent(e).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),Pn="%[a-f0-9]{2}",xt=new RegExp("("+Pn+")|([^%]+?)","gi"),Nt=new RegExp("("+Pn+")+","gi");function cr(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;var t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],cr(t),cr(n))}function $v(e){try{return decodeURIComponent(e)}catch{for(var r=e.match(xt)||[],t=1;t<r.length;t++)e=cr(r,t).join(""),r=e.match(xt)||[];return e}}function mv(e){for(var r={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},t=Nt.exec(e);t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{var n=$v(t[0]);n!==t[0]&&(r[t[0]]=n)}t=Nt.exec(e)}r["%C2"]="\uFFFD";for(var a=Object.keys(r),i=0;i<a.length;i++){var s=a[i];e=e.replace(new RegExp(s,"g"),r[s])}return e}var bv=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return mv(e)}},_v=(e,r)=>{if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(r==="")return[e];const t=e.indexOf(r);return t===-1?[e]:[e.slice(0,t),e.slice(t+r.length)]},Av=function(e,r){for(var t={},n=Object.keys(e),a=Array.isArray(r),i=0;i<n.length;i++){var s=n[i],f=e[s];(a?r.indexOf(s)!==-1:r(s,f,e))&&(t[s]=f)}return t};(function(e){const r=yv,t=bv,n=_v,a=Av,i=u=>u==null,s=Symbol("encodeFragmentIdentifier");function f(u){switch(u.arrayFormat){case"index":return c=>(l,d)=>{const $=l.length;return d===void 0||u.skipNull&&d===null||u.skipEmptyString&&d===""?l:d===null?[...l,[m(c,u),"[",$,"]"].join("")]:[...l,[m(c,u),"[",m($,u),"]=",m(d,u)].join("")]};case"bracket":return c=>(l,d)=>d===void 0||u.skipNull&&d===null||u.skipEmptyString&&d===""?l:d===null?[...l,[m(c,u),"[]"].join("")]:[...l,[m(c,u),"[]=",m(d,u)].join("")];case"colon-list-separator":return c=>(l,d)=>d===void 0||u.skipNull&&d===null||u.skipEmptyString&&d===""?l:d===null?[...l,[m(c,u),":list="].join("")]:[...l,[m(c,u),":list=",m(d,u)].join("")];case"comma":case"separator":case"bracket-separator":{const c=u.arrayFormat==="bracket-separator"?"[]=":"=";return l=>(d,$)=>$===void 0||u.skipNull&&$===null||u.skipEmptyString&&$===""?d:($=$===null?"":$,d.length===0?[[m(l,u),c,m($,u)].join("")]:[[d,m($,u)].join(u.arrayFormatSeparator)])}default:return c=>(l,d)=>d===void 0||u.skipNull&&d===null||u.skipEmptyString&&d===""?l:d===null?[...l,m(c,u)]:[...l,[m(c,u),"=",m(d,u)].join("")]}}function o(u){let c;switch(u.arrayFormat){case"index":return(l,d,$)=>{if(c=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!c){$[l]=d;return}$[l]===void 0&&($[l]={}),$[l][c[1]]=d};case"bracket":return(l,d,$)=>{if(c=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!c){$[l]=d;return}if($[l]===void 0){$[l]=[d];return}$[l]=[].concat($[l],d)};case"colon-list-separator":return(l,d,$)=>{if(c=/(:list)$/.exec(l),l=l.replace(/:list$/,""),!c){$[l]=d;return}if($[l]===void 0){$[l]=[d];return}$[l]=[].concat($[l],d)};case"comma":case"separator":return(l,d,$)=>{const w=typeof d=="string"&&d.includes(u.arrayFormatSeparator),T=typeof d=="string"&&!w&&y(d,u).includes(u.arrayFormatSeparator);d=T?y(d,u):d;const C=w||T?d.split(u.arrayFormatSeparator).map(R=>y(R,u)):d===null?d:y(d,u);$[l]=C};case"bracket-separator":return(l,d,$)=>{const w=/(\[\])$/.test(l);if(l=l.replace(/\[\]$/,""),!w){$[l]=d&&y(d,u);return}const T=d===null?[]:d.split(u.arrayFormatSeparator).map(C=>y(C,u));if($[l]===void 0){$[l]=T;return}$[l]=[].concat($[l],T)};default:return(l,d,$)=>{if($[l]===void 0){$[l]=d;return}$[l]=[].concat($[l],d)}}}function v(u){if(typeof u!="string"||u.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(u,c){return c.encode?c.strict?r(u):encodeURIComponent(u):u}function y(u,c){return c.decode?t(u):u}function h(u){return Array.isArray(u)?u.sort():typeof u=="object"?h(Object.keys(u)).sort((c,l)=>Number(c)-Number(l)).map(c=>u[c]):u}function g(u){const c=u.indexOf("#");return c!==-1&&(u=u.slice(0,c)),u}function A(u){let c="";const l=u.indexOf("#");return l!==-1&&(c=u.slice(l)),c}function p(u){u=g(u);const c=u.indexOf("?");return c===-1?"":u.slice(c+1)}function O(u,c){return c.parseNumbers&&!Number.isNaN(Number(u))&&typeof u=="string"&&u.trim()!==""?u=Number(u):c.parseBooleans&&u!==null&&(u.toLowerCase()==="true"||u.toLowerCase()==="false")&&(u=u.toLowerCase()==="true"),u}function j(u,c){c=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},c),v(c.arrayFormatSeparator);const l=o(c),d=Object.create(null);if(typeof u!="string"||(u=u.trim().replace(/^[?#&]/,""),!u))return d;for(const $ of u.split("&")){if($==="")continue;let[w,T]=n(c.decode?$.replace(/\+/g," "):$,"=");T=T===void 0?null:["comma","separator","bracket-separator"].includes(c.arrayFormat)?T:y(T,c),l(y(w,c),T,d)}for(const $ of Object.keys(d)){const w=d[$];if(typeof w=="object"&&w!==null)for(const T of Object.keys(w))w[T]=O(w[T],c);else d[$]=O(w,c)}return c.sort===!1?d:(c.sort===!0?Object.keys(d).sort():Object.keys(d).sort(c.sort)).reduce(($,w)=>{const T=d[w];return Boolean(T)&&typeof T=="object"&&!Array.isArray(T)?$[w]=h(T):$[w]=T,$},Object.create(null))}e.extract=p,e.parse=j,e.stringify=(u,c)=>{if(!u)return"";c=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},c),v(c.arrayFormatSeparator);const l=T=>c.skipNull&&i(u[T])||c.skipEmptyString&&u[T]==="",d=f(c),$={};for(const T of Object.keys(u))l(T)||($[T]=u[T]);const w=Object.keys($);return c.sort!==!1&&w.sort(c.sort),w.map(T=>{const C=u[T];return C===void 0?"":C===null?m(T,c):Array.isArray(C)?C.length===0&&c.arrayFormat==="bracket-separator"?m(T,c)+"[]":C.reduce(d(T),[]).join("&"):m(T,c)+"="+m(C,c)}).filter(T=>T.length>0).join("&")},e.parseUrl=(u,c)=>{c=Object.assign({decode:!0},c);const[l,d]=n(u,"#");return Object.assign({url:l.split("?")[0]||"",query:j(p(u),c)},c&&c.parseFragmentIdentifier&&d?{fragmentIdentifier:y(d,c)}:{})},e.stringifyUrl=(u,c)=>{c=Object.assign({encode:!0,strict:!0,[s]:!0},c);const l=g(u.url).split("?")[0]||"",d=e.extract(u.url),$=e.parse(d,{sort:!1}),w=Object.assign($,u.query);let T=e.stringify(w,c);T&&(T=`?${T}`);let C=A(u.url);return u.fragmentIdentifier&&(C=`#${c[s]?m(u.fragmentIdentifier,c):u.fragmentIdentifier}`),`${l}${T}${C}`},e.pick=(u,c,l)=>{l=Object.assign({parseFragmentIdentifier:!0,[s]:!1},l);const{url:d,query:$,fragmentIdentifier:w}=e.parseUrl(u,l);return e.stringifyUrl({url:d,query:a($,c),fragmentIdentifier:w},l)},e.exclude=(u,c,l)=>{const d=Array.isArray(c)?$=>!c.includes($):($,w)=>!c($,w);return e.pick(u,d,l)}})(fr);const Ev=[".png",".jpg",".jpeg",".webp",".bmp",".tiff"];function Un(e,r=500){const t=fr.parseUrl(e);if(!(e.startsWith("https://orderingstackmedia.blob.core.windows.net/pictures")||e.startsWith("https://orderingstack-mmedia-tools.azurewebsites.net/api/img/")))return e;const n=t.url.substring(t.url.lastIndexOf("."));return Ev.includes(n)?fr.stringifyUrl({url:t.url.replace("https://orderingstackmedia.blob.core.windows.net/pictures/","https://orderingstack-mmedia-tools.azurewebsites.net/api/img/"),query:{...t.query,w:r}}):e}function Ov(e,r=500){return Un(e,r)}exports.addDiscounts=fn;exports.formatPrice=hc;exports.getGroupedBucketLines=Mh;exports.getMediaUrl=Un;exports.getProductAcronym=pc;exports.groupOrderLines=_r;exports.isChannelOpen=pe;exports.isProductEnabled=cn;exports.summarizeLineDiscounts=dc;exports.useAvailability=ln;exports.useCms=Cr;exports.useDisplayPrice=Ph;exports.useGroupOrderLines=Uh;exports.useInterval=Le;exports.useKioskChannelsAvailability=gv;exports.useKioskMediaCms=Nn;exports.useKioskMediaCmsWithContext=pv;exports.useLocalizedVenueMedia=hv;exports.useMediaUrl=Ov;exports.useMenu=gc;exports.useOnClickOutside=vv;exports.useVenueCms=xn;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var B=require("react"),dr=require("@orderingstack/ordering-core-react"),Mn=require("react-i18next");function xe(e,r){const t=B.useRef(),[n,a]=B.useState(null);return B.useEffect(()=>{t.current=e},[e]),B.useEffect(()=>{function i(){var s;(s=t.current)==null||s.call(t)}if(r!==null){const s=setInterval(i,r);return a(s),()=>{a(null),clearInterval(s)}}},[r]),()=>{n&&clearInterval(n)}}var X=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Fn=Object.prototype;function Bn(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Fn;return e===t}var Le=Bn;function Hn(e,r){return function(t){return e(r(t))}}var Ut=Hn,Gn=Ut,qn=Gn(Object.keys,Object),Kn=qn,Yn=Le,Wn=Kn,kn=Object.prototype,Vn=kn.hasOwnProperty;function Jn(e){if(!Yn(e))return Wn(e);var r=[];for(var t in Object(e))Vn.call(e,t)&&t!="constructor"&&r.push(t);return r}var Mt=Jn,zn=typeof X=="object"&&X&&X.Object===Object&&X,Ft=zn,Zn=Ft,Xn=typeof self=="object"&&self&&self.Object===Object&&self,Qn=Zn||Xn||Function("return this")(),W=Qn,ea=W,ra=ea.Symbol,Re=ra,jr=Re,Bt=Object.prototype,ta=Bt.hasOwnProperty,na=Bt.toString,he=jr?jr.toStringTag:void 0;function aa(e){var r=ta.call(e,he),t=e[he];try{e[he]=void 0;var n=!0}catch{}var a=na.call(e);return n&&(r?e[he]=t:delete e[he]),a}var ia=aa,sa=Object.prototype,oa=sa.toString;function ua(e){return oa.call(e)}var fa=ua,xr=Re,ca=ia,la=fa,da="[object Null]",ha="[object Undefined]",Lr=xr?xr.toStringTag:void 0;function pa(e){return e==null?e===void 0?ha:da:Lr&&Lr in Object(e)?ca(e):la(e)}var Ne=pa;function va(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var ye=va,ga=Ne,ya=ye,$a="[object AsyncFunction]",ma="[object Function]",ba="[object GeneratorFunction]",_a="[object Proxy]";function Aa(e){if(!ya(e))return!1;var r=ga(e);return r==ma||r==ba||r==$a||r==_a}var Ht=Aa,Ea=W,Oa=Ea["__core-js_shared__"],Ta=Oa,We=Ta,Rr=function(){var e=/[^.]+$/.exec(We&&We.keys&&We.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Sa(e){return!!Rr&&Rr in e}var wa=Sa,Ca=Function.prototype,Ia=Ca.toString;function Da(e){if(e!=null){try{return Ia.call(e)}catch{}try{return e+""}catch{}}return""}var Gt=Da,ja=Ht,xa=wa,La=ye,Ra=Gt,Na=/[\\^$.*+?()[\]{}|]/g,Pa=/^\[object .+?Constructor\]$/,Ua=Function.prototype,Ma=Object.prototype,Fa=Ua.toString,Ba=Ma.hasOwnProperty,Ha=RegExp("^"+Fa.call(Ba).replace(Na,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ga(e){if(!La(e)||xa(e))return!1;var r=ja(e)?Ha:Pa;return r.test(Ra(e))}var qa=Ga;function Ka(e,r){return e==null?void 0:e[r]}var Ya=Ka,Wa=qa,ka=Ya;function Va(e,r){var t=ka(e,r);return Wa(t)?t:void 0}var Q=Va,Ja=Q,za=W,Za=Ja(za,"DataView"),Xa=Za,Qa=Q,ei=W,ri=Qa(ei,"Map"),hr=ri,ti=Q,ni=W,ai=ti(ni,"Promise"),ii=ai,si=Q,oi=W,ui=si(oi,"Set"),fi=ui,ci=Q,li=W,di=ci(li,"WeakMap"),hi=di,Qe=Xa,er=hr,rr=ii,tr=fi,nr=hi,qt=Ne,ie=Gt,Nr="[object Map]",pi="[object Object]",Pr="[object Promise]",Ur="[object Set]",Mr="[object WeakMap]",Fr="[object DataView]",vi=ie(Qe),gi=ie(er),yi=ie(rr),$i=ie(tr),mi=ie(nr),Z=qt;(Qe&&Z(new Qe(new ArrayBuffer(1)))!=Fr||er&&Z(new er)!=Nr||rr&&Z(rr.resolve())!=Pr||tr&&Z(new tr)!=Ur||nr&&Z(new nr)!=Mr)&&(Z=function(e){var r=qt(e),t=r==pi?e.constructor:void 0,n=t?ie(t):"";if(n)switch(n){case vi:return Fr;case gi:return Nr;case yi:return Pr;case $i:return Ur;case mi:return Mr}return r});var $e=Z;function bi(e){return e!=null&&typeof e=="object"}var se=bi,_i=Ne,Ai=se,Ei="[object Arguments]";function Oi(e){return Ai(e)&&_i(e)==Ei}var Ti=Oi,Br=Ti,Si=se,Kt=Object.prototype,wi=Kt.hasOwnProperty,Ci=Kt.propertyIsEnumerable,Ii=Br(function(){return arguments}())?Br:function(e){return Si(e)&&wi.call(e,"callee")&&!Ci.call(e,"callee")},Yt=Ii,Di=Array.isArray,me=Di,ji=9007199254740991;function xi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ji}var Wt=xi,Li=Ht,Ri=Wt;function Ni(e){return e!=null&&Ri(e.length)&&!Li(e)}var pr=Ni,ae={exports:{}};function Pi(){return!1}var Ui=Pi;(function(e,r){var t=W,n=Ui,a=r&&!r.nodeType&&r,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,f=s?t.Buffer:void 0,o=f?f.isBuffer:void 0,v=o||n;e.exports=v})(ae,ae.exports);var Mi=Ne,Fi=Wt,Bi=se,Hi="[object Arguments]",Gi="[object Array]",qi="[object Boolean]",Ki="[object Date]",Yi="[object Error]",Wi="[object Function]",ki="[object Map]",Vi="[object Number]",Ji="[object Object]",zi="[object RegExp]",Zi="[object Set]",Xi="[object String]",Qi="[object WeakMap]",es="[object ArrayBuffer]",rs="[object DataView]",ts="[object Float32Array]",ns="[object Float64Array]",as="[object Int8Array]",is="[object Int16Array]",ss="[object Int32Array]",os="[object Uint8Array]",us="[object Uint8ClampedArray]",fs="[object Uint16Array]",cs="[object Uint32Array]",P={};P[ts]=P[ns]=P[as]=P[is]=P[ss]=P[os]=P[us]=P[fs]=P[cs]=!0;P[Hi]=P[Gi]=P[es]=P[qi]=P[rs]=P[Ki]=P[Yi]=P[Wi]=P[ki]=P[Vi]=P[Ji]=P[zi]=P[Zi]=P[Xi]=P[Qi]=!1;function ls(e){return Bi(e)&&Fi(e.length)&&!!P[Mi(e)]}var ds=ls;function hs(e){return function(r){return e(r)}}var vr=hs,ve={exports:{}};(function(e,r){var t=Ft,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&t.process,f=function(){try{var o=a&&a.require&&a.require("util").types;return o||s&&s.binding&&s.binding("util")}catch{}}();e.exports=f})(ve,ve.exports);var ps=ds,vs=vr,Hr=ve.exports,Gr=Hr&&Hr.isTypedArray,gs=Gr?vs(Gr):ps,gr=gs,ys=Mt,$s=$e,ms=Yt,bs=me,_s=pr,As=ae.exports,Es=Le,Os=gr,Ts="[object Map]",Ss="[object Set]",ws=Object.prototype,Cs=ws.hasOwnProperty;function Is(e){if(e==null)return!0;if(_s(e)&&(bs(e)||typeof e=="string"||typeof e.splice=="function"||As(e)||Os(e)||ms(e)))return!e.length;var r=$s(e);if(r==Ts||r==Ss)return!e.size;if(Es(e))return!ys(e).length;for(var t in e)if(Cs.call(e,t))return!1;return!0}var yr=Is,kt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t="minute",n=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(i,s,f){var o=s.prototype;f.utc=function(p){var O={date:p,utc:!0,args:arguments};return new s(O)},o.utc=function(p){var O=f(this.toDate(),{locale:this.$L,utc:!0});return p?O.add(this.utcOffset(),t):O},o.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var v=o.parse;o.parse=function(p){p.utc&&(this.$u=!0),this.$utils().u(p.$offset)||(this.$offset=p.$offset),v.call(this,p)};var m=o.init;o.init=function(){if(this.$u){var p=this.$d;this.$y=p.getUTCFullYear(),this.$M=p.getUTCMonth(),this.$D=p.getUTCDate(),this.$W=p.getUTCDay(),this.$H=p.getUTCHours(),this.$m=p.getUTCMinutes(),this.$s=p.getUTCSeconds(),this.$ms=p.getUTCMilliseconds()}else m.call(this)};var y=o.utcOffset;o.utcOffset=function(p,O){var j=this.$utils().u;if(j(p))return this.$u?0:j(this.$offset)?y.call(this):this.$offset;if(typeof p=="string"&&(p=function(d){d===void 0&&(d="");var $=d.match(n);if(!$)return null;var w=(""+$[0]).match(a)||["-",0,0],T=w[0],C=60*+w[1]+ +w[2];return C===0?0:T==="+"?C:-C}(p),p===null))return this;var u=Math.abs(p)<=16?60*p:p,c=this;if(O)return c.$offset=u,c.$u=p===0,c;if(p!==0){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(c=this.local().add(u+l,t)).$offset=u,c.$x.$localOffset=l}else c=this.utc();return c};var h=o.format;o.format=function(p){var O=p||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,O)},o.valueOf=function(){var p=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*p},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var g=o.toDate;o.toDate=function(p){return p==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var A=o.diff;o.diff=function(p,O,j){if(p&&this.$u===p.$u)return A.call(this,p,O,j);var u=this.local(),c=f(p).local();return A.call(u,c,O,j)}}})})(kt);var Ds=kt.exports,Vt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(a,i,s){var f,o=function(h,g,A){A===void 0&&(A={});var p=new Date(h),O=function(j,u){u===void 0&&(u={});var c=u.timeZoneName||"short",l=j+"|"+c,d=n[l];return d||(d=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:j,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:c}),n[l]=d),d}(g,A);return O.formatToParts(p)},v=function(h,g){for(var A=o(h,g),p=[],O=0;O<A.length;O+=1){var j=A[O],u=j.type,c=j.value,l=t[u];l>=0&&(p[l]=parseInt(c,10))}var d=p[3],$=d===24?0:d,w=p[0]+"-"+p[1]+"-"+p[2]+" "+$+":"+p[4]+":"+p[5]+":000",T=+h;return(s.utc(w).valueOf()-(T-=T%1e3))/6e4},m=i.prototype;m.tz=function(h,g){h===void 0&&(h=f);var A=this.utcOffset(),p=this.toDate(),O=p.toLocaleString("en-US",{timeZone:h}),j=Math.round((p-new Date(O))/1e3/60),u=s(O).$set("millisecond",this.$ms).utcOffset(15*-Math.round(p.getTimezoneOffset()/15)-j,!0);if(g){var c=u.utcOffset();u=u.add(A-c,"minute")}return u.$x.$timezone=h,u},m.offsetName=function(h){var g=this.$x.$timezone||s.tz.guess(),A=o(this.valueOf(),g,{timeZoneName:h}).find(function(p){return p.type.toLowerCase()==="timezonename"});return A&&A.value};var y=m.startOf;m.startOf=function(h,g){if(!this.$x||!this.$x.$timezone)return y.call(this,h,g);var A=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return y.call(A,h,g).tz(this.$x.$timezone,!0)},s.tz=function(h,g,A){var p=A&&g,O=A||g||f,j=v(+s(),O);if(typeof h!="string")return s(h).tz(O);var u=function($,w,T){var C=$-60*w*1e3,L=v(C,T);if(w===L)return[C,w];var V=v(C-=60*(L-w)*1e3,T);return L===V?[C,L]:[$-60*Math.min(L,V)*1e3,Math.max(L,V)]}(s.utc(h,p).valueOf(),j,O),c=u[0],l=u[1],d=s(c).utcOffset(l);return d.$x.$timezone=O,d},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(h){f=h}}})})(Vt);var js=Vt.exports,Jt={exports:{}};(function(e,r){(function(t,n){e.exports=n()})(X,function(){var t=1e3,n=6e4,a=36e5,i="millisecond",s="second",f="minute",o="hour",v="day",m="week",y="month",h="quarter",g="year",A="date",p="Invalid Date",O=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,j=/\[([^\]]+)]|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,u={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("_")},c=function(x,E,b){var S=String(x);return!S||S.length>=E?x:""+Array(E+1-S.length).join(b)+x},l={s:c,z:function(x){var E=-x.utcOffset(),b=Math.abs(E),S=Math.floor(b/60),_=b%60;return(E<=0?"+":"-")+c(S,2,"0")+":"+c(_,2,"0")},m:function x(E,b){if(E.date()<b.date())return-x(b,E);var S=12*(b.year()-E.year())+(b.month()-E.month()),_=E.clone().add(S,y),D=b-_<0,I=E.clone().add(S+(D?-1:1),y);return+(-(S+(b-_)/(D?_-I:I-_))||0)},a:function(x){return x<0?Math.ceil(x)||0:Math.floor(x)},p:function(x){return{M:y,y:g,w:m,d:v,D:A,h:o,m:f,s,ms:i,Q:h}[x]||String(x||"").toLowerCase().replace(/s$/,"")},u:function(x){return x===void 0}},d="en",$={};$[d]=u;var w=function(x){return x instanceof V},T=function x(E,b,S){var _;if(!E)return d;if(typeof E=="string"){var D=E.toLowerCase();$[D]&&(_=D),b&&($[D]=b,_=D);var I=E.split("-");if(!_&&I.length>1)return x(I[0])}else{var R=E.name;$[R]=E,_=R}return!S&&_&&(d=_),_||!S&&d},C=function(x,E){if(w(x))return x.clone();var b=typeof E=="object"?E:{};return b.date=x,b.args=arguments,new V(b)},L=l;L.l=T,L.i=w,L.w=function(x,E){return C(x,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var V=function(){function x(b){this.$L=T(b.locale,null,!0),this.parse(b)}var E=x.prototype;return E.parse=function(b){this.$d=function(S){var _=S.date,D=S.utc;if(_===null)return new Date(NaN);if(L.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var I=_.match(O);if(I){var R=I[2]-1||0,M=(I[7]||"0").substring(0,3);return D?new Date(Date.UTC(I[1],R,I[3]||1,I[4]||0,I[5]||0,I[6]||0,M)):new Date(I[1],R,I[3]||1,I[4]||0,I[5]||0,I[6]||0,M)}}return new Date(_)}(b),this.$x=b.x||{},this.init()},E.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},E.$utils=function(){return L},E.isValid=function(){return this.$d.toString()!==p},E.isSame=function(b,S){var _=C(b);return this.startOf(S)<=_&&_<=this.endOf(S)},E.isAfter=function(b,S){return C(b)<this.startOf(S)},E.isBefore=function(b,S){return this.endOf(S)<C(b)},E.$g=function(b,S,_){return L.u(b)?this[S]:this.set(_,b)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(b,S){var _=this,D=!!L.u(S)||S,I=L.p(b),R=function(re,q){var z=L.w(_.$u?Date.UTC(_.$y,q,re):new Date(_.$y,q,re),_);return D?z:z.endOf(v)},M=function(re,q){return L.w(_.toDate()[re].apply(_.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(q)),_)},U=this.$W,H=this.$M,J=this.$D,k="set"+(this.$u?"UTC":"");switch(I){case g:return D?R(1,0):R(31,11);case y:return D?R(1,H):R(0,H+1);case m:var le=this.$locale().weekStart||0,de=(U<le?U+7:U)-le;return R(D?J-de:J+(6-de),H);case v:case A:return M(k+"Hours",0);case o:return M(k+"Minutes",1);case f:return M(k+"Seconds",2);case s:return M(k+"Milliseconds",3);default:return this.clone()}},E.endOf=function(b){return this.startOf(b,!1)},E.$set=function(b,S){var _,D=L.p(b),I="set"+(this.$u?"UTC":""),R=(_={},_[v]=I+"Date",_[A]=I+"Date",_[y]=I+"Month",_[g]=I+"FullYear",_[o]=I+"Hours",_[f]=I+"Minutes",_[s]=I+"Seconds",_[i]=I+"Milliseconds",_)[D],M=D===v?this.$D+(S-this.$W):S;if(D===y||D===g){var U=this.clone().set(A,1);U.$d[R](M),U.init(),this.$d=U.set(A,Math.min(this.$D,U.daysInMonth())).$d}else R&&this.$d[R](M);return this.init(),this},E.set=function(b,S){return this.clone().$set(b,S)},E.get=function(b){return this[L.p(b)]()},E.add=function(b,S){var _,D=this;b=Number(b);var I=L.p(S),R=function(H){var J=C(D);return L.w(J.date(J.date()+Math.round(H*b)),D)};if(I===y)return this.set(y,this.$M+b);if(I===g)return this.set(g,this.$y+b);if(I===v)return R(1);if(I===m)return R(7);var M=(_={},_[f]=n,_[o]=a,_[s]=t,_)[I]||1,U=this.$d.getTime()+b*M;return L.w(U,this)},E.subtract=function(b,S){return this.add(-1*b,S)},E.format=function(b){var S=this,_=this.$locale();if(!this.isValid())return _.invalidDate||p;var D=b||"YYYY-MM-DDTHH:mm:ssZ",I=L.z(this),R=this.$H,M=this.$m,U=this.$M,H=_.weekdays,J=_.months,k=function(q,z,Ye,_e){return q&&(q[z]||q(S,D))||Ye[z].slice(0,_e)},le=function(q){return L.s(R%12||12,q,"0")},de=_.meridiem||function(q,z,Ye){var _e=q<12?"AM":"PM";return Ye?_e.toLowerCase():_e},re={YY:String(this.$y).slice(-2),YYYY:this.$y,M:U+1,MM:L.s(U+1,2,"0"),MMM:k(_.monthsShort,U,J,3),MMMM:k(J,U),D:this.$D,DD:L.s(this.$D,2,"0"),d:String(this.$W),dd:k(_.weekdaysMin,this.$W,H,2),ddd:k(_.weekdaysShort,this.$W,H,3),dddd:H[this.$W],H:String(R),HH:L.s(R,2,"0"),h:le(1),hh:le(2),a:de(R,M,!0),A:de(R,M,!1),m:String(M),mm:L.s(M,2,"0"),s:String(this.$s),ss:L.s(this.$s,2,"0"),SSS:L.s(this.$ms,3,"0"),Z:I};return D.replace(j,function(q,z){return z||re[q]||I.replace(":","")})},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(b,S,_){var D,I=L.p(S),R=C(b),M=(R.utcOffset()-this.utcOffset())*n,U=this-R,H=L.m(this,R);return H=(D={},D[g]=H/12,D[y]=H,D[h]=H/3,D[m]=(U-M)/6048e5,D[v]=(U-M)/864e5,D[o]=U/a,D[f]=U/n,D[s]=U/t,D)[I]||U,_?H:L.a(H)},E.daysInMonth=function(){return this.endOf(y).$D},E.$locale=function(){return $[this.$L]},E.locale=function(b,S){if(!b)return this.$L;var _=this.clone(),D=T(b,S,!0);return D&&(_.$L=D),_},E.clone=function(){return L.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},x}(),Dr=V.prototype;return C.prototype=Dr,[["$ms",i],["$s",s],["$m",f],["$H",o],["$W",v],["$M",y],["$y",g],["$D",A]].forEach(function(x){Dr[x[1]]=function(E){return this.$g(E,x[0],x[1])}}),C.extend=function(x,E){return x.$i||(x(E,V,C),x.$i=!0),C},C.locale=T,C.isDayjs=w,C.unix=function(x){return C(1e3*x)},C.en=$[d],C.Ls=$,C.p={},C})})(Jt);var ge=Jt.exports;ge.extend(Ds);ge.extend(js);const zt=["SUN","MON","TUE","WED","THU","FRI","SAT"],Ce=e=>{const[r,t]=e.split(":");return{hour:parseInt(r||"0",10),minutes:parseInt(t||"0",10)}};function ar(e,r,t){const{availability:n}=e;if(!n)return!0;if(yr(n))return!1;const a=t?ge(t).tz(r):ge().tz(r),i=a.day(),s=n[zt[i]];if(!Array.isArray(s)||s.length!==2)return!1;const f=a.hour(),o=a.minute(),v=Ce(s[0]),m=Ce(s[1]);return f<v.hour||f===v.hour&&o<v.minutes?!1:!(f>m.hour||f===m.hour&&o>m.minutes)}const ir=(e,r=void 0,t=void 0,n=!1)=>n?e.map(i=>{let s;return Array.isArray(i.items)&&(s=ir(i.items,r,t,n)),{...i,items:s,outsideAvailabilitySlot:!ar(i,r,t)||(s==null?void 0:s.every(f=>f.outsideAvailabilitySlot))||!1}}):e.filter(i=>ar(i,r,t)).map(i=>Array.isArray(i.items)?{...i,items:ir(i.items,r,t)}:i),qr=(e,r=void 0,t=void 0,n=!1)=>{let a=[];return e.forEach(i=>{if(!Array.isArray(i.items)){a.push(i);return}const s=ir(i.items,r,t,n);s.length>0&&a.push({...i,items:s})}),n&&(a=a.map(i=>!i.items||!Array.isArray(i.items)?i:{...i,outsideAvailabilitySlot:!ar(i,r,t)||i.items.every(s=>s.outsideAvailabilitySlot)})),a};function pe(e){const r=e==null?void 0:e.week;if(!e||!e.active||!r)return!1;const t=ge(),n=t.day(),a=r[zt[n]];return a?a.some(i=>xs(t,i)):!1}function xs(e,r){const t=e.hour(),n=e.minute(),a=Ce(r.from),i=Ce(r.to);return t<a.hour||t===a.hour&&n<a.minutes?!1:!(t>i.hour||t===i.hour&&n>i.minutes)}function Ls(){this.__data__=[],this.size=0}var Rs=Ls;function Ns(e,r){return e===r||e!==e&&r!==r}var $r=Ns,Ps=$r;function Us(e,r){for(var t=e.length;t--;)if(Ps(e[t][0],r))return t;return-1}var Pe=Us,Ms=Pe,Fs=Array.prototype,Bs=Fs.splice;function Hs(e){var r=this.__data__,t=Ms(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Bs.call(r,t,1),--this.size,!0}var Gs=Hs,qs=Pe;function Ks(e){var r=this.__data__,t=qs(r,e);return t<0?void 0:r[t][1]}var Ys=Ks,Ws=Pe;function ks(e){return Ws(this.__data__,e)>-1}var Vs=ks,Js=Pe;function zs(e,r){var t=this.__data__,n=Js(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}var Zs=zs,Xs=Rs,Qs=Gs,eo=Ys,ro=Vs,to=Zs;function oe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}oe.prototype.clear=Xs;oe.prototype.delete=Qs;oe.prototype.get=eo;oe.prototype.has=ro;oe.prototype.set=to;var Ue=oe,no=Ue;function ao(){this.__data__=new no,this.size=0}var io=ao;function so(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}var oo=so;function uo(e){return this.__data__.get(e)}var fo=uo;function co(e){return this.__data__.has(e)}var lo=co,ho=Q,po=ho(Object,"create"),Me=po,Kr=Me;function vo(){this.__data__=Kr?Kr(null):{},this.size=0}var go=vo;function yo(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var $o=yo,mo=Me,bo="__lodash_hash_undefined__",_o=Object.prototype,Ao=_o.hasOwnProperty;function Eo(e){var r=this.__data__;if(mo){var t=r[e];return t===bo?void 0:t}return Ao.call(r,e)?r[e]:void 0}var Oo=Eo,To=Me,So=Object.prototype,wo=So.hasOwnProperty;function Co(e){var r=this.__data__;return To?r[e]!==void 0:wo.call(r,e)}var Io=Co,Do=Me,jo="__lodash_hash_undefined__";function xo(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Do&&r===void 0?jo:r,this}var Lo=xo,Ro=go,No=$o,Po=Oo,Uo=Io,Mo=Lo;function ue(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}ue.prototype.clear=Ro;ue.prototype.delete=No;ue.prototype.get=Po;ue.prototype.has=Uo;ue.prototype.set=Mo;var Fo=ue,Yr=Fo,Bo=Ue,Ho=hr;function Go(){this.size=0,this.__data__={hash:new Yr,map:new(Ho||Bo),string:new Yr}}var qo=Go;function Ko(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var Yo=Ko,Wo=Yo;function ko(e,r){var t=e.__data__;return Wo(r)?t[typeof r=="string"?"string":"hash"]:t.map}var Fe=ko,Vo=Fe;function Jo(e){var r=Vo(this,e).delete(e);return this.size-=r?1:0,r}var zo=Jo,Zo=Fe;function Xo(e){return Zo(this,e).get(e)}var Qo=Xo,eu=Fe;function ru(e){return eu(this,e).has(e)}var tu=ru,nu=Fe;function au(e,r){var t=nu(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}var iu=au,su=qo,ou=zo,uu=Qo,fu=tu,cu=iu;function fe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}fe.prototype.clear=su;fe.prototype.delete=ou;fe.prototype.get=uu;fe.prototype.has=fu;fe.prototype.set=cu;var Zt=fe,lu=Ue,du=hr,hu=Zt,pu=200;function vu(e,r){var t=this.__data__;if(t instanceof lu){var n=t.__data__;if(!du||n.length<pu-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new hu(n)}return t.set(e,r),this.size=t.size,this}var gu=vu,yu=Ue,$u=io,mu=oo,bu=fo,_u=lo,Au=gu;function ce(e){var r=this.__data__=new yu(e);this.size=r.size}ce.prototype.clear=$u;ce.prototype.delete=mu;ce.prototype.get=bu;ce.prototype.has=_u;ce.prototype.set=Au;var Xt=ce,Eu="__lodash_hash_undefined__";function Ou(e){return this.__data__.set(e,Eu),this}var Tu=Ou;function Su(e){return this.__data__.has(e)}var wu=Su,Cu=Zt,Iu=Tu,Du=wu;function Ie(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new Cu;++r<t;)this.add(e[r])}Ie.prototype.add=Ie.prototype.push=Iu;Ie.prototype.has=Du;var ju=Ie;function xu(e,r){for(var t=-1,n=e==null?0:e.length;++t<n;)if(r(e[t],t,e))return!0;return!1}var Lu=xu;function Ru(e,r){return e.has(r)}var Nu=Ru,Pu=ju,Uu=Lu,Mu=Nu,Fu=1,Bu=2;function Hu(e,r,t,n,a,i){var s=t&Fu,f=e.length,o=r.length;if(f!=o&&!(s&&o>f))return!1;var v=i.get(e),m=i.get(r);if(v&&m)return v==r&&m==e;var y=-1,h=!0,g=t&Bu?new Pu:void 0;for(i.set(e,r),i.set(r,e);++y<f;){var A=e[y],p=r[y];if(n)var O=s?n(p,A,y,r,e,i):n(A,p,y,e,r,i);if(O!==void 0){if(O)continue;h=!1;break}if(g){if(!Uu(r,function(j,u){if(!Mu(g,u)&&(A===j||a(A,j,t,n,i)))return g.push(u)})){h=!1;break}}else if(!(A===p||a(A,p,t,n,i))){h=!1;break}}return i.delete(e),i.delete(r),h}var Qt=Hu,Gu=W,qu=Gu.Uint8Array,en=qu;function Ku(e){var r=-1,t=Array(e.size);return e.forEach(function(n,a){t[++r]=[a,n]}),t}var Yu=Ku;function Wu(e){var r=-1,t=Array(e.size);return e.forEach(function(n){t[++r]=n}),t}var ku=Wu,Wr=Re,kr=en,Vu=$r,Ju=Qt,zu=Yu,Zu=ku,Xu=1,Qu=2,ef="[object Boolean]",rf="[object Date]",tf="[object Error]",nf="[object Map]",af="[object Number]",sf="[object RegExp]",of="[object Set]",uf="[object String]",ff="[object Symbol]",cf="[object ArrayBuffer]",lf="[object DataView]",Vr=Wr?Wr.prototype:void 0,ke=Vr?Vr.valueOf:void 0;function df(e,r,t,n,a,i,s){switch(t){case lf:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case cf:return!(e.byteLength!=r.byteLength||!i(new kr(e),new kr(r)));case ef:case rf:case af:return Vu(+e,+r);case tf:return e.name==r.name&&e.message==r.message;case sf:case uf:return e==r+"";case nf:var f=zu;case of:var o=n&Xu;if(f||(f=Zu),e.size!=r.size&&!o)return!1;var v=s.get(e);if(v)return v==r;n|=Qu,s.set(e,r);var m=Ju(f(e),f(r),n,a,i,s);return s.delete(e),m;case ff:if(ke)return ke.call(e)==ke.call(r)}return!1}var hf=df;function pf(e,r){for(var t=-1,n=r.length,a=e.length;++t<n;)e[a+t]=r[t];return e}var rn=pf,vf=rn,gf=me;function yf(e,r,t){var n=r(e);return gf(e)?n:vf(n,t(e))}var tn=yf;function $f(e,r){for(var t=-1,n=e==null?0:e.length,a=0,i=[];++t<n;){var s=e[t];r(s,t,e)&&(i[a++]=s)}return i}var mf=$f;function bf(){return[]}var nn=bf,_f=mf,Af=nn,Ef=Object.prototype,Of=Ef.propertyIsEnumerable,Jr=Object.getOwnPropertySymbols,Tf=Jr?function(e){return e==null?[]:(e=Object(e),_f(Jr(e),function(r){return Of.call(e,r)}))}:Af,mr=Tf;function Sf(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var wf=Sf,Cf=9007199254740991,If=/^(?:0|[1-9]\d*)$/;function Df(e,r){var t=typeof e;return r=r==null?Cf:r,!!r&&(t=="number"||t!="symbol"&&If.test(e))&&e>-1&&e%1==0&&e<r}var jf=Df,xf=wf,Lf=Yt,Rf=me,Nf=ae.exports,Pf=jf,Uf=gr,Mf=Object.prototype,Ff=Mf.hasOwnProperty;function Bf(e,r){var t=Rf(e),n=!t&&Lf(e),a=!t&&!n&&Nf(e),i=!t&&!n&&!a&&Uf(e),s=t||n||a||i,f=s?xf(e.length,String):[],o=f.length;for(var v in e)(r||Ff.call(e,v))&&!(s&&(v=="length"||a&&(v=="offset"||v=="parent")||i&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||Pf(v,o)))&&f.push(v);return f}var an=Bf,Hf=an,Gf=Mt,qf=pr;function Kf(e){return qf(e)?Hf(e):Gf(e)}var br=Kf,Yf=tn,Wf=mr,kf=br;function Vf(e){return Yf(e,kf,Wf)}var sn=Vf,zr=sn,Jf=1,zf=Object.prototype,Zf=zf.hasOwnProperty;function Xf(e,r,t,n,a,i){var s=t&Jf,f=zr(e),o=f.length,v=zr(r),m=v.length;if(o!=m&&!s)return!1;for(var y=o;y--;){var h=f[y];if(!(s?h in r:Zf.call(r,h)))return!1}var g=i.get(e),A=i.get(r);if(g&&A)return g==r&&A==e;var p=!0;i.set(e,r),i.set(r,e);for(var O=s;++y<o;){h=f[y];var j=e[h],u=r[h];if(n)var c=s?n(u,j,h,r,e,i):n(j,u,h,e,r,i);if(!(c===void 0?j===u||a(j,u,t,n,i):c)){p=!1;break}O||(O=h=="constructor")}if(p&&!O){var l=e.constructor,d=r.constructor;l!=d&&"constructor"in e&&"constructor"in r&&!(typeof l=="function"&&l instanceof l&&typeof d=="function"&&d instanceof d)&&(p=!1)}return i.delete(e),i.delete(r),p}var Qf=Xf,Ve=Xt,ec=Qt,rc=hf,tc=Qf,Zr=$e,Xr=me,Qr=ae.exports,nc=gr,ac=1,et="[object Arguments]",rt="[object Array]",Ae="[object Object]",ic=Object.prototype,tt=ic.hasOwnProperty;function sc(e,r,t,n,a,i){var s=Xr(e),f=Xr(r),o=s?rt:Zr(e),v=f?rt:Zr(r);o=o==et?Ae:o,v=v==et?Ae:v;var m=o==Ae,y=v==Ae,h=o==v;if(h&&Qr(e)){if(!Qr(r))return!1;s=!0,m=!1}if(h&&!m)return i||(i=new Ve),s||nc(e)?ec(e,r,t,n,a,i):rc(e,r,o,t,n,a,i);if(!(t&ac)){var g=m&&tt.call(e,"__wrapped__"),A=y&&tt.call(r,"__wrapped__");if(g||A){var p=g?e.value():e,O=A?r.value():r;return i||(i=new Ve),a(p,O,t,n,i)}}return h?(i||(i=new Ve),tc(e,r,t,n,a,i)):!1}var oc=sc,uc=oc,nt=se;function on(e,r,t,n,a){return e===r?!0:e==null||r==null||!nt(e)&&!nt(r)?e!==e&&r!==r:uc(e,r,t,n,on,a)}var fc=on,cc=fc;function lc(e,r){return cc(e,r)}var un=lc;function fn(e){let r=0;return e==null||e.forEach(t=>r+=Number(t.discountPrice)),r}function dc(e){return fn(e.discounts)}function hc(e,r,t=",",n=2){return`${Number(e).toFixed(n).replace(".",t)}${r?"\xA0"+r:""}`}function cn(e,r){var a;const t=(a=e._)==null?void 0:a.enableKey;return t?!r||!Array.isArray(r)||r.length===0?!1:t.replace(/\s/g,"").split(",").some(i=>r.includes(i)):!0}function pc(e){var t,n,a,i,s,f;const r=(n=(t=e.details)==null?void 0:t.literals)==null?void 0:n.name.split(" ").filter(o=>o!=="");return r?r.length===1?((f=(s=(i=(a=e.details)==null?void 0:a.literals)==null?void 0:i.name)==null?void 0:s.slice)==null?void 0:f.call(s,0,2))||"":r.length>1?`${r[0][0]}${r[1][0]}`:"":""}function ln(e,r=!1,t=void 0,n=60){const[a,i]=B.useState(e&&qr(e,t,void 0,r));xe(s,n*1e3);function s(){const f=e&&qr(e,t,void 0,r);un(f,a)||(console.log("menu has changed",f),i(f))}return B.useEffect(s,[a,e]),a}function dn(e,r){return e.__||(e.__={}),e.__.isHiddenByEnableKey=!cn(e,r),e.items&&e.items.length>0&&(e.items=e.items.map(t=>dn(t,r))),e}function vc(e,r){if(!!e)return e.map(t=>dn(t,r))}function gc({originalMenu:e,markOnly:r=!1,timeZone:t,interval:n=60,enableKeys:a=[]}){const i=ln(e,r,t,n);return vc(i,a)}var at;(function(e){e.UNINITIALIZED="UNINITIALIZED",e.PROCESSING="PROCESSING",e.PAID="PAID",e.FAILED="FAILED",e.PRINTING_RECEIPT="PRINTING_RECEIPT",e.PRINTING_RECEIPT_SUCCESS="PRINTING_RECEIPT_SUCCESS",e.SENDING_RECEIPT="SENDING_RECEIPT",e.SENDING_RECEIPT_SUCCESS="SENDING_RECEIPT_SUCCESS",e.ERROR="ERROR"})(at||(at={}));var it;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(it||(it={}));var sr;(function(e){e.GROUP="3e/group",e.PRODUCT="3e/product",e.CATEGORY="3e/group/category",e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.STATIC="3e/static",e.REF="3e/ref",e.QUERY="3e/query"})(sr||(sr={}));var st;(function(e){e.GROUP="group",e.PRODUCT="product"})(st||(st={}));var ot;(function(e){e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.DINE_IN="DINE_IN",e.DINE_IN_OPEN="DINE_IN_OPEN",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.GLOVO_TAKE_AWAY="GLOVO_TAKE_AWAY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.JUSTEAT_TAKE_AWAY="JUSTEAT_TAKE_AWAY",e.UBER_DELIVERY="UBER_DELIVERY",e.UBER_TAKE_AWAY="UBER_TAKE_AWAY",e.UBER_DINE_IN="UBER_DINE_IN",e.BOLT_DELIVERY="BOLT_DELIVERY",e.BOLT_TAKE_AWAY="BOLT_TAKE_AWAY",e.WOLT_DELIVERY="WOLT_DELIVERY",e.WOLT_TAKE_AWAY="WOLT_TAKE_AWAY",e.WOLT_DINE_IN="WOLT_DINE_IN"})(ot||(ot={}));var ut;(function(e){e.NEW="NEW",e.COMPLETED="COMPLETED",e.VERIFIED="VERIFIED",e.DELIVER="DELIVER",e.DELIVERED="DELIVERED",e.CLOSED="CLOSED",e.ABANDONED="ABANDONED",e.CANCELLED="CANCELLED",e.PICKED="PICKED"})(ut||(ut={}));var ft;(function(e){e.CASH="CASH",e.CARD="CARD",e.COD="COD",e.TERMINAL="TERMINAL",e.EPAYMENT="EPAYMENT",e.COUPON="COUPON",e.WALLET="WALLET",e.PREAUTHORIZED="PREAUTHORIZED",e.RETURN="RETURN",e.EXTERNAL="EXTERNAL"})(ft||(ft={}));var ct;(function(e){e.KIOSK="KIOSK",e.WEB="WEB",e.JUST_EAT_TAKE_AWAY="JUSTEATTAKEAWAY",e.GLOVO="GLOVO",e.PYSZNE="PYSZNE",e.WOLT="WOLT",e.UBER="UBER",e.BOLT="BOLT"})(ct||(ct={}));var lt;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(lt||(lt={}));var dt;(function(e){e.GROUP="group",e.PRODUCT="product"})(dt||(dt={}));var ht;(function(e){e.DINE_IN="DINE_IN",e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.GLOVO="GLOVO",e.JUSTEAT="JUSTEAT",e.UBER="UBER",e.BOLT="BOLT",e.WOLT="WOLT"})(ht||(ht={}));var pt;(function(e){e.ORDER_EVENT_ERROR="OrderEventError",e.ORDER_APPLIED_EVENTS="OrderAppliedEvents",e.ORDER_EVENT_FISCAL="OrderEventFiscal",e.ORDER_UPSELL="OrderUpsell"})(pt||(pt={}));function yc(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var $c=yc,mc=Q,bc=function(){try{var e=mc(Object,"defineProperty");return e({},"",{}),e}catch{}}(),_c=bc,vt=_c;function Ac(e,r,t){r=="__proto__"&&vt?vt(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var hn=Ac,Ec=hn,Oc=$r,Tc=Object.prototype,Sc=Tc.hasOwnProperty;function wc(e,r,t){var n=e[r];(!(Sc.call(e,r)&&Oc(n,t))||t===void 0&&!(r in e))&&Ec(e,r,t)}var pn=wc,Cc=pn,Ic=hn;function Dc(e,r,t,n){var a=!t;t||(t={});for(var i=-1,s=r.length;++i<s;){var f=r[i],o=n?n(t[f],e[f],f,t,e):void 0;o===void 0&&(o=e[f]),a?Ic(t,f,o):Cc(t,f,o)}return t}var Be=Dc,jc=Be,xc=br;function Lc(e,r){return e&&jc(r,xc(r),e)}var Rc=Lc;function Nc(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var Pc=Nc,Uc=ye,Mc=Le,Fc=Pc,Bc=Object.prototype,Hc=Bc.hasOwnProperty;function Gc(e){if(!Uc(e))return Fc(e);var r=Mc(e),t=[];for(var n in e)n=="constructor"&&(r||!Hc.call(e,n))||t.push(n);return t}var qc=Gc,Kc=an,Yc=qc,Wc=pr;function kc(e){return Wc(e)?Kc(e,!0):Yc(e)}var _r=kc,Vc=Be,Jc=_r;function zc(e,r){return e&&Vc(r,Jc(r),e)}var Zc=zc,or={exports:{}};(function(e,r){var t=W,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?t.Buffer:void 0,f=s?s.allocUnsafe:void 0;function o(v,m){if(m)return v.slice();var y=v.length,h=f?f(y):new v.constructor(y);return v.copy(h),h}e.exports=o})(or,or.exports);function Xc(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var Qc=Xc,el=Be,rl=mr;function tl(e,r){return el(e,rl(e),r)}var nl=tl,al=Ut,il=al(Object.getPrototypeOf,Object),vn=il,sl=rn,ol=vn,ul=mr,fl=nn,cl=Object.getOwnPropertySymbols,ll=cl?function(e){for(var r=[];e;)sl(r,ul(e)),e=ol(e);return r}:fl,gn=ll,dl=Be,hl=gn;function pl(e,r){return dl(e,hl(e),r)}var vl=pl,gl=tn,yl=gn,$l=_r;function ml(e){return gl(e,$l,yl)}var bl=ml,_l=Object.prototype,Al=_l.hasOwnProperty;function El(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&Al.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var Ol=El,gt=en;function Tl(e){var r=new e.constructor(e.byteLength);return new gt(r).set(new gt(e)),r}var Ar=Tl,Sl=Ar;function wl(e,r){var t=r?Sl(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var Cl=wl,Il=/\w*$/;function Dl(e){var r=new e.constructor(e.source,Il.exec(e));return r.lastIndex=e.lastIndex,r}var jl=Dl,yt=Re,$t=yt?yt.prototype:void 0,mt=$t?$t.valueOf:void 0;function xl(e){return mt?Object(mt.call(e)):{}}var Ll=xl,Rl=Ar;function Nl(e,r){var t=r?Rl(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Pl=Nl,Ul=Ar,Ml=Cl,Fl=jl,Bl=Ll,Hl=Pl,Gl="[object Boolean]",ql="[object Date]",Kl="[object Map]",Yl="[object Number]",Wl="[object RegExp]",kl="[object Set]",Vl="[object String]",Jl="[object Symbol]",zl="[object ArrayBuffer]",Zl="[object DataView]",Xl="[object Float32Array]",Ql="[object Float64Array]",ed="[object Int8Array]",rd="[object Int16Array]",td="[object Int32Array]",nd="[object Uint8Array]",ad="[object Uint8ClampedArray]",id="[object Uint16Array]",sd="[object Uint32Array]";function od(e,r,t){var n=e.constructor;switch(r){case zl:return Ul(e);case Gl:case ql:return new n(+e);case Zl:return Ml(e,t);case Xl:case Ql:case ed:case rd:case td:case nd:case ad:case id:case sd:return Hl(e,t);case Kl:return new n;case Yl:case Vl:return new n(e);case Wl:return Fl(e);case kl:return new n;case Jl:return Bl(e)}}var ud=od,fd=ye,bt=Object.create,cd=function(){function e(){}return function(r){if(!fd(r))return{};if(bt)return bt(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}(),ld=cd,dd=ld,hd=vn,pd=Le;function vd(e){return typeof e.constructor=="function"&&!pd(e)?dd(hd(e)):{}}var gd=vd,yd=$e,$d=se,md="[object Map]";function bd(e){return $d(e)&&yd(e)==md}var _d=bd,Ad=_d,Ed=vr,_t=ve.exports,At=_t&&_t.isMap,Od=At?Ed(At):Ad,Td=Od,Sd=$e,wd=se,Cd="[object Set]";function Id(e){return wd(e)&&Sd(e)==Cd}var Dd=Id,jd=Dd,xd=vr,Et=ve.exports,Ot=Et&&Et.isSet,Ld=Ot?xd(Ot):jd,Rd=Ld,Nd=Xt,Pd=$c,Ud=pn,Md=Rc,Fd=Zc,Bd=or.exports,Hd=Qc,Gd=nl,qd=vl,Kd=sn,Yd=bl,Wd=$e,kd=Ol,Vd=ud,Jd=gd,zd=me,Zd=ae.exports,Xd=Td,Qd=ye,eh=Rd,rh=br,th=_r,nh=1,ah=2,ih=4,yn="[object Arguments]",sh="[object Array]",oh="[object Boolean]",uh="[object Date]",fh="[object Error]",$n="[object Function]",ch="[object GeneratorFunction]",lh="[object Map]",dh="[object Number]",mn="[object Object]",hh="[object RegExp]",ph="[object Set]",vh="[object String]",gh="[object Symbol]",yh="[object WeakMap]",$h="[object ArrayBuffer]",mh="[object DataView]",bh="[object Float32Array]",_h="[object Float64Array]",Ah="[object Int8Array]",Eh="[object Int16Array]",Oh="[object Int32Array]",Th="[object Uint8Array]",Sh="[object Uint8ClampedArray]",wh="[object Uint16Array]",Ch="[object Uint32Array]",N={};N[yn]=N[sh]=N[$h]=N[mh]=N[oh]=N[uh]=N[bh]=N[_h]=N[Ah]=N[Eh]=N[Oh]=N[lh]=N[dh]=N[mn]=N[hh]=N[ph]=N[vh]=N[gh]=N[Th]=N[Sh]=N[wh]=N[Ch]=!0;N[fh]=N[$n]=N[yh]=!1;function Te(e,r,t,n,a,i){var s,f=r&nh,o=r&ah,v=r&ih;if(t&&(s=a?t(e,n,a,i):t(e)),s!==void 0)return s;if(!Qd(e))return e;var m=zd(e);if(m){if(s=kd(e),!f)return Hd(e,s)}else{var y=Wd(e),h=y==$n||y==ch;if(Zd(e))return Bd(e,f);if(y==mn||y==yn||h&&!a){if(s=o||h?{}:Jd(e),!f)return o?qd(e,Fd(s,e)):Gd(e,Md(s,e))}else{if(!N[y])return a?e:{};s=Vd(e,y,f)}}i||(i=new Nd);var g=i.get(e);if(g)return g;i.set(e,s),eh(e)?e.forEach(function(O){s.add(Te(O,r,t,O,e,i))}):Xd(e)&&e.forEach(function(O,j){s.set(j,Te(O,r,t,j,e,i))});var A=v?o?Yd:Kd:o?th:rh,p=m?void 0:A(e);return Pd(p||e,function(O,j){p&&(j=O,O=e[j]),Ud(s,j,Te(O,r,t,j,e,i))}),s}var Ih=Te,Dh=Ih,jh=1,xh=4;function Lh(e){return Dh(e,jh|xh)}var Rh=Lh;function Nh(e,r){if(!r||!r.filter||!e||!e.filter||e.kind!==sr.CONFIG)return!0;if(e.filter&&e.items){const t=Object.values(e.filter).flat().filter(n=>{var a,i,s,f;return r.filter[(i=(a=e.items)==null?void 0:a[0])==null?void 0:i.fltCtx]&&Object.values(r.filter[(f=(s=e.items)==null?void 0:s[0])==null?void 0:f.fltCtx]).includes(n)});if(Array.isArray(t)&&t.length===0)return!1}return!0}const De=(e,r,t=0)=>{if(!e)return 0;let n=parseFloat(e.price)||0;const{items:a}=e,i=Rh(r);return Nh(e,i)&&Array.isArray(a)&&a.forEach(s=>{let f=0;if(s.kind!=="3e/product")f=De(s,i,t+1);else{const{selected:o={}}=i,{selCtx:v,id:m}=s;v in o&&m in o[v]&&(f=De(s,i,t+1)*o[v][m],delete i.selected[v][m])}n+=f}),Math.round(100*n)/100},Ph=({product:e,state:r,selected:t,cheapestGroupOptionsProduct:n})=>{var o;const a=r?De(e,r):0,i=e.state&&!yr((o=e==null?void 0:e.state)==null?void 0:o.selected)?De(e,e.state):0,s=e.minPrice&&parseFloat(e.price)===a;let f=t||!!n||parseFloat(e.price)===0?a||i:parseFloat(e.price);return n!==void 0&&(f-=n),s&&e.minPrice&&(f=parseFloat(e.minPrice)),{displayPrice:f,showAsMinPrice:s,calculatedPriceDefaultProductState:i}};function Er(e){const r=[];return e.reduce((t,n)=>{if(t[n.hash]||(t[n.hash]={...n,quantity:0,discounted:0,discounts:[],firstProductQuantity:n.quantity,itemsToRemove:[]},r.push(t[n.hash])),t[n.hash].quantity+=n.quantity,t[n.hash].itemsToRemove.push(n.id),n.discounts){t[n.hash].discounts||(t[n.hash].discounts=[]),t[n.hash].discounts=t[n.hash].discounts.concat(n.discounts),t[n.hash].discounted=0;for(let a=0;a<t[n.hash].discounts.length;a+=1)t[n.hash].discounts[a]&&(t[n.hash].discounted+=parseFloat(t[n.hash].discounts[a].discountPrice))}return t},{}),r}function Uh(e){return Er(e)}function Mh(e){return!e||e.length===0?null:Er(e.flatMap(r=>r.lines))}var Or={exports:{}},bn=function(r,t){return function(){for(var a=new Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return r.apply(t,a)}},Fh=bn,ee=Object.prototype.toString;function Tr(e){return ee.call(e)==="[object Array]"}function ur(e){return typeof e=="undefined"}function Bh(e){return e!==null&&!ur(e)&&e.constructor!==null&&!ur(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Hh(e){return ee.call(e)==="[object ArrayBuffer]"}function Gh(e){return typeof FormData!="undefined"&&e instanceof FormData}function qh(e){var r;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&e.buffer instanceof ArrayBuffer,r}function Kh(e){return typeof e=="string"}function Yh(e){return typeof e=="number"}function _n(e){return e!==null&&typeof e=="object"}function Se(e){if(ee.call(e)!=="[object Object]")return!1;var r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function Wh(e){return ee.call(e)==="[object Date]"}function kh(e){return ee.call(e)==="[object File]"}function Vh(e){return ee.call(e)==="[object Blob]"}function An(e){return ee.call(e)==="[object Function]"}function Jh(e){return _n(e)&&An(e.pipe)}function zh(e){return typeof URLSearchParams!="undefined"&&e instanceof URLSearchParams}function Zh(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Xh(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function Sr(e,r){if(!(e===null||typeof e=="undefined"))if(typeof e!="object"&&(e=[e]),Tr(e))for(var t=0,n=e.length;t<n;t++)r.call(null,e[t],t,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.call(null,e[a],a,e)}function fr(){var e={};function r(a,i){Se(e[i])&&Se(a)?e[i]=fr(e[i],a):Se(a)?e[i]=fr({},a):Tr(a)?e[i]=a.slice():e[i]=a}for(var t=0,n=arguments.length;t<n;t++)Sr(arguments[t],r);return e}function Qh(e,r,t){return Sr(r,function(a,i){t&&typeof a=="function"?e[i]=Fh(a,t):e[i]=a}),e}function ep(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var K={isArray:Tr,isArrayBuffer:Hh,isBuffer:Bh,isFormData:Gh,isArrayBufferView:qh,isString:Kh,isNumber:Yh,isObject:_n,isPlainObject:Se,isUndefined:ur,isDate:Wh,isFile:kh,isBlob:Vh,isFunction:An,isStream:Jh,isURLSearchParams:zh,isStandardBrowserEnv:Xh,forEach:Sr,merge:fr,extend:Qh,trim:Zh,stripBOM:ep},te=K;function Tt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var En=function(r,t,n){if(!t)return r;var a;if(n)a=n(t);else if(te.isURLSearchParams(t))a=t.toString();else{var i=[];te.forEach(t,function(o,v){o===null||typeof o=="undefined"||(te.isArray(o)?v=v+"[]":o=[o],te.forEach(o,function(y){te.isDate(y)?y=y.toISOString():te.isObject(y)&&(y=JSON.stringify(y)),i.push(Tt(v)+"="+Tt(y))}))}),a=i.join("&")}if(a){var s=r.indexOf("#");s!==-1&&(r=r.slice(0,s)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r},rp=K;function He(){this.handlers=[]}He.prototype.use=function(r,t,n){return this.handlers.push({fulfilled:r,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};He.prototype.eject=function(r){this.handlers[r]&&(this.handlers[r]=null)};He.prototype.forEach=function(r){rp.forEach(this.handlers,function(n){n!==null&&r(n)})};var tp=He,np=K,ap=function(r,t){np.forEach(r,function(a,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(r[t]=a,delete r[i])})},On=function(r,t,n,a,i){return r.config=t,n&&(r.code=n),r.request=a,r.response=i,r.isAxiosError=!0,r.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:this.config,code:this.code}},r},ip=On,Tn=function(r,t,n,a,i){var s=new Error(r);return ip(s,t,n,a,i)},sp=Tn,op=function(r,t,n){var a=n.config.validateStatus;!n.status||!a||a(n.status)?r(n):t(sp("Request failed with status code "+n.status,n.config,null,n.request,n))},Ee=K,up=Ee.isStandardBrowserEnv()?function(){return{write:function(t,n,a,i,s,f){var o=[];o.push(t+"="+encodeURIComponent(n)),Ee.isNumber(a)&&o.push("expires="+new Date(a).toGMTString()),Ee.isString(i)&&o.push("path="+i),Ee.isString(s)&&o.push("domain="+s),f===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),fp=function(r){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(r)},cp=function(r,t){return t?r.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):r},lp=fp,dp=cp,hp=function(r,t){return r&&!lp(t)?dp(r,t):t},Je=K,pp=["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"],vp=function(r){var t={},n,a,i;return r&&Je.forEach(r.split(`
2
+ `),function(f){if(i=f.indexOf(":"),n=Je.trim(f.substr(0,i)).toLowerCase(),a=Je.trim(f.substr(i+1)),n){if(t[n]&&pp.indexOf(n)>=0)return;n==="set-cookie"?t[n]=(t[n]?t[n]:[]).concat([a]):t[n]=t[n]?t[n]+", "+a:a}}),t},St=K,gp=St.isStandardBrowserEnv()?function(){var r=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),n;function a(i){var s=i;return r&&(t.setAttribute("href",s),s=t.href),t.setAttribute("href",s),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return n=a(window.location.href),function(s){var f=St.isString(s)?a(s):s;return f.protocol===n.protocol&&f.host===n.host}}():function(){return function(){return!0}}(),Oe=K,yp=op,$p=up,mp=En,bp=hp,_p=vp,Ap=gp,ze=Tn,wt=function(r){return new Promise(function(n,a){var i=r.data,s=r.headers,f=r.responseType;Oe.isFormData(i)&&delete s["Content-Type"];var o=new XMLHttpRequest;if(r.auth){var v=r.auth.username||"",m=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";s.Authorization="Basic "+btoa(v+":"+m)}var y=bp(r.baseURL,r.url);o.open(r.method.toUpperCase(),mp(y,r.params,r.paramsSerializer),!0),o.timeout=r.timeout;function h(){if(!!o){var A="getAllResponseHeaders"in o?_p(o.getAllResponseHeaders()):null,p=!f||f==="text"||f==="json"?o.responseText:o.response,O={data:p,status:o.status,statusText:o.statusText,headers:A,config:r,request:o};yp(n,a,O),o=null}}if("onloadend"in o?o.onloadend=h:o.onreadystatechange=function(){!o||o.readyState!==4||o.status===0&&!(o.responseURL&&o.responseURL.indexOf("file:")===0)||setTimeout(h)},o.onabort=function(){!o||(a(ze("Request aborted",r,"ECONNABORTED",o)),o=null)},o.onerror=function(){a(ze("Network Error",r,null,o)),o=null},o.ontimeout=function(){var p="timeout of "+r.timeout+"ms exceeded";r.timeoutErrorMessage&&(p=r.timeoutErrorMessage),a(ze(p,r,r.transitional&&r.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",o)),o=null},Oe.isStandardBrowserEnv()){var g=(r.withCredentials||Ap(y))&&r.xsrfCookieName?$p.read(r.xsrfCookieName):void 0;g&&(s[r.xsrfHeaderName]=g)}"setRequestHeader"in o&&Oe.forEach(s,function(p,O){typeof i=="undefined"&&O.toLowerCase()==="content-type"?delete s[O]:o.setRequestHeader(O,p)}),Oe.isUndefined(r.withCredentials)||(o.withCredentials=!!r.withCredentials),f&&f!=="json"&&(o.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&o.addEventListener("progress",r.onDownloadProgress),typeof r.onUploadProgress=="function"&&o.upload&&o.upload.addEventListener("progress",r.onUploadProgress),r.cancelToken&&r.cancelToken.promise.then(function(p){!o||(o.abort(),a(p),o=null)}),i||(i=null),o.send(i)})},F=K,Ct=ap,Ep=On,Op={"Content-Type":"application/x-www-form-urlencoded"};function It(e,r){!F.isUndefined(e)&&F.isUndefined(e["Content-Type"])&&(e["Content-Type"]=r)}function Tp(){var e;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(e=wt),e}function Sp(e,r,t){if(F.isString(e))try{return(r||JSON.parse)(e),F.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(e)}var Ge={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:Tp(),transformRequest:[function(r,t){return Ct(t,"Accept"),Ct(t,"Content-Type"),F.isFormData(r)||F.isArrayBuffer(r)||F.isBuffer(r)||F.isStream(r)||F.isFile(r)||F.isBlob(r)?r:F.isArrayBufferView(r)?r.buffer:F.isURLSearchParams(r)?(It(t,"application/x-www-form-urlencoded;charset=utf-8"),r.toString()):F.isObject(r)||t&&t["Content-Type"]==="application/json"?(It(t,"application/json"),Sp(r)):r}],transformResponse:[function(r){var t=this.transitional,n=t&&t.silentJSONParsing,a=t&&t.forcedJSONParsing,i=!n&&this.responseType==="json";if(i||a&&F.isString(r)&&r.length)try{return JSON.parse(r)}catch(s){if(i)throw s.name==="SyntaxError"?Ep(s,this,"E_JSON_PARSE"):s}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(r){return r>=200&&r<300}};Ge.headers={common:{Accept:"application/json, text/plain, */*"}};F.forEach(["delete","get","head"],function(r){Ge.headers[r]={}});F.forEach(["post","put","patch"],function(r){Ge.headers[r]=F.merge(Op)});var wr=Ge,wp=K,Cp=wr,Ip=function(r,t,n){var a=this||Cp;return wp.forEach(n,function(s){r=s.call(a,r,t)}),r},Sn=function(r){return!!(r&&r.__CANCEL__)},Dt=K,Ze=Ip,Dp=Sn,jp=wr;function Xe(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var xp=function(r){Xe(r),r.headers=r.headers||{},r.data=Ze.call(r,r.data,r.headers,r.transformRequest),r.headers=Dt.merge(r.headers.common||{},r.headers[r.method]||{},r.headers),Dt.forEach(["delete","get","head","post","put","patch","common"],function(a){delete r.headers[a]});var t=r.adapter||jp.adapter;return t(r).then(function(a){return Xe(r),a.data=Ze.call(r,a.data,a.headers,r.transformResponse),a},function(a){return Dp(a)||(Xe(r),a&&a.response&&(a.response.data=Ze.call(r,a.response.data,a.response.headers,r.transformResponse))),Promise.reject(a)})},G=K,wn=function(r,t){t=t||{};var n={},a=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],f=["validateStatus"];function o(h,g){return G.isPlainObject(h)&&G.isPlainObject(g)?G.merge(h,g):G.isPlainObject(g)?G.merge({},g):G.isArray(g)?g.slice():g}function v(h){G.isUndefined(t[h])?G.isUndefined(r[h])||(n[h]=o(void 0,r[h])):n[h]=o(r[h],t[h])}G.forEach(a,function(g){G.isUndefined(t[g])||(n[g]=o(void 0,t[g]))}),G.forEach(i,v),G.forEach(s,function(g){G.isUndefined(t[g])?G.isUndefined(r[g])||(n[g]=o(void 0,r[g])):n[g]=o(void 0,t[g])}),G.forEach(f,function(g){g in t?n[g]=o(r[g],t[g]):g in r&&(n[g]=o(void 0,r[g]))});var m=a.concat(i).concat(s).concat(f),y=Object.keys(r).concat(Object.keys(t)).filter(function(g){return m.indexOf(g)===-1});return G.forEach(y,v),n};const Lp="axios",Rp="0.21.4",Np="Promise based HTTP client for the browser and node.js",Pp="index.js",Up={test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},Mp={type:"git",url:"https://github.com/axios/axios.git"},Fp=["xhr","http","ajax","promise","node"],Bp="Matt Zabriskie",Hp="MIT",Gp={url:"https://github.com/axios/axios/issues"},qp="https://axios-http.com",Kp={coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},Yp={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},Wp="dist/axios.min.js",kp="dist/axios.min.js",Vp="./index.d.ts",Jp={"follow-redirects":"^1.14.0"},zp=[{path:"./dist/axios.min.js",threshold:"5kB"}];var Zp={name:Lp,version:Rp,description:Np,main:Pp,scripts:Up,repository:Mp,keywords:Fp,author:Bp,license:Hp,bugs:Gp,homepage:qp,devDependencies:Kp,browser:Yp,jsdelivr:Wp,unpkg:kp,typings:Vp,dependencies:Jp,bundlesize:zp},Cn=Zp,Cr={};["object","boolean","number","function","string","symbol"].forEach(function(e,r){Cr[e]=function(n){return typeof n===e||"a"+(r<1?"n ":" ")+e}});var jt={},Xp=Cn.version.split(".");function In(e,r){for(var t=r?r.split("."):Xp,n=e.split("."),a=0;a<3;a++){if(t[a]>n[a])return!0;if(t[a]<n[a])return!1}return!1}Cr.transitional=function(r,t,n){var a=t&&In(t);function i(s,f){return"[Axios v"+Cn.version+"] Transitional option '"+s+"'"+f+(n?". "+n:"")}return function(s,f,o){if(r===!1)throw new Error(i(f," has been removed in "+t));return a&&!jt[f]&&(jt[f]=!0,console.warn(i(f," has been deprecated since v"+t+" and will be removed in the near future"))),r?r(s,f,o):!0}};function Qp(e,r,t){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),a=n.length;a-- >0;){var i=n[a],s=r[i];if(s){var f=e[i],o=f===void 0||s(f,i,e);if(o!==!0)throw new TypeError("option "+i+" must be "+o);continue}if(t!==!0)throw Error("Unknown option "+i)}}var ev={isOlderVersion:In,assertOptions:Qp,validators:Cr},Dn=K,rv=En,xt=tp,Lt=xp,qe=wn,jn=ev,ne=jn.validators;function be(e){this.defaults=e,this.interceptors={request:new xt,response:new xt}}be.prototype.request=function(r){typeof r=="string"?(r=arguments[1]||{},r.url=arguments[0]):r=r||{},r=qe(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var t=r.transitional;t!==void 0&&jn.assertOptions(t,{silentJSONParsing:ne.transitional(ne.boolean,"1.0.0"),forcedJSONParsing:ne.transitional(ne.boolean,"1.0.0"),clarifyTimeoutError:ne.transitional(ne.boolean,"1.0.0")},!1);var n=[],a=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(r)===!1||(a=a&&h.synchronous,n.unshift(h.fulfilled,h.rejected))});var i=[];this.interceptors.response.forEach(function(h){i.push(h.fulfilled,h.rejected)});var s;if(!a){var f=[Lt,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(i),s=Promise.resolve(r);f.length;)s=s.then(f.shift(),f.shift());return s}for(var o=r;n.length;){var v=n.shift(),m=n.shift();try{o=v(o)}catch(y){m(y);break}}try{s=Lt(o)}catch(y){return Promise.reject(y)}for(;i.length;)s=s.then(i.shift(),i.shift());return s};be.prototype.getUri=function(r){return r=qe(this.defaults,r),rv(r.url,r.params,r.paramsSerializer).replace(/^\?/,"")};Dn.forEach(["delete","get","head","options"],function(r){be.prototype[r]=function(t,n){return this.request(qe(n||{},{method:r,url:t,data:(n||{}).data}))}});Dn.forEach(["post","put","patch"],function(r){be.prototype[r]=function(t,n,a){return this.request(qe(a||{},{method:r,url:t,data:n}))}});var tv=be;function Ir(e){this.message=e}Ir.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Ir.prototype.__CANCEL__=!0;var xn=Ir,nv=xn;function je(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(a){r=a});var t=this;e(function(a){t.reason||(t.reason=new nv(a),r(t.reason))})}je.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};je.source=function(){var r,t=new je(function(a){r=a});return{token:t,cancel:r}};var av=je,iv=function(r){return function(n){return r.apply(null,n)}},sv=function(r){return typeof r=="object"&&r.isAxiosError===!0},Rt=K,ov=bn,we=tv,uv=wn,fv=wr;function Ln(e){var r=new we(e),t=ov(we.prototype.request,r);return Rt.extend(t,we.prototype,r),Rt.extend(t,r),t}var Y=Ln(fv);Y.Axios=we;Y.create=function(r){return Ln(uv(Y.defaults,r))};Y.Cancel=xn;Y.CancelToken=av;Y.isCancel=Sn;Y.all=function(r){return Promise.all(r)};Y.spread=iv;Y.isAxiosError=sv;Or.exports=Y;Or.exports.default=Y;var cv=Or.exports;const lv=(e,r)=>{var t,n,a;return e&&((t=e==null?void 0:e.url)==null?void 0:t.length)>0&&(((n=e.url.find(i=>i.locale===r))==null?void 0:n.value)||((a=e.url.find(i=>i.locale==="*"))==null?void 0:a.value))||null},dv=(e,r)=>{var t,n;return((t=e==null?void 0:e.find)==null?void 0:t.call(e,a=>a.venue===r))||((n=e==null?void 0:e.find)==null?void 0:n.call(e,a=>a.venue==="*"))};function Ke(e,r=600,t=!0,n,a){var j,u;if(!n||!a)throw new Error("baseUrl or tenant was not provided");const i=`${e}_${a}_${n}`,s=`${n.endsWith("/")?n.slice(0,-1):n}/cms-api/content/${a}/${e}`,f=((j=O())==null?void 0:j.value)||null,[o,v]=B.useState(((u=O())==null?void 0:u.timestamp)||0),[m,y]=B.useState(f||null),[h,g]=B.useState(!1);async function A(c){return cv.get(s,{signal:c}).then(l=>{if(yr(l.data))throw new Error(`CMS data '${e}' is an empty object`);un(l.data,m)||y(l.data),h&&g(!1),t&&p(l.data)}).catch(l=>{l.code!=="ERR_CANCELED"&&(console.error(l),g(!0))})}function p(c){const l=new Date().valueOf(),d=JSON.stringify({value:c,timestamp:l});localStorage.setItem(i,d),v(l)}function O(){try{const c=localStorage.getItem(i);if(c)return JSON.parse(c)}catch(c){console.warn(c)}return null}return B.useEffect(()=>{if(console.log("CMS ID",e),new Date().valueOf()-o>r*1e3){const l=new AbortController;return A(l.signal),()=>l.abort()}const c=O();if(c!=null&&c.value)y(c.value),v(c.timestamp);else{const l=new AbortController;return A(l.signal),()=>l.abort()}},[e]),xe(A,r*1e3),{value:m,isError:h,isLoading:!h&&!m}}function hv({id:e,intervalSeconds:r,withLocalStorage:t}){const n=B.useContext(dr.ConfigContext);if(!n)throw new Error("Hook was used outside config context");return Ke(e,r,t,n.baseUrl,n.tenant)}function Rn(e,r=600,t=!0,n,a,i){var f,o,v,m;if(!n||!a||!i)throw new Error("baseUrl, tenant or venue was not provided");const s=Ke(e,r,t,n,a);return{value:((o=(f=s.value)==null?void 0:f.find)==null?void 0:o.call(f,y=>y.venue===i))||((m=(v=s.value)==null?void 0:v.find)==null?void 0:m.call(v,y=>y.venue==="*"))||null,isError:s.isError}}function pv(e,r,t,n=300,a=!0){var m,y,h,g;const i=B.useContext(dr.ConfigContext);if(!i)throw new Error("Hook was used outside config context");const{value:s,isError:f}=Rn(e,n,a,i.baseUrl,i.tenant,r);let o=null,v=null;return s&&((m=s==null?void 0:s.url)==null?void 0:m.length)>0&&(o=((y=s.url.find(A=>A.locale===t))==null?void 0:y.value)||((h=s.url.find(A=>A.locale==="*"))==null?void 0:h.value)||null),!o&&s&&((g=s==null?void 0:s.url)==null?void 0:g.length)>0&&(v=s.url[0].value),{url:o,fallbackUrl:v,isError:f,mediaType:s==null?void 0:s.mediaType}}function Nn({kioskMediaId:e,kioskMediaType:r,intervalSeconds:t=600,withLocalStorage:n=!0,baseUrl:a,tenant:i,venue:s,locale:f}){var p;const{value:o,isError:v,isLoading:m}=Ke(e,t,n,a,i),y=(o==null?void 0:o[r])||[],h=dv(y,s),g=lv(h,f),A=!g&&h&&((p=h==null?void 0:h.url)==null?void 0:p.length)>0?h.url[0].value:null;return{url:g,fallbackUrl:A,mediaType:h==null?void 0:h.mediaType,isError:v,isLoading:m}}function vv({kioskMediaId:e,kioskMediaType:r,venue:t,intervalSeconds:n=600,withLocalStorage:a=!0}){const i=B.useContext(dr.ConfigContext);if(!i)throw new Error("Missing config context");const{i18n:{language:s}}=Mn.useTranslation();return Nn({kioskMediaId:e,kioskMediaType:r,intervalSeconds:n,withLocalStorage:a,venue:t,baseUrl:i.baseUrl,tenant:i.tenant,locale:s})}function gv(e,r){B.useEffect(()=>{const t=n=>{!e.current||e.current.contains(n.target)||r(n)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}},[e,r])}function yv(e){const[r,t]=B.useState(pe(e==null?void 0:e.DINE_IN)),[n,a]=B.useState(pe(e==null?void 0:e.TAKE_AWAY));function i(){const s=pe(e==null?void 0:e.DINE_IN),f=pe(e==null?void 0:e.TAKE_AWAY);s!==r&&(console.log("dine in open changed",r,"=>",s),t(s)),f!==n&&(console.log("take away open changed",n,"=>",f),a(f))}return B.useEffect(()=>{i()},[e]),xe(i,6e4),{dineInOpen:r,takeAwayOpen:n,loaded:!!e}}var cr={},$v=e=>encodeURIComponent(e).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),Pn="%[a-f0-9]{2}",Nt=new RegExp("("+Pn+")|([^%]+?)","gi"),Pt=new RegExp("("+Pn+")+","gi");function lr(e,r){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;r=r||1;var t=e.slice(0,r),n=e.slice(r);return Array.prototype.concat.call([],lr(t),lr(n))}function mv(e){try{return decodeURIComponent(e)}catch{for(var r=e.match(Nt)||[],t=1;t<r.length;t++)e=lr(r,t).join(""),r=e.match(Nt)||[];return e}}function bv(e){for(var r={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},t=Pt.exec(e);t;){try{r[t[0]]=decodeURIComponent(t[0])}catch{var n=mv(t[0]);n!==t[0]&&(r[t[0]]=n)}t=Pt.exec(e)}r["%C2"]="\uFFFD";for(var a=Object.keys(r),i=0;i<a.length;i++){var s=a[i];e=e.replace(new RegExp(s,"g"),r[s])}return e}var _v=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return bv(e)}},Av=(e,r)=>{if(!(typeof e=="string"&&typeof r=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(r==="")return[e];const t=e.indexOf(r);return t===-1?[e]:[e.slice(0,t),e.slice(t+r.length)]},Ev=function(e,r){for(var t={},n=Object.keys(e),a=Array.isArray(r),i=0;i<n.length;i++){var s=n[i],f=e[s];(a?r.indexOf(s)!==-1:r(s,f,e))&&(t[s]=f)}return t};(function(e){const r=$v,t=_v,n=Av,a=Ev,i=u=>u==null,s=Symbol("encodeFragmentIdentifier");function f(u){switch(u.arrayFormat){case"index":return c=>(l,d)=>{const $=l.length;return d===void 0||u.skipNull&&d===null||u.skipEmptyString&&d===""?l:d===null?[...l,[m(c,u),"[",$,"]"].join("")]:[...l,[m(c,u),"[",m($,u),"]=",m(d,u)].join("")]};case"bracket":return c=>(l,d)=>d===void 0||u.skipNull&&d===null||u.skipEmptyString&&d===""?l:d===null?[...l,[m(c,u),"[]"].join("")]:[...l,[m(c,u),"[]=",m(d,u)].join("")];case"colon-list-separator":return c=>(l,d)=>d===void 0||u.skipNull&&d===null||u.skipEmptyString&&d===""?l:d===null?[...l,[m(c,u),":list="].join("")]:[...l,[m(c,u),":list=",m(d,u)].join("")];case"comma":case"separator":case"bracket-separator":{const c=u.arrayFormat==="bracket-separator"?"[]=":"=";return l=>(d,$)=>$===void 0||u.skipNull&&$===null||u.skipEmptyString&&$===""?d:($=$===null?"":$,d.length===0?[[m(l,u),c,m($,u)].join("")]:[[d,m($,u)].join(u.arrayFormatSeparator)])}default:return c=>(l,d)=>d===void 0||u.skipNull&&d===null||u.skipEmptyString&&d===""?l:d===null?[...l,m(c,u)]:[...l,[m(c,u),"=",m(d,u)].join("")]}}function o(u){let c;switch(u.arrayFormat){case"index":return(l,d,$)=>{if(c=/\[(\d*)\]$/.exec(l),l=l.replace(/\[\d*\]$/,""),!c){$[l]=d;return}$[l]===void 0&&($[l]={}),$[l][c[1]]=d};case"bracket":return(l,d,$)=>{if(c=/(\[\])$/.exec(l),l=l.replace(/\[\]$/,""),!c){$[l]=d;return}if($[l]===void 0){$[l]=[d];return}$[l]=[].concat($[l],d)};case"colon-list-separator":return(l,d,$)=>{if(c=/(:list)$/.exec(l),l=l.replace(/:list$/,""),!c){$[l]=d;return}if($[l]===void 0){$[l]=[d];return}$[l]=[].concat($[l],d)};case"comma":case"separator":return(l,d,$)=>{const w=typeof d=="string"&&d.includes(u.arrayFormatSeparator),T=typeof d=="string"&&!w&&y(d,u).includes(u.arrayFormatSeparator);d=T?y(d,u):d;const C=w||T?d.split(u.arrayFormatSeparator).map(L=>y(L,u)):d===null?d:y(d,u);$[l]=C};case"bracket-separator":return(l,d,$)=>{const w=/(\[\])$/.test(l);if(l=l.replace(/\[\]$/,""),!w){$[l]=d&&y(d,u);return}const T=d===null?[]:d.split(u.arrayFormatSeparator).map(C=>y(C,u));if($[l]===void 0){$[l]=T;return}$[l]=[].concat($[l],T)};default:return(l,d,$)=>{if($[l]===void 0){$[l]=d;return}$[l]=[].concat($[l],d)}}}function v(u){if(typeof u!="string"||u.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(u,c){return c.encode?c.strict?r(u):encodeURIComponent(u):u}function y(u,c){return c.decode?t(u):u}function h(u){return Array.isArray(u)?u.sort():typeof u=="object"?h(Object.keys(u)).sort((c,l)=>Number(c)-Number(l)).map(c=>u[c]):u}function g(u){const c=u.indexOf("#");return c!==-1&&(u=u.slice(0,c)),u}function A(u){let c="";const l=u.indexOf("#");return l!==-1&&(c=u.slice(l)),c}function p(u){u=g(u);const c=u.indexOf("?");return c===-1?"":u.slice(c+1)}function O(u,c){return c.parseNumbers&&!Number.isNaN(Number(u))&&typeof u=="string"&&u.trim()!==""?u=Number(u):c.parseBooleans&&u!==null&&(u.toLowerCase()==="true"||u.toLowerCase()==="false")&&(u=u.toLowerCase()==="true"),u}function j(u,c){c=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},c),v(c.arrayFormatSeparator);const l=o(c),d=Object.create(null);if(typeof u!="string"||(u=u.trim().replace(/^[?#&]/,""),!u))return d;for(const $ of u.split("&")){if($==="")continue;let[w,T]=n(c.decode?$.replace(/\+/g," "):$,"=");T=T===void 0?null:["comma","separator","bracket-separator"].includes(c.arrayFormat)?T:y(T,c),l(y(w,c),T,d)}for(const $ of Object.keys(d)){const w=d[$];if(typeof w=="object"&&w!==null)for(const T of Object.keys(w))w[T]=O(w[T],c);else d[$]=O(w,c)}return c.sort===!1?d:(c.sort===!0?Object.keys(d).sort():Object.keys(d).sort(c.sort)).reduce(($,w)=>{const T=d[w];return Boolean(T)&&typeof T=="object"&&!Array.isArray(T)?$[w]=h(T):$[w]=T,$},Object.create(null))}e.extract=p,e.parse=j,e.stringify=(u,c)=>{if(!u)return"";c=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},c),v(c.arrayFormatSeparator);const l=T=>c.skipNull&&i(u[T])||c.skipEmptyString&&u[T]==="",d=f(c),$={};for(const T of Object.keys(u))l(T)||($[T]=u[T]);const w=Object.keys($);return c.sort!==!1&&w.sort(c.sort),w.map(T=>{const C=u[T];return C===void 0?"":C===null?m(T,c):Array.isArray(C)?C.length===0&&c.arrayFormat==="bracket-separator"?m(T,c)+"[]":C.reduce(d(T),[]).join("&"):m(T,c)+"="+m(C,c)}).filter(T=>T.length>0).join("&")},e.parseUrl=(u,c)=>{c=Object.assign({decode:!0},c);const[l,d]=n(u,"#");return Object.assign({url:l.split("?")[0]||"",query:j(p(u),c)},c&&c.parseFragmentIdentifier&&d?{fragmentIdentifier:y(d,c)}:{})},e.stringifyUrl=(u,c)=>{c=Object.assign({encode:!0,strict:!0,[s]:!0},c);const l=g(u.url).split("?")[0]||"",d=e.extract(u.url),$=e.parse(d,{sort:!1}),w=Object.assign($,u.query);let T=e.stringify(w,c);T&&(T=`?${T}`);let C=A(u.url);return u.fragmentIdentifier&&(C=`#${c[s]?m(u.fragmentIdentifier,c):u.fragmentIdentifier}`),`${l}${T}${C}`},e.pick=(u,c,l)=>{l=Object.assign({parseFragmentIdentifier:!0,[s]:!1},l);const{url:d,query:$,fragmentIdentifier:w}=e.parseUrl(u,l);return e.stringifyUrl({url:d,query:a($,c),fragmentIdentifier:w},l)},e.exclude=(u,c,l)=>{const d=Array.isArray(c)?$=>!c.includes($):($,w)=>!c($,w);return e.pick(u,d,l)}})(cr);const Ov=[".png",".jpg",".jpeg",".webp",".bmp",".tiff"];function Un(e,r=500){const t=cr.parseUrl(e);if(!(e.startsWith("https://orderingstackmedia.blob.core.windows.net/pictures")||e.startsWith("https://orderingstack-mmedia-tools.azurewebsites.net/api/img/")))return e;const n=t.url.substring(t.url.lastIndexOf("."));return Ov.includes(n)?cr.stringifyUrl({url:t.url.replace("https://orderingstackmedia.blob.core.windows.net/pictures/","https://orderingstack-mmedia-tools.azurewebsites.net/api/img/"),query:{...t.query,w:r}}):e}function Tv(e,r=500){return Un(e,r)}exports.addDiscounts=fn;exports.formatPrice=hc;exports.getGroupedBucketLines=Mh;exports.getMediaUrl=Un;exports.getProductAcronym=pc;exports.groupOrderLines=Er;exports.isChannelOpen=pe;exports.isProductEnabled=cn;exports.summarizeLineDiscounts=dc;exports.useAvailability=ln;exports.useCms=Ke;exports.useCmsInConfigContext=hv;exports.useDisplayPrice=Ph;exports.useGroupOrderLines=Uh;exports.useInterval=xe;exports.useKioskChannelsAvailability=yv;exports.useKioskMediaCms=Nn;exports.useKioskMediaCmsWithContext=vv;exports.useLocalizedVenueMedia=pv;exports.useMediaUrl=Tv;exports.useMenu=gc;exports.useOnClickOutside=gv;exports.useVenueCms=Rn;
3
3
  //# sourceMappingURL=index.cjs.js.map