webpackJsonp([11],[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e){return e&&e.__esModule?e:{default:e}}function u(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function r(a,u){try{var o=t[a](u),l=o.value}catch(e){return void n(e)}return o.done?void e(l):Promise.resolve(l).then(function(e){r("next",e)},function(e){r("throw",e)})}return r("next")})}}var o=n(257),l=a(o),i=n(3),c=n(6),p=r(c);i.browser.runtime.onMessage.addListener(function(e,t,n){return e.type==p.MESSAGE_ACTION.AXIOS&&("post"==e.value.type?(e.value.form&&(e.value.data=new FormData,Object.keys(e.value.form).forEach(function(t){return e.value.data.append(t,e.value.form[t])})),e.value.headers?(e.value.method=e.value.type.toUpperCase(),delete e.value.type,(0,l.default)(e.value).then(function(e){return n({done:e})}).catch(function(e){return n({fail:e})})):l.default.post(e.value.url,e.value.data).then(function(e){return n({done:e})}).catch(function(e){return n({fail:e})})):"put"==e.value.type?l.default.put(e.value.url,e.value.content,e.value.data).then(function(e){return n({done:e})}).catch(function(e){return n({fail:e})}):"download"==e.value.type&&(0,l.default)(e.value).then(function(e){return n({done:e})}).catch(function(e){return n({fail:e})})),!0});var f=new Map;i.browser.runtime.onMessage.addListener(function(){var e=u(regeneratorRuntime.mark(function e(t,n,r){var a,u,o,i,c,s,d,v,h;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.type!=p.MESSAGE_ACTION.notion_dl_img){e.next=19;break}return e.prev=1,a=t.value,u=a.url,o=a.protocol,e.next=7,(0,l.default)({method:"get",url:u.replace(/https?:/,o),responseType:"blob"});case 7:i=e.sent,c=i.data,"image/webp"===c.type&&(c=c.slice(0,c.size,"image/jpeg")),f.set(u,c),r({done:{type:c.type,size:c.size,url:u}}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),r({fail:e.t0});case 17:e.next=31;break;case 19:if(t.type!=p.MESSAGE_ACTION.notion_up_img){e.next=31;break}return e.prev=20,s=t.value,d=s.url,v=s.upUrl,h=f.get(d),e.next=24,l.default.put(v,h,{headers:{"Content-Type":h.type}});case 24:f.delete(d),r({done:!0}),e.next=31;break;case 28:e.prev=28,e.t1=e.catch(20),r({fail:e.t1});case 31:return e.abrupt("return",!0);case 32:case"end":return e.stop()}},e,this,[[1,14],[20,28]])}));return function(t,n,r){return e.apply(this,arguments)}}())}]);