From 4b1443a7050a3d96b559ea35e500fbeab7702c97 Mon Sep 17 00:00:00 2001 From: Kaibu Date: Wed, 13 Oct 2021 14:50:52 +0200 Subject: [PATCH] new meal type edit --- .gitignore | 1 + cookbook/templates/sw.js | 1 - vue/src/apps/MealPlanView/MealPlanView.vue | 146 +++++++++++++++++- vue/src/components/MealPlanCalenderHeader.vue | 10 +- vue/src/components/Modals/EmojiInput.vue | 10 +- vue/src/locales/en.json | 4 +- 6 files changed, 157 insertions(+), 15 deletions(-) delete mode 100644 cookbook/templates/sw.js diff --git a/.gitignore b/.gitignore index 6d7ac9e7..5791432e 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,4 @@ vue/yarn.lock vetur.config.js cookbook/static/vue vue/webpack-stats.json +cookbook/templates/sw.js diff --git a/cookbook/templates/sw.js b/cookbook/templates/sw.js deleted file mode 100644 index 03272984..00000000 --- a/cookbook/templates/sw.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="249e")})({"00ee":function(e,t,n){var r=n("b622"),o=r("toStringTag"),a={};a[o]="z",e.exports="[object z]"===String(a)},"06cf":function(e,t,n){var r=n("83ab"),o=n("d1e7"),a=n("5c6c"),i=n("fc6a"),c=n("a04b"),s=n("5135"),u=n("0cfb"),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=i(e),t=c(t),u)try{return l(e,t)}catch(n){}if(s(e,t))return a(!o.f.call(e,t),e[t])}},"0719":function(e,t,n){"use strict";try{self["workbox:core:6.2.4"]&&_()}catch(r){}},"0cfb":function(e,t,n){var r=n("83ab"),o=n("d039"),a=n("cc12");e.exports=!r&&!o((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},"0d51":function(e,t){e.exports=function(e){try{return String(e)}catch(t){return"Object"}}},"107c":function(e,t,n){var r=n("d039"),o=n("da84"),a=o.RegExp;e.exports=r((function(){var e=a("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}))},"14c3":function(e,t,n){var r=n("825a"),o=n("1626"),a=n("c6b6"),i=n("9263");e.exports=function(e,t){var n=e.exec;if(o(n)){var c=n.call(e,t);return null!==c&&r(c),c}if("RegExp"===a(e))return i.call(e,t);throw TypeError("RegExp#exec called on incompatible receiver")}},1626:function(e,t){e.exports=function(e){return"function"===typeof e}},"1be4":function(e,t,n){var r=n("d066");e.exports=r("document","documentElement")},"1d80":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"23cb":function(e,t,n){var r=n("a691"),o=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):a(n,t)}},"23e7":function(e,t,n){var r=n("da84"),o=n("06cf").f,a=n("9112"),i=n("6eeb"),c=n("ce4e"),s=n("e893"),u=n("94ca");e.exports=function(e,t){var n,l,f,h,d,p,g=e.target,v=e.global,m=e.stat;if(l=v?r:m?r[g]||c(g,{}):(r[g]||{}).prototype,l)for(f in t){if(d=t[f],e.noTargetGet?(p=o(l,f),h=p&&p.value):h=l[f],n=u(v?f:g+(m?".":"#")+f,e.forced),!n&&void 0!==h){if(typeof d===typeof h)continue;s(d,h)}(e.sham||h&&h.sham)&&a(d,"sham",!0),i(l,f,d,e)}}},"241c":function(e,t,n){var r=n("ca84"),o=n("7839"),a=o.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,a)}},"249e":function(e,t,n){"use strict";n.r(t);n("d3b7");function r(e,t,n,r,o,a,i){try{var c=e[a](i),s=c.value}catch(u){return void n(u)}c.done?t(s):Promise.resolve(s).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var i=e.apply(t,n);function c(e){r(i,o,a,c,s,"next",e)}function s(e){r(i,o,a,c,s,"throw",e)}c(void 0)}))}}n("ac1f"),n("466d"),n("4d63"),n("25f0"),n("96cf"),n("0719");const a=(e,...t)=>{let n=e;return t.length>0&&(n+=" :: "+JSON.stringify(t)),n},i=a;class c extends Error{constructor(e,t){const n=i(e,t);super(n),this.name=e,this.details=t}}const s={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},u=e=>[s.prefix,e,s.suffix].filter(e=>e&&e.length>0).join("-"),l=e=>{for(const t of Object.keys(s))e(t)},f={updateDetails:e=>{l(t=>{"string"===typeof e[t]&&(s[t]=e[t])})},getGoogleAnalyticsName:e=>e||u(s.googleAnalytics),getPrecacheName:e=>e||u(s.precache),getPrefix:()=>s.prefix,getRuntimeName:e=>e||u(s.runtime),getSuffix:()=>s.suffix};n("c700");let h;function d(){if(void 0===h){const t=new Response("");if("body"in t)try{new Response(t.body),h=!0}catch(e){h=!1}h=!1}return h}async function p(e,t){let n=null;if(e.url){const t=new URL(e.url);n=t.origin}if(n!==self.location.origin)throw new c("cross-origin-copy-response",{origin:n});const r=e.clone(),o={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},a=t?t(o):o,i=d()?r.body:await r.blob();return new Response(i,a)}const g=e=>{const t=new URL(String(e),location.href);return t.href.replace(new RegExp("^"+location.origin),"")};function v(e,t){const n=new URL(e);for(const r of t)n.searchParams.delete(r);return n.href}async function m(e,t,n,r){const o=v(t.url,n);if(t.url===o)return e.match(t,r);const a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),i=await e.keys(t,a);for(const c of i){const t=v(c.url,n);if(o===t)return e.match(c,r)}}class y{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}const w=new Set;async function b(){for(const e of w)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}n("6aa8");function _(e){return"string"===typeof e?new Request(e):e}class E{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new y,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=_(e);if("navigate"===n.mode&&t instanceof FetchEvent&&t.preloadResponse){const e=await t.preloadResponse;if(e)return e}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))n=await e({request:n.clone(),event:t})}catch(a){if(a instanceof Error)throw new c("plugin-error-request-will-fetch",{thrownErrorMessage:a.message})}const o=n.clone();try{let e;e=await fetch(n,"navigate"===n.mode?void 0:this._strategy.fetchOptions);for(const n of this.iterateCallbacks("fetchDidSucceed"))e=await n({event:t,request:o,response:e});return e}catch(i){throw r&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:r.clone(),request:o.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=_(e);let n;const{cacheName:r,matchOptions:o}=this._strategy,a=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},o),{cacheName:r});n=await caches.match(a,i);for(const c of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await c({cacheName:r,matchOptions:o,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,t){const n=_(e);await x(0);const r=await this.getCacheKey(n,"write");if(!t)throw new c("cache-put-with-no-response",{url:g(r.url)});const o=await this._ensureResponseSafeToCache(t);if(!o)return!1;const{cacheName:a,matchOptions:i}=this._strategy,s=await self.caches.open(a),u=this.hasCallback("cacheDidUpdate"),l=u?await m(s,r.clone(),["__WB_REVISION__"],i):null;try{await s.put(r,u?o.clone():o)}catch(f){if(f instanceof Error)throw"QuotaExceededError"===f.name&&await b(),f}for(const c of this.iterateCallbacks("cacheDidUpdate"))await c({cacheName:a,oldResponse:l,newResponse:o.clone(),request:r,event:this.event});return!0}async getCacheKey(e,t){if(!this._cacheKeys[t]){let n=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))n=_(await e({mode:t,request:n,event:this.event,params:this.params}));this._cacheKeys[t]=n}return this._cacheKeys[t]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"===typeof t[e]){const n=this._pluginStateMap.get(t),r=r=>{const o=Object.assign(Object.assign({},r),{state:n});return t[e](o)};yield r}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;while(e=this._extendLifetimePromises.shift())await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const r of this.iterateCallbacks("cacheWillUpdate"))if(t=await r({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&200!==t.status&&(t=void 0),t}}class O{constructor(e={}){this.cacheName=f.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n="string"===typeof e.request?new Request(e.request):e.request,r="params"in e?e.params:void 0,o=new E(this,{event:t,request:n,params:r}),a=this._getResponse(o,n,t),i=this._awaitComplete(a,o,n,t);return[a,i]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let r=void 0;try{if(r=await this._handle(t,e),!r||"error"===r.type)throw new c("no-response",{url:t.url})}catch(o){if(o instanceof Error)for(const a of e.iterateCallbacks("handlerDidError"))if(r=await a({error:o,event:n,request:t}),r)break;if(!r)throw o}for(const a of e.iterateCallbacks("handlerWillRespond"))r=await a({event:n,request:t,response:r});return r}async _awaitComplete(e,t,n,r){let o,a;try{o=await e}catch(a){}try{await t.runCallbacks("handlerDidRespond",{event:r,request:n,response:o}),await t.doneWaiting()}catch(i){i instanceof Error&&(a=i)}if(await t.runCallbacks("handlerDidComplete",{event:r,request:n,response:o,error:a}),t.destroy(),a)throw a}}class R extends O{constructor(e={}){e.cacheName=f.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(R.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const r=t.params||{};if(!this._fallbackToNetwork)throw new c("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const o=r.integrity,a=e.integrity,i=!a||a===o;if(n=await t.fetch(new Request(e,{integrity:a||o})),o&&i){this._useDefaultCacheabilityPluginIfNeeded();await t.cachePut(e,n.clone());0}}return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e),r=await t.cachePut(e,n.clone());if(!r)throw new c("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,r]of this.plugins.entries())r!==R.copyRedirectedCacheableResponsesPlugin&&(r===R.defaultPrecacheCacheabilityPlugin&&(e=n),r.cacheWillUpdate&&t++);0===t?this.plugins.push(R.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}R.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},R.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};n("e6d2");const S="GET",j=e=>e&&"object"===typeof e?e:{handle:e};class P{constructor(e,t,n=S){this.handler=j(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=j(e)}}class N extends P{constructor(e,t,n){const r=({url:t})=>{const n=e.exec(t.href);if(n&&(t.origin===location.origin||0===n.index))return n.slice(1)};super(r,t,n)}}class k{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data;0;const n=Promise.all(t.urlsToCache.map(t=>{"string"===typeof t&&(t=[t]);const n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return void 0;const r=n.origin===location.origin,{params:o,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n});let i=a&&a.handler;const c=e.method;if(!i&&this._defaultHandlerMap.has(c)&&(i=this._defaultHandlerMap.get(c)),!i)return void 0;let s;try{s=i.handle({url:n,request:e,event:t,params:o})}catch(l){s=Promise.reject(l)}const u=a&&a.catchHandler;return s instanceof Promise&&(this._catchHandler||u)&&(s=s.catch(async r=>{if(u){0;try{return await u.handle({url:n,request:e,event:t,params:o})}catch(a){a instanceof Error&&(r=a)}}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),s}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){const o=this._routes.get(n.method)||[];for(const a of o){let o;const i=a.match({url:e,sameOrigin:t,request:n,event:r});if(i)return o=i,(Array.isArray(o)&&0===o.length||i.constructor===Object&&0===Object.keys(i).length||"boolean"===typeof i)&&(o=void 0),{route:a,params:o}}return{}}setDefaultHandler(e,t=S){this._defaultHandlerMap.set(t,j(e))}setCatchHandler(e){this._catchHandler=j(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new c("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new c("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)}}let C;const T=()=>(C||(C=new k,C.addFetchListener(),C.addCacheListener()),C);function D(e,t,n){let r;if("string"===typeof e){const o=new URL(e,location.href);0;const a=({url:e})=>e.href===o.href;r=new P(a,t,n)}else if(e instanceof RegExp)r=new N(e,t,n);else if("function"===typeof e)r=new P(e,t,n);else{if(!(e instanceof P))throw new c("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});r=e}const o=T();return o.registerRoute(r),r}function I(e){const t=T();t.setCatchHandler(e)}class L extends O{async _handle(e,t){let n=await t.cacheMatch(e),r=void 0;if(n)0;else{0;try{n=await t.fetchAndCachePut(e)}catch(o){o instanceof Error&&(r=o)}0}if(!n)throw new c("no-response",{url:e.url,error:r});return n}}const A={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};class q extends O{constructor(e={}){super(e),this.plugins.some(e=>"cacheWillUpdate"in e)||this.plugins.unshift(A),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(e,t){const n=[];const r=[];let o;if(this._networkTimeoutSeconds){const{id:a,promise:i}=this._getTimeoutPromise({request:e,logs:n,handler:t});o=a,r.push(i)}const a=this._getNetworkPromise({timeoutId:o,request:e,logs:n,handler:t});r.push(a);const i=await t.waitUntil((async()=>await t.waitUntil(Promise.race(r))||await a)());if(!i)throw new c("no-response",{url:e.url});return i}_getTimeoutPromise({request:e,logs:t,handler:n}){let r;const o=new Promise(t=>{const o=async()=>{t(await n.cacheMatch(e))};r=setTimeout(o,1e3*this._networkTimeoutSeconds)});return{promise:o,id:r}}async _getNetworkPromise({timeoutId:e,request:t,logs:n,handler:r}){let o,a;try{a=await r.fetchAndCachePut(t)}catch(i){i instanceof Error&&(o=i)}return e&&clearTimeout(e),!o&&a||(a=await r.cacheMatch(t)),a}}class M extends O{constructor(e={}){super(e),this.plugins.some(e=>"cacheWillUpdate"in e)||this.plugins.unshift(A)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});let r,o=await t.cacheMatch(e);if(o)0;else{0;try{o=await n}catch(a){a instanceof Error&&(r=a)}}if(!o)throw new c("no-response",{url:e.url,error:r});return o}}function U(e){e.then(()=>{})}const F=(e,t)=>t.some(t=>e instanceof t);let B,W;function H(){return B||(B=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function G(){return W||(W=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const K=new WeakMap,z=new WeakMap,Y=new WeakMap,V=new WeakMap,$=new WeakMap;function Q(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",a)},o=()=>{t(ne(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",a)});return t.then(t=>{t instanceof IDBCursor&&K.set(t,e)}).catch(()=>{}),$.set(t,e),t}function X(e){if(z.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",a),e.removeEventListener("abort",a)},o=()=>{t(),r()},a=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",a),e.addEventListener("abort",a)});z.set(e,t)}let J={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return z.get(e);if("objectStoreNames"===t)return e.objectStoreNames||Y.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ne(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e}};function Z(e){J=e(J)}function ee(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?G().includes(e)?function(...t){return e.apply(re(this),t),ne(K.get(this))}:function(...t){return ne(e.apply(re(this),t))}:function(t,...n){const r=e.call(re(this),t,...n);return Y.set(r,t.sort?t.sort():[t]),ne(r)}}function te(e){return"function"===typeof e?ee(e):(e instanceof IDBTransaction&&X(e),F(e,H())?new Proxy(e,J):e)}function ne(e){if(e instanceof IDBRequest)return Q(e);if(V.has(e))return V.get(e);const t=te(e);return t!==e&&(V.set(e,t),$.set(t,e)),t}const re=e=>$.get(e);function oe(e,t,{blocked:n,upgrade:r,blocking:o,terminated:a}={}){const i=indexedDB.open(e,t),c=ne(i);return r&&i.addEventListener("upgradeneeded",e=>{r(ne(i.result),e.oldVersion,e.newVersion,ne(i.transaction))}),n&&i.addEventListener("blocked",()=>n()),c.then(e=>{a&&e.addEventListener("close",()=>a()),o&&e.addEventListener("versionchange",()=>o())}).catch(()=>{}),c}function ae(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),ne(n).then(()=>{})}const ie=["get","getKey","getAll","getAllKeys","count"],ce=["put","add","delete","clear"],se=new Map;function ue(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(se.get(t))return se.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=ce.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!ie.includes(n))return;const a=async function(e,...t){const a=this.transaction(e,o?"readwrite":"readonly");let i=a.store;return r&&(i=i.index(t.shift())),(await Promise.all([i[n](...t),o&&a.done]))[0]};return se.set(t,a),a}Z(e=>({...e,get:(t,n,r)=>ue(t,n)||e.get(t,n,r),has:(t,n)=>!!ue(t,n)||e.has(t,n)}));n("d8a5");const le="workbox-expiration",fe="cache-entries",he=e=>{const t=new URL(e,location.href);return t.hash="",t.href};class de{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(fe,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&ae(this._cacheName)}async setTimestamp(e,t){e=he(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=await this.getDb(),o=r.transaction(fe,"readwrite",{durability:"relaxed"});await o.store.put(n),await o.done}async getTimestamp(e){const t=await this.getDb(),n=await t.get(fe,this._getId(e));return null===n||void 0===n?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let r=await n.transaction(fe).store.index("timestamp").openCursor(null,"prev");const o=[];let a=0;while(r){const n=r.value;n.cacheName===this._cacheName&&(e&&n.timestamp=t?o.push(r.value):a++),r=await r.continue()}const i=[];for(const c of o)await n.delete(fe,c.id),i.push(c.url);return i}_getId(e){return this._cacheName+"|"+he(e)}async getDb(){return this._db||(this._db=await oe(le,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class pe{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new de(e)}async expireEntries(){if(this._isRunning)return void(this._rerunRequested=!0);this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const r of t)await n.delete(r,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,U(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-1e3*this._maxAgeSeconds;return void 0===t||t{if(!r)return null;const o=this._isResponseDateFresh(r),a=this._getCacheExpiration(n);U(a.expireEntries());const i=a.updateTimestamp(t.url);if(e)try{e.waitUntil(i)}catch(c){0}return o?r:null},this.cacheDidUpdate=async({cacheName:e,request:t})=>{const n=this._getCacheExpiration(e);await n.updateTimestamp(t.url),await n.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&ge(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===f.getRuntimeName())throw new c("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new pe(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(null===t)return!0;const n=Date.now();return t>=n-1e3*this._maxAgeSeconds}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),n=new Date(t),r=n.getTime();return isNaN(r)?null:r}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}var me="offline-html",ye="undefined"!==typeof window?localStorage.getItem("SCRIPT_NAME"):"/",we=ye+"offline/";self.addEventListener("install",function(){var e=o(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.waitUntil(caches.open(me).then((function(e){return e.add(new Request(we,{cache:"reload"}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),[{'url':'static/vue/checklist_view.html'},{'url':'static/vue/cookbook_view.html'},{'url':'static/vue/css/chunk-22ef2d6a.css'},{'url':'static/vue/css/chunk-vendors.css'},{'url':'static/vue/css/cookbook_view.css'},{'url':'static/vue/css/edit_internal_recipe.css'},{'url':'static/vue/css/meal_plan_view.css'},{'url':'static/vue/css/model_list_view.css'},{'url':'static/vue/css/recipe_search_view.css'},{'url':'static/vue/css/recipe_view.css'},{'url':'static/vue/edit_internal_recipe.html'},{'url':'static/vue/import_response_view.html'},{'url':'static/vue/js/checklist_view.js'},{'url':'static/vue/js/chunk-22ef2d6a.js'},{'url':'static/vue/js/chunk-vendors.js'},{'url':'static/vue/js/cookbook_view.js'},{'url':'static/vue/js/edit_internal_recipe.js'},{'url':'static/vue/js/import_response_view.js'},{'url':'static/vue/js/meal_plan_view.js'},{'url':'static/vue/js/model_list_view.js'},{'url':'static/vue/js/offline_view.js'},{'url':'static/vue/js/recipe_search_view.js'},{'url':'static/vue/js/recipe_view.js'},{'url':'static/vue/js/supermarket_view.js'},{'url':'static/vue/js/user_file_view.js'},{'url':'static/vue/manifest.json'},{'url':'static/vue/meal_plan_view.html'},{'url':'static/vue/model_list_view.html'},{'url':'static/vue/offline_view.html'},{'url':'static/vue/recipe_search_view.html'},{'url':'static/vue/recipe_view.html'},{'url':'static/vue/supermarket_view.html'},{'url':'static/vue/user_file_view.html'}],I((function(e){var t=e.event;switch(t.request.destination){case"document":return console.log("Triggered fallback HTML"),caches.open(me).then((function(e){return e.match(we)}));default:return console.log("Triggered response ERROR"),Response.error()}})),D((function(e){var t=e.request;return"image"===t.destination}),new L({cacheName:"images",plugins:[new ve({maxEntries:20})]})),D((function(e){var t=e.request;return"script"===t.destination||"style"===t.destination}),new M({cacheName:"assets"})),D(new RegExp("jsreverse"),new M({cacheName:"assets"})),D(new RegExp("jsi18n"),new M({cacheName:"assets"})),D(new RegExp("api/recipe/([0-9]+)"),new q({cacheName:"api-recipe",plugins:[new ve({maxEntries:50})]})),D(new RegExp("api/*"),new q({cacheName:"api",plugins:[new ve({maxEntries:50})]})),D((function(e){var t=e.request;return"document"===t.destination}),new q({cacheName:"html",plugins:[new ve({maxAgeSeconds:2592e3,maxEntries:50})]}))},"25f0":function(e,t,n){"use strict";var r=n("5e77").PROPER,o=n("6eeb"),a=n("825a"),i=n("577e"),c=n("d039"),s=n("ad6d"),u="toString",l=RegExp.prototype,f=l[u],h=c((function(){return"/a/b"!=f.call({source:"a",flags:"b"})})),d=r&&f.name!=u;(h||d)&&o(RegExp.prototype,u,(function(){var e=a(this),t=i(e.source),n=e.flags,r=i(void 0===n&&e instanceof RegExp&&!("flags"in l)?s.call(e):n);return"/"+t+"/"+r}),{unsafe:!0})},2626:function(e,t,n){"use strict";var r=n("d066"),o=n("9bf2"),a=n("b622"),i=n("83ab"),c=a("species");e.exports=function(e){var t=r(e),n=o.f;i&&t&&!t[c]&&n(t,c,{configurable:!0,get:function(){return this}})}},"2d00":function(e,t,n){var r,o,a=n("da84"),i=n("342f"),c=a.process,s=a.Deno,u=c&&c.versions||s&&s.version,l=u&&u.v8;l?(r=l.split("."),o=r[0]<4?1:r[0]+r[1]):i&&(r=i.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=i.match(/Chrome\/(\d+)/),r&&(o=r[1]))),e.exports=o&&+o},"342f":function(e,t,n){var r=n("d066");e.exports=r("navigator","userAgent")||""},"37e8":function(e,t,n){var r=n("83ab"),o=n("9bf2"),a=n("825a"),i=n("df75");e.exports=r?Object.defineProperties:function(e,t){a(e);var n,r=i(t),c=r.length,s=0;while(c>s)o.f(e,n=r[s++],t[n]);return e}},"3bbe":function(e,t,n){var r=n("1626");e.exports=function(e){if("object"===typeof e||r(e))return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},"44ad":function(e,t,n){var r=n("d039"),o=n("c6b6"),a="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?a.call(e,""):Object(e)}:Object},"44e7":function(e,t,n){var r=n("861d"),o=n("c6b6"),a=n("b622"),i=a("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},"466d":function(e,t,n){"use strict";var r=n("d784"),o=n("825a"),a=n("50c4"),i=n("577e"),c=n("1d80"),s=n("dc4a"),u=n("8aa5"),l=n("14c3");r("match",(function(e,t,n){return[function(t){var n=c(this),r=void 0==t?void 0:s(t,e);return r?r.call(t,n):new RegExp(t)[e](i(n))},function(e){var r=o(this),c=i(e),s=n(t,r,c);if(s.done)return s.value;if(!r.global)return l(r,c);var f=r.unicode;r.lastIndex=0;var h,d=[],p=0;while(null!==(h=l(r,c))){var g=i(h[0]);d[p]=g,""===g&&(r.lastIndex=u(c,a(r.lastIndex),f)),p++}return 0===p?null:d}]}))},"485a":function(e,t,n){var r=n("1626"),o=n("861d");e.exports=function(e,t){var n,a;if("string"===t&&r(n=e.toString)&&!o(a=n.call(e)))return a;if(r(n=e.valueOf)&&!o(a=n.call(e)))return a;if("string"!==t&&r(n=e.toString)&&!o(a=n.call(e)))return a;throw TypeError("Can't convert object to primitive value")}},4930:function(e,t,n){var r=n("2d00"),o=n("d039");e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},"4d63":function(e,t,n){var r=n("83ab"),o=n("da84"),a=n("94ca"),i=n("7156"),c=n("9112"),s=n("9bf2").f,u=n("241c").f,l=n("44e7"),f=n("577e"),h=n("ad6d"),d=n("9f7f"),p=n("6eeb"),g=n("d039"),v=n("5135"),m=n("69f3").enforce,y=n("2626"),w=n("b622"),b=n("fce3"),x=n("107c"),_=w("match"),E=o.RegExp,O=E.prototype,R=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,S=/a/g,j=/a/g,P=new E(S)!==S,N=d.UNSUPPORTED_Y,k=r&&(!P||N||b||x||g((function(){return j[_]=!1,E(S)!=S||E(j)==j||"/a/i"!=E(S,"i")}))),C=function(e){for(var t,n=e.length,r=0,o="",a=!1;r<=n;r++)t=e.charAt(r),"\\"!==t?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),o+=t):o+="[\\s\\S]":o+=t+e.charAt(++r);return o},T=function(e){for(var t,n=e.length,r=0,o="",a=[],i={},c=!1,s=!1,u=0,l="";r<=n;r++){if(t=e.charAt(r),"\\"===t)t+=e.charAt(++r);else if("]"===t)c=!1;else if(!c)switch(!0){case"["===t:c=!0;break;case"("===t:R.test(e.slice(r+1))&&(r+=2,s=!0),o+=t,u++;continue;case">"===t&&s:if(""===l||v(i,l))throw new SyntaxError("Invalid capture group name");i[l]=!0,a.push([l,u]),s=!1,l="";continue}s?l+=t:o+=t}return[o,a]};if(a("RegExp",k)){for(var D=function(e,t){var n,r,o,a,s,u,d=this instanceof D,p=l(e),g=void 0===t,v=[],y=e;if(!d&&p&&g&&e.constructor===D)return e;if((p||e instanceof D)&&(e=e.source,g&&(t="flags"in y?y.flags:h.call(y))),e=void 0===e?"":f(e),t=void 0===t?"":f(t),y=e,b&&"dotAll"in S&&(r=!!t&&t.indexOf("s")>-1,r&&(t=t.replace(/s/g,""))),n=t,N&&"sticky"in S&&(o=!!t&&t.indexOf("y")>-1,o&&(t=t.replace(/y/g,""))),x&&(a=T(e),e=a[0],v=a[1]),s=i(E(e,t),d?this:O,D),(r||o||v.length)&&(u=m(s),r&&(u.dotAll=!0,u.raw=D(C(e),n)),o&&(u.sticky=!0),v.length&&(u.groups=v)),e!==y)try{c(s,"source",""===y?"(?:)":y)}catch(w){}return s},I=function(e){e in D||s(D,e,{configurable:!0,get:function(){return E[e]},set:function(t){E[e]=t}})},L=u(E),A=0;L.length>A;)I(L[A++]);O.constructor=D,D.prototype=O,p(o,"RegExp",D)}y("RegExp")},"4d64":function(e,t,n){var r=n("fc6a"),o=n("50c4"),a=n("23cb"),i=function(e){return function(t,n,i){var c,s=r(t),u=o(s.length),l=a(i,u);if(e&&n!=n){while(u>l)if(c=s[l++],c!=c)return!0}else for(;u>l;l++)if((e||l in s)&&s[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},"50c4":function(e,t,n){var r=n("a691"),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},5135:function(e,t,n){var r=n("7b0b"),o={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return o.call(r(e),t)}},5692:function(e,t,n){var r=n("c430"),o=n("c6cd");(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.18.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"56ef":function(e,t,n){var r=n("d066"),o=n("241c"),a=n("7418"),i=n("825a");e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(i(e)),n=a.f;return n?t.concat(n(e)):t}},"577e":function(e,t,n){var r=n("f5df");e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)}},"59ed":function(e,t,n){var r=n("1626"),o=n("0d51");e.exports=function(e){if(r(e))return e;throw TypeError(o(e)+" is not a function")}},"5c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"5e77":function(e,t,n){var r=n("83ab"),o=n("5135"),a=Function.prototype,i=r&&Object.getOwnPropertyDescriptor,c=o(a,"name"),s=c&&"something"===function(){}.name,u=c&&(!r||r&&i(a,"name").configurable);e.exports={EXISTS:c,PROPER:s,CONFIGURABLE:u}},6547:function(e,t,n){var r=n("a691"),o=n("577e"),a=n("1d80"),i=function(e){return function(t,n){var i,c,s=o(a(t)),u=r(n),l=s.length;return u<0||u>=l?e?"":void 0:(i=s.charCodeAt(u),i<55296||i>56319||u+1===l||(c=s.charCodeAt(u+1))<56320||c>57343?e?s.charAt(u):i:e?s.slice(u,u+2):c-56320+(i-55296<<10)+65536)}};e.exports={codeAt:i(!1),charAt:i(!0)}},"69f3":function(e,t,n){var r,o,a,i=n("7f9a"),c=n("da84"),s=n("861d"),u=n("9112"),l=n("5135"),f=n("c6cd"),h=n("f772"),d=n("d012"),p="Object already initialized",g=c.WeakMap,v=function(e){return a(e)?o(e):r(e,{})},m=function(e){return function(t){var n;if(!s(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}};if(i||f.state){var y=f.state||(f.state=new g),w=y.get,b=y.has,x=y.set;r=function(e,t){if(b.call(y,e))throw new TypeError(p);return t.facade=e,x.call(y,e,t),t},o=function(e){return w.call(y,e)||{}},a=function(e){return b.call(y,e)}}else{var _=h("state");d[_]=!0,r=function(e,t){if(l(e,_))throw new TypeError(p);return t.facade=e,u(e,_,t),t},o=function(e){return l(e,_)?e[_]:{}},a=function(e){return l(e,_)}}e.exports={set:r,get:o,has:a,enforce:v,getterFor:m}},"6aa8":function(e,t,n){"use strict";try{self["workbox:strategies:6.2.4"]&&_()}catch(r){}},"6eeb":function(e,t,n){var r=n("da84"),o=n("1626"),a=n("5135"),i=n("9112"),c=n("ce4e"),s=n("8925"),u=n("69f3"),l=n("5e77").CONFIGURABLE,f=u.get,h=u.enforce,d=String(String).split("String");(e.exports=function(e,t,n,s){var u,f=!!s&&!!s.unsafe,p=!!s&&!!s.enumerable,g=!!s&&!!s.noTargetGet,v=s&&void 0!==s.name?s.name:t;o(n)&&("Symbol("===String(v).slice(0,7)&&(v="["+String(v).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!a(n,"name")||l&&n.name!==v)&&i(n,"name",v),u=h(n),u.source||(u.source=d.join("string"==typeof v?v:""))),e!==r?(f?!g&&e[t]&&(p=!0):delete e[t],p?e[t]=n:i(e,t,n)):p?e[t]=n:c(t,n)})(Function.prototype,"toString",(function(){return o(this)&&f(this).source||s(this)}))},7156:function(e,t,n){var r=n("1626"),o=n("861d"),a=n("d2bb");e.exports=function(e,t,n){var i,c;return a&&r(i=t.constructor)&&i!==n&&o(c=i.prototype)&&c!==n.prototype&&a(e,c),e}},7418:function(e,t){t.f=Object.getOwnPropertySymbols},7839:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(e,t,n){var r=n("1d80");e.exports=function(e){return Object(r(e))}},"7c73":function(e,t,n){var r,o=n("825a"),a=n("37e8"),i=n("7839"),c=n("d012"),s=n("1be4"),u=n("cc12"),l=n("f772"),f=">",h="<",d="prototype",p="script",g=l("IE_PROTO"),v=function(){},m=function(e){return h+p+f+e+h+"/"+p+f},y=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},w=function(){var e,t=u("iframe"),n="java"+p+":";return t.style.display="none",s.appendChild(t),t.src=String(n),e=t.contentWindow.document,e.open(),e.write(m("document.F=Object")),e.close(),e.F},b=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}b="undefined"!=typeof document?document.domain&&r?y(r):w():y(r);var e=i.length;while(e--)delete b[d][i[e]];return b()};c[g]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(v[d]=o(e),n=new v,v[d]=null,n[g]=e):n=b(),void 0===t?n:a(n,t)}},"7f9a":function(e,t,n){var r=n("da84"),o=n("1626"),a=n("8925"),i=r.WeakMap;e.exports=o(i)&&/native code/.test(a(i))},"825a":function(e,t,n){var r=n("861d");e.exports=function(e){if(r(e))return e;throw TypeError(String(e)+" is not an object")}},"83ab":function(e,t,n){var r=n("d039");e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"861d":function(e,t,n){var r=n("1626");e.exports=function(e){return"object"===typeof e?null!==e:r(e)}},8925:function(e,t,n){var r=n("1626"),o=n("c6cd"),a=Function.toString;r(o.inspectSource)||(o.inspectSource=function(e){return a.call(e)}),e.exports=o.inspectSource},"8aa5":function(e,t,n){"use strict";var r=n("6547").charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},"90e3":function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},9112:function(e,t,n){var r=n("83ab"),o=n("9bf2"),a=n("5c6c");e.exports=r?function(e,t,n){return o.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},9263:function(e,t,n){"use strict";var r=n("577e"),o=n("ad6d"),a=n("9f7f"),i=n("5692"),c=n("7c73"),s=n("69f3").get,u=n("fce3"),l=n("107c"),f=RegExp.prototype.exec,h=i("native-string-replace",String.prototype.replace),d=f,p=function(){var e=/a/,t=/b*/g;return f.call(e,"a"),f.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),g=a.UNSUPPORTED_Y||a.BROKEN_CARET,v=void 0!==/()??/.exec("")[1],m=p||v||g||u||l;m&&(d=function(e){var t,n,a,i,u,l,m,y=this,w=s(y),b=r(e),x=w.raw;if(x)return x.lastIndex=y.lastIndex,t=d.call(x,b),y.lastIndex=x.lastIndex,t;var _=w.groups,E=g&&y.sticky,O=o.call(y),R=y.source,S=0,j=b;if(E&&(O=O.replace("y",""),-1===O.indexOf("g")&&(O+="g"),j=b.slice(y.lastIndex),y.lastIndex>0&&(!y.multiline||y.multiline&&"\n"!==b.charAt(y.lastIndex-1))&&(R="(?: "+R+")",j=" "+j,S++),n=new RegExp("^(?:"+R+")",O)),v&&(n=new RegExp("^"+R+"$(?!\\s)",O)),p&&(a=y.lastIndex),i=f.call(E?n:y,j),E?i?(i.input=i.input.slice(S),i[0]=i[0].slice(S),i.index=y.lastIndex,y.lastIndex+=i[0].length):y.lastIndex=0:p&&i&&(y.lastIndex=y.global?i.index+i[0].length:a),v&&i&&i.length>1&&h.call(i[0],n,(function(){for(u=1;u=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=r}catch(o){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},"9bf2":function(e,t,n){var r=n("83ab"),o=n("0cfb"),a=n("825a"),i=n("a04b"),c=Object.defineProperty;t.f=r?c:function(e,t,n){if(a(e),t=i(t),a(n),o)try{return c(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},"9f7f":function(e,t,n){var r=n("d039"),o=n("da84"),a=o.RegExp;t.UNSUPPORTED_Y=r((function(){var e=a("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),t.BROKEN_CARET=r((function(){var e=a("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},a04b:function(e,t,n){var r=n("c04e"),o=n("d9b5");e.exports=function(e){var t=r(e,"string");return o(t)?t:String(t)}},a691:function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},ac1f:function(e,t,n){"use strict";var r=n("23e7"),o=n("9263");r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},ad6d:function(e,t,n){"use strict";var r=n("825a");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},b041:function(e,t,n){"use strict";var r=n("00ee"),o=n("f5df");e.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},b622:function(e,t,n){var r=n("da84"),o=n("5692"),a=n("5135"),i=n("90e3"),c=n("4930"),s=n("fdbf"),u=o("wks"),l=r.Symbol,f=s?l:l&&l.withoutSetter||i;e.exports=function(e){return a(u,e)&&(c||"string"==typeof u[e])||(c&&a(l,e)?u[e]=l[e]:u[e]=f("Symbol."+e)),u[e]}},c04e:function(e,t,n){var r=n("861d"),o=n("d9b5"),a=n("dc4a"),i=n("485a"),c=n("b622"),s=c("toPrimitive");e.exports=function(e,t){if(!r(e)||o(e))return e;var n,c=a(e,s);if(c){if(void 0===t&&(t="default"),n=c.call(e,t),!r(n)||o(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),i(e,t)}},c430:function(e,t){e.exports=!1},c6b6:function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},c6cd:function(e,t,n){var r=n("da84"),o=n("ce4e"),a="__core-js_shared__",i=r[a]||o(a,{});e.exports=i},c700:function(e,t,n){"use strict";try{self["workbox:precaching:6.2.4"]&&_()}catch(r){}},c8ba:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},ca84:function(e,t,n){var r=n("5135"),o=n("fc6a"),a=n("4d64").indexOf,i=n("d012");e.exports=function(e,t){var n,c=o(e),s=0,u=[];for(n in c)!r(i,n)&&r(c,n)&&u.push(n);while(t.length>s)r(c,n=t[s++])&&(~a(u,n)||u.push(n));return u}},cc12:function(e,t,n){var r=n("da84"),o=n("861d"),a=r.document,i=o(a)&&o(a.createElement);e.exports=function(e){return i?a.createElement(e):{}}},ce4e:function(e,t,n){var r=n("da84");e.exports=function(e,t){try{Object.defineProperty(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},d012:function(e,t){e.exports={}},d039:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},d066:function(e,t,n){var r=n("da84"),o=n("1626"),a=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?a(r[e]):r[e]&&r[e][t]}},d1e7:function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!r.call({1:2},1);t.f=a?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},d2bb:function(e,t,n){var r=n("825a"),o=n("3bbe");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,e.call(n,[]),t=n instanceof Array}catch(a){}return function(n,a){return r(n),o(a),t?e.call(n,a):n.__proto__=a,n}}():void 0)},d3b7:function(e,t,n){var r=n("00ee"),o=n("6eeb"),a=n("b041");r||o(Object.prototype,"toString",a,{unsafe:!0})},d784:function(e,t,n){"use strict";n("ac1f");var r=n("6eeb"),o=n("9263"),a=n("d039"),i=n("b622"),c=n("9112"),s=i("species"),u=RegExp.prototype;e.exports=function(e,t,n,l){var f=i(e),h=!a((function(){var t={};return t[f]=function(){return 7},7!=""[e](t)})),d=h&&!a((function(){var t=!1,n=/a/;return"split"===e&&(n={},n.constructor={},n.constructor[s]=function(){return n},n.flags="",n[f]=/./[f]),n.exec=function(){return t=!0,null},n[f](""),!t}));if(!h||!d||n){var p=/./[f],g=t(f,""[e],(function(e,t,n,r,a){var i=t.exec;return i===o||i===u.exec?h&&!a?{done:!0,value:p.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}));r(String.prototype,e,g[0]),r(u,f,g[1])}l&&c(u[f],"sham",!0)}},d8a5:function(e,t,n){"use strict";try{self["workbox:expiration:6.2.4"]&&_()}catch(r){}},d9b5:function(e,t,n){var r=n("1626"),o=n("d066"),a=n("fdbf");e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=o("Symbol");return r(t)&&Object(e)instanceof t}},da84:function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},dc4a:function(e,t,n){var r=n("59ed");e.exports=function(e,t){var n=e[t];return null==n?void 0:r(n)}},df75:function(e,t,n){var r=n("ca84"),o=n("7839");e.exports=Object.keys||function(e){return r(e,o)}},e6d2:function(e,t,n){"use strict";try{self["workbox:routing:6.2.4"]&&_()}catch(r){}},e893:function(e,t,n){var r=n("5135"),o=n("56ef"),a=n("06cf"),i=n("9bf2");e.exports=function(e,t){for(var n=o(t),c=i.f,s=a.f,u=0;u + @input="setShowDate" @delete-dragged="deleteEntry(dragged_item)" + @create-new="createEntryClick(new Date())"/> @@ -67,10 +68,57 @@
{{ $t('Meal_Types') }}
- - - - +
+ + + +
+
+ +
+
+
{{ meal_type.icon }} {{ meal_type.name }}
+
+
+
+ +
+ + +
+
+ +
+
+ + +
+ + {{ $t('Default') }} + + + +
+
+
+ +
@@ -119,6 +167,8 @@ import {ApiMixin, StandardToasts} from "@/utils/utils"; import MealPlanEditModal from "../../components/MealPlanEditModal"; import VueCookies from "vue-cookies"; import MealPlanCalenderHeader from "@/components/MealPlanCalenderHeader"; +import EmojiInput from "../../components/Modals/EmojiInput"; +import draggable from 'vuedraggable' Vue.prototype.moment = moment Vue.use(BootstrapVue) @@ -131,11 +181,12 @@ export default { components: { MealPlanEditModal, MealPlanCard, - RecipeCard, CalendarView, ContextMenu, ContextMenuItem, - MealPlanCalenderHeader + MealPlanCalenderHeader, + EmojiInput, + draggable }, mixins: [CalendarMathMixin, ApiMixin], data: function () { @@ -171,6 +222,7 @@ export default { title_placeholder: this.$t('Title') } }, + current_period: null, entryEditing: {}, edit_modal_show: false } @@ -231,6 +283,7 @@ export default { this.settings = Object.assign({}, this.settings, this.$cookies.get(SETTINGS_COOKIE_NAME)) } }) + this.$root.$on('change', this.updateEmoji); }, watch: { settings: { @@ -241,6 +294,69 @@ export default { }, }, methods: { + newMealType() { + let apiClient = new ApiApiFactory() + + apiClient.createMealType({name: "Mealtype"}).then(e => { + this.periodChangedCallback(this.current_period) + }).catch(error => { + StandardToasts.makeStandardToast(StandardToasts.FAIL_UPDATE) + }) + + this.refreshMealTypes() + }, + sortMealTypes() { + this.meal_types.forEach(function (element, index) { + element.order = index + }); + let updated = 0 + this.meal_types.forEach((meal_type) => { + let apiClient = new ApiApiFactory() + + apiClient.updateMealType(meal_type.id, meal_type).then(e => { + if (updated === (this.meal_types.length - 1)) { + this.periodChangedCallback(this.current_period) + } else { + updated++ + } + }).catch(error => { + StandardToasts.makeStandardToast(StandardToasts.FAIL_UPDATE) + }) + }) + }, + editOrSaveMealType(index) { + let meal_type = this.meal_types[index] + if (meal_type.editing) { + this.$set(this.meal_types[index], 'editing', false) + let apiClient = new ApiApiFactory() + + apiClient.updateMealType(this.meal_types[index].id, this.meal_types[index]).then(e => { + this.periodChangedCallback(this.current_period) + StandardToasts.makeStandardToast(StandardToasts.SUCCESS_UPDATE) + }).catch(error => { + StandardToasts.makeStandardToast(StandardToasts.FAIL_UPDATE) + }) + } else { + this.$set(this.meal_types[index], 'editing', true) + } + }, + deleteMealType(index) { + let apiClient = new ApiApiFactory() + + apiClient.destroyMealType(this.meal_types[index].id).then(e => { + this.periodChangedCallback(this.current_period) + StandardToasts.makeStandardToast(StandardToasts.SUCCESS_DELETE) + }).catch(error => { + StandardToasts.makeStandardToast(StandardToasts.FAIL_DELETE) + }) + }, + updateEmoji: function (field, value) { + this.meal_types.forEach((meal_type) => { + if (meal_type.editing) { + meal_type.icon = value + } + }) + }, editEntry(edit_entry) { if (edit_entry.id !== -1) { this.plan_entries.forEach((entry, index) => { @@ -322,6 +438,7 @@ export default { } }, periodChangedCallback(date) { + this.current_period = date let apiClient = new ApiApiFactory() apiClient.listMealPlans({ @@ -338,6 +455,9 @@ export default { let apiClient = new ApiApiFactory() apiClient.listMealTypes().then(result => { + result.data.forEach((meal_type) => { + meal_type.editing = false + }) this.meal_types = result.data }) }, @@ -371,6 +491,18 @@ export default { entry: plan_entry } } + }, + directives: { + hover: { + inserted: function (el) { + el.addEventListener('mouseenter', () => { + el.classList.add("shadow") + }); + el.addEventListener('mouseleave', () => { + el.classList.remove("shadow") + }); + } + } } } diff --git a/vue/src/components/MealPlanCalenderHeader.vue b/vue/src/components/MealPlanCalenderHeader.vue index 79efed6a..131d5061 100644 --- a/vue/src/components/MealPlanCalenderHeader.vue +++ b/vue/src/components/MealPlanCalenderHeader.vue @@ -43,7 +43,8 @@ {{ headerProps.periodLabel }}
- + {{ $t('Drag_Here_To_Delete') }}
@@ -107,6 +108,13 @@ export default { font-size: 1.5em; } +.plus-button { + border-style: dotted; + margin-left: auto; + order: 1; + user-select: none +} + .delete-area { border-style: dotted; margin-left: auto; diff --git a/vue/src/components/Modals/EmojiInput.vue b/vue/src/components/Modals/EmojiInput.vue index 06fc5019..5123068b 100644 --- a/vue/src/components/Modals/EmojiInput.vue +++ b/vue/src/components/Modals/EmojiInput.vue @@ -1,15 +1,15 @@