mealz-components 1.3.7 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
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(h){return Promise.resolve(h).then(f,b)}}function s(f,h){i[f]&&(o[f]=function(p){return new Promise(function(Y,D){n.push([f,p,Y,D])>1||a(f,p)})},h&&(o[f]=h(o[f])))}function a(f,h){try{c(i[f](h))}catch(p){d(n[0][3],p)}}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,h){f(h),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:
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
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(p){e={error:p}}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(p){n=p instanceof S?p.errors:[p]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var d=m(b),f=d.next();!f.done;f=d.next()){var h=f.value;try{j(h)}catch(p){n=n??[],p instanceof S?n=E(E([],g(n)),g(p.errors)):n.push(p)}}}catch(p){i={error:p}}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,g as _,O as a,E as b,ot as c,I as d,J as e,tt as f,N as g,P as h,y as i,m as j,z as k,rt as l,B as m,G as n,it as o,K as p,C as r};
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 +1 @@
1
- import{m as d,a as h,E as p,S as b,d as _,O as l,n as a,j as y}from"./OperatorSubscriber-BPZabEAm.js";var S=d(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 b(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
+ 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 +1 @@
1
- import{a as c,S as l,b as a,_ as d,d as f}from"./OperatorSubscriber-BPZabEAm.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),g=w;export{g as a,w as b};
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 +1 @@
1
- import{S as l}from"./Subject-CZHNlEkK.js";import{b}from"./async-B_IhBgzg.js";import{o as p,c as d}from"./OperatorSubscriber-BPZabEAm.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};
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};
@@ -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-BPZabEAm.js";import"../../assets/mapOneOrManyArgs-2FiDGdaS.js";import"../../assets/async-B_IhBgzg.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 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 +1 @@
1
- import{t as u}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 g}from"../../assets/session-handler-BPS5vj92.js";import{o as h,c as m}from"../../assets/OperatorSubscriber-BPZabEAm.js";import"../../assets/no-shadow-element-CaVIVF-o.js";import"../../assets/mapOneOrManyArgs-2FiDGdaS.js";import"../../assets/async-B_IhBgzg.js";function f(e,t){return h(function(i,a){var s=0;i.subscribe(m(a,function(r){return e.call(t,r,s++)&&a.next(r)}))})}function v(e){return f(function(t,i){return e<=i})}var _=Object.defineProperty,b=Object.getOwnPropertyDescriptor,L=(e,t,i,a)=>{for(var s=a>1?void 0:a?b(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(s=(a?o(t,i,s):o(s))||s);return a&&s&&_(t,i,s),s};let n=class extends p{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:i,loadMoreURL:a,displayRecipeVariant:s,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&&(g(o),this.loadMoreRecipesOnScroll({displayRecipeVariant:s,loadMoreURL:a,sessionId:o,pageSize:t,storeId:i,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 i=document.getElementById("mealz-recipe-card-"+e);i&&i.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 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 +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-BPZabEAm.js";import"../../assets/mapOneOrManyArgs-2FiDGdaS.js";import"../../assets/async-B_IhBgzg.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 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 +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-CPRlX51w.js";import"../../assets/Subject-CZHNlEkK.js";import"../../assets/OperatorSubscriber-BPZabEAm.js";import"../../assets/async-B_IhBgzg.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-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 +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-BPZabEAm.js";import"../../assets/mapOneOrManyArgs-2FiDGdaS.js";import"../../assets/async-B_IhBgzg.js";var g=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h=(r,t,s,a)=>{for(var e=a>1?void 0:a?u(t,s):t,i=r.length-1,o;i>=0;i--)(o=r[i])&&(e=(a?o(t,s,e):o(e))||e);return a&&e&&g(t,s,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 r=(n=this.attributes["starting-data"])==null?void 0:n.value;if(!r||(this.recipeCardListHTML=this.querySelector(".mealz-catalog__list"),!this.recipeCardListHTML))return;const{pageSize:t,storeId:s,loadMoreURL:a,displayRecipeVariant:e,search:i,promotions:o,sessionId:c}=JSON.parse(r);m(c),this.loadMoreRecipesOnScroll({displayRecipeVariant:e,loadMoreURL:a,sessionId:c,pageSize:t,storeId:s,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 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 +1 @@
1
- import{N as x}from"../assets/no-shadow-element-CaVIVF-o.js";import{c as L,i as h,o as b,_ as k,O as _}from"../assets/OperatorSubscriber-BPZabEAm.js";import{i as y,m as I,a as T,b as D,c as H}from"../assets/mapOneOrManyArgs-2FiDGdaS.js";import{a as z,b as O}from"../assets/async-B_IhBgzg.js";import"../assets/lit-element-4gw3YGga.js";function A(i){return i instanceof Date&&!isNaN(i)}function N(i,e,t,n,o,s,c,f){var l=[],a=0,u=0,r=!1,d=function(){r&&!l.length&&!a&&e.complete()},p=function(v){return a<n?E(v):l.push(v)},E=function(v){a++;var g=!1;y(t(v,u++)).subscribe(L(e,function(m){e.next(m)},function(){g=!0},void 0,function(){if(g)try{a--;for(var m=function(){var w=l.shift();c||E(w)};l.length&&a<n;)m();d()}catch(w){e.error(w)}}))};return i.subscribe(L(e,p,function(){r=!0,d()})),function(){}}function R(i,e,t){return t===void 0&&(t=1/0),h(e)?R(function(n,o){return I(function(s,c){return e(n,s,o,c)})(y(i(n,o)))},t):(typeof e=="number"&&(t=e),b(function(n,o){return N(n,o,i,t)}))}var $=["addListener","removeListener"],q=["addEventListener","removeEventListener"],B=["on","off"];function M(i,e,t,n){if(h(t)&&(n=t,t=void 0),n)return M(i,e,t).pipe(T(n));var o=k(V(i)?q.map(function(f){return function(l){return i[f](e,l,t)}}):F(i)?$.map(C(i,e)):S(i)?B.map(C(i,e)):[],2),s=o[0],c=o[1];if(!s&&D(i))return R(function(f){return M(f,e,t)})(y(i));if(!s)throw new TypeError("Invalid event target");return new _(function(f){var l=function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];return f.next(1<a.length?a:a[0])};return s(l),function(){return c(l)}})}function C(i,e){return function(t){return function(n){return i[t](e,n)}}}function F(i){return h(i.addListener)&&h(i.removeListener)}function S(i){return h(i.on)&&h(i.off)}function V(i){return h(i.addEventListener)&&h(i.removeEventListener)}function j(i,e,t){t===void 0&&(t=z);var n=-1;return e!=null&&(H(e)?t=e:n=e),new _(function(o){var s=A(i)?+i-t.now():i;s<0&&(s=0);var c=0;return t.schedule(function(){o.closed||(o.next(c++),0<=n?this.schedule(void 0,n):o.complete())},s)})}function G(i,e){return b(function(t,n){var o=e??{},s=o.leading,c=s===void 0?!0:s,f=o.trailing,l=f===void 0?!1:f,a=!1,u=null,r=null,d=!1,p=function(){r==null||r.unsubscribe(),r=null,l&&(g(),d&&n.complete())},E=function(){r=null,d&&n.complete()},v=function(m){return r=y(i(m)).subscribe(L(n,p,E))},g=function(){if(a){a=!1;var m=u;u=null,n.next(m),!d&&v(m)}};t.subscribe(L(n,function(m){a=!0,u=m,!(r&&!r.closed)&&(c?g():v(m))},function(){d=!0,!(l&&a&&r&&!r.closed)&&n.complete()}))})}function J(i,e,t){e===void 0&&(e=O);var n=j(i,e);return G(function(){return n},t)}const P=300;class Z extends x{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(e=>e.unsubscribe()),this.removeLoader()}loadMoreRecipesOnScroll({displayRecipeVariant:e,loadMoreURL:t,sessionId:n,pageSize:o,storeId:s,packageId:c,search:f,listHTML:l,promotions:a=!1,historyStyle:u=""}){const r=M(window,"scroll");this.subscriptions.push(r.pipe(J(100)).subscribe(()=>{const d=this.getBoundingClientRect(),p=d.bottom>0&&d.bottom<=window.innerHeight+P;!this.noMoreData&&!this.isLoading&&p&&this.getMoreRecipes({loadMoreURL:t,sessionId:n,pageSize:o,storeId:s,displayRecipeVariant:e,packageId:c,search:f,promotions:a,listHTML:l,historyStyle:u})}))}buildHeaders(e){const t={"language-id":window.mealzInternal.user.getLanguage(),"supplier-token":window.mealzInternal.supplier.getToken(),"session-id":e},n=localStorage.getItem("_miam/userId");return n?t.authorization=`user_id ${n}`:t["authless-id"]=localStorage.getItem("_miam/authlessId"),t}async getMoreRecipes({loadMoreURL:e,sessionId:t,pageSize:n,storeId:o,displayRecipeVariant:s,packageId:c,search:f,promotions:l,listHTML:a,historyStyle:u=""}){if(this.checkIfMoreRecipes(a.innerHTML,n),this.noMoreData||this.isLoading)return;this.isLoading=!0,this.toggleLoader(!0);const r=new URLSearchParams;r.append("size",n.toString()),r.append("page",this.page.toString()),s&&r.append("display_recipe_variant",s),c&&r.append("category_id",c),o&&r.append("store_id",o),f&&r.append("search",f),l&&r.append("promotions",l),u&&r.append("history_style",u);try{const d=await fetch(e+"?"+r,{method:"GET",headers:this.buildHeaders(t)});if(!d.ok)throw new Error(`Load more request failed with status: ${d.status}`);const p=await d.text();this.appendRecipesToList(p,a,n)}catch(d){console.error(d),this.isLoading=!1}}appendRecipesToList(e,t,n){this.checkIfMoreRecipes(e,n),t.insertAdjacentHTML("beforeend",e),this.isLoading=!1,this.toggleLoader(!1),this.page++}checkIfMoreRecipes(e,t){const n=e.match(/<mealz-recipe-card(?=\s|>)/gi)||e.match(/<mealz-history-order(?=\s|>)/gi)||e.match(/<mealz-history-order-expanded(?=\s|>)/gi);(n?n.length:0)<t&&(this.noMoreData=!0)}createLoader(){const e=this.querySelector(".mealz-catalog__content");!this.loaderElement&&e&&(this.loaderElement=document.createElement("div"),this.loaderElement.className="miam-ds-loader",this.loaderElement.style.display="none",e.appendChild(this.loaderElement))}removeLoader(){this.loaderElement&&this.loaderElement.parentElement&&(this.loaderElement.parentElement.removeChild(this.loaderElement),this.loaderElement=null)}toggleLoader(e){this.loaderElement&&(this.loaderElement.style.display=e?"block":"none")}}export{Z as C};
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 +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")}async 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")}))}async 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{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 +1 @@
1
- import{t as o}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 u}from"../assets/no-shadow-element-CaVIVF-o.js";import{V as d}from"../assets/viewport-listener-CPRlX51w.js";import"../assets/Subject-CZHNlEkK.js";import"../assets/OperatorSubscriber-BPZabEAm.js";import"../assets/async-B_IhBgzg.js";var I=Object.defineProperty,m=Object.getOwnPropertyDescriptor,C=(e,t,i,r)=>{for(var s=r>1?void 0:r?m(t,i):t,a=e.length-1,c;a>=0;a--)(c=e[a])&&(s=(r?c(t,i,s):c(s))||s);return r&&s&&I(t,i,s),s};let n=class extends u{constructor(){super(...arguments),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.listenInView(),this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(e=>{const t=e.find(i=>i.id===this.recipeId);t&&(this.updatedRecipeId=t.id,this.updatedGuests=t.guests,this.updateDOM())}))}disconnectedCallback(){var e,t;super.disconnectedCallback(),this.subscriptions.forEach(i=>i.unsubscribe()),(e=this.priceViewportObserver)==null||e.disconnect(),(t=this.analyticsViewportObserver)==null||t.disconnect()}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 d(this,()=>{this.handleIntersection()}),this.analyticsViewportObserver=new d(this,()=>{this.sendAnalyticsShow()},{threshold:.8,debounce:1e3})}handleIntersection(){var e;this.recipePricing=this.querySelector("mealz-recipe-pricing"),this.recipePricing&&((e=this.recipePricing)==null||e.fetchPrice(this.posId,this.guests),this.priceViewportObserver.disconnect())}getInitialStatus(){var p;const e=(p=this.attributes["starting-data"])==null?void 0:p.value;if(!e)return;const{id:t,guests:i,posId:r,path:s,categoryId:a,initialTabIndex:c,sessionId:h}=JSON.parse(e);this.posId=r,this.recipeId=t,this.analyticsPath=s,this.categoryId=a,this.guests=i,this.initialTabIndex=c,l(h),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)}updateDOM(){if(this.recipeId!==this.updatedRecipeId)return;const e=this.querySelector(".mealz-recipe-card__counter p");e&&(this.guests=this.updatedGuests,e.innerHTML=this.guests.toString())}sendAnalyticsShow(){window.mealzInternal.analytics.sendEvent("recipe.show",this.analyticsPath,{recipe_id:this.recipeId,category_id:this.categoryId})}};n=C([o("mealz-recipe-card")],n);customElements.get("mealz-recipe-card")||customElements.define("mealz-recipe-card",n);
1
+ import{t as l}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{h as u}from"../assets/session-handler-BPS5vj92.js";import{N as g}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,I=Object.getOwnPropertyDescriptor,C=(t,e,i,r)=>{for(var s=r>1?void 0:r?I(e,i):e,a=t.length-1,c;a>=0;a--)(c=t[a])&&(s=(r?c(e,i,s):c(s))||s);return r&&s&&m(e,i,s),s};let n=class extends g{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(i=>i.id===this.recipeId);e&&(this.updatedRecipeId=e.id,this.updatedGuests=e.guests,this.updateDOM())}))}disconnectedCallback(){var t,e;super.disconnectedCallback(),this.subscriptions.forEach(i=>i.unsubscribe()),(t=this.priceViewportObserver)==null||t.disconnect(),(e=this.analyticsViewportObserver)==null||e.disconnect()}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 d(this,()=>{this.handleIntersection()}),this.analyticsViewportObserver=new d(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 p;const t=(p=this.attributes["starting-data"])==null?void 0:p.value;if(!t)return;const{id:e,guests:i,posId:r,path:s,categoryId:a,initialTabIndex:c,sessionId:h}=JSON.parse(t);if(this.posId=r,this.recipeId=e,this.analyticsPath=s,this.categoryId=a,this.guests=i,this.initialTabIndex=c,u(h),!i){this.guests=this.getGuests();const o=this.querySelector(".mealz-recipe-card__counter p");o&&(o.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(){window.mealzInternal.analytics.sendEvent("recipe.show",this.analyticsPath,{recipe_id:this.recipeId,category_id:this.categoryId})}};n=C([l("mealz-recipe-card")],n);customElements.get("mealz-recipe-card")||customElements.define("mealz-recipe-card",n);
@@ -1 +1 @@
1
- import{t as k}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as D}from"../assets/no-shadow-element-CaVIVF-o.js";import{a as A,i as S,o as h,c as v,O as u,p as P}from"../assets/OperatorSubscriber-BPZabEAm.js";import{S as j}from"../assets/Subject-CZHNlEkK.js";import{c as z,e as s,i as d,d as C,r as E,f as F,b as N,g as V,h as q,j as M,k as R,l as B,a as J}from"../assets/mapOneOrManyArgs-2FiDGdaS.js";var W=function(e){A(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,i=r.thrownError,a=r._value;if(n)throw i;return this._throwIfClosed(),a},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(j);function b(e){return e[e.length-1]}function $(e){return S(b(e))?e.pop():void 0}function G(e){return z(b(e))?e.pop():void 0}function O(e,t){return t===void 0&&(t=0),h(function(r,n){r.subscribe(v(n,function(i){return s(n,e,function(){return n.next(i)},t)},function(){return s(n,e,function(){return n.complete()},t)},function(i){return s(n,e,function(){return n.error(i)},t)}))})}function w(e,t){return t===void 0&&(t=0),h(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function H(e,t){return d(e).pipe(w(t),O(t))}function K(e,t){return d(e).pipe(w(t),O(t))}function T(e,t){return new u(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}function U(e,t){return new u(function(r){var n;return s(r,t,function(){n=e[C](),s(r,t,function(){var i,a,c;try{i=n.next(),a=i.value,c=i.done}catch(o){r.error(o);return}c?r.complete():r.next(a)},0,!0)}),function(){return S(n==null?void 0:n.return)&&n.return()}})}function _(e,t){if(!e)throw new Error("Iterable cannot be null");return new u(function(r){s(r,t,function(){var n=e[Symbol.asyncIterator]();s(r,t,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function Q(e,t){return _(E(e),t)}function X(e,t){if(e!=null){if(F(e))return H(e,t);if(N(e))return T(e,t);if(V(e))return K(e,t);if(q(e))return _(e,t);if(M(e))return U(e,t);if(R(e))return Q(e,t)}throw B(e)}function I(e,t){return t?X(e,t):d(e)}var Y=Array.isArray,Z=Object.getPrototypeOf,ee=Object.prototype,te=Object.keys;function re(e){if(e.length===1){var t=e[0];if(Y(t))return{args:t,keys:null};if(ne(t)){var r=te(t);return{args:r.map(function(n){return t[n]}),keys:r}}}return{args:e,keys:null}}function ne(e){return e&&typeof e=="object"&&Z(e)===ee}function ie(e,t){return e.reduce(function(r,n,i){return r[n]=t[i],r},{})}function ae(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=G(e),n=$(e),i=re(e),a=i.args,c=i.keys;if(a.length===0)return I([],r);var o=new u(ce(a,r,c?function(l){return ie(c,l)}:P));return n?o.pipe(J(n)):o}function ce(e,t,r){return r===void 0&&(r=P),function(n){y(t,function(){for(var i=e.length,a=new Array(i),c=i,o=i,l=function(m){y(t,function(){var x=I(e[m],t),g=!1;x.subscribe(v(n,function(L){a[m]=L,g||(g=!0,o--),o||n.next(r(a.slice()))},function(){--c||n.complete()}))},n)},p=0;p<i;p++)l(p)},n)}}function y(e,t,r){e?s(r,e,t):t()}function oe(e){return h(function(t,r){var n=!1,i=0;t.subscribe(v(r,function(a){return(n||(n=!e(a,i++)))&&r.next(a)}))})}var se=Object.defineProperty,ue=Object.getOwnPropertyDescriptor,le=(e,t,r,n)=>{for(var i=n>1?void 0:n?ue(t,r):t,a=e.length-1,c;a>=0;a--)(c=e[a])&&(i=(n?c(t,r,i):c(i))||i);return n&&i&&se(t,r,i),i};let f=class extends D{constructor(){super(...arguments),this.formattedPrice="",this.rendered=new W(!1),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.subscriptions.push(window.mealzInternal.recipes.guestsUpdated().subscribe(e=>{e.recipeId===this.recipeId&&(this.serves=e.guests)}),ae([this.rendered,window.mealzInternal.basket.recipeDataInBasket$()]).pipe(oe(([e,t])=>!e||!t)).subscribe(([e,t])=>{this.recipePricingValue=t.find(n=>n.id===this.recipeId);const r=this.recipePricingValue?(this.recipePricingValue.price/this.serves).toString():this.pricePerServe;this.applyCurrencyDisplay(r),this.showPrice()}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}fetchPrice(e,t){var a,c;let r=(a=this.recipePricing)==null?void 0:a.querySelector(".mealz-recipe-pricing__wrapper");const n=(c=this.attributes["starting-data"])==null?void 0:c.value;if(!n){r==null||r.classList.replace("active","hidden");return}const i=JSON.parse(n);this.removeAttribute("starting-data"),!(i.pricePerServe!==null||i.inBasket)&&(r==null||r.classList.replace("active","hidden"),this.subscriptions.push(window.mealzInternal.recipes.fetchPricing(this.recipeId,e,t).subscribe(o=>{o!=null&&o.price_per_serve&&(r==null||r.classList.replace("hidden","active"),this.applyCurrencyDisplay(o.price_per_serve))})))}render(){this.recipePricing=this.querySelector(".mealz-recipe-pricing"),this.recipePricing&&this.rendered.next(!0)}getInitialStatus(){var i;const e=(i=this.attributes["starting-data"])==null?void 0:i.value;if(!e)return;const{recipeId:t,pricePerServe:r,serves:n}=JSON.parse(e);this.recipeId=t,this.pricePerServe=(r==null?void 0:r.toString())??null,this.serves=n,this.applyCurrencyDisplay(this.pricePerServe)}applyCurrencyDisplay(e){const t=parseFloat(e);isNaN(t)||(this.formattedPrice=t.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2}),this.updateDOM())}showPrice(){var r,n;let e=(r=this.recipePricing)==null?void 0:r.querySelector(".mealz-recipe-pricing__loading"),t=(n=this.recipePricing)==null?void 0:n.querySelector(".mealz-recipe-pricing__wrapper");e&&e.classList.contains("active")&&(e.classList.replace("active","hidden"),t.classList.replace("hidden","active"))}updateDOM(){var t;const e=(t=this.recipePricing)==null?void 0:t.querySelector(".mealz-recipe-pricing__wrapper__price");e&&(e.innerHTML=this.formattedPrice+" €")}};f=le([k("mealz-recipe-pricing")],f);customElements.get("mealz-recipe-pricing")||customElements.define("mealz-recipe-pricing",f);
1
+ import{t as l}from"../assets/custom-element-BhZVzxrc.js";import"../assets/lit-element-4gw3YGga.js";import{N as u}from"../assets/no-shadow-element-CaVIVF-o.js";import{k as h,O as f,o as p,c as o}from"../assets/OperatorSubscriber-CcnWrfoX.js";import{S as d}from"../assets/Subject-rBVVIydv.js";var g=function(e){h(r,e);function r(i){var t=e.call(this)||this;return t._value=i,t}return Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),r.prototype._subscribe=function(i){var t=e.prototype._subscribe.call(this,i);return!t.closed&&i.next(this._value),t},r.prototype.getValue=function(){var i=this,t=i.hasError,s=i.thrownError,c=i._value;if(t)throw s;return this._throwIfClosed(),c},r.prototype.next=function(i){e.prototype.next.call(this,this._value=i)},r}(d),m=new f(function(e){return e.complete()});function b(e){return e<=0?function(){return m}:p(function(r,i){var t=0;r.subscribe(o(i,function(s){++t<=e&&(i.next(s),e<=t&&i.complete())}))})}function v(e){return p(function(r,i){var t=!1,s=0;r.subscribe(o(i,function(c){return(t||(t=!e(c,s++)))&&i.next(c)}))})}var P=Object.defineProperty,_=Object.getOwnPropertyDescriptor,y=(e,r,i,t)=>{for(var s=t>1?void 0:t?_(r,i):r,c=e.length-1,n;c>=0;c--)(n=e[c])&&(s=(t?n(r,i,s):n(s))||s);return t&&s&&P(r,i,s),s};let a=class extends u{constructor(){super(...arguments),this.formattedPrice="",this.rendered=new g(!1),this.subscriptions=[]}connectedCallback(){super.connectedCallback(),this.getInitialStatus(),this.subscriptions.push(window.mealzInternal.recipes.guestsUpdated().subscribe(e=>{e.recipeId===this.recipeId&&(this.serves=e.guests,this.recalculatePrice())}),this.rendered.pipe(v(e=>!e),b(1)).subscribe(()=>{this.subscriptions.push(window.mealzInternal.basket.recipeDataInBasket$().subscribe(e=>{e&&(this.recipePricingValue=e.find(r=>r.id===this.recipeId),this.recalculatePrice(),this.showPrice())}))}))}disconnectedCallback(){super.disconnectedCallback(),this.subscriptions.forEach(e=>e.unsubscribe())}fetchPrice(e,r,i=null){i||(i=this.recipeId),this.subscriptions.push(window.mealzInternal.recipes.fetchPricing(i,e,r).subscribe(t=>{t!=null&&t.price_per_serve&&this.applyCurrencyDisplay(t.price_per_serve)}))}render(){this.recipePricing=this.querySelector(".mealz-recipe-pricing"),this.recipePricing&&this.rendered.next(!0)}getInitialStatus(){var s;const e=(s=this.attributes["starting-data"])==null?void 0:s.value;if(!e)return;const{recipeId:r,pricePerServe:i,serves:t}=JSON.parse(e);this.recipeId=r,this.pricePerServe=(i==null?void 0:i.toString())??null,this.serves=t,this.applyCurrencyDisplay(this.pricePerServe)}applyCurrencyDisplay(e){const r=parseFloat(e);isNaN(r)||(this.formattedPrice=r.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2}),this.updateDOM())}showPrice(){var i,t;let e=(i=this.recipePricing)==null?void 0:i.querySelector(".mealz-recipe-pricing__loading"),r=(t=this.recipePricing)==null?void 0:t.querySelector(".mealz-recipe-pricing__wrapper");e&&e.classList.contains("active")&&(e.classList.replace("active","hidden"),r.classList.replace("hidden","active"))}updateDOM(){var r;const e=(r=this.recipePricing)==null?void 0:r.querySelector(".mealz-recipe-pricing__wrapper__price");e&&(e.innerHTML=this.formattedPrice+" €")}recalculatePrice(){if(this.recipePricingValue){const e=(parseFloat(this.recipePricingValue.price)/this.recipePricingValue.guests).toString();this.applyCurrencyDisplay(e)}}};a=y([l("mealz-recipe-pricing")],a);customElements.get("mealz-recipe-pricing")||customElements.define("mealz-recipe-pricing",a);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mealz-components",
3
3
  "type": "module",
4
- "version": "1.3.7",
4
+ "version": "1.3.8",
5
5
  "main": "./dist/mealz-components.js",
6
6
  "module": "./dist/mealz-components.js",
7
7
  "scripts": {
@@ -1 +0,0 @@
1
- import{i as u,e as d,f as m,g as v,h as f,O as i,r as h,j as w,k as S,l as A,o as I,c as b,b as p,_ as x}from"./OperatorSubscriber-BPZabEAm.js";function D(e){return e&&u(e.schedule)}var O=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function k(e){return u(e==null?void 0:e.then)}function g(e){return u(e[d])}function L(e){return Symbol.asyncIterator&&u(e==null?void 0:e[Symbol.asyncIterator])}function R(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 T(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var E=T();function P(e){return u(e==null?void 0:e[E])}function _(e){return m(this,arguments,function(){var n,t,a,o;return v(this,function(s){switch(s.label){case 0:n=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,f(n.read())];case 3:return t=s.sent(),a=t.value,o=t.done,o?[4,f(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,f(a)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function G(e){return u(e==null?void 0:e.getReader)}function H(e){if(e instanceof i)return e;if(e!=null){if(g(e))return F(e);if(O(e))return Y(e);if(k(e))return j(e);if(L(e))return y(e);if(P(e))return M(e);if(G(e))return U(e)}throw R(e)}function F(e){return new i(function(r){var n=e[d]();if(u(n.subscribe))return n.subscribe(r);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Y(e){return new i(function(r){for(var n=0;n<e.length&&!r.closed;n++)r.next(e[n]);r.complete()})}function j(e){return new i(function(r){e.then(function(n){r.closed||(r.next(n),r.complete())},function(n){return r.error(n)}).then(null,h)})}function M(e){return new i(function(r){var n,t;try{for(var a=w(e),o=a.next();!o.done;o=a.next()){var s=o.value;if(r.next(s),r.closed)return}}catch(l){n={error:l}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}r.complete()})}function y(e){return new i(function(r){V(e,r).catch(function(n){return r.error(n)})})}function U(e){return y(_(e))}function V(e,r){var n,t,a,o;return S(this,void 0,void 0,function(){var s,l;return v(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=A(e),c.label=1;case 1:return[4,n.next()];case 2:if(t=c.sent(),!!t.done)return[3,4];if(s=t.value,r.next(s),r.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=c.sent(),a={error:l},[3,11];case 6:return c.trys.push([6,,9,10]),t&&!t.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return r.complete(),[2]}})})}function J(e,r,n,t,a){t===void 0&&(t=0),a===void 0&&(a=!1);var o=r.schedule(function(){n(),a?e.add(this.schedule(null,t)):this.unsubscribe()},t);if(e.add(o),!a)return o}function q(e,r){return I(function(n,t){var a=0;n.subscribe(b(t,function(o){t.next(e.call(r,o,a++))}))})}var z=Array.isArray;function B(e,r){return z(r)?e.apply(void 0,p([],x(r))):e(r)}function K(e){return q(function(r){return B(e,r)})}export{K as a,O as b,D as c,E as d,J as e,g as f,k as g,L as h,H as i,P as j,G as k,R as l,q as m,_ as r};