mealz-components 1.3.13 → 1.3.14

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.
@@ -0,0 +1,3 @@
1
+ var x=function(r,e){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},x(r,e)};function b(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");x(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ot(r,e,t,n){function o(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function c(f){try{u(n.next(f))}catch(d){s(d)}}function a(f){try{u(n.throw(f))}catch(d){s(d)}}function u(f){f.done?i(f.value):o(f.value).then(c,a)}u((n=n.apply(r,e||[])).next())})}function st(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=c(0),s.throw=c(1),s.return=c(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return a([u,f])}}function a(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(t=0)),t;)try{if(n=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,o=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){t.label=u[1];break}if(u[0]===6&&t.label<i[1]){t.label=i[1],i=u;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(u);break}i[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],o=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function w(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(c){s={error:c}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return i}function g(r,e,t){if(t||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}function I(r){return this instanceof I?(this.v=r,this):new I(r)}function ut(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(l){return function(p){return Promise.resolve(p).then(l,d)}}function c(l,p){n[l]&&(o[l]=function(h){return new Promise(function(M,Y){i.push([l,h,M,Y])>1||a(l,h)})},p&&(o[l]=p(o[l])))}function a(l,p){try{u(n[l](p))}catch(h){v(i[0][3],h)}}function u(l){l.value instanceof I?Promise.resolve(l.value.v).then(f,d):v(i[0][2],l)}function f(l){a("next",l)}function d(l){a("throw",l)}function v(l,p){l(p),i.shift(),i.length&&a(i[0][0],i[0][1])}}function ct(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof w=="function"?w(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(s){return new Promise(function(c,a){s=r[i](s),o(c,a,s.done,s.value)})}}function o(i,s,c,a){Promise.resolve(a).then(function(u){i({value:u,done:c})},s)}}function y(r){return typeof r=="function"}function V(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var A=V(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
2
+ `+t.map(function(n,o){return o+1+") "+n.toString()}).join(`
3
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function P(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var _=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var c=w(s),a=c.next();!a.done;a=c.next()){var u=a.value;u.remove(this)}}catch(h){e={error:h}}finally{try{a&&!a.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}else s.remove(this);var f=this.initialTeardown;if(y(f))try{f()}catch(h){i=h instanceof A?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var v=w(d),l=v.next();!l.done;l=v.next()){var p=l.value;try{j(p)}catch(h){i=i??[],h instanceof A?i=g(g([],S(i)),S(h.errors)):i.push(h)}}}catch(h){n={error:h}}finally{try{l&&!l.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(i)throw new A(i)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)j(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&P(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&P(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}(),at=_.EMPTY;function q(r){return r instanceof _||r&&"closed"in r&&y(r.remove)&&y(r.add)&&y(r.unsubscribe)}function j(r){y(r)?r():r.unsubscribe()}var C={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},D={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,g([r,e],S(t)))},clearTimeout:function(r){var e=D.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(r)},delegate:void 0};function B(r){D.setTimeout(function(){throw r})}function k(){}function G(r){r()}var O=function(r){b(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,q(t)&&t.add(n)):n.destination=K,n}return e.create=function(t,n,o){return new T(t,n,o)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(_),H=Function.prototype.bind;function E(r,e){return H.call(r,e)}var L=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){m(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){m(n)}else m(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){m(t)}},r}(),T=function(r){b(e,r);function e(t,n,o){var i=r.call(this)||this,s;if(y(t)||!t)s={next:t??void 0,error:n??void 0,complete:o??void 0};else{var c;i&&C.useDeprecatedNextContext?(c=Object.create(t),c.unsubscribe=function(){return i.unsubscribe()},s={next:t.next&&E(t.next,c),error:t.error&&E(t.error,c),complete:t.complete&&E(t.complete,c)}):s=t}return i.destination=new L(s),i}return e}(O);function m(r){B(r)}function J(r){throw r}var K={closed:!0,next:k,error:J,complete:k},Q=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function W(r){return r}function X(r){return r.length===0?W:r.length===1?r[0]:function(t){return r.reduce(function(n,o){return o(n)},t)}}var lt=function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var o=this,i=$(e)?e:new T(e,t,n);return G(function(){var s=o,c=s.operator,a=s.source;i.add(c?c.call(i,a):a?o._subscribe(i):o._trySubscribe(i))}),i},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=U(t),new t(function(o,i){var s=new T({next:function(c){try{e(c)}catch(a){i(a),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[Q]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return X(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=U(e),new e(function(n,o){var i;t.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},r.create=function(e){return new r(e)},r}();function U(r){var e;return(e=r??C.Promise)!==null&&e!==void 0?e:Promise}function Z(r){return r&&y(r.next)&&y(r.error)&&y(r.complete)}function $(r){return r&&r instanceof O||Z(r)&&q(r)}function z(r){return y(r==null?void 0:r.lift)}function ft(r){return function(e){if(z(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function ht(r,e,t,n,o){return new N(r,e,t,n,o)}var N=function(r){b(e,r);function e(t,n,o,i,s,c){var a=r.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=c,a._next=n?function(u){try{n(u)}catch(f){t.error(f)}}:r.prototype._next,a._error=i?function(u){try{i(u)}catch(f){t.error(f)}finally{this.unsubscribe()}}:r.prototype._error,a._complete=o?function(){try{o()}catch(u){t.error(u)}finally{this.unsubscribe()}}:r.prototype._complete,a}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(O),tt={now:function(){return Date.now()},delegate:void 0},rt=function(r){b(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return this},e}(_),F={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setInterval.apply(void 0,g([r,e],S(t)))},clearInterval:function(r){return clearInterval(r)},delegate:void 0},et=function(r){b(e,r);function e(t,n){var o=r.call(this,t,n)||this;return o.scheduler=t,o.work=n,o.pending=!1,o}return e.prototype.schedule=function(t,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,o){return o===void 0&&(o=0),F.setInterval(t.flush.bind(t,this),o)},e.prototype.recycleAsyncId=function(t,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&F.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(t,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var o=!1,i;try{this.work(t)}catch(s){o=!0,i=s||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,o=t.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,P(i,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(rt),R=function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=tt.now,r}(),nt=function(r){b(e,r);function e(t,n){n===void 0&&(n=R.now);var o=r.call(this,t,n)||this;return o.actions=[],o._active=!1,o}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var o;this._active=!0;do if(o=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,o){for(;t=n.shift();)t.unsubscribe();throw o}},e}(R),it=new nt(et),pt=it;export{at as E,lt as O,_ as S,ut as _,Q as a,st as b,ht as c,I as d,w as e,ot as f,ct as g,g as h,y as i,S as j,pt as k,it as l,V as m,b as n,ft as o,P as p,G as q,B as r};
@@ -0,0 +1 @@
1
+ import{m as S,n as f,E as b,S as _,p as m,O as p,q as l,e as y,o as w,c as E,l as O}from"./async--NeWdP3z.js";var j=S(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),d=function(n){f(o,n);function o(){var t=n.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return o.prototype.lift=function(t){var e=new v(this,this);return e.operator=t,e},o.prototype._throwIfClosed=function(){if(this.closed)throw new j},o.prototype.next=function(t){var e=this;l(function(){var r,s;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=y(e.currentObservers),c=i.next();!c.done;c=i.next()){var u=c.value;u.next(t)}}catch(a){r={error:a}}finally{try{c&&!c.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}}})},o.prototype.error=function(t){var e=this;l(function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}})},o.prototype.complete=function(){var t=this;l(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},o.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(o.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),o.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},o.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},o.prototype._innerSubscribe=function(t){var e=this,r=this,s=r.hasError,i=r.isStopped,c=r.observers;return s||i?b:(this.currentObservers=null,c.push(t),new _(function(){e.currentObservers=null,m(c,t)}))},o.prototype._checkFinalizedStatuses=function(t){var e=this,r=e.hasError,s=e.thrownError,i=e.isStopped;r?t.error(s):i&&t.complete()},o.prototype.asObservable=function(){var t=new p;return t.source=this,t},o.create=function(t,e){return new v(t,e)},o}(p),v=function(n){f(o,n);function o(t,e){var r=n.call(this)||this;return r.destination=t,r.source=e,r}return o.prototype.next=function(t){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.next)===null||r===void 0||r.call(e,t)},o.prototype.error=function(t){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.error)===null||r===void 0||r.call(e,t)},o.prototype.complete=function(){var t,e;(e=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||e===void 0||e.call(t)},o.prototype._subscribe=function(t){var e,r;return(r=(e=this.source)===null||e===void 0?void 0:e.subscribe(t))!==null&&r!==void 0?r:b},o}(d);function I(n,o){return o===void 0&&(o=O),w(function(t,e){var r=null,s=null,i=null,c=function(){if(r){r.unsubscribe(),r=null;var a=s;s=null,e.next(a)}};function u(){var a=i+n,h=o.now();if(h<a){r=this.schedule(void 0,a-h),e.add(r);return}c()}t.subscribe(E(e,function(a){s=a,i=o.now(),r||(r=o.schedule(u,n),e.add(r))},function(){c(),e.complete()},void 0,function(){s=r=null}))})}class x{constructor(){this.condition=!0,this.threshold=0,this.debounce=0}}class C{constructor(o,t,e={}){this.element=o,this.callback=t,this.params=e,this.intersectionSubject=new d,this.subscriptions=[],this.params={...new x,...e};let r={root:null,rootMargin:"0px",threshold:this.params.threshold};this.observer=new IntersectionObserver(s=>{s.forEach(i=>this.intersectionSubject.next(i))},r),this.connect()}connect(){this.subscriptions.push(this.intersectionSubject.pipe(I(this.params.debounce)).subscribe(o=>this.handleIntersection(o))),this.observer.observe(this.element)}disconnect(){this.observer&&this.observer.disconnect(),this.intersectionSubject.complete(),this.subscriptions.forEach(o=>o.unsubscribe())}handleIntersection(o){this.params.condition&&o.isIntersecting&&this.callback()}}export{d as S,C as V};
@@ -1 +1 @@
1
- import{t as p}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as h}from"../catalog-load-more.min.js";import{h as m}from"../../assets/session-handler-BPS5vj92.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/OperatorSubscriber-CcnWrfoX.js";import"../../assets/async-CcgIcE7w.js";var g=Object.defineProperty,u=Object.getOwnPropertyDescriptor,C=(s,t,r,a)=>{for(var e=a>1?void 0:a?u(t,r):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(e=(a?o(t,r,e):o(e))||e);return a&&e&&g(t,r,e),e};let n=class extends h{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const s=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!s||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{batchSize:t,packageId:r,posId:a,loadMoreURL:e,displayRecipeVariant:i,search:o,sessionId:l,path:d}=JSON.parse(s);m(l),this.analyticsPath=d,this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:i,loadMoreURL:e,sessionId:l,pageSize:t,storeId:a,packageId:r,search:o,listHTML:this.recipeCardListHTML}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=C([p("mealz-catalog-category")],n);customElements.get("mealz-catalog-category")||customElements.define("mealz-catalog-category",n);
1
+ import{t as p}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as h}from"../catalog-load-more.min.js";import{h as g}from"../../assets/session-handler-BPS5vj92.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/async--NeWdP3z.js";var m=Object.defineProperty,u=Object.getOwnPropertyDescriptor,C=(s,t,r,a)=>{for(var e=a>1?void 0:a?u(t,r):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(e=(a?o(t,r,e):o(e))||e);return a&&e&&m(t,r,e),e};let n=class extends h{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const s=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!s||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{batchSize:t,packageId:r,posId:a,loadMoreURL:e,displayRecipeVariant:i,search:o,sessionId:l,path:d}=JSON.parse(s);g(l),this.analyticsPath=d,this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:i,loadMoreURL:e,sessionId:l,pageSize:t,storeId:a,packageId:r,search:o,listHTML:this.recipeCardListHTML}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=C([p("mealz-catalog-category")],n);customElements.get("mealz-catalog-category")||customElements.define("mealz-catalog-category",n);
@@ -1 +1 @@
1
- import{t as u}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as g}from"../catalog-load-more.min.js";import{h as p}from"../../assets/session-handler-BPS5vj92.js";import{o as h,c as m}from"../../assets/OperatorSubscriber-CcnWrfoX.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/async-CcgIcE7w.js";function f(e,t){return h(function(s,a){var i=0;s.subscribe(m(a,function(r){return e.call(t,r,i++)&&a.next(r)}))})}function v(e){return f(function(t,s){return e<=s})}var _=Object.defineProperty,b=Object.getOwnPropertyDescriptor,L=(e,t,s,a)=>{for(var i=a>1?void 0:a?b(t,s):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(i=(a?o(t,s,i):o(i))||i);return a&&i&&_(t,s,i),i};let n=class extends g{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.user.isAuthenticated().pipe(v(1)).subscribe(e=>{this.isLogged=e,this.updateDOM()}),this.handleLikedRecipe())}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const e=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!e)return;const{pageSize:t,storeId:s,loadMoreURL:a,displayRecipeVariant:i,search:r,sessionId:o,path:d}=JSON.parse(e);if(this.analyticsPath=d,this.sendPageViewEvent(),this.favorites=this.querySelector(".mealz-catalog-favorites__list"),!this.favorites)return;const l=this.querySelector(".mealz-catalog__list");l&&(p(o),this.loadMoreRecipesOnScroll({displayRecipeVariant:i,loadMoreURL:a,sessionId:o,pageSize:t,storeId:s,packageId:null,search:r,listHTML:l}),this.removeAttribute("starting-data"))}updateDOM(){const e=this.querySelector(".mealz-catalog-favorites__list__not-logged"),t=this.querySelector(".mealz-catalog-favorites__list__logged");!e||!t||(e.classList.toggle("hidden",this.isLogged),t.classList.toggle("hidden",!this.isLogged))}sendPageViewEvent(){var e;window.mealzInternal?((e=window.mealzInternal.analytics)==null||e.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}handleLikedRecipe(){return window.mealzInternal.recipes.recipeLikeUpdated().subscribe(({id:e,isPast:t})=>{const s=document.getElementById("mealz-recipe-card-"+e);s&&s.classList.toggle("hidden",t),this.requestUpdate()})}};n=L([u("mealz-catalog-favorites")],n);customElements.get("mealz-catalog-favorites")||customElements.define("mealz-catalog-favorites",n);
1
+ import{t as u}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as g}from"../catalog-load-more.min.js";import{h}from"../../assets/session-handler-BPS5vj92.js";import{o as p,c as m}from"../../assets/async--NeWdP3z.js";import"../../assets/no-shadow-element-CaVIVF-o.js";function f(e,t){return p(function(s,a){var i=0;s.subscribe(m(a,function(r){return e.call(t,r,i++)&&a.next(r)}))})}function v(e){return f(function(t,s){return e<=s})}var _=Object.defineProperty,b=Object.getOwnPropertyDescriptor,L=(e,t,s,a)=>{for(var i=a>1?void 0:a?b(t,s):t,r=e.length-1,n;r>=0;r--)(n=e[r])&&(i=(a?n(t,s,i):n(i))||i);return a&&i&&_(t,s,i),i};let o=class extends g{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.user.isAuthenticated().pipe(v(1)).subscribe(e=>{this.isLogged=e,this.updateDOM()}),this.handleLikedRecipe())}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const e=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!e)return;const{pageSize:t,storeId:s,loadMoreURL:a,displayRecipeVariant:i,search:r,sessionId:n,path:d}=JSON.parse(e);if(this.analyticsPath=d,this.sendPageViewEvent(),this.favorites=this.querySelector(".mealz-catalog-favorites__list"),!this.favorites)return;const l=this.querySelector(".mealz-catalog__list");l&&(h(n),this.loadMoreRecipesOnScroll({displayRecipeVariant:i,loadMoreURL:a,sessionId:n,pageSize:t,storeId:s,packageId:null,search:r,listHTML:l}),this.removeAttribute("starting-data"))}updateDOM(){const e=this.querySelector(".mealz-catalog-favorites__list__not-logged"),t=this.querySelector(".mealz-catalog-favorites__list__logged");!e||!t||(e.classList.toggle("hidden",this.isLogged),t.classList.toggle("hidden",!this.isLogged))}sendPageViewEvent(){var e;window.mealzInternal?((e=window.mealzInternal.analytics)==null||e.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}handleLikedRecipe(){return window.mealzInternal.recipes.recipeLikeUpdated().subscribe(({id:e,isPast:t})=>{const s=document.getElementById("mealz-recipe-card-"+e);s&&s.classList.toggle("hidden",t),this.requestUpdate()})}};o=L([u("mealz-catalog-favorites")],o);customElements.get("mealz-catalog-favorites")||customElements.define("mealz-catalog-favorites",o);
@@ -1 +1 @@
1
- import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as m}from"../catalog-load-more.min.js";import{h as p}from"../../assets/session-handler-BPS5vj92.js";import{M as u}from"../../drawer/drawer.min.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/OperatorSubscriber-CcnWrfoX.js";import"../../assets/async-CcgIcE7w.js";var w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,g=(i,t,r,a)=>{for(var e=a>1?void 0:a?y(t,r):t,s=i.length-1,o;s>=0;s--)(o=i[s])&&(e=(a?o(t,r,e):o(e))||e);return a&&e&&w(t,r,e),e};let n=class extends m{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const i=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!i||(this.historyOrderListHTML=this.querySelector(".mealz-catalog__list")||this.querySelector(".mealz-catalog__list__row"),!this.historyOrderListHTML))return;const{pageSize:t,storeId:r,loadMoreURL:a,sessionId:e,drawerDataURL:s,historyStyle:o,path:d}=JSON.parse(i);this.analyticsPath=d,p(e),this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:"",loadMoreURL:a,sessionId:e,pageSize:t,storeId:r,packageId:null,search:"",listHTML:this.historyOrderListHTML,historyStyle:o});const l=new URL(window.location.href).searchParams.get("order");l&&this.initializeDrawer(s,l,e,r),this.removeAttribute("starting-data")}initializeDrawer(i,t,r,a){let e=document.querySelector("mealz-drawer");e||(e=new u,document.body.appendChild(e)),e.openDrawer(),e.loadDrawerData(i,t,r,a)}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=g([h("mealz-catalog-history")],n);customElements.get("mealz-catalog-history")||customElements.define("mealz-catalog-history",n);
1
+ import{t as h}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as m}from"../catalog-load-more.min.js";import{h as u}from"../../assets/session-handler-BPS5vj92.js";import{M as p}from"../../drawer/drawer.min.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/async--NeWdP3z.js";var w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,g=(s,t,r,a)=>{for(var e=a>1?void 0:a?y(t,r):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(e=(a?o(t,r,e):o(e))||e);return a&&e&&w(t,r,e),e};let n=class extends m{constructor(){super(...arguments),this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){var c;const s=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!s||(this.historyOrderListHTML=this.querySelector(".mealz-catalog__list")||this.querySelector(".mealz-catalog__list__row"),!this.historyOrderListHTML))return;const{pageSize:t,storeId:r,loadMoreURL:a,sessionId:e,drawerDataURL:i,historyStyle:o,path:d}=JSON.parse(s);this.analyticsPath=d,u(e),this.sendPageViewEvent(),this.loadMoreRecipesOnScroll({displayRecipeVariant:"",loadMoreURL:a,sessionId:e,pageSize:t,storeId:r,packageId:null,search:"",listHTML:this.historyOrderListHTML,historyStyle:o});const l=new URL(window.location.href).searchParams.get("order");l&&this.initializeDrawer(i,l,e,r),this.removeAttribute("starting-data")}initializeDrawer(s,t,r,a){let e=document.querySelector("mealz-drawer");e||(e=new p,document.body.appendChild(e)),e.openDrawer(),e.loadDrawerData(s,t,r,a)}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}};n=g([h("mealz-catalog-history")],n);customElements.get("mealz-catalog-history")||customElements.define("mealz-catalog-history",n);
@@ -1 +1 @@
1
- import{t as c}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{h as l}from"../../assets/session-handler-BPS5vj92.js";import{N as h}from"../../assets/no-shadow-element-CaVIVF-o.js";import{V as d}from"../../assets/viewport-listener-DAXSJTi3.js";import"../../assets/Subject-rBVVIydv.js";import"../../assets/OperatorSubscriber-CcnWrfoX.js";import"../../assets/async-CcgIcE7w.js";var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,p=(t,e,a,i)=>{for(var s=i>1?void 0:i?g(e,a):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(s=(i?n(e,a,s):n(s))||s);return i&&s&&m(e,a,s),s};let o=class extends h{constructor(){super(...arguments),this.categories=[],this.viewportListeners=[],this.subscriptions=[],this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe()),this.viewportListeners.forEach(t=>t.disconnect()),this.viewportListeners=[]}render(){var s;const t=(s=this.attributes["starting-data"])==null?void 0:s.value;if(!t)return;const{categories:e,path:a,sessionId:i}=JSON.parse(t);l(i),this.analyticsPath=a,this.categories=e,this.sendPageViewEvent(),this.addEventListeners(),this.listenCategoriesInView(),this.removeAttribute("starting-data")}addEventListeners(){Array.from(this.getElementsByClassName("mealz-catalog__link")).forEach((e,a)=>{e==null||e.addEventListener("click",()=>this.sendCategoryDisplay(a))})}listenCategoriesInView(){Array.from(this.getElementsByClassName("mealz-catalog-home__category")).forEach((e,a)=>{const i=new d(e,()=>this.sendCategoryShow(a),{threshold:.8,debounce:1e3});this.viewportListeners.push(i)})}reloadPage(){location.reload()}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}sendCategoryDisplay(t){var e;window.mealzInternal.analytics.sendEvent("category.display",this.analyticsPath,{category_id:(e=this.categories[Math.floor(t/2)])==null?void 0:e.id})}sendCategoryShow(t){var e;window.mealzInternal.analytics.sendEvent("category.show",this.analyticsPath,{category_id:(e=this.categories[t])==null?void 0:e.id})}};o=p([c("mealz-catalog-home")],o);customElements.get("mealz-catalog-home")||customElements.define("mealz-catalog-home",o);
1
+ import{t as c}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{h as l}from"../../assets/session-handler-BPS5vj92.js";import{N as h}from"../../assets/no-shadow-element-CaVIVF-o.js";import{V as d}from"../../assets/viewport-listener-Ci9Ivhrq.js";import"../../assets/async--NeWdP3z.js";var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,p=(t,e,a,i)=>{for(var s=i>1?void 0:i?g(e,a):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(s=(i?n(e,a,s):n(s))||s);return i&&s&&m(e,a,s),s};let o=class extends h{constructor(){super(...arguments),this.categories=[],this.viewportListeners=[],this.subscriptions=[],this.retryCount=0,this.maxRetries=30}connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe()),this.viewportListeners.forEach(t=>t.disconnect()),this.viewportListeners=[]}render(){var s;const t=(s=this.attributes["starting-data"])==null?void 0:s.value;if(!t)return;const{categories:e,path:a,sessionId:i}=JSON.parse(t);l(i),this.analyticsPath=a,this.categories=e,this.sendPageViewEvent(),this.addEventListeners(),this.listenCategoriesInView(),this.removeAttribute("starting-data")}addEventListeners(){Array.from(this.getElementsByClassName("mealz-catalog__link")).forEach((e,a)=>{e==null||e.addEventListener("click",()=>this.sendCategoryDisplay(a))})}listenCategoriesInView(){Array.from(this.getElementsByClassName("mealz-catalog-home__category")).forEach((e,a)=>{const i=new d(e,()=>this.sendCategoryShow(a),{threshold:.8,debounce:1e3});this.viewportListeners.push(i)})}reloadPage(){location.reload()}sendPageViewEvent(){window.mealzInternal?(window.mealzInternal.analytics.sendEvent("pageview",this.analyticsPath,{}),this.retryCount=0):this.retryCount<this.maxRetries&&(this.retryCount++,setTimeout(()=>this.sendPageViewEvent(),10))}sendCategoryDisplay(t){var e;window.mealzInternal.analytics.sendEvent("category.display",this.analyticsPath,{category_id:(e=this.categories[Math.floor(t/2)])==null?void 0:e.id})}sendCategoryShow(t){var e;window.mealzInternal.analytics.sendEvent("category.show",this.analyticsPath,{category_id:(e=this.categories[t])==null?void 0:e.id})}};o=p([c("mealz-catalog-home")],o);customElements.get("mealz-catalog-home")||customElements.define("mealz-catalog-home",o);
@@ -1 +1 @@
1
- import{t as p}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as d}from"../catalog-load-more.min.js";import{h as m}from"../../assets/session-handler-BPS5vj92.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/OperatorSubscriber-CcnWrfoX.js";import"../../assets/async-CcgIcE7w.js";var g=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h=(s,t,r,a)=>{for(var e=a>1?void 0:a?u(t,r):t,i=s.length-1,o;i>=0;i--)(o=s[i])&&(e=(a?o(t,r,e):o(e))||e);return a&&e&&g(t,r,e),e};let l=class extends d{connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback()}render(){var n;const s=(n=this.attributes["starting-data"])==null?void 0:n.value;if(!s||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{pageSize:t,storeId:r,loadMoreURL:a,displayRecipeVariant:e,search:i,promotions:o,sessionId:c}=JSON.parse(s);m(c),this.loadMoreRecipesOnScroll({displayRecipeVariant:e,loadMoreURL:a,sessionId:c,pageSize:t,storeId:r,packageId:null,search:i,listHTML:this.recipeCardListHTML,promotions:o}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}};l=h([p("mealz-catalog-list")],l);customElements.get("mealz-catalog-list")||customElements.define("mealz-catalog-list",l);
1
+ import{t as d}from"../../assets/custom-element-BhZVzxrc.js";import"../../assets/lit-element-4gw3YGga.js";import{C as p}from"../catalog-load-more.min.js";import{h as m}from"../../assets/session-handler-BPS5vj92.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/async--NeWdP3z.js";var g=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h=(s,t,r,a)=>{for(var e=a>1?void 0:a?u(t,r):t,i=s.length-1,l;i>=0;i--)(l=s[i])&&(e=(a?l(t,r,e):l(e))||e);return a&&e&&g(t,r,e),e};let o=class extends p{connectedCallback(){super.connectedCallback(),this.subscriptions.push(window.mealzInternal.catalog.preferencesModalChanged().subscribe(()=>this.reloadPage()))}disconnectedCallback(){super.disconnectedCallback()}render(){var n;const s=(n=this.attributes["starting-data"])==null?void 0:n.value;if(!s||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{pageSize:t,storeId:r,loadMoreURL:a,displayRecipeVariant:e,search:i,promotions:l,sessionId:c}=JSON.parse(s);m(c),this.loadMoreRecipesOnScroll({displayRecipeVariant:e,loadMoreURL:a,sessionId:c,pageSize:t,storeId:r,packageId:null,search:i,listHTML:this.recipeCardListHTML,promotions:l}),this.removeAttribute("starting-data")}reloadPage(){location.reload()}};o=h([d("mealz-catalog-list")],o);customElements.get("mealz-catalog-list")||customElements.define("mealz-catalog-list",o);
@@ -1 +1 @@
1
- import{N as D}from"../assets/no-shadow-element-CaVIVF-o.js";import{i as h,a as k,_ as H,b as A,d as x,O as v,r as z,e as P,f as G,g as N,o as M,c as w,h as V,j as C}from"../assets/OperatorSubscriber-CcnWrfoX.js";import{a as $,b as q}from"../assets/async-CcgIcE7w.js";import"../assets/lit-element-4gw3YGga.js";function B(e){return e&&h(e.schedule)}var T=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function F(e){return h(e==null?void 0:e.then)}function U(e){return h(e[k])}function Y(e){return Symbol.asyncIterator&&h(e==null?void 0:e[Symbol.asyncIterator])}function j(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function J(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Q=J();function K(e){return h(e==null?void 0:e[Q])}function W(e){return H(this,arguments,function(){var t,r,o,a;return A(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,x(t.read())];case 3:return r=i.sent(),o=r.value,a=r.done,a?[4,x(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,x(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function X(e){return h(e==null?void 0:e.getReader)}function L(e){if(e instanceof v)return e;if(e!=null){if(U(e))return Z(e);if(T(e))return ee(e);if(F(e))return ne(e);if(Y(e))return _(e);if(K(e))return te(e);if(X(e))return re(e)}throw j(e)}function Z(e){return new v(function(n){var t=e[k]();if(h(t.subscribe))return t.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ee(e){return new v(function(n){for(var t=0;t<e.length&&!n.closed;t++)n.next(e[t]);n.complete()})}function ne(e){return new v(function(n){e.then(function(t){n.closed||(n.next(t),n.complete())},function(t){return n.error(t)}).then(null,z)})}function te(e){return new v(function(n){var t,r;try{for(var o=P(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(n.next(i),n.closed)return}}catch(c){t={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}n.complete()})}function _(e){return new v(function(n){oe(e,n).catch(function(t){return n.error(t)})})}function re(e){return _(W(e))}function oe(e,n){var t,r,o,a;return G(this,void 0,void 0,function(){var i,c;return A(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),t=N(e),s.label=1;case 1:return[4,t.next()];case 2:if(r=s.sent(),!!r.done)return[3,4];if(i=r.value,n.next(i),n.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=s.sent(),o={error:c},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(a=t.return)?[4,a.call(t)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}function ae(e){return e instanceof Date&&!isNaN(e)}function S(e,n){return M(function(t,r){var o=0;t.subscribe(w(r,function(a){r.next(e.call(n,a,o++))}))})}var ie=Array.isArray;function se(e,n){return ie(n)?e.apply(void 0,V([],C(n))):e(n)}function le(e){return S(function(n){return se(e,n)})}function ue(e,n,t,r,o,a,i,c){var s=[],u=0,d=0,l=!1,f=function(){l&&!s.length&&!u&&n.complete()},p=function(y){return u<r?E(y):s.push(y)},E=function(y){u++;var g=!1;L(t(y,d++)).subscribe(w(n,function(m){n.next(m)},function(){g=!0},void 0,function(){if(g)try{u--;for(var m=function(){var I=s.shift();i||E(I)};s.length&&u<r;)m();f()}catch(I){n.error(I)}}))};return e.subscribe(w(n,p,function(){l=!0,f()})),function(){}}function O(e,n,t){return t===void 0&&(t=1/0),h(n)?O(function(r,o){return S(function(a,i){return n(r,a,o,i)})(L(e(r,o)))},t):(typeof n=="number"&&(t=n),M(function(r,o){return ue(r,o,e,t)}))}var ce=["addListener","removeListener"],fe=["addEventListener","removeEventListener"],de=["on","off"];function b(e,n,t,r){if(h(t)&&(r=t,t=void 0),r)return b(e,n,t).pipe(le(r));var o=C(ve(e)?fe.map(function(c){return function(s){return e[c](n,s,t)}}):he(e)?ce.map(R(e,n)):me(e)?de.map(R(e,n)):[],2),a=o[0],i=o[1];if(!a&&T(e))return O(function(c){return b(c,n,t)})(L(e));if(!a)throw new TypeError("Invalid event target");return new v(function(c){var s=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return c.next(1<u.length?u:u[0])};return a(s),function(){return i(s)}})}function R(e,n){return function(t){return function(r){return e[t](n,r)}}}function he(e){return h(e.addListener)&&h(e.removeListener)}function me(e){return h(e.on)&&h(e.off)}function ve(e){return h(e.addEventListener)&&h(e.removeEventListener)}function pe(e,n,t){t===void 0&&(t=$);var r=-1;return n!=null&&(B(n)?t=n:r=n),new v(function(o){var a=ae(e)?+e-t.now():e;a<0&&(a=0);var i=0;return t.schedule(function(){o.closed||(o.next(i++),0<=r?this.schedule(void 0,r):o.complete())},a)})}function ye(e,n){return M(function(t,r){var o=n??{},a=o.leading,i=a===void 0?!0:a,c=o.trailing,s=c===void 0?!1:c,u=!1,d=null,l=null,f=!1,p=function(){l==null||l.unsubscribe(),l=null,s&&(g(),f&&r.complete())},E=function(){l=null,f&&r.complete()},y=function(m){return l=L(e(m)).subscribe(w(r,p,E))},g=function(){if(u){u=!1;var m=d;d=null,r.next(m),!f&&y(m)}};t.subscribe(w(r,function(m){u=!0,d=m,!(l&&!l.closed)&&(i?g():y(m))},function(){f=!0,!(s&&u&&l&&!l.closed)&&r.complete()}))})}function ge(e,n,t){n===void 0&&(n=q);var r=pe(e,n);return ye(function(){return r},t)}const we=300;class be extends D{constructor(){super(...arguments),this.noMoreData=!1,this.isLoading=!1,this.page=2,this.loaderElement=null,this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.createLoader()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(n=>n.unsubscribe()),this.removeLoader()}loadMoreRecipesOnScroll({displayRecipeVariant:n,loadMoreURL:t,sessionId:r,pageSize:o,storeId:a,packageId:i,search:c,listHTML:s,promotions:u=!1,historyStyle:d=""}){const l=b(window,"scroll");this.subscriptions.push(l.pipe(ge(100)).subscribe(()=>{const f=this.getBoundingClientRect(),p=f.bottom>0&&f.bottom<=window.innerHeight+we;!this.noMoreData&&!this.isLoading&&p&&this.getMoreRecipes({loadMoreURL:t,sessionId:r,pageSize:o,storeId:a,displayRecipeVariant:n,packageId:i,search:c,promotions:u,listHTML:s,historyStyle:d})}))}buildHeaders(n){const t={"language-id":window.mealzInternal.user.getLanguage(),"supplier-token":window.mealzInternal.supplier.getToken(),"session-id":n},r=localStorage.getItem("_miam/userId");return r?t.authorization=`user_id ${r}`:t["authless-id"]=localStorage.getItem("_miam/authlessId"),t}async getMoreRecipes({loadMoreURL:n,sessionId:t,pageSize:r,storeId:o,displayRecipeVariant:a,packageId:i,search:c,promotions:s,listHTML:u,historyStyle:d=""}){if(this.checkIfMoreRecipes(u.innerHTML,r),this.noMoreData||this.isLoading)return;this.isLoading=!0,this.toggleLoader(!0);const l=new URLSearchParams;l.append("size",r.toString()),l.append("page",this.page.toString()),a&&l.append("display_recipe_variant",a),i&&l.append("category_id",i),o&&l.append("store_id",o),c&&l.append("search",c),s&&l.append("promotions",s),d&&l.append("history_style",d);try{const f=await fetch(n+"?"+l,{method:"GET",headers:this.buildHeaders(t)});if(!f.ok)throw new Error(`Load more request failed with status: ${f.status}`);const p=await f.text();this.appendRecipesToList(p,u,r)}catch(f){console.error(f),this.isLoading=!1}}appendRecipesToList(n,t,r){this.checkIfMoreRecipes(n,r),t.insertAdjacentHTML("beforeend",n),this.isLoading=!1,this.toggleLoader(!1),this.page++}checkIfMoreRecipes(n,t){const r=n.match(/<mealz-recipe-card(?=\s|>)/gi)||n.match(/<mealz-history-order(?=\s|>)/gi)||n.match(/<mealz-history-order-expanded(?=\s|>)/gi);(r?r.length:0)<t&&(this.noMoreData=!0)}createLoader(){const n=this.querySelector(".mealz-catalog__content");!this.loaderElement&&n&&(this.loaderElement=document.createElement("div"),this.loaderElement.className="miam-ds-loader",this.loaderElement.style.display="none",n.appendChild(this.loaderElement))}removeLoader(){this.loaderElement&&this.loaderElement.parentElement&&(this.loaderElement.parentElement.removeChild(this.loaderElement),this.loaderElement=null)}toggleLoader(n){this.loaderElement&&(this.loaderElement.style.display=n?"block":"none")}}export{be as C};
1
+ import{N as D}from"../assets/no-shadow-element-CaVIVF-o.js";import{i as h,a as R,_ as H,b as A,d as x,O as v,r as z,e as P,f as G,g as N,o as k,c as w,h as V,j as C,k as $,l as q}from"../assets/async--NeWdP3z.js";import"../assets/lit-element-4gw3YGga.js";function B(e){return e&&h(e.schedule)}var T=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function F(e){return h(e==null?void 0:e.then)}function U(e){return h(e[R])}function Y(e){return Symbol.asyncIterator&&h(e==null?void 0:e[Symbol.asyncIterator])}function j(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function J(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Q=J();function K(e){return h(e==null?void 0:e[Q])}function W(e){return H(this,arguments,function(){var t,r,o,a;return A(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,x(t.read())];case 3:return r=i.sent(),o=r.value,a=r.done,a?[4,x(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,x(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function X(e){return h(e==null?void 0:e.getReader)}function L(e){if(e instanceof v)return e;if(e!=null){if(U(e))return Z(e);if(T(e))return ee(e);if(F(e))return ne(e);if(Y(e))return _(e);if(K(e))return te(e);if(X(e))return re(e)}throw j(e)}function Z(e){return new v(function(n){var t=e[R]();if(h(t.subscribe))return t.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ee(e){return new v(function(n){for(var t=0;t<e.length&&!n.closed;t++)n.next(e[t]);n.complete()})}function ne(e){return new v(function(n){e.then(function(t){n.closed||(n.next(t),n.complete())},function(t){return n.error(t)}).then(null,z)})}function te(e){return new v(function(n){var t,r;try{for(var o=P(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(n.next(i),n.closed)return}}catch(c){t={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}n.complete()})}function _(e){return new v(function(n){oe(e,n).catch(function(t){return n.error(t)})})}function re(e){return _(W(e))}function oe(e,n){var t,r,o,a;return G(this,void 0,void 0,function(){var i,c;return A(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),t=N(e),s.label=1;case 1:return[4,t.next()];case 2:if(r=s.sent(),!!r.done)return[3,4];if(i=r.value,n.next(i),n.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=s.sent(),o={error:c},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(a=t.return)?[4,a.call(t)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}function ae(e){return e instanceof Date&&!isNaN(e)}function S(e,n){return k(function(t,r){var o=0;t.subscribe(w(r,function(a){r.next(e.call(n,a,o++))}))})}var ie=Array.isArray;function se(e,n){return ie(n)?e.apply(void 0,V([],C(n))):e(n)}function le(e){return S(function(n){return se(e,n)})}function ue(e,n,t,r,o,a,i,c){var s=[],u=0,d=0,l=!1,f=function(){l&&!s.length&&!u&&n.complete()},p=function(y){return u<r?E(y):s.push(y)},E=function(y){u++;var g=!1;L(t(y,d++)).subscribe(w(n,function(m){n.next(m)},function(){g=!0},void 0,function(){if(g)try{u--;for(var m=function(){var I=s.shift();i||E(I)};s.length&&u<r;)m();f()}catch(I){n.error(I)}}))};return e.subscribe(w(n,p,function(){l=!0,f()})),function(){}}function O(e,n,t){return t===void 0&&(t=1/0),h(n)?O(function(r,o){return S(function(a,i){return n(r,a,o,i)})(L(e(r,o)))},t):(typeof n=="number"&&(t=n),k(function(r,o){return ue(r,o,e,t)}))}var ce=["addListener","removeListener"],fe=["addEventListener","removeEventListener"],de=["on","off"];function b(e,n,t,r){if(h(t)&&(r=t,t=void 0),r)return b(e,n,t).pipe(le(r));var o=C(ve(e)?fe.map(function(c){return function(s){return e[c](n,s,t)}}):he(e)?ce.map(M(e,n)):me(e)?de.map(M(e,n)):[],2),a=o[0],i=o[1];if(!a&&T(e))return O(function(c){return b(c,n,t)})(L(e));if(!a)throw new TypeError("Invalid event target");return new v(function(c){var s=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return c.next(1<u.length?u:u[0])};return a(s),function(){return i(s)}})}function M(e,n){return function(t){return function(r){return e[t](n,r)}}}function he(e){return h(e.addListener)&&h(e.removeListener)}function me(e){return h(e.on)&&h(e.off)}function ve(e){return h(e.addEventListener)&&h(e.removeEventListener)}function pe(e,n,t){t===void 0&&(t=$);var r=-1;return n!=null&&(B(n)?t=n:r=n),new v(function(o){var a=ae(e)?+e-t.now():e;a<0&&(a=0);var i=0;return t.schedule(function(){o.closed||(o.next(i++),0<=r?this.schedule(void 0,r):o.complete())},a)})}function ye(e,n){return k(function(t,r){var o=n??{},a=o.leading,i=a===void 0?!0:a,c=o.trailing,s=c===void 0?!1:c,u=!1,d=null,l=null,f=!1,p=function(){l==null||l.unsubscribe(),l=null,s&&(g(),f&&r.complete())},E=function(){l=null,f&&r.complete()},y=function(m){return l=L(e(m)).subscribe(w(r,p,E))},g=function(){if(u){u=!1;var m=d;d=null,r.next(m),!f&&y(m)}};t.subscribe(w(r,function(m){u=!0,d=m,!(l&&!l.closed)&&(i?g():y(m))},function(){f=!0,!(s&&u&&l&&!l.closed)&&r.complete()}))})}function ge(e,n,t){n===void 0&&(n=q);var r=pe(e,n);return ye(function(){return r},t)}const we=300;class xe extends D{constructor(){super(...arguments),this.noMoreData=!1,this.isLoading=!1,this.page=2,this.loaderElement=null,this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.createLoader()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(n=>n.unsubscribe()),this.removeLoader()}loadMoreRecipesOnScroll({displayRecipeVariant:n,loadMoreURL:t,sessionId:r,pageSize:o,storeId:a,packageId:i,search:c,listHTML:s,promotions:u=!1,historyStyle:d=""}){const l=b(window,"scroll");this.subscriptions.push(l.pipe(ge(100)).subscribe(()=>{const f=this.getBoundingClientRect(),p=f.bottom>0&&f.bottom<=window.innerHeight+we;!this.noMoreData&&!this.isLoading&&p&&this.getMoreRecipes({loadMoreURL:t,sessionId:r,pageSize:o,storeId:a,displayRecipeVariant:n,packageId:i,search:c,promotions:u,listHTML:s,historyStyle:d})}))}buildHeaders(n){const t={"language-id":window.mealzInternal.user.getLanguage(),"supplier-token":window.mealzInternal.supplier.getToken(),"session-id":n},r=localStorage.getItem("_miam/userId");return r?t.authorization=`user_id ${r}`:t["authless-id"]=localStorage.getItem("_miam/authlessId"),t}async getMoreRecipes({loadMoreURL:n,sessionId:t,pageSize:r,storeId:o,displayRecipeVariant:a,packageId:i,search:c,promotions:s,listHTML:u,historyStyle:d=""}){if(this.checkIfMoreRecipes(u.innerHTML,r),this.noMoreData||this.isLoading)return;this.isLoading=!0,this.toggleLoader(!0);const l=new URLSearchParams;l.append("size",r.toString()),l.append("page",this.page.toString()),a&&l.append("display_recipe_variant",a),i&&l.append("category_id",i),o&&l.append("store_id",o),c&&l.append("search",c),s&&l.append("promotions",s),d&&l.append("history_style",d);try{const f=await fetch(n+"?"+l,{method:"GET",headers:this.buildHeaders(t)});if(!f.ok)throw new Error(`Load more request failed with status: ${f.status}`);const p=await f.text();this.appendRecipesToList(p,u,r)}catch(f){console.error(f),this.isLoading=!1}}appendRecipesToList(n,t,r){this.checkIfMoreRecipes(n,r),t.insertAdjacentHTML("beforeend",n),this.isLoading=!1,this.toggleLoader(!1),this.page++}checkIfMoreRecipes(n,t){const r=n.match(/<mealz-recipe-card(?=\s|>)/gi)||n.match(/<mealz-history-order(?=\s|>)/gi)||n.match(/<mealz-history-order-expanded(?=\s|>)/gi);(r?r.length:0)<t&&(this.noMoreData=!0)}createLoader(){const n=this.querySelector(".mealz-catalog__content");!this.loaderElement&&n&&(this.loaderElement=document.createElement("div"),this.loaderElement.className="miam-ds-loader",this.loaderElement.style.display="none",n.appendChild(this.loaderElement))}removeLoader(){this.loaderElement&&this.loaderElement.parentElement&&(this.loaderElement.parentElement.removeChild(this.loaderElement),this.loaderElement=null)}toggleLoader(n){this.loaderElement&&(this.loaderElement.style.display=n?"block":"none")}}export{xe as C};
@@ -1 +1 @@
1
- import{t as c}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as o}from"../assets/no-shadow-element-CaVIVF-o.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,u=(t,i,a,s)=>{for(var e=s>1?void 0:s?d(i,a):i,n=t.length-1,r;n>=0;n--)(r=t[n])&&(e=(s?r(i,a,e):r(e))||e);return s&&e&&h(i,a,e),e};let l=class extends o{constructor(){super(...arguments),this.liked=null,this.recipeLikeId="",this.recipeId="",this.analyticsPath="",this.subscriptions=[]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe())}render(){this.button=this.querySelector(".mealz-like-button"),this.button&&(this.icon=this.button.querySelector(".mealz-like-button__icon"),this.hearts=Array.from(this.button.querySelectorAll(".mealz-like-button__icon img")),!(!this.icon||!this.hearts)&&(this.getInitialStatus(),this.button.addEventListener("click",t=>{t.stopPropagation(),this.toggle()}),this.subscriptions.push(window.mealzInternal.recipes.recipeLikeUpdated().subscribe(({id:t,isPast:i})=>{t===this.recipeId&&(this.liked=!i,this.updateDOM())}))))}getInitialStatus(){var r;const t=(r=this.attributes["starting-data"])==null?void 0:r.value;if(!t)return;const{id:i,recipeId:a,liked:s,path:e,likeHidden:n}=JSON.parse(t);this.recipeLikeId=i,this.recipeId=a,this.liked=s!==void 0?s:!1,this.analyticsPath=e,n&&this.initHiddenLike(),this.removeAttribute("starting-data")}initHiddenLike(){this.subscriptions.push(window.mealzInternal.recipes.getRecipeLike(this.recipeId).subscribe(t=>{this.recipeLikeId=t.id,this.liked=t.attributes["is-past"]===!1,this.updateDOM(),this.button.classList.remove("hidden")}))}toggle(){window.mealzInternal.recipes.updateRecipeLike(this.recipeLikeId,this.recipeId,this.liked,this.analyticsPath)}updateDOM(){this.icon.classList.toggle("fill",this.liked),this.hearts[0].classList.toggle("active",!this.liked),this.hearts[1].classList.toggle("active",this.liked)}};l=u([c("mealz-like-button")],l);customElements.get("mealz-like-button")||customElements.define("mealz-like-button",l);
1
+ import{N as c}from"../assets/no-shadow-element-CaVIVF-o.js";import{t as h}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";var o=Object.defineProperty,d=Object.getOwnPropertyDescriptor,u=(t,e,a,s)=>{for(var i=s>1?void 0:s?d(e,a):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(i=(s?r(e,a,i):r(i))||i);return s&&i&&o(e,a,i),i};let l=class extends c{constructor(){super(...arguments),this.liked=null,this.recipeLikeId="",this.recipeId="",this.analyticsPath="",this.subscriptions=[]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe())}render(){this.button=this.querySelector(".mealz-like-button"),this.button&&(this.icon=this.button.querySelector(".mealz-like-button__icon"),this.hearts=Array.from(this.button.querySelectorAll(".mealz-like-button__icon img")),!(!this.icon||!this.hearts)&&(this.getInitialStatus(),this.button.addEventListener("click",t=>{t.stopPropagation(),this.toggle()}),this.subscriptions.push(window.mealzInternal.recipes.recipeLikeUpdated().subscribe(({id:t,isPast:e})=>{t===this.recipeId&&(this.liked=!e,this.updateDOM())}))))}getInitialStatus(){var r;const t=(r=this.attributes["starting-data"])==null?void 0:r.value;if(!t)return;const{id:e,recipeId:a,liked:s,path:i,likeHidden:n}=JSON.parse(t);this.recipeLikeId=e,this.recipeId=a,this.liked=s!==void 0?s:!1,this.analyticsPath=i,n&&this.initHiddenLike(),this.removeAttribute("starting-data")}initHiddenLike(){this.subscriptions.push(window.mealzInternal.recipes.getRecipeLike(this.recipeId).subscribe(t=>{this.recipeLikeId=t.id,this.liked=t.attributes["is-past"]===!1,this.updateDOM(),this.button.classList.remove("hidden")}))}toggle(){window.mealzInternal.recipes.updateRecipeLike(this.recipeLikeId,this.recipeId,this.liked,this.analyticsPath)}updateDOM(){this.icon.classList.toggle("fill",this.liked),this.hearts[0].classList.toggle("active",!this.liked),this.hearts[1].classList.toggle("active",this.liked)}};l=u([h("mealz-like-button")],l);
@@ -1 +1 @@
1
- import{N as u}from"../assets/no-shadow-element-CaVIVF-o.js";import{V as p}from"../assets/viewport-listener-DAXSJTi3.js";import{t as w}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{h as I}from"../assets/session-handler-BPS5vj92.js";import"../assets/Subject-rBVVIydv.js";import"../assets/OperatorSubscriber-CcnWrfoX.js";import"../assets/async-CcgIcE7w.js";class n{constructor(){this.trackedRecipes=new Map,this.hasScrolled=!1,this.scrollListener=null,this.cleanupInterval=null,this.MAX_RECIPES=1e3,this.CLEANUP_INTERVAL=5*60*1e3,this.handlePageUnload=()=>{this.destroy()},this.setupScrollListener(),this.startAutoCleanup(),this.setupPageUnloadListener()}static getInstance(){return n.instance||(n.instance=new n),n.instance}trackRecipeShow(e,s,r){const i=Date.now(),c=!this.trackedRecipes.get(e),l=this.hasScrolled;!c&&!l||(this.trackedRecipes.size>=this.MAX_RECIPES&&this.cleanOldRecipes(),this.trackedRecipes.set(e,i),window.mealzInternal.analytics.sendEvent("recipe.show",s,{recipe_id:e,category_id:r}))}cleanOldRecipes(){const s=Date.now()-60*60*1e3;for(const[r,i]of this.trackedRecipes.entries())i<s&&this.trackedRecipes.delete(r)}clearAllRecipes(){this.trackedRecipes.clear()}destroy(){this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener),this.scrollListener=null),window.removeEventListener("beforeunload",this.handlePageUnload),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.trackedRecipes.clear(),this.hasScrolled=!1,n.instance=null}setupScrollListener(){let e;this.scrollListener=()=>{this.hasScrolled=!0,clearTimeout(e),e=window.setTimeout(()=>{this.hasScrolled=!1},2e3)},window.addEventListener("scroll",this.scrollListener)}startAutoCleanup(){this.cleanupInterval=window.setInterval(()=>{this.cleanOldRecipes()},this.CLEANUP_INTERVAL)}setupPageUnloadListener(){window.addEventListener("beforeunload",this.handlePageUnload)}}var g=Object.defineProperty,m=Object.getOwnPropertyDescriptor,f=(t,e,s,r)=>{for(var i=r>1?void 0:r?m(e,s):e,a=t.length-1,c;a>=0;a--)(c=t[a])&&(i=(r?c(e,s,i):c(i))||i);return r&&i&&g(e,s,i),i};let o=class extends u{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.listenInView(),this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(t=>{const e=t.find(s=>s.id===this.recipeId);e&&(this.updatedRecipeId=e.id,this.updatedGuests=e.guests,this.updateDOM())}))}disconnectedCallback(){var e,s;super.disconnectedCallback(),this.subscriptions.forEach(r=>r.unsubscribe()),(e=this.priceViewportObserver)==null||e.disconnect(),(s=this.analyticsViewportObserver)==null||s.disconnect(),n.getInstance().cleanOldRecipes()}render(){this.recipeCardTop=this.querySelector(".mealz-recipe-card__top"),this.recipeCardCta=this.querySelector(".mealz-recipe-card__cta"),this.recipeCardTop&&(this.recipeCardTop.addEventListener("click",()=>this.recipeCardTopClick()),this.recipeCardCta&&this.recipeCardCta.addEventListener("click",()=>this.recipeCardCtaClick()))}listenInView(){this.priceViewportObserver=new p(this,()=>{this.handleIntersection()}),this.analyticsViewportObserver=new p(this,()=>{this.sendAnalyticsShow()},{threshold:.8,debounce:1e3})}handleIntersection(){this.recipePricing=this.querySelector("mealz-recipe-pricing"),this.recipePricing&&(this.recipePricing.fetchPrice(this.posId,this.guests,this.recipeId),this.priceViewportObserver.disconnect())}getInitialStatus(){var h;const t=(h=this.attributes["starting-data"])==null?void 0:h.value;if(!t)return;const{id:e,guests:s,posId:r,path:i,categoryId:a,initialTabIndex:c,sessionId:l}=JSON.parse(t);if(this.posId=r,this.recipeId=e,this.analyticsPath=i,this.categoryId=a,this.guests=s,this.initialTabIndex=c,I(l),!s){this.guests=this.getGuests();const d=this.querySelector(".mealz-recipe-card__counter p");d&&(d.innerHTML=this.guests.toString())}this.removeAttribute("starting-data")}recipeCardTopClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,this.initialTabIndex,this.analyticsPath,this.categoryId)}recipeCardCtaClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,this.initialTabIndex,this.analyticsPath,this.categoryId)}getGuests(){const t=localStorage.getItem("_miam/preferences/guests");if(t){const e=+t;if(!isNaN(e)&&e>0&&e<=30)return e}return 4}updateDOM(){if(this.recipeId!==this.updatedRecipeId)return;const t=this.querySelector(".mealz-recipe-card__counter p");t&&(this.guests=this.updatedGuests??this.getGuests(),t.innerHTML=this.guests.toString())}sendAnalyticsShow(){n.getInstance().trackRecipeShow(this.recipeId,this.analyticsPath,this.categoryId)}};o=f([w("mealz-recipe-card")],o);customElements.get("mealz-recipe-card")||customElements.define("mealz-recipe-card",o);
1
+ import{N as d}from"../assets/no-shadow-element-CaVIVF-o.js";import{V as p}from"../assets/viewport-listener-Ci9Ivhrq.js";import{t as u}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{h as w}from"../assets/session-handler-BPS5vj92.js";import"../assets/async--NeWdP3z.js";class a{constructor(){this.trackedRecipes=new Map,this.hasScrolled=!1,this.scrollListener=null,this.cleanupInterval=null,this.MAX_RECIPES=1e3,this.CLEANUP_INTERVAL=5*60*1e3,this.handlePageUnload=()=>{this.destroy()},this.setupScrollListener(),this.startAutoCleanup(),this.setupPageUnloadListener()}static getInstance(){return a.instance||(a.instance=new a),a.instance}trackRecipeShow(e,s,r){const i=Date.now(),n=!this.trackedRecipes.get(e),l=this.hasScrolled;!n&&!l||(this.trackedRecipes.size>=this.MAX_RECIPES&&this.cleanOldRecipes(),this.trackedRecipes.set(e,i),window.mealzInternal.analytics.sendEvent("recipe.show",s,{recipe_id:e,category_id:r}))}cleanOldRecipes(){const s=Date.now()-60*60*1e3;for(const[r,i]of this.trackedRecipes.entries())i<s&&this.trackedRecipes.delete(r)}clearAllRecipes(){this.trackedRecipes.clear()}destroy(){this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener),this.scrollListener=null),window.removeEventListener("beforeunload",this.handlePageUnload),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.trackedRecipes.clear(),this.hasScrolled=!1,a.instance=null}setupScrollListener(){let e;this.scrollListener=()=>{this.hasScrolled=!0,clearTimeout(e),e=window.setTimeout(()=>{this.hasScrolled=!1},2e3)},window.addEventListener("scroll",this.scrollListener)}startAutoCleanup(){this.cleanupInterval=window.setInterval(()=>{this.cleanOldRecipes()},this.CLEANUP_INTERVAL)}setupPageUnloadListener(){window.addEventListener("beforeunload",this.handlePageUnload)}}var m=Object.defineProperty,I=Object.getOwnPropertyDescriptor,g=(t,e,s,r)=>{for(var i=r>1?void 0:r?I(e,s):e,c=t.length-1,n;c>=0;c--)(n=t[c])&&(i=(r?n(e,s,i):n(i))||i);return r&&i&&m(e,s,i),i};let o=class extends d{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.listenInView(),this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(t=>{const e=t.find(s=>s.id===this.recipeId);e&&(this.updatedRecipeId=e.id,this.updatedGuests=e.guests,this.updateDOM())}))}disconnectedCallback(){var e;super.disconnectedCallback(),this.subscriptions.forEach(s=>s.unsubscribe()),(e=this.analyticsViewportObserver)==null||e.disconnect(),a.getInstance().cleanOldRecipes()}render(){this.recipeCardTop=this.querySelector(".mealz-recipe-card__top"),this.recipeCardCta=this.querySelector(".mealz-recipe-card__cta"),this.recipeCardTop&&(this.recipeCardTop.addEventListener("click",()=>this.recipeCardTopClick()),this.recipeCardCta&&this.recipeCardCta.addEventListener("click",()=>this.recipeCardCtaClick()))}listenInView(){this.analyticsViewportObserver=new p(this,()=>{this.sendAnalyticsShow()},{threshold:.8,debounce:1e3})}getInitialStatus(){var l;const t=(l=this.attributes["starting-data"])==null?void 0:l.value;if(!t)return;const{id:e,guests:s,path:r,categoryId:i,initialTabIndex:c,sessionId:n}=JSON.parse(t);if(this.recipeId=e,this.analyticsPath=r,this.categoryId=i,this.guests=s,this.initialTabIndex=c,w(n),!s){this.guests=this.getGuests();const h=this.querySelector(".mealz-recipe-card__counter p");h&&(h.innerHTML=this.guests.toString())}this.removeAttribute("starting-data")}recipeCardTopClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,this.initialTabIndex,this.analyticsPath,this.categoryId)}recipeCardCtaClick(){window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,this.initialTabIndex,this.analyticsPath,this.categoryId)}getGuests(){const t=localStorage.getItem("_miam/preferences/guests");if(t){const e=+t;if(!isNaN(e)&&e>0&&e<=30)return e}return 4}updateDOM(){if(this.recipeId!==this.updatedRecipeId)return;const t=this.querySelector(".mealz-recipe-card__counter p");t&&(this.guests=this.updatedGuests??this.getGuests(),t.innerHTML=this.guests.toString())}sendAnalyticsShow(){a.getInstance().trackRecipeShow(this.recipeId,this.analyticsPath,this.categoryId)}};o=g([u("mealz-recipe-card")],o);customElements.get("mealz-recipe-card")||customElements.define("mealz-recipe-card",o);
@@ -1 +1 @@
1
- import{t as l}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as o}from"../assets/no-shadow-element-CaVIVF-o.js";var p=Object.defineProperty,d=Object.getOwnPropertyDescriptor,u=(t,e,a,i)=>{for(var s=i>1?void 0:i?d(e,a):e,r=t.length-1,c;r>=0;r--)(c=t[r])&&(s=(i?c(e,a,s):c(s))||s);return i&&s&&p(e,a,s),s};let n=class extends o{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(t=>{const e=t.map(a=>a.id).includes(this.recipeId);this.updateDOM(e)}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(t=>t.unsubscribe())}getInitialStatus(){var e;this.recipeId=(e=this.attributes["starting-data"])==null?void 0:e.value,this.removeAttribute("starting-data");const t=this.classList.contains("in-basket");this.updateDOM(t)}updateDOM(t){const e=this.querySelector(".mealz-recipe-card-cta");e&&(e.classList.remove("hidden"),t?(e.classList.replace("primary","secondary"),e.classList.add("in-basket")):(e.classList.replace("secondary","primary"),e.classList.remove("in-basket")))}};n=u([l("mealz-recipe-card-cta")],n);customElements.get("mealz-recipe-card-cta")||customElements.define("mealz-recipe-card-cta",n);
1
+ import{t as l}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as d}from"../assets/no-shadow-element-CaVIVF-o.js";var p=Object.defineProperty,o=Object.getOwnPropertyDescriptor,h=(e,t,s,a)=>{for(var i=a>1?void 0:a?o(t,s):t,r=e.length-1,c;r>=0;r--)(c=e[r])&&(i=(a?c(t,s,i):c(i))||i);return a&&i&&p(t,s,i),i};let n=class extends d{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.setupClickHandler(),this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(e=>{const t=e.map(s=>s.id).includes(this.recipeId);this.updateDOM(t)}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe()),this.removeClickHandler()}getInitialStatus(){var t,s;const e=JSON.parse(((t=this.attributes["starting-data"])==null?void 0:t.value)||"{}");if(e){if(e!=null&&e.recipeId)this.recipeId=e.recipeId,this.storeId=e.storeId,this.guests=e.guests,this.standalone=!0,this.inBasket=e.inBasket,this.updateDOM(this.inBasket);else{this.recipeId=(s=this.attributes["starting-data"])==null?void 0:s.value,this.standalone=!1;const a=this.classList.contains("in-basket");this.updateDOM(a)}this.removeAttribute("starting-data")}}setupClickHandler(){this.standalone&&(this.recipeCta=this.querySelector(".mealz-recipe-card-cta"),this.recipeCta&&(this.clickHandler=()=>{window.mealzInternal.recipes.openDetails(this.recipeId,this.guests,0,"/recipes")},this.recipeCta.addEventListener("click",this.clickHandler)))}removeClickHandler(){this.recipeCta&&this.clickHandler&&this.recipeCta.removeEventListener("click",this.clickHandler)}updateDOM(e){const t=this.querySelector(".mealz-recipe-card-cta");t&&(t.classList.remove("hidden"),e?(t.classList.replace("primary","secondary"),t.classList.add("in-basket")):(t.classList.replace("secondary","primary"),t.classList.remove("in-basket")))}};n=h([l("mealz-recipe-card-cta")],n);
@@ -1 +1 @@
1
- import{N as h}from"../assets/no-shadow-element-CaVIVF-o.js";import{t as u}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{k as d,O as m,o as l,c as p}from"../assets/OperatorSubscriber-CcnWrfoX.js";import{S as f}from"../assets/Subject-rBVVIydv.js";var P=function(r){d(i,r);function i(e){var t=r.call(this)||this;return t._value=e,t}return Object.defineProperty(i.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),i.prototype._subscribe=function(e){var t=r.prototype._subscribe.call(this,e);return!t.closed&&e.next(this._value),t},i.prototype.getValue=function(){var e=this,t=e.hasError,s=e.thrownError,n=e._value;if(t)throw s;return this._throwIfClosed(),n},i.prototype.next=function(e){r.prototype.next.call(this,this._value=e)},i}(f),v=new m(function(r){return r.complete()});function y(r){return r<=0?function(){return v}:l(function(i,e){var t=0;i.subscribe(p(e,function(s){++t<=r&&(e.next(s),r<=t&&e.complete())}))})}function g(r){return l(function(i,e){var t=!1,s=0;i.subscribe(p(e,function(n){return(t||(t=!r(n,s++)))&&e.next(n)}))})}class c{constructor(){this.priceMemorized=new Map,this.displayedPrices=new Set,this.cleanupInterval=null,this.MAX_MEMO_SIZE=500,this.CLEANUP_INTERVAL=10*60*1e3,this.handlePageUnload=()=>{this.destroy()},this.startAutoCleanup(),this.setupPageUnloadListener()}static getInstance(){return c.instance||(c.instance=new c),c.instance}getMemorizedPrice(i,e){const t=`${i}-${e}`;return this.priceMemorized.get(t)}memorizedPrice(i,e,t){const s=`${i}-${e}`;this.priceMemorized.size>=this.MAX_MEMO_SIZE&&this.cleanOldPrices(),this.priceMemorized.set(s,{price:t,guests:e})}isPriceDisplayed(i,e){const t=`${i}-${e}`;return this.displayedPrices.has(t)}markPriceAsDisplayed(i,e){const t=`${i}-${e}`;this.displayedPrices.add(t)}cleanOldPrices(){this.priceMemorized.size>this.MAX_MEMO_SIZE*.8&&Array.from(this.priceMemorized.entries()).slice(0,Math.floor(this.priceMemorized.size*.3)).forEach(([t])=>{this.priceMemorized.delete(t),this.displayedPrices.delete(t)})}clearAllPrices(){this.priceMemorized.clear(),this.displayedPrices.clear()}destroy(){window.removeEventListener("beforeunload",this.handlePageUnload),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.priceMemorized.clear(),this.displayedPrices.clear(),c.instance=null}startAutoCleanup(){this.cleanupInterval=window.setInterval(()=>{this.cleanOldPrices()},this.CLEANUP_INTERVAL)}setupPageUnloadListener(){window.addEventListener("beforeunload",this.handlePageUnload)}}var b=Object.defineProperty,_=Object.getOwnPropertyDescriptor,z=(r,i,e,t)=>{for(var s=t>1?void 0:t?_(i,e):i,n=r.length-1,a;n>=0;n--)(a=r[n])&&(s=(t?a(i,e,s):a(s))||s);return t&&s&&b(i,e,s),s};let o=class extends h{constructor(){super(...arguments),this.formattedPrice="",this.rendered=new P(!1),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.classList.add("re-rendering"),this.getInitialStatus(),this.subscriptions.push(window.mealzInternal.recipes.guestsUpdated().subscribe(r=>{r.recipeId===this.recipeId&&(this.serves=r.guests,this.recalculatePrice())}),this.rendered.pipe(g(r=>!r),y(1)).subscribe(()=>{this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(r=>{if(!r)return;const i=r.find(e=>e.id===this.recipeId);r.length>0&&i?(this.recipePricingValue=i,this.recalculatePrice()):this.recipePricingValue&&!i&&(this.recipePricingValue=void 0,this.updatePriceDisplay(this.pricePerServe,this.serves))}))})),requestAnimationFrame(()=>{this.classList.remove("re-rendering")})}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(r=>r.unsubscribe())}fetchPrice(r,i,e=null){e||(e=this.recipeId);const t=c.getInstance(),s=t.getMemorizedPrice(e,i);if(s){requestAnimationFrame(()=>{this.applyCurrencyDisplay(s.price),t.markPriceAsDisplayed(e,i)});return}this.subscriptions.push(window.mealzInternal.recipes.fetchPricing(e,r,i).subscribe(n=>{n!=null&&n.price_per_serve&&(t.memorizedPrice(e,i,n.price_per_serve),requestAnimationFrame(()=>{this.applyCurrencyDisplay(n.price_per_serve),t.markPriceAsDisplayed(e,i)}))}))}render(){this.recipePricing=this.querySelector(".mealz-recipe-pricing"),this.recipePricing&&(this.recipeId&&this.pricePerServe&&c.getInstance().isPriceDisplayed(this.recipeId,this.serves)&&requestAnimationFrame(()=>{this.applyCurrencyDisplay(this.pricePerServe)}),this.rendered.next(!0))}getInitialStatus(){var s;const r=(s=this.attributes["starting-data"])==null?void 0:s.value;if(!r)return;const{recipeId:i,pricePerServe:e,serves:t}=JSON.parse(r);this.recipeId=i,this.pricePerServe=(e==null?void 0:e.toString())??null,this.serves=t,this.applyCurrencyDisplay(this.pricePerServe)}applyCurrencyDisplay(r){const i=parseFloat(r);isNaN(i)||(this.formattedPrice=i.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2}),this.updateDOM())}showPrice(){var e,t;let r=(e=this.recipePricing)==null?void 0:e.querySelector(".mealz-recipe-pricing__loading"),i=(t=this.recipePricing)==null?void 0:t.querySelector(".mealz-recipe-pricing__wrapper");r==null||r.classList.replace("active","hidden"),i==null||i.classList.replace("hidden","active")}updateDOM(){var i;const r=(i=this.recipePricing)==null?void 0:i.querySelector(".mealz-recipe-pricing__wrapper__price");r&&(r.innerHTML=this.formattedPrice+" €",this.showPrice())}recalculatePrice(){if(this.recipePricingValue){const r=(parseFloat(this.recipePricingValue.price)/this.recipePricingValue.guests).toString();this.updatePriceDisplay(r,this.recipePricingValue.guests)}}updatePriceDisplay(r,i){requestAnimationFrame(()=>{this.applyCurrencyDisplay(r);const e=c.getInstance();e.memorizedPrice(this.recipeId,i,r),e.markPriceAsDisplayed(this.recipeId,i)})}};o=z([u("mealz-recipe-pricing")],o);customElements.get("mealz-recipe-pricing")||customElements.define("mealz-recipe-pricing",o);
1
+ import{N as l}from"../assets/no-shadow-element-CaVIVF-o.js";import{S as d,V as u}from"../assets/viewport-listener-Ci9Ivhrq.js";import{t as m}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{n as f,O as P,o as p,c as h}from"../assets/async--NeWdP3z.js";var v=function(e){f(i,e);function i(r){var t=e.call(this)||this;return t._value=r,t}return Object.defineProperty(i.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),i.prototype._subscribe=function(r){var t=e.prototype._subscribe.call(this,r);return!t.closed&&r.next(this._value),t},i.prototype.getValue=function(){var r=this,t=r.hasError,s=r.thrownError,c=r._value;if(t)throw s;return this._throwIfClosed(),c},i.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},i}(d),g=new P(function(e){return e.complete()});function I(e){return e<=0?function(){return g}:p(function(i,r){var t=0;i.subscribe(h(r,function(s){++t<=e&&(r.next(s),e<=t&&r.complete())}))})}function y(e){return p(function(i,r){var t=!1,s=0;i.subscribe(h(r,function(c){return(t||(t=!e(c,s++)))&&r.next(c)}))})}class n{constructor(){this.priceMemorized=new Map,this.displayedPrices=new Set,this.cleanupInterval=null,this.MAX_MEMO_SIZE=500,this.CLEANUP_INTERVAL=10*60*1e3,this.handlePageUnload=()=>{this.destroy()},this.startAutoCleanup(),this.setupPageUnloadListener()}static getInstance(){return n.instance||(n.instance=new n),n.instance}getMemorizedPrice(i,r){const t=`${i}-${r}`;return this.priceMemorized.get(t)}memorizedPrice(i,r,t){const s=`${i}-${r}`;this.priceMemorized.size>=this.MAX_MEMO_SIZE&&this.cleanOldPrices(),this.priceMemorized.set(s,{price:t,guests:r})}isPriceDisplayed(i,r){const t=`${i}-${r}`;return this.displayedPrices.has(t)}markPriceAsDisplayed(i,r){const t=`${i}-${r}`;this.displayedPrices.add(t)}cleanOldPrices(){this.priceMemorized.size>this.MAX_MEMO_SIZE*.8&&Array.from(this.priceMemorized.entries()).slice(0,Math.floor(this.priceMemorized.size*.3)).forEach(([t])=>{this.priceMemorized.delete(t),this.displayedPrices.delete(t)})}clearAllPrices(){this.priceMemorized.clear(),this.displayedPrices.clear()}destroy(){window.removeEventListener("beforeunload",this.handlePageUnload),this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null),this.priceMemorized.clear(),this.displayedPrices.clear(),n.instance=null}startAutoCleanup(){this.cleanupInterval=window.setInterval(()=>{this.cleanOldPrices()},this.CLEANUP_INTERVAL)}setupPageUnloadListener(){window.addEventListener("beforeunload",this.handlePageUnload)}}var b=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=(e,i,r,t)=>{for(var s=t>1?void 0:t?w(i,r):i,c=e.length-1,a;c>=0;c--)(a=e[c])&&(s=(t?a(i,r,s):a(s))||s);return t&&s&&b(i,r,s),s};let o=class extends l{constructor(){super(...arguments),this.formattedPrice="",this.rendered=new v(!1),this.priceFetched=!1,this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.classList.add("re-rendering"),this.getInitialStatus(),this.listenInView(),this.subscriptions.push(window.mealzInternal.recipes.guestsUpdated().subscribe(e=>{e.recipeId===this.recipeId&&(this.serves=e.guests,this.recalculatePrice())}),this.rendered.pipe(y(e=>!e),I(1)).subscribe(()=>{this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(e=>{if(!e)return;const i=e.find(r=>r.id===this.recipeId);e.length>0&&i&&parseFloat(i.price)>0?(this.recipePricingValue=i,this.recalculatePrice()):this.recipePricingValue&&!i&&(this.recipePricingValue=void 0,(this.posId||this.extStoreId)&&this.fetchAndUpdatePrice())}))})),requestAnimationFrame(()=>{this.classList.remove("re-rendering")})}disconnectedCallback(){var e;super.disconnectedCallback(),this.subscriptions.forEach(i=>i.unsubscribe()),(e=this.priceViewportObserver)==null||e.disconnect()}fetchPrice(){const e=n.getInstance(),i=e.getMemorizedPrice(this.recipeId,this.serves);if(i){requestAnimationFrame(()=>{this.applyCurrencyDisplay(i.price),e.markPriceAsDisplayed(this.recipeId,this.serves)});return}this.fetchAndUpdatePrice()}render(){this.recipePricing=this.querySelector(".mealz-recipe-pricing"),this.recipePricing&&(this.recipeId&&this.pricePerServe&&n.getInstance().isPriceDisplayed(this.recipeId,this.serves)&&requestAnimationFrame(()=>{this.applyCurrencyDisplay(this.pricePerServe)}),this.rendered.next(!0))}getInitialStatus(){var a;const e=(a=this.attributes["starting-data"])==null?void 0:a.value;if(!e)return;const{recipeId:i,extStoreId:r,posId:t,pricePerServe:s,serves:c}=JSON.parse(e);this.extStoreId=r,this.posId=t,this.recipeId=i,this.pricePerServe=(s==null?void 0:s.toString())??null,this.serves=c,this.pricePerServe&&this.applyCurrencyDisplay(this.pricePerServe)}applyCurrencyDisplay(e){const i=parseFloat(e);isNaN(i)||(this.formattedPrice=i.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2}),this.recipePricing||(this.recipePricing=this.querySelector(".mealz-recipe-pricing")),this.updateDOM())}showPrice(){var r,t;const e=(r=this.recipePricing)==null?void 0:r.querySelector(".mealz-recipe-pricing__loading"),i=(t=this.recipePricing)==null?void 0:t.querySelector(".mealz-recipe-pricing__wrapper");e==null||e.classList.replace("active","hidden"),i==null||i.classList.replace("hidden","active")}updateDOM(){var i;const e=(i=this.recipePricing)==null?void 0:i.querySelector(".mealz-recipe-pricing__wrapper__price");e&&(e.innerHTML=this.formattedPrice+" €",this.showPrice())}recalculatePrice(){if(this.recipePricingValue){const e=(parseFloat(this.recipePricingValue.price)/this.recipePricingValue.guests).toString();this.updatePriceDisplay(e,this.recipePricingValue.guests)}}updatePriceDisplay(e,i){requestAnimationFrame(()=>{this.applyCurrencyDisplay(e);const r=n.getInstance();r.memorizedPrice(this.recipeId,i,e),r.markPriceAsDisplayed(this.recipeId,i)})}listenInView(){this.priceViewportObserver=new u(this,()=>{this.priceFetched||(this.priceFetched=!0,this.fetchPrice())})}fetchAndUpdatePrice(){const e=this.posId||this.extStoreId,i=this.extStoreId;if(!e||!this.recipeId||!this.serves)return;const t=window.mealzInternal.recipes.fetchPricing(this.recipeId,e,this.serves,i).subscribe({next:s=>{s&&s["price-per-serve"]&&(this.pricePerServe=s["price-per-serve"].toString(),this.updatePriceDisplay(this.pricePerServe,this.serves))},error:s=>{console.error("Failed to fetch recipe pricing:",s)}});this.subscriptions.push(t)}};o=S([m("mealz-recipe-pricing")],o);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mealz-components",
3
3
  "type": "module",
4
- "version": "1.3.13",
4
+ "version": "1.3.14",
5
5
  "main": "./dist/mealz-components.js",
6
6
  "module": "./dist/mealz-components.js",
7
7
  "scripts": {
@@ -1,3 +0,0 @@
1
- var _=function(r,e){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])},_(r,e)};function O(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function z(r,e,t,i){function o(n){return n instanceof t?n:new t(function(u){u(n)})}return new(t||(t=Promise))(function(n,u){function s(l){try{c(i.next(l))}catch(b){u(b)}}function a(l){try{c(i.throw(l))}catch(b){u(b)}}function c(l){l.done?n(l.value):o(l.value).then(s,a)}c((i=i.apply(r,e||[])).next())})}function N(r,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,o,n,u=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return u.next=s(0),u.throw=s(1),u.return=s(2),typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(c){return function(l){return a([c,l])}}function a(c){if(i)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(t=0)),t;)try{if(i=1,o&&(n=c[0]&2?o.return:c[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,c[1])).done)return n;switch(o=0,n&&(c=[c[0]&2,n.value]),c[0]){case 0:case 1:n=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,o=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!n||c[1]>n[0]&&c[1]<n[3])){t.label=c[1];break}if(c[0]===6&&t.label<n[1]){t.label=n[1],n=c;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(c);break}n[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(l){c=[6,l],o=0}finally{i=n=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function m(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),o,n=[],u;try{for(;(e===void 0||e-- >0)&&!(o=i.next()).done;)n.push(o.value)}catch(s){u={error:s}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return n}function E(r,e,t){if(t||arguments.length===2)for(var i=0,o=e.length,n;i<o;i++)(n||!(i in e))&&(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return r.concat(n||Array.prototype.slice.call(e))}function P(r){return this instanceof P?(this.v=r,this):new P(r)}function tt(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),o,n=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",u),o[Symbol.asyncIterator]=function(){return this},o;function u(f){return function(p){return Promise.resolve(p).then(f,b)}}function s(f,p){i[f]&&(o[f]=function(h){return new Promise(function(Y,D){n.push([f,h,Y,D])>1||a(f,h)})},p&&(o[f]=p(o[f])))}function a(f,p){try{c(i[f](p))}catch(h){d(n[0][3],h)}}function c(f){f.value instanceof P?Promise.resolve(f.value.v).then(l,b):d(n[0][2],f)}function l(f){a("next",f)}function b(f){a("throw",f)}function d(f,p){f(p),n.shift(),n.length&&a(n[0][0],n[0][1])}}function rt(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof m=="function"?m(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=r[n]&&function(u){return new Promise(function(s,a){u=r[n](u),o(s,a,u.done,u.value)})}}function o(n,u,s,a){Promise.resolve(a).then(function(c){n({value:c,done:s})},u)}}function y(r){return typeof r=="function"}function B(r){var e=function(i){Error.call(i),i.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var S=B(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
2
- `+t.map(function(i,o){return o+1+") "+i.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=t}});function I(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var T=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,i,o,n;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var s=m(u),a=s.next();!a.done;a=s.next()){var c=a.value;c.remove(this)}}catch(h){e={error:h}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else u.remove(this);var l=this.initialTeardown;if(y(l))try{l()}catch(h){n=h instanceof S?h.errors:[h]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var d=m(b),f=d.next();!f.done;f=d.next()){var p=f.value;try{j(p)}catch(h){n=n??[],h instanceof S?n=E(E([],g(n)),g(h.errors)):n.push(h)}}}catch(h){i={error:h}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}if(n)throw new S(n)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)j(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&I(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&I(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}(),et=T.EMPTY;function F(r){return r instanceof T||r&&"closed"in r&&y(r.remove)&&y(r.add)&&y(r.unsubscribe)}function j(r){y(r)?r():r.unsubscribe()}var R={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},M={setTimeout:function(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,E([r,e],g(t)))},clearTimeout:function(r){var e=M.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(r)},delegate:void 0};function C(r){M.setTimeout(function(){throw r})}function U(){}function G(r){r()}var A=function(r){O(e,r);function e(t){var i=r.call(this)||this;return i.isStopped=!1,t?(i.destination=t,F(t)&&t.add(i)):i.destination=L,i}return e.create=function(t,i,o){return new x(t,i,o)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(T),H=Function.prototype.bind;function w(r,e){return H.call(r,e)}var V=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){v(i)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){v(i)}else v(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){v(t)}},r}(),x=function(r){O(e,r);function e(t,i,o){var n=r.call(this)||this,u;if(y(t)||!t)u={next:t??void 0,error:i??void 0,complete:o??void 0};else{var s;n&&R.useDeprecatedNextContext?(s=Object.create(t),s.unsubscribe=function(){return n.unsubscribe()},u={next:t.next&&w(t.next,s),error:t.error&&w(t.error,s),complete:t.complete&&w(t.complete,s)}):u=t}return n.destination=new V(u),n}return e}(A);function v(r){C(r)}function q(r){throw r}var L={closed:!0,next:U,error:q,complete:U},J=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function K(r){return r}function Q(r){return r.length===0?K:r.length===1?r[0]:function(t){return r.reduce(function(i,o){return o(i)},t)}}var nt=function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,i){var o=this,n=X(e)?e:new x(e,t,i);return G(function(){var u=o,s=u.operator,a=u.source;n.add(s?s.call(n,a):a?o._subscribe(n):o._trySubscribe(n))}),n},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var i=this;return t=k(t),new t(function(o,n){var u=new x({next:function(s){try{e(s)}catch(a){n(a),u.unsubscribe()}},error:n,complete:o});i.subscribe(u)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[J]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Q(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=k(e),new e(function(i,o){var n;t.subscribe(function(u){return n=u},function(u){return o(u)},function(){return i(n)})})},r.create=function(e){return new r(e)},r}();function k(r){var e;return(e=r??R.Promise)!==null&&e!==void 0?e:Promise}function W(r){return r&&y(r.next)&&y(r.error)&&y(r.complete)}function X(r){return r&&r instanceof A||W(r)&&F(r)}function Z(r){return y(r==null?void 0:r.lift)}function it(r){return function(e){if(Z(e))return e.lift(function(t){try{return r(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function ot(r,e,t,i,o){return new $(r,e,t,i,o)}var $=function(r){O(e,r);function e(t,i,o,n,u,s){var a=r.call(this,t)||this;return a.onFinalize=u,a.shouldUnsubscribe=s,a._next=i?function(c){try{i(c)}catch(l){t.error(l)}}:r.prototype._next,a._error=n?function(c){try{n(c)}catch(l){t.error(l)}finally{this.unsubscribe()}}:r.prototype._error,a._complete=o?function(){try{o()}catch(c){t.error(c)}finally{this.unsubscribe()}}:r.prototype._complete,a}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;r.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(A);export{et as E,nt as O,T as S,tt as _,J as a,N as b,ot as c,P as d,m as e,z as f,rt as g,E as h,y as i,g as j,O as k,I as l,B as m,G as n,it as o,C as r};
@@ -1 +0,0 @@
1
- import{m as b,k as h,E as p,S as d,l as _,O as l,n as a,e as y}from"./OperatorSubscriber-CcnWrfoX.js";var S=b(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),w=function(s){h(o,s);function o(){var r=s.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return o.prototype.lift=function(r){var t=new c(this,this);return t.operator=r,t},o.prototype._throwIfClosed=function(){if(this.closed)throw new S},o.prototype.next=function(r){var t=this;a(function(){var e,u;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var n=y(t.currentObservers),i=n.next();!i.done;i=n.next()){var v=i.value;v.next(r)}}catch(f){e={error:f}}finally{try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(e)throw e.error}}}})},o.prototype.error=function(r){var t=this;a(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=r;for(var e=t.observers;e.length;)e.shift().error(r)}})},o.prototype.complete=function(){var r=this;a(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var t=r.observers;t.length;)t.shift().complete()}})},o.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(o.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),o.prototype._trySubscribe=function(r){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,r)},o.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},o.prototype._innerSubscribe=function(r){var t=this,e=this,u=e.hasError,n=e.isStopped,i=e.observers;return u||n?p:(this.currentObservers=null,i.push(r),new d(function(){t.currentObservers=null,_(i,r)}))},o.prototype._checkFinalizedStatuses=function(r){var t=this,e=t.hasError,u=t.thrownError,n=t.isStopped;e?r.error(u):n&&r.complete()},o.prototype.asObservable=function(){var r=new l;return r.source=this,r},o.create=function(r,t){return new c(r,t)},o}(l),c=function(s){h(o,s);function o(r,t){var e=s.call(this)||this;return e.destination=r,e.source=t,e}return o.prototype.next=function(r){var t,e;(e=(t=this.destination)===null||t===void 0?void 0:t.next)===null||e===void 0||e.call(t,r)},o.prototype.error=function(r){var t,e;(e=(t=this.destination)===null||t===void 0?void 0:t.error)===null||e===void 0||e.call(t,r)},o.prototype.complete=function(){var r,t;(t=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||t===void 0||t.call(r)},o.prototype._subscribe=function(r){var t,e;return(e=(t=this.source)===null||t===void 0?void 0:t.subscribe(r))!==null&&e!==void 0?e:p},o}(w);export{w as S};
@@ -1 +0,0 @@
1
- import{k as c,S as l,h as a,j as d,l as f}from"./OperatorSubscriber-CcnWrfoX.js";var v={now:function(){return Date.now()},delegate:void 0},p=function(n){c(i,n);function i(t,e){return n.call(this)||this}return i.prototype.schedule=function(t,e){return this},i}(l),h={setInterval:function(n,i){for(var t=[],e=2;e<arguments.length;e++)t[e-2]=arguments[e];return setInterval.apply(void 0,a([n,i],d(t)))},clearInterval:function(n){return clearInterval(n)},delegate:void 0},y=function(n){c(i,n);function i(t,e){var r=n.call(this,t,e)||this;return r.scheduler=t,r.work=e,r.pending=!1,r}return i.prototype.schedule=function(t,e){var r;if(e===void 0&&(e=0),this.closed)return this;this.state=t;var s=this.id,u=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(u,s,e)),this.pending=!0,this.delay=e,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(u,this.id,e),this},i.prototype.requestAsyncId=function(t,e,r){return r===void 0&&(r=0),h.setInterval(t.flush.bind(t,this),r)},i.prototype.recycleAsyncId=function(t,e,r){if(r===void 0&&(r=0),r!=null&&this.delay===r&&this.pending===!1)return e;e!=null&&h.clearInterval(e)},i.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},i.prototype._execute=function(t,e){var r=!1,s;try{this.work(t)}catch(u){r=!0,s=u||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),s},i.prototype.unsubscribe=function(){if(!this.closed){var t=this,e=t.id,r=t.scheduler,s=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,f(s,this),e!=null&&(this.id=this.recycleAsyncId(r,e,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},i}(p),o=function(){function n(i,t){t===void 0&&(t=n.now),this.schedulerActionCtor=i,this.now=t}return n.prototype.schedule=function(i,t,e){return t===void 0&&(t=0),new this.schedulerActionCtor(this,i).schedule(e,t)},n.now=v.now,n}(),A=function(n){c(i,n);function i(t,e){e===void 0&&(e=o.now);var r=n.call(this,t,e)||this;return r.actions=[],r._active=!1,r}return i.prototype.flush=function(t){var e=this.actions;if(this._active){e.push(t);return}var r;this._active=!0;do if(r=t.execute(t.state,t.delay))break;while(t=e.shift());if(this._active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}},i}(o),w=new A(y),b=w;export{b as a,w as b};
@@ -1 +0,0 @@
1
- import{S as l}from"./Subject-rBVVIydv.js";import{b}from"./async-CcgIcE7w.js";import{o as p,c as d}from"./OperatorSubscriber-CcnWrfoX.js";function f(o,t){return t===void 0&&(t=b),p(function(c,i){var e=null,n=null,r=null,a=function(){if(e){e.unsubscribe(),e=null;var s=n;n=null,i.next(s)}};function u(){var s=r+o,h=t.now();if(h<s){e=this.schedule(void 0,s-h),i.add(e);return}a()}c.subscribe(d(i,function(s){n=s,r=t.now(),e||(e=t.schedule(u,o),i.add(e))},function(){a(),i.complete()},void 0,function(){n=e=null}))})}class m{constructor(){this.condition=!0,this.threshold=0,this.debounce=0}}class j{constructor(t,c,i={}){this.element=t,this.callback=c,this.params=i,this.intersectionSubject=new l,this.subscriptions=[],this.params={...new m,...i};let e={root:null,rootMargin:"0px",threshold:this.params.threshold};this.observer=new IntersectionObserver(n=>{n.forEach(r=>this.intersectionSubject.next(r))},e),this.connect()}connect(){this.subscriptions.push(this.intersectionSubject.pipe(f(this.params.debounce)).subscribe(t=>this.handleIntersection(t))),this.observer.observe(this.element)}disconnect(){this.observer&&this.observer.disconnect(),this.intersectionSubject.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}handleIntersection(t){this.params.condition&&t.isIntersecting&&this.callback()}}export{j as V};