X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=priv%2Fstatic%2Fsw.js;h=334bf79ac3e006dc5c491b24f8f472b32c570746;hb=6e6f1ead31ba26bc42b14226e3c0876042f0596a;hp=d01b6b2495426393b9ddb276673abab2d4a8196d;hpb=c349573791bfaca6e8c8c86c519c23397b088967;p=akkoma diff --git a/priv/static/sw.js b/priv/static/sw.js index d01b6b249..334bf79ac 100644 --- a/priv/static/sw.js +++ b/priv/static/sw.js @@ -1,3 +1,3 @@ -var __wpo = {"assets":{"main":[],"additional":[],"optional":[]},"externals":["/emoji/1f602.svg","/emoji/sheet_10.png"],"hashesMap":{},"strategy":"changed","responseStrategy":"cache-first","version":"4/11/2019, 5:19:34 AM","name":"webpack-offline:mastodon","pluginVersion":"5.0.6","relativePaths":false}; +var __wpo = {"assets":{"main":[],"additional":[],"optional":[]},"externals":["/emoji/1f602.svg","/emoji/sheet_10.png"],"hashesMap":{},"strategy":"changed","responseStrategy":"cache-first","version":"1/22/2020, 2:57:23 PM","name":"webpack-offline:mastodon","pluginVersion":"5.0.7","relativePaths":false}; -!function(n){var e={};function i(t){if(e[t])return e[t].exports;var o=e[t]={i:t,l:!1,exports:{}};return n[t].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=n,i.c=e,i.d=function(t,o,n){i.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(o,t){if(1&t&&(o=i(o)),8&t)return o;if(4&t&&"object"==typeof o&&o&&o.__esModule)return o;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:o}),2&t&&"string"!=typeof o)for(var e in o)i.d(n,e,function(t){return o[t]}.bind(null,e));return n},i.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(o,"a",o),o},i.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},i.p="/packs/",i(i.s=5)}([function(t,o,n){var e=n(8).Symbol;t.exports=e},function(t,o,n){"use strict";o.extend=function(t){var o,n,e,i,a=Array.prototype.slice.call(arguments,1);for(o=0,n=a.length;o",""":'"',"'":"'"});t.exports=e},function(t,o){t.exports=function(o){return function(t){return null==o?void 0:o[t]}}},function(t,o,n){"use strict";var e=n(21),i=n(26);e.default.__addLocaleData(i.default),e.default.defaultLocale="en",o.default=e.default},function(t,o,n){"use strict";var c=n(1),s=n(22),i=n(23),e=n(24);function u(o,t,n){var e="string"==typeof o?u.__parse(o):o;if(!e||"messageFormatPattern"!==e.type)throw new TypeError("A message must be provided as a String or AST.");n=this._mergeFormats(u.formats,n),s.defineProperty(this,"_locale",{value:this._resolveLocale(t)});var i=this._findPluralRuleFunction(this._locale),a=this._compilePattern(e,t,n,i),r=this;this.format=function(t){try{return r._format(a,t)}catch(t){throw t.variableId?new Error("The intl string context variable '"+t.variableId+"' was not provided to the string '"+o+"'"):t}}}o.default=u,s.defineProperty(u,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),s.defineProperty(u,"__localeData__",{value:s.objCreate(null)}),s.defineProperty(u,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");u.__localeData__[t.locale.toLowerCase()]=t}}),s.defineProperty(u,"__parse",{value:e.default.parse}),s.defineProperty(u,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),u.prototype.resolvedOptions=function(){return{locale:this._locale}},u.prototype._compilePattern=function(t,o,n,e){return new i.default(o,n,e).compile(t)},u.prototype._findPluralRuleFunction=function(t){for(var o=u.__localeData__,n=o[t.toLowerCase()];n;){if(n.pluralRuleFunction)return n.pluralRuleFunction;n=n.parentLocale&&o[n.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+t)},u.prototype._format=function(t,o){var n,e,i,a,r,s,u="";for(n=0,e=t.length;no.description?1:0});o/g,"\n").replace(/<\/p>

/g,"\n\n").replace(/<[^>]*>/g,""))},d=function(t){return{action:"expand",icon:"/web-push-icon_expand.png",title:m("status.show_more",t)}},h=function(t){return{action:"reblog",icon:"/web-push-icon_reblog.png",title:m("status.reblog",t)}},v=function(t){return{action:"favourite",icon:"/web-push-icon_favourite.png",title:m("status.favourite",t)}},g=function(t){var o=t.find(function(t){return t.focused}),n=t.find(function(t){return"visible"===t.visibilityState});return o||n||t[0]},b=function(t,o){var n=f(t);return n.actions=n.actions.filter(function(t){return t.action!==o}),self.registration.showNotification(n.title,n)};self.addEventListener("push",function(t){var o=t.data.json(),n=o.access_token,e=o.notification_id,i=o.preferred_locale,a=o.title,r=o.body,s=o.icon;t.waitUntil(l("/api/v1/notifications/"+e,"get",n).then(function(t){var o={};return o.title=m("notification."+t.type,i,{name:0",""":'"',"'":"'"});t.exports=e},function(t,o){t.exports=function(t){return function(o){return null==t?void 0:t[o]}}},function(t,o,n){"use strict";var e=n(21),i=n(26);e.default.__addLocaleData(i.default),e.default.defaultLocale="en",o.default=e.default},function(t,o,n){"use strict";var e=n(1),i=n(22),a=n(23),r=n(24);function s(t,o,n){var e="string"==typeof t?s.__parse(t):t;if(!e||"messageFormatPattern"!==e.type)throw new TypeError("A message must be provided as a String or AST.");n=this._mergeFormats(s.formats,n),i.defineProperty(this,"_locale",{value:this._resolveLocale(o)});var a=this._findPluralRuleFunction(this._locale),r=this._compilePattern(e,o,n,a),u=this;this.format=function(o){try{return u._format(r,o)}catch(o){throw o.variableId?new Error("The intl string context variable '"+o.variableId+"' was not provided to the string '"+t+"'"):o}}}o.default=s,i.defineProperty(s,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),i.defineProperty(s,"__localeData__",{value:i.objCreate(null)}),i.defineProperty(s,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");s.__localeData__[t.locale.toLowerCase()]=t}}),i.defineProperty(s,"__parse",{value:r.default.parse}),i.defineProperty(s,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),s.prototype.resolvedOptions=function(){return{locale:this._locale}},s.prototype._compilePattern=function(t,o,n,e){return new a.default(o,n,e).compile(t)},s.prototype._findPluralRuleFunction=function(t){for(var o=s.__localeData__,n=o[t.toLowerCase()];n;){if(n.pluralRuleFunction)return n.pluralRuleFunction;n=n.parentLocale&&o[n.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+t)},s.prototype._format=function(t,o){var n,i,a,r,s,u,c="";for(n=0,i=t.length;n1?arguments[1]:{},i={},a={start:St},r=St,s=function(t){return{type:"messageFormatPattern",elements:t,location:At()}},u=function(t){var o,n,e,i,a,r="";for(o=0,e=t.length;ojt&&(jt=wt,kt=[]),kt.push(t))}function zt(o,n,e,i){return null!==n&&function(t){var o=1;for(t.sort(function(t,o){return t.descriptiono.description?1:0});o1?e.slice(0,-1).join(", ")+" or "+e[t.length-1]:e[0])+" but "+(o?'"'+function(t){function o(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+o(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+o(t)}).replace(/[\u0100-\u0FFF]/g,function(t){return"\\u0"+o(t)}).replace(/[\u1000-\uFFFF]/g,function(t){return"\\u"+o(t)})}(o)+'"':"end of input")+" found."}(n,e),n,e,i)}function St(){return Et()}function Et(){var t,o,n;for(t=wt,o=[],n=Rt();n!==i;)o.push(n),n=Rt();return o!==i&&(yt=t,o=s(o)),t=o}function Rt(){var t;return(t=function(){var t,n;t=wt,(n=function(){var t,n,e,a,r,s;t=wt,n=[],e=wt,(a=Ct())!==i&&(r=Dt())!==i&&(s=Ct())!==i?e=a=[a,r,s]:(wt=e,e=i);if(e!==i)for(;e!==i;)n.push(e),e=wt,(a=Ct())!==i&&(r=Dt())!==i&&(s=Ct())!==i?e=a=[a,r,s]:(wt=e,e=i);else n=i;n!==i&&(yt=t,n=u(n));(t=n)===i&&(t=wt,n=Lt(),t=n!==i?o.substring(t,wt):n);return t}())!==i&&(yt=t,n=c(n));return t=n}())===i&&(t=function(){var t,n,e,a,r,s,u;t=wt,123===o.charCodeAt(wt)?(n=m,wt++):(n=i,0===xt&&Ot(p));n!==i&&Ct()!==i&&(e=function(){var t,n,e;if((t=Bt())===i){if(t=wt,n=[],f.test(o.charAt(wt))?(e=o.charAt(wt),wt++):(e=i,0===xt&&Ot(l)),e!==i)for(;e!==i;)n.push(e),f.test(o.charAt(wt))?(e=o.charAt(wt),wt++):(e=i,0===xt&&Ot(l));else n=i;t=n!==i?o.substring(t,wt):n}return t}())!==i&&Ct()!==i?(a=wt,44===o.charCodeAt(wt)?(r=d,wt++):(r=i,0===xt&&Ot(v)),r!==i&&(s=Ct())!==i&&(u=function(){var t;(t=function(){var t,n,e,a,r,s;t=wt,o.substr(wt,6)===w?(n=w,wt+=6):(n=i,0===xt&&Ot(y));n===i&&(o.substr(wt,4)===_?(n=_,wt+=4):(n=i,0===xt&&Ot(j)),n===i&&(o.substr(wt,4)===k?(n=k,wt+=4):(n=i,0===xt&&Ot(x))));n!==i&&Ct()!==i?(e=wt,44===o.charCodeAt(wt)?(a=d,wt++):(a=i,0===xt&&Ot(v)),a!==i&&(r=Ct())!==i&&(s=Dt())!==i?e=a=[a,r,s]:(wt=e,e=i),e===i&&(e=null),e!==i?(yt=t,n=A(n,e),t=n):(wt=t,t=i)):(wt=t,t=i);return t}())===i&&(t=function(){var t,n,e,a;t=wt,o.substr(wt,6)===F?(n=F,wt+=6):(n=i,0===xt&&Ot(P));n!==i&&Ct()!==i?(44===o.charCodeAt(wt)?(e=d,wt++):(e=i,0===xt&&Ot(v)),e!==i&&Ct()!==i&&(a=Ut())!==i?(yt=t,n=O(a),t=n):(wt=t,t=i)):(wt=t,t=i);return t}())===i&&(t=function(){var t,n,e,a;t=wt,o.substr(wt,13)===z?(n=z,wt+=13):(n=i,0===xt&&Ot(S));n!==i&&Ct()!==i?(44===o.charCodeAt(wt)?(e=d,wt++):(e=i,0===xt&&Ot(v)),e!==i&&Ct()!==i&&(a=Ut())!==i?(yt=t,n=E(a),t=n):(wt=t,t=i)):(wt=t,t=i);return t}())===i&&(t=function(){var t,n,e,a,r;t=wt,o.substr(wt,6)===R?(n=R,wt+=6):(n=i,0===xt&&Ot(q));if(n!==i)if(Ct()!==i)if(44===o.charCodeAt(wt)?(e=d,wt++):(e=i,0===xt&&Ot(v)),e!==i)if(Ct()!==i){if(a=[],(r=qt())!==i)for(;r!==i;)a.push(r),r=qt();else a=i;a!==i?(yt=t,n=U(a),t=n):(wt=t,t=i)}else wt=t,t=i;else wt=t,t=i;else wt=t,t=i;else wt=t,t=i;return t}());return t}())!==i?a=r=[r,s,u]:(wt=a,a=i),a===i&&(a=null),a!==i&&(r=Ct())!==i?(125===o.charCodeAt(wt)?(s=h,wt++):(s=i,0===xt&&Ot(g)),s!==i?(yt=t,n=b(e,a),t=n):(wt=t,t=i)):(wt=t,t=i)):(wt=t,t=i);return t}()),t}function qt(){var t,n,e,a,r;return t=wt,Ct()!==i&&(n=function(){var t,n,e,a;return t=wt,n=wt,61===o.charCodeAt(wt)?(e=L,wt++):(e=i,0===xt&&Ot(C)),e!==i&&(a=Bt())!==i?n=e=[e,a]:(wt=n,n=i),(t=n!==i?o.substring(t,wt):n)===i&&(t=Dt()),t}())!==i&&Ct()!==i?(123===o.charCodeAt(wt)?(e=m,wt++):(e=i,0===xt&&Ot(p)),e!==i&&Ct()!==i&&(a=Et())!==i&&Ct()!==i?(125===o.charCodeAt(wt)?(r=h,wt++):(r=i,0===xt&&Ot(g)),r!==i?(yt=t,t=M(n,a)):(wt=t,t=i)):(wt=t,t=i)):(wt=t,t=i),t}function Ut(){var t,n,e,a;if(t=wt,(n=function(){var t,n,e;return t=wt,o.substr(wt,7)===T?(n=T,wt+=7):(n=i,0===xt&&Ot(B)),n!==i&&Ct()!==i&&(e=Bt())!==i?(yt=t,t=n=N(e)):(wt=t,t=i),t}())===i&&(n=null),n!==i)if(Ct()!==i){if(e=[],(a=qt())!==i)for(;a!==i;)e.push(a),a=qt();else e=i;e!==i?(yt=t,t=n=D(n,e)):(wt=t,t=i)}else wt=t,t=i;else wt=t,t=i;return t}function Lt(){var t,n;if(xt++,t=[],W.test(o.charAt(wt))?(n=o.charAt(wt),wt++):(n=i,0===xt&&Ot(G)),n!==i)for(;n!==i;)t.push(n),W.test(o.charAt(wt))?(n=o.charAt(wt),wt++):(n=i,0===xt&&Ot(G));else t=i;return xt--,t===i&&(n=i,0===xt&&Ot(I)),t}function Ct(){var t,n,e;for(xt++,t=wt,n=[],e=Lt();e!==i;)n.push(e),e=Lt();return t=n!==i?o.substring(t,wt):n,xt--,t===i&&(n=i,0===xt&&Ot(V)),t}function Mt(){var t;return H.test(o.charAt(wt))?(t=o.charAt(wt),wt++):(t=i,0===xt&&Ot(K)),t}function Tt(){var t;return Z.test(o.charAt(wt))?(t=o.charAt(wt),wt++):(t=i,0===xt&&Ot($)),t}function Bt(){var t,n,e,a,r,s;if(t=wt,48===o.charCodeAt(wt)?(n=J,wt++):(n=i,0===xt&&Ot(Q)),n===i){if(n=wt,e=wt,X.test(o.charAt(wt))?(a=o.charAt(wt),wt++):(a=i,0===xt&&Ot(Y)),a!==i){for(r=[],s=Mt();s!==i;)r.push(s),s=Mt();r!==i?e=a=[a,r]:(wt=e,e=i)}else wt=e,e=i;n=e!==i?o.substring(n,wt):e}return n!==i&&(yt=t,n=tt(n)),t=n}function Nt(){var t,n,e,a,r,s,u,c;return ot.test(o.charAt(wt))?(t=o.charAt(wt),wt++):(t=i,0===xt&&Ot(nt)),t===i&&(t=wt,o.substr(wt,2)===et?(n=et,wt+=2):(n=i,0===xt&&Ot(it)),n!==i&&(yt=t,n=at()),(t=n)===i&&(t=wt,o.substr(wt,2)===rt?(n=rt,wt+=2):(n=i,0===xt&&Ot(st)),n!==i&&(yt=t,n=ut()),(t=n)===i&&(t=wt,o.substr(wt,2)===ct?(n=ct,wt+=2):(n=i,0===xt&&Ot(ft)),n!==i&&(yt=t,n=lt()),(t=n)===i&&(t=wt,o.substr(wt,2)===mt?(n=mt,wt+=2):(n=i,0===xt&&Ot(pt)),n!==i&&(yt=t,n=dt()),(t=n)===i&&(t=wt,o.substr(wt,2)===vt?(n=vt,wt+=2):(n=i,0===xt&&Ot(ht)),n!==i?(e=wt,a=wt,(r=Tt())!==i&&(s=Tt())!==i&&(u=Tt())!==i&&(c=Tt())!==i?a=r=[r,s,u,c]:(wt=a,a=i),(e=a!==i?o.substring(e,wt):a)!==i?(yt=t,t=n=gt(e)):(wt=t,t=i)):(wt=t,t=i)))))),t}function Dt(){var t,o,n;if(t=wt,o=[],(n=Nt())!==i)for(;n!==i;)o.push(n),n=Nt();else o=i;return o!==i&&(yt=t,o=bt(o)),t=o}if((n=r())!==i&&wt===o.length)return n;throw n!==i&&wt=5){var n={title:p("notifications.group",t.data.preferred_locale,{count:o.length+1}),body:o.sort(function(t,o){return t.timestamp/g,"\n").replace(/<\/p>

/g,"\n\n").replace(/<[^>]*>/g,""))},v=function(t){return{action:"expand",icon:"/web-push-icon_expand.png",title:p("status.show_more",t)}},h=function(t){return{action:"reblog",icon:"/web-push-icon_reblog.png",title:p("status.reblog",t)}},g=function(t){return{action:"favourite",icon:"/web-push-icon_favourite.png",title:p("status.favourite",t)}},b=function(t){var o=t.find(function(t){return t.focused}),n=t.find(function(t){return"visible"===t.visibilityState});return o||n||t[0]},w=function(t,o){var n=m(t);return n.actions=n.actions.filter(function(t){return t.action!==o}),self.registration.showNotification(n.title,n)};self.addEventListener("push",function(t){var o=t.data.json(),n=o.access_token,e=o.notification_id,i=o.preferred_locale,a=o.title,r=o.body,s=o.icon;t.waitUntil(l("/api/v1/notifications/"+e,"get",n).then(function(t){var o={};return o.title=p("notification."+t.type,i,{name:t.account.display_name.length>0?t.account.display_name:t.account.username}),o.body=t.status&&d(t.status.content),o.icon=t.account.avatar_static,o.timestamp=t.created_at&&new Date(t.created_at),o.tag=t.id,o.badge="/badge.png",o.image=t.status&&t.status.media_attachments.length>0&&t.status.media_attachments[0].preview_url||void 0,o.data={access_token:n,preferred_locale:i,id:t.status?t.status.id:t.account.id,url:t.status?"/web/statuses/"+t.status.id:"/web/accounts/"+t.account.id},t.status&&t.status.spoiler_text||t.status.sensitive?(o.data.hiddenBody=d(t.status.content),o.data.hiddenImage=t.status.media_attachments.length>0&&t.status.media_attachments[0].preview_url,t.status.spoiler_text&&(o.body=t.status.spoiler_text),o.image=void 0,o.actions=[v(i)]):"mention"===t.type&&(o.actions=[h(i),g(i)]),f(o)}).catch(function(){return f({title:a,body:r,icon:s,tag:e,timestamp:new Date,badge:"/badge.png",data:{access_token:n,preferred_locale:i,url:"/web/notifications"}})}))}),self.addEventListener("notificationclick",function(t){var o=new Promise(function(o,n){if(t.action)if("expand"===t.action)o((r=t.notification,(s=m(r)).body=s.data.hiddenBody,s.image=s.data.hiddenImage,s.actions=[h(r.data.preferred_locale),g(r.data.preferred_locale)],self.registration.showNotification(s.title,s)));else if("reblog"===t.action){var e=t.notification.data;o(l("/api/v1/statuses/"+e.id+"/reblog","post",e.access_token).then(function(){return w(t.notification,"reblog")}))}else if("favourite"===t.action){var i=t.notification.data;o(l("/api/v1/statuses/"+i.id+"/favourite","post",i.access_token).then(function(){return w(t.notification,"favourite")}))}else n("Unknown action: "+t.action);else t.notification.close(),o((a=t.notification.data.url,self.clients.matchAll({type:"window"}).then(function(t){if(0!==t.length){var o=t.filter(function(t){return/\/web\//.test(t.url)});if(0!==o.length){var n=b(o),e=new URL(a,self.location).pathname;if(e.startsWith("/web/"))return n.focus().then(function(t){return t.postMessage({type:"navigate",path:e.slice("/web/".length-1)})})}else if("navigate"in t[0])return b(t).navigate(a).then(function(t){return t.focus()})}return self.clients.openWindow(a)})));var a,r,s});t.waitUntil(o)});function y(){return caches.open("mastodon-web")}function _(){return fetch("/web",{credentials:"include",redirect:"manual"})}self.addEventListener("install",function(t){t.waitUntil(Promise.all([y(),_()]).then(function(t){var o=t[0],n=t[1];return o.put("/web",n)}))}),self.addEventListener("activate",function(t){t.waitUntil(self.clients.claim())}),self.addEventListener("fetch",function(t){var o=new URL(t.request.url);if(o.pathname.startsWith("/web")){if(o.pathname.startsWith("/web/login"))return;var n=_(),e=y();t.respondWith(n.then(function(t){var o=t.clone();return e.then(function(t){return t.put("/web",o)}).catch(),t},function(){return e.then(function(t){return t.match("/web")})}))}else if("/auth/sign_out"===o.pathname){var i=fetch(t.request),a=y();t.respondWith(i.then(function(t){return t.ok||"opaqueredirect"===t.type?Promise.all([a.then(function(t){return t.delete("/web")}),indexedDB.deleteDatabase("mastodon")]).then(function(){return t}):t}))}})}]); \ No newline at end of file