diff --git a/p0weruser.dev.user.js b/p0weruser.dev.user.js index c0b88c7..972e8fd 100644 --- a/p0weruser.dev.user.js +++ b/p0weruser.dev.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name p0weruser - Rel0aded [Dev] // @namespace https://github.com/Scarwolf/p0weruser/ -// @version 2.10.1-dev-1712002201849 +// @version 2.10.1-dev-1712002659792 // @author PoTTii - Created by Florian Maak // @description A modularized userScript for pr0gramm.com - Developed by FlorianMaak, Modified by Scarwolf // @license GPL-3.0; http://www.gnu.org/licenses/gpl-3.0.txt @@ -109,14 +109,14 @@ var Es=Object.defineProperty;var Ss=(ae,J,se)=>J in ae?Es(ae,J,{enumerable:!0,co ##TIME## `,Mi=`#inbox-link{position:relative}#inbox-link.active{color:var(--theme-main-color)}#notification-center{display:none;position:absolute;top:52px;right:0px;z-index:100;border:3px solid #2a2e31;background-color:#161618;box-shadow:2px 0 10px #000;min-width:300px;max-height:50vh;flex-direction:column;overflow-y:scroll}#notification-center.visible{display:flex}#notification-center>div{padding:10px;text-align:center;border-top:1px solid #252525}#notification-center #new-messages{padding-left:10px;margin:0}#notification-center #new-messages.loading{text-align:center;justify-content:center;padding:10px}#notification-center #new-messages.loading .fa-spin{font-size:24px}#notification-center #new-messages .simplebar-scrollbar{background:#2a2e31;right:0;border-radius:0}#notification-center #new-messages .simplebar-scrollbar.visible{opacity:1}#notification-center #new-messages li{align-items:center;justify-content:center;display:flex;opacity:.5}#notification-center #new-messages li:not(:last-child){border-bottom:1px solid #252525}#notification-center #new-messages li:hover{opacity:1}#notification-center #new-messages li:hover .headline{color:var(--theme-main-color)}#notification-center #new-messages li.new{opacity:1}#notification-center #new-messages li.new .message:before{content:"\\f0e0"}#notification-center #new-messages li.no-notifications{text-align:center;width:100%;padding:10px}#notification-center #new-messages li .headline{color:#fff;font-weight:700}#notification-center #new-messages li .comment-thumb{height:42px;width:42px}#notification-center #new-messages li .content{padding:10px;flex-grow:1}#notification-center #new-messages li .content small{display:block;font-size:12px;font-weight:400;color:#666}#notification-center #new-messages li .content .time{float:right}#notification-center #new-messages li .content .text{text-overflow:ellipsis;max-width:200px;color:#666;white-space:nowrap;overflow:hidden}#notification-center #new-messages li .content span{font-size:12px}#notification-center #new-messages li .message{width:42px;margin-left:4px;font-size:34px;margin-right:-4px} -`;class rt{constructor(){d(this,"id","NotificationCenter");d(this,"name","Nachrichten Schnellzugriff");d(this,"description","\xD6ffnet neue Benachrichtigungen in einem kleinen Men\xFC");d(this,"showUnreadMessages",x.get("NotificationCenter.settings.show_unread_messages"));d(this,"menuOpen",!1);d(this,"icon",$("#inbox-link"));d(this,"elem",document.createElement("div"));d(this,"messageContainer",null)}static getTitle(n){return n.thumb===null?"Private Nachricht":"Kommentar"}async load(){this.elem.innerHTML=Ai,this.elem.id="notification-center",document.querySelectorAll(".user-info.user-only")[0].appendChild(this.elem),this.messageContainer=document.getElementById("new-messages"),this.addListener(),P(Mi)}getSettings(){return[{id:"show_unread_messages",title:"Ungelesene Nachrichten Anzeigen",description:"Zeigt auch ungelesene Nachrichten an, es werden allerdings nur gelesene hervorgehoben",type:"checkbox"}]}addListener(){this.icon.unbind("click"),this.icon[0].addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.toggleMenu()}),window.addEventListener("click",n=>{this.menuOpen&&($(n.target).parents("#notification-center")[0]||(n.preventDefault(),this.toggleMenu()))})}toggleMenu(){this.menuOpen=!this.menuOpen,this.icon[0].classList.toggle("active"),this.elem.classList.toggle("visible");const n=this.messageContainer;n&&(n.innerHTML='',n.classList.add("loading"),this.getNotifications(!0).then(t=>{let i=t.messages,o=i.filter(a=>!a.read).length;if(n.innerHTML="",n.classList.remove("loading"),p.user.setInboxLink({notifications:0,mentions:0,messages:0,comments:0,follows:0,digests:0}),o<=0){let a=document.createElement("li");if(a.innerText="Keine neuen Benachrichtigungen!",a.className="no-notifications",n.appendChild(a),!this.showUnreadMessages)return!1}i.filter(a=>a.message!==null).forEach(a=>{this.addEntry(rt.getTitle(a),a.name,a.created,a.thumb,a.mark,a.itemId,a.id,a.message,a.read)})}))}getNotifications(n=!1){return new Promise((t,i)=>{p.api.get(n?"inbox.all":"inbox.conversations",{},t,i)})}addEntry(n,t,i,o,a,c,s,m,r){var f;let l=document.createElement("li");l.id=`notification-${s}`;let b='',h=o?`/new/${c}:comment${s}`:`/inbox/messages/${t}`;o?b=b.replace("##THUMB",o):b='',t===null&&(t="Systembenachrichtigung"),l.innerHTML=Ni.replace("##TITLE##",n).replace("##USER##",t).replace("##TIME##",new Intl.DateTimeFormat("de-DE",{dateStyle:"medium",timeStyle:"short"}).format(new Date(i*1e3))).replace("##THUMB##",b).replace("##URL##",h).replace("##MARK##",a).replace("##TEXT##",G.escapeHtml(m)),$(l).on("click",g=>{g.preventDefault();const y=$(g.target).closest("a").first().attr("href");y&&(this.menuOpen&&this.toggleMenu(),p.navigateTo(y.substring(1)))}),r||l.classList.add("new"),(f=this.messageContainer)==null||f.appendChild(l)}}const $i=`.repost-link{margin-left:15px}.repost-link .fa{color:#f2f5f4;margin-right:5px}.rep0sts{width:33vw;background-color:#161618;border-left:3px solid #2a2e31;overflow-y:auto;overflow-x:clip;height:100%}.rep0sts .sidebar-head{display:flex;align-items:center;background-color:#2a2e31;text-align:left;padding:10px;transition:width .2s ease-out;z-index:400;width:30vw;margin-left:-10px}.rep0sts .sidebar-head .sidebar-label{margin-left:5px}.rep0sts .sidebar-head .close{cursor:pointer;position:fixed;right:10px}.rep0sts a{display:block;margin-bottom:5px;position:relative}.rep0sts a img{max-width:100%}.rep0sts a span{position:absolute;left:5px;bottom:10px;text-shadow:1px 1px 0px black;color:#f2f5f4}.rep0sts a span:hover{color:#75c0c7}.item-container .loader{font-size:45px;margin-top:30px;width:15vw}.probability{position:absolute;top:5px;right:5px;font-weight:700;color:red}.probability:hover{color:#fff;background-color:#2a2e31;border-radius:10px;padding:2px 10px} -`;class Bi{constructor(){d(this,"closeBtn",{});d(this,"id","Rep0st");d(this,"name","Rep0st Check");d(this,"description","Frage rene8888, ob es sich um einen rep0st handelt.");d(this,"visible",!1);d(this,"$loader")}async load(){let n=this;p.View.Stream.Item=p.View.Stream.Item.extend({show:function(t,i,o,a){this.parent(t,i,o,a),n.addButton(this.$container)},remove:function(){this.parent(),n.visible=!1}}),G.addVideoConstants(),P($i)}addButton(n){const t=n.find('.item-image-actual:not([src*=".gif"])');if(this.$loader=$(''),t[0]&&t[0].tagName!=="VIDEO"){const i=$(' rep0st?');n.find(".item-details .user").after(i),i[0].addEventListener("click",()=>{this.visible||this.checkImage(n,t)})}}checkImage(n,t){let i=new FormData,o=$("
"),a=$('
'),c=$(''),s=$('');c.append(s),a.append(c),a.append(this.$loader),n.find(".image-main").after(a),s[0].addEventListener("click",()=>{this.visible=!1,a.remove()}),i.append("image",new Blob([],{type:"application/octet-stream"}),""),i.append("url",t[0].src);let m=p.user.flagsName.split("+");m=m.indexOf("all")!==-1?["sfw","nsfw","nsfl","pol"]:m;for(const r of m)i.append("filter",r);at({url:"https://rep0st.rene8888.at/",method:"POST",headers:{"cache-control":"no-cache","Upgrade-Insecure-Requests":"1",Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"},overrideMimeType:"multipart/form-data",data:i,onload:r=>{let l=[];this.visible=!0,this.$loader.remove(),o.html(r.responseText);const b=o.find(".search-results a");let h=this.getCurrentPostId();for(let f=1;f${i.probability}`;n.append($(`${o}`)).find(`a[href='${i.url}'] > .fa.fa-comment`)[0].addEventListener("click",s=>{s.preventDefault();let m=$(document.body);const r=`Re: ${i.url}`;let l=m.find(".comment:not(.reply)"),b=m.find(".tag-form");l[0].value=r,l.parent().find('input[type="submit"]')[0].click(),b.find(".item-tagsinput")[0].value="repost",b.find('input[type="submit"]').click()})}}}class ct{constructor(){d(this,"id","RepostMarker");d(this,"name","Repost Markierung");d(this,"description","Markiert Reposts in der \xDCbersicht")}static markRepost(n){let t=document.getElementById("item-"+n);t&&t.classList.add("repost")}async load(){}async loadReposts(n){const t=await new Promise((i,o)=>{p.api.get("items.get",{...n,tags:"repost"},i,o)});for(const i of t.items)ct.markRepost(i.id)}}class Fi{constructor(){d(this,"id","StatisticsLinkInNavbar");d(this,"name","Link to Statistics");d(this,"description","(Pr0mium) Verlinkt in der Navigation-Bar rechts oben auf die neue Statistik-Seite");d(this,"target",document.getElementsByClassName("user-info user-only")[0])}async load(){this.addStatsLink()}addStatsLink(){let n=document.createElement("a"),t=document.createTextNode("Statistiken");n.classList.add("head-link"),n.id="user-link-stats",n.appendChild(t),n.setAttribute("href","https://pr0gramm.com/userstats"),n.setAttribute("style","margin-left: 8px"),this.target.appendChild(n)}}const Di=`.transparent#head{width:100%!important;display:flex;justify-content:center;background-color:#000000e6}@supports (backdrop-filter: blur()){.transparent#head{background-color:#00000094!important;backdrop-filter:blur(30px)}}.transparent#head #head-content{background-color:transparent;width:1052px} +`;class rt{constructor(){d(this,"id","NotificationCenter");d(this,"name","Nachrichten Schnellzugriff");d(this,"description","\xD6ffnet neue Benachrichtigungen in einem kleinen Men\xFC");d(this,"showUnreadMessages",x.get("NotificationCenter.settings.show_unread_messages"));d(this,"menuOpen",!1);d(this,"icon",$("#inbox-link"));d(this,"elem",document.createElement("div"));d(this,"messageContainer",null)}static getTitle(n){return n.thumb===null?"Private Nachricht":"Kommentar"}async load(){this.elem.innerHTML=Ai,this.elem.id="notification-center",document.querySelectorAll(".user-info.user-only")[0].appendChild(this.elem),this.messageContainer=document.getElementById("new-messages"),this.addListener(),P(Mi)}getSettings(){return[{id:"show_unread_messages",title:"Ungelesene Nachrichten Anzeigen",description:"Zeigt auch ungelesene Nachrichten an, es werden allerdings nur gelesene hervorgehoben",type:"checkbox"}]}addListener(){this.icon.unbind("click"),this.icon[0].addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.toggleMenu()}),window.addEventListener("click",n=>{this.menuOpen&&($(n.target).parents("#notification-center")[0]||(n.preventDefault(),this.toggleMenu()))})}toggleMenu(){this.menuOpen=!this.menuOpen,this.icon[0].classList.toggle("active"),this.elem.classList.toggle("visible");const n=this.messageContainer;n&&(n.innerHTML='',n.classList.add("loading"),this.getNotifications(!0).then(t=>{let i=t.messages,o=i.filter(a=>!a.read).length;if(n.innerHTML="",n.classList.remove("loading"),p.user.setInboxLink({notifications:0,mentions:0,messages:0,comments:0,follows:0,digests:0}),o<=0){let a=document.createElement("li");if(a.innerText="Keine neuen Benachrichtigungen!",a.className="no-notifications",n.appendChild(a),!this.showUnreadMessages)return!1}i.filter(a=>a.message!==null).forEach(a=>{this.addEntry(rt.getTitle(a),a.name,a.created,a.thumb,a.mark,a.itemId,a.id,a.message,a.read)})}))}getNotifications(n=!1){return new Promise((t,i)=>{p.api.get(n?"inbox.all":"inbox.conversations",{},t,i)})}addEntry(n,t,i,o,a,c,s,m,r){var g;const l=document.createElement("li");l.id=`notification-${s}`;let b='';const h=t===null,f=o?`/new/${c}:comment${s}`:h?"/inbox/notifications":`/inbox/messages/${t}`;o?b=b.replace("##THUMB",o):b='',h&&(t="Systembenachrichtigung"),l.innerHTML=Ni.replace("##TITLE##",n).replace("##USER##",t).replace("##TIME##",new Intl.DateTimeFormat("de-DE",{dateStyle:"medium",timeStyle:"short"}).format(new Date(i*1e3))).replace("##THUMB##",b).replace("##URL##",f).replace("##MARK##",a).replace("##TEXT##",G.escapeHtml(m)),$(l).on("click",I=>{I.preventDefault();const _=$(I.target).closest("a").first().attr("href");_&&(this.menuOpen&&this.toggleMenu(),p.navigateTo(_.substring(1)))}),r||l.classList.add("new"),(g=this.messageContainer)==null||g.appendChild(l)}}const $i=`.repost-link{margin-left:15px}.repost-link .fa{color:#f2f5f4;margin-right:5px}.rep0sts{width:33vw;background-color:#161618;border-left:3px solid #2a2e31;overflow-y:auto;overflow-x:clip;height:100%}.rep0sts .sidebar-head{display:flex;align-items:center;background-color:#2a2e31;text-align:left;padding:10px;transition:width .2s ease-out;z-index:400;width:30vw;margin-left:-10px}.rep0sts .sidebar-head .sidebar-label{margin-left:5px}.rep0sts .sidebar-head .close{cursor:pointer;position:fixed;right:10px}.rep0sts a{display:block;margin-bottom:5px;position:relative}.rep0sts a img{max-width:100%}.rep0sts a span{position:absolute;left:5px;bottom:10px;text-shadow:1px 1px 0px black;color:#f2f5f4}.rep0sts a span:hover{color:#75c0c7}.item-container .loader{font-size:45px;margin-top:30px;width:15vw}.probability{position:absolute;top:5px;right:5px;font-weight:700;color:red}.probability:hover{color:#fff;background-color:#2a2e31;border-radius:10px;padding:2px 10px} +`;class Bi{constructor(){d(this,"closeBtn",{});d(this,"id","Rep0st");d(this,"name","Rep0st Check");d(this,"description","Frage rene8888, ob es sich um einen rep0st handelt.");d(this,"visible",!1);d(this,"$loader")}async load(){let n=this;p.View.Stream.Item=p.View.Stream.Item.extend({show:function(t,i,o,a){this.parent(t,i,o,a),n.addButton(this.$container)},remove:function(){this.parent(),n.visible=!1}}),G.addVideoConstants(),P($i)}addButton(n){const t=n.find('.item-image-actual:not([src*=".gif"])');if(this.$loader=$(''),t[0]&&t[0].tagName!=="VIDEO"){const i=$(' rep0st?');n.find(".item-details .user").after(i),i[0].addEventListener("click",()=>{this.visible||this.checkImage(n,t)})}}checkImage(n,t){let i=new FormData,o=$("
"),a=$('
'),c=$(''),s=$('');c.append(s),a.append(c),a.append(this.$loader),n.find(".image-main").after(a),s[0].addEventListener("click",()=>{this.visible=!1,a.remove()}),i.append("image",new Blob([],{type:"application/octet-stream"}),""),i.append("url",t[0].src);let m=p.user.flagsName.split("+");m=m.indexOf("all")!==-1?["sfw","nsfw","nsfl","pol"]:m;for(const r of m)i.append("filter",r);at({url:"https://rep0st.rene8888.at/",method:"POST",headers:{"cache-control":"no-cache","Upgrade-Insecure-Requests":"1",Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"},overrideMimeType:"multipart/form-data",data:i,onload:r=>{let l=[];this.visible=!0,this.$loader.remove(),o.html(r.responseText);const b=o.find(".search-results a");let h=this.getCurrentPostId();for(let f=1;f${i.probability}`;n.append($(`${o}`)).find(`a[href='${i.url}'] > .fa.fa-comment`)[0].addEventListener("click",s=>{s.preventDefault();let m=$(document.body);const r=`Re: ${i.url}`;let l=m.find(".comment:not(.reply)"),b=m.find(".tag-form");l[0].value=r,l.parent().find('input[type="submit"]')[0].click(),b.find(".item-tagsinput")[0].value="repost",b.find('input[type="submit"]').click()})}}}class ct{constructor(){d(this,"id","RepostMarker");d(this,"name","Repost Markierung");d(this,"description","Markiert Reposts in der \xDCbersicht")}static markRepost(n){let t=document.getElementById("item-"+n);t&&t.classList.add("repost")}async load(){}async loadReposts(n){const t=await new Promise((i,o)=>{p.api.get("items.get",{...n,tags:"repost"},i,o)});for(const i of t.items)ct.markRepost(i.id)}}class Fi{constructor(){d(this,"id","StatisticsLinkInNavbar");d(this,"name","Link to Statistics");d(this,"description","(Pr0mium) Verlinkt in der Navigation-Bar rechts oben auf die neue Statistik-Seite");d(this,"target",document.getElementsByClassName("user-info user-only")[0])}async load(){this.addStatsLink()}addStatsLink(){let n=document.createElement("a"),t=document.createTextNode("Statistiken");n.classList.add("head-link"),n.id="user-link-stats",n.appendChild(t),n.setAttribute("href","https://pr0gramm.com/userstats"),n.setAttribute("style","margin-left: 8px"),this.target.appendChild(n)}}const Di=`.transparent#head{width:100%!important;display:flex;justify-content:center;background-color:#000000e6}@supports (backdrop-filter: blur()){.transparent#head{background-color:#00000094!important;backdrop-filter:blur(30px)}}.transparent#head #head-content{background-color:transparent;width:1052px} `;class Ri{constructor(){d(this,"id","StyleCustomization");d(this,"name","Stilisierung");d(this,"description","Einzelne Styleanpassungen");d(this,"isTransparentNavbarEnabled",x.get(`${this.id}.settings.transparent_navbar`));d(this,"hideBenis",x.get(`${this.id}.settings.hide_benis`,!1))}async load(){var n;if(this.isTransparentNavbarEnabled===!0&&((n=document.getElementById("head"))==null||n.classList.add("transparent")),P(Di),this.hideBenis===!0){const t=document.createElement("style");t.innerText=` .score, .user-score { color: transparent; } `,document.head.appendChild(t)}}getSettings(){return[{id:"transparent_navbar",title:"Transparente Navigationsleiste",description:'Die Navigationsleiste wird transparent angezeigt. Inspieriert von Augenzuckerl von @holzmaster. Au\xDFerdem wird das Navigationsmen\xFC auch im Widescreen Mode zentriert dargestellt.',type:"checkbox"},{id:"hide_benis",title:"Versteckt den Benis",description:"Versteckt den Benis bei Posts, Kommenteren und Nutzern. Der Benis wird nur \xFCber unsichtbare Schrift versteckt und kann \xFCber eine Markierung sichtbar gemacht werden - wie Zaubertinte",type:"checkbox"}]}}const Oi=`.thumb.viewed{position:relative}.thumb.viewed:after{font-family:FontAwesome,sans-serif}.thumb.viewed:not(.repost):after,.thumb.viewed .active:after{content:"\\f00c";position:absolute;color:#fff;z-index:4;left:0;font-weight:700;font-size:18px;top:0;right:0;bottom:0;background-color:#000000bf;display:flex;align-items:center;justify-content:center;height:inherit;width:inherit;border:none!important}.thumb.viewed.repost:after{content:"rep0st / \\f00c"} -`;/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Ui=4,Pt=0,jt=1,Vi=2;function ue(e){let n=e.length;for(;--n>=0;)e[n]=0}const Zi=0,Ht=1,Pi=2,ji=3,Hi=258,lt=29,Se=256,Le=Se+1+lt,ge=30,dt=19,Wt=2*Le+1,re=15,mt=16,Wi=7,ft=256,Kt=16,Gt=17,Xt=18,ht=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Pe=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Ki=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),qt=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gi=512,X=new Array((Le+2)*2);ue(X);const Te=new Array(ge*2);ue(Te);const Ce=new Array(Gi);ue(Ce);const ze=new Array(Hi-ji+1);ue(ze);const pt=new Array(lt);ue(pt);const je=new Array(ge);ue(je);function ut(e,n,t,i,o){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=i,this.max_length=o,this.has_stree=e&&e.length}let Yt,Jt,Qt;function gt(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}const en=e=>e<256?Ce[e]:Ce[256+(e>>>7)],Ie=(e,n)=>{e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255},R=(e,n,t)=>{e.bi_valid>mt-t?(e.bi_buf|=n<>mt-e.bi_valid,e.bi_valid+=t-mt):(e.bi_buf|=n<{R(e,t[n*2],t[n*2+1])},tn=(e,n)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1},Xi=e=>{e.bi_valid===16?(Ie(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},qi=(e,n)=>{const t=n.dyn_tree,i=n.max_code,o=n.stat_desc.static_tree,a=n.stat_desc.has_stree,c=n.stat_desc.extra_bits,s=n.stat_desc.extra_base,m=n.stat_desc.max_length;let r,l,b,h,f,g,I=0;for(h=0;h<=re;h++)e.bl_count[h]=0;for(t[e.heap[e.heap_max]*2+1]=0,r=e.heap_max+1;rm&&(h=m,I++),t[l*2+1]=h,!(l>i)&&(e.bl_count[h]++,f=0,l>=s&&(f=c[l-s]),g=t[l*2],e.opt_len+=g*(h+f),a&&(e.static_len+=g*(o[l*2+1]+f)));if(I!==0){do{for(h=m-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[m]--,I-=2}while(I>0);for(h=m;h!==0;h--)for(l=e.bl_count[h];l!==0;)b=e.heap[--r],!(b>i)&&(t[b*2+1]!==h&&(e.opt_len+=(h-t[b*2+1])*t[b*2],t[b*2+1]=h),l--)}},nn=(e,n,t)=>{const i=new Array(re+1);let o=0,a,c;for(a=1;a<=re;a++)o=o+t[a-1]<<1,i[a]=o;for(c=0;c<=n;c++){let s=e[c*2+1];s!==0&&(e[c*2]=tn(i[s]++,s))}},Yi=()=>{let e,n,t,i,o;const a=new Array(re+1);for(t=0,i=0;i>=7;i{let n;for(n=0;n{e.bi_valid>8?Ie(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},sn=(e,n,t,i)=>{const o=n*2,a=t*2;return e[o]{const i=e.heap[t];let o=t<<1;for(;o<=e.heap_len&&(o{let i,o,a=0,c,s;if(e.sym_next!==0)do i=e.pending_buf[e.sym_buf+a++]&255,i+=(e.pending_buf[e.sym_buf+a++]&255)<<8,o=e.pending_buf[e.sym_buf+a++],i===0?j(e,o,n):(c=ze[o],j(e,c+Se+1,n),s=ht[c],s!==0&&(o-=pt[c],R(e,o,s)),i--,c=en(i),j(e,c,t),s=Pe[c],s!==0&&(i-=je[c],R(e,i,s)));while(a{const t=n.dyn_tree,i=n.stat_desc.static_tree,o=n.stat_desc.has_stree,a=n.stat_desc.elems;let c,s,m=-1,r;for(e.heap_len=0,e.heap_max=Wt,c=0;c>1;c>=1;c--)bt(e,t,c);r=a;do c=e.heap[1],e.heap[1]=e.heap[e.heap_len--],bt(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=c,e.heap[--e.heap_max]=s,t[r*2]=t[c*2]+t[s*2],e.depth[r]=(e.depth[c]>=e.depth[s]?e.depth[c]:e.depth[s])+1,t[c*2+1]=t[s*2+1]=r,e.heap[1]=r++,bt(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],qi(e,n),nn(t,m,e.bl_count)},cn=(e,n,t)=>{let i,o=-1,a,c=n[0*2+1],s=0,m=7,r=4;for(c===0&&(m=138,r=3),n[(t+1)*2+1]=65535,i=0;i<=t;i++)a=c,c=n[(i+1)*2+1],!(++s{let i,o=-1,a,c=n[0*2+1],s=0,m=7,r=4;for(c===0&&(m=138,r=3),i=0;i<=t;i++)if(a=c,c=n[(i+1)*2+1],!(++s{let n;for(cn(e,e.dyn_ltree,e.l_desc.max_code),cn(e,e.dyn_dtree,e.d_desc.max_code),vt(e,e.bl_desc),n=dt-1;n>=3&&e.bl_tree[qt[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n},Qi=(e,n,t,i)=>{let o;for(R(e,n-257,5),R(e,t-1,5),R(e,i-4,4),o=0;o{let n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return Pt;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return jt;for(t=32;t{dn||(Yi(),dn=!0),e.l_desc=new gt(e.dyn_ltree,Yt),e.d_desc=new gt(e.dyn_dtree,Jt),e.bl_desc=new gt(e.bl_tree,Qt),e.bi_buf=0,e.bi_valid=0,on(e)},mn=(e,n,t,i)=>{R(e,(Zi<<1)+(i?1:0),3),an(e),Ie(e,t),Ie(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t},no=e=>{R(e,Ht<<1,3),j(e,ft,X),Xi(e)},io=(e,n,t,i)=>{let o,a,c=0;e.level>0?(e.strm.data_type===Vi&&(e.strm.data_type=eo(e)),vt(e,e.l_desc),vt(e,e.d_desc),c=Ji(e),o=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=o&&(o=a)):o=a=t+5,t+4<=o&&n!==-1?mn(e,n,t,i):e.strategy===Ui||a===o?(R(e,(Ht<<1)+(i?1:0),3),rn(e,X,Te)):(R(e,(Pi<<1)+(i?1:0),3),Qi(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),rn(e,e.dyn_ltree,e.dyn_dtree)),on(e),i&&an(e)},oo=(e,n,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(ze[t]+Se+1)*2]++,e.dyn_dtree[en(n)*2]++),e.sym_next===e.sym_end);var ao=to,so=mn,ro=io,co=oo,lo=no,mo={_tr_init:ao,_tr_stored_block:so,_tr_flush_block:ro,_tr_tally:co,_tr_align:lo},Ae=(e,n,t,i)=>{let o=e&65535|0,a=e>>>16&65535|0,c=0;for(;t!==0;){c=t>2e3?2e3:t,t-=c;do o=o+n[i++]|0,a=a+o|0;while(--c);o%=65521,a%=65521}return o|a<<16|0};const fo=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},ho=new Uint32Array(fo());var M=(e,n,t,i)=>{const o=ho,a=i+t;e^=-1;for(let c=i;c>>8^o[(e^n[c])&255];return e^-1},be={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ne={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:po,_tr_stored_block:_t,_tr_flush_block:uo,_tr_tally:ee,_tr_align:go}=mo,{Z_NO_FLUSH:te,Z_PARTIAL_FLUSH:bo,Z_FULL_FLUSH:vo,Z_FINISH:V,Z_BLOCK:fn,Z_OK:F,Z_STREAM_END:hn,Z_STREAM_ERROR:H,Z_DATA_ERROR:_o,Z_BUF_ERROR:wt,Z_DEFAULT_COMPRESSION:wo,Z_FILTERED:xo,Z_HUFFMAN_ONLY:He,Z_RLE:yo,Z_FIXED:ko,Z_DEFAULT_STRATEGY:Eo,Z_UNKNOWN:So,Z_DEFLATED:We}=Ne,Lo=9,To=15,Co=8,zo=29,xt=256+1+zo,Io=30,Ao=19,No=2*xt+1,Mo=15,E=3,ne=258,W=ne+E+1,$o=32,ve=42,yt=57,kt=69,Et=73,St=91,Lt=103,ce=113,Me=666,D=1,_e=2,le=3,we=4,Bo=3,de=(e,n)=>(e.msg=be[n],n),pn=e=>e*2-(e>4?9:0),ie=e=>{let n=e.length;for(;--n>=0;)e[n]=0},Fo=e=>{let n,t,i,o=e.w_size;n=e.hash_size,i=n;do t=e.head[--i],e.head[i]=t>=o?t-o:0;while(--n);n=o,i=n;do t=e.prev[--i],e.prev[i]=t>=o?t-o:0;while(--n)};let oe=(e,n,t)=>(n<{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},U=(e,n)=>{uo(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,O(e.strm)},C=(e,n)=>{e.pending_buf[e.pending++]=n},$e=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255},Tt=(e,n,t,i)=>{let o=e.avail_in;return o>i&&(o=i),o===0?0:(e.avail_in-=o,n.set(e.input.subarray(e.next_in,e.next_in+o),t),e.state.wrap===1?e.adler=Ae(e.adler,n,o,t):e.state.wrap===2&&(e.adler=M(e.adler,n,o,t)),e.next_in+=o,e.total_in+=o,o)},un=(e,n)=>{let t=e.max_chain_length,i=e.strstart,o,a,c=e.prev_length,s=e.nice_match;const m=e.strstart>e.w_size-W?e.strstart-(e.w_size-W):0,r=e.window,l=e.w_mask,b=e.prev,h=e.strstart+ne;let f=r[i+c-1],g=r[i+c];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=n,!(r[o+c]!==g||r[o+c-1]!==f||r[o]!==r[i]||r[++o]!==r[i+1])){i+=2,o++;do;while(r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&ic){if(e.match_start=n,c=a,a>=s)break;f=r[i+c-1],g=r[i+c]}}while((n=b[n&l])>m&&--t!==0);return c<=e.lookahead?c:e.lookahead},xe=e=>{const n=e.w_size;let t,i,o;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-W)&&(e.window.set(e.window.subarray(n,n+n-i),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),Fo(e),i+=n),e.strm.avail_in===0)break;if(t=Tt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=E)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=oe(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=oe(e,e.ins_h,e.window[o+E-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,i,o,a,c=0,s=e.strm.avail_in;do{if(i=65535,a=e.bi_valid+42>>3,e.strm.avail_outo+e.strm.avail_in&&(i=o+e.strm.avail_in),i>a&&(i=a),i>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,O(e.strm),o&&(o>i&&(o=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+o),e.strm.next_out),e.strm.next_out+=o,e.strm.avail_out-=o,e.strm.total_out+=o,e.block_start+=o,i-=o),i&&(Tt(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(c===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_watera&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Tt(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,t=a>e.w_size?e.w_size:a,o=e.strstart-e.block_start,(o>=t||(o||n===V)&&n!==te&&e.strm.avail_in===0&&o<=a)&&(i=o>a?a:o,c=n===V&&e.strm.avail_in===0&&i===o?1:0,_t(e,e.block_start,i,c),e.block_start+=i,O(e.strm)),c?le:D)},Ct=(e,n)=>{let t,i;for(;;){if(e.lookahead=E&&(e.ins_h=oe(e,e.ins_h,e.window[e.strstart+E-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-W&&(e.match_length=un(e,t)),e.match_length>=E)if(i=ee(e,e.strstart-e.match_start,e.match_length-E),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=E){e.match_length--;do e.strstart++,e.ins_h=oe(e,e.ins_h,e.window[e.strstart+E-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=oe(e,e.ins_h,e.window[e.strstart+1]);else i=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(U(e,!1),e.strm.avail_out===0))return D}return e.insert=e.strstart{let t,i,o;for(;;){if(e.lookahead=E&&(e.ins_h=oe(e,e.ins_h,e.window[e.strstart+E-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=E-1,t!==0&&e.prev_length4096)&&(e.match_length=E-1)),e.prev_length>=E&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-E,i=ee(e,e.strstart-1-e.prev_match,e.prev_length-E),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=oe(e,e.ins_h,e.window[e.strstart+E-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=E-1,e.strstart++,i&&(U(e,!1),e.strm.avail_out===0))return D}else if(e.match_available){if(i=ee(e,0,e.window[e.strstart-1]),i&&U(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return D}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=ee(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let t,i,o,a;const c=e.window;for(;;){if(e.lookahead<=ne){if(xe(e),e.lookahead<=ne&&n===te)return D;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=E&&e.strstart>0&&(o=e.strstart-1,i=c[o],i===c[++o]&&i===c[++o]&&i===c[++o])){a=e.strstart+ne;do;while(i===c[++o]&&i===c[++o]&&i===c[++o]&&i===c[++o]&&i===c[++o]&&i===c[++o]&&i===c[++o]&&i===c[++o]&&oe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=E?(t=ee(e,1,e.match_length-E),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(U(e,!1),e.strm.avail_out===0))return D}return e.insert=0,n===V?(U(e,!0),e.strm.avail_out===0?le:we):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?D:_e},Ro=(e,n)=>{let t;for(;;){if(e.lookahead===0&&(xe(e),e.lookahead===0)){if(n===te)return D;break}if(e.match_length=0,t=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(U(e,!1),e.strm.avail_out===0))return D}return e.insert=0,n===V?(U(e,!0),e.strm.avail_out===0?le:we):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?D:_e};function K(e,n,t,i,o){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=i,this.func=o}const Be=[new K(0,0,0,0,gn),new K(4,4,8,4,Ct),new K(4,5,16,8,Ct),new K(4,6,32,32,Ct),new K(4,4,16,16,ye),new K(8,16,32,32,ye),new K(8,16,128,128,ye),new K(8,32,128,256,ye),new K(32,128,258,1024,ye),new K(32,258,258,4096,ye)],Oo=e=>{e.window_size=2*e.w_size,ie(e.head),e.max_lazy_match=Be[e.level].max_lazy,e.good_match=Be[e.level].good_length,e.nice_match=Be[e.level].nice_length,e.max_chain_length=Be[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=E-1,e.match_available=0,e.ins_h=0};function Uo(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=We,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(No*2),this.dyn_dtree=new Uint16Array((2*Io+1)*2),this.bl_tree=new Uint16Array((2*Ao+1)*2),ie(this.dyn_ltree),ie(this.dyn_dtree),ie(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Mo+1),this.heap=new Uint16Array(2*xt+1),ie(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*xt+1),ie(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Fe=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.status!==ve&&n.status!==yt&&n.status!==kt&&n.status!==Et&&n.status!==St&&n.status!==Lt&&n.status!==ce&&n.status!==Me?1:0},bn=e=>{if(Fe(e))return de(e,H);e.total_in=e.total_out=0,e.data_type=So;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?yt:n.wrap?ve:ce,e.adler=n.wrap===2?0:1,n.last_flush=-2,po(n),F},vn=e=>{const n=bn(e);return n===F&&Oo(e.state),n},Vo=(e,n)=>Fe(e)||e.state.wrap!==2?H:(e.state.gzhead=n,F),_n=(e,n,t,i,o,a)=>{if(!e)return H;let c=1;if(n===wo&&(n=6),i<0?(c=0,i=-i):i>15&&(c=2,i-=16),o<1||o>Lo||t!==We||i<8||i>15||n<0||n>9||a<0||a>ko||i===8&&c!==1)return de(e,H);i===8&&(i=9);const s=new Uo;return e.state=s,s.strm=e,s.status=ve,s.wrap=c,s.gzhead=null,s.w_bits=i,s.w_size=1<_n(e,n,We,To,Co,Eo),Po=(e,n)=>{if(Fe(e)||n>fn||n<0)return e?de(e,H):H;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===Me&&n!==V)return de(e,e.avail_out===0?wt:H);const i=t.last_flush;if(t.last_flush=n,t.pending!==0){if(O(e),e.avail_out===0)return t.last_flush=-1,F}else if(e.avail_in===0&&pn(n)<=pn(i)&&n!==V)return de(e,wt);if(t.status===Me&&e.avail_in!==0)return de(e,wt);if(t.status===ve&&t.wrap===0&&(t.status=ce),t.status===ve){let o=We+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=He||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,o|=a<<6,t.strstart!==0&&(o|=$o),o+=31-o%31,$e(t,o),t.strstart!==0&&($e(t,e.adler>>>16),$e(t,e.adler&65535)),e.adler=1,t.status=ce,O(e),t.pending!==0)return t.last_flush=-1,F}if(t.status===yt){if(e.adler=0,C(t,31),C(t,139),C(t,8),t.gzhead)C(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),C(t,t.gzhead.time&255),C(t,t.gzhead.time>>8&255),C(t,t.gzhead.time>>16&255),C(t,t.gzhead.time>>24&255),C(t,t.level===9?2:t.strategy>=He||t.level<2?4:0),C(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(C(t,t.gzhead.extra.length&255),C(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=M(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=kt;else if(C(t,0),C(t,0),C(t,0),C(t,0),C(t,0),C(t,t.level===9?2:t.strategy>=He||t.level<2?4:0),C(t,Bo),t.status=ce,O(e),t.pending!==0)return t.last_flush=-1,F}if(t.status===kt){if(t.gzhead.extra){let o=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let s=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>o&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o)),t.gzindex+=s,O(e),t.pending!==0)return t.last_flush=-1,F;o=0,a-=s}let c=new Uint8Array(t.gzhead.extra);t.pending_buf.set(c.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>o&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o)),t.gzindex=0}t.status=Et}if(t.status===Et){if(t.gzhead.name){let o=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>o&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o)),O(e),t.pending!==0)return t.last_flush=-1,F;o=0}t.gzindexo&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o)),t.gzindex=0}t.status=St}if(t.status===St){if(t.gzhead.comment){let o=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>o&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o)),O(e),t.pending!==0)return t.last_flush=-1,F;o=0}t.gzindexo&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o))}t.status=Lt}if(t.status===Lt){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(O(e),t.pending!==0))return t.last_flush=-1,F;C(t,e.adler&255),C(t,e.adler>>8&255),e.adler=0}if(t.status=ce,O(e),t.pending!==0)return t.last_flush=-1,F}if(e.avail_in!==0||t.lookahead!==0||n!==te&&t.status!==Me){let o=t.level===0?gn(t,n):t.strategy===He?Ro(t,n):t.strategy===yo?Do(t,n):Be[t.level].func(t,n);if((o===le||o===we)&&(t.status=Me),o===D||o===le)return e.avail_out===0&&(t.last_flush=-1),F;if(o===_e&&(n===bo?go(t):n!==fn&&(_t(t,0,0,!1),n===vo&&(ie(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),O(e),e.avail_out===0))return t.last_flush=-1,F}return n!==V?F:t.wrap<=0?hn:(t.wrap===2?(C(t,e.adler&255),C(t,e.adler>>8&255),C(t,e.adler>>16&255),C(t,e.adler>>24&255),C(t,e.total_in&255),C(t,e.total_in>>8&255),C(t,e.total_in>>16&255),C(t,e.total_in>>24&255)):($e(t,e.adler>>>16),$e(t,e.adler&65535)),O(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?F:hn)},jo=e=>{if(Fe(e))return H;const n=e.state.status;return e.state=null,n===ce?de(e,_o):F},Ho=(e,n)=>{let t=n.length;if(Fe(e))return H;const i=e.state,o=i.wrap;if(o===2||o===1&&i.status!==ve||i.lookahead)return H;if(o===1&&(e.adler=Ae(e.adler,n,t,0)),i.wrap=0,t>=i.w_size){o===0&&(ie(i.head),i.strstart=0,i.block_start=0,i.insert=0);let m=new Uint8Array(i.w_size);m.set(n.subarray(t-i.w_size,t),0),n=m,t=i.w_size}const a=e.avail_in,c=e.next_in,s=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,xe(i);i.lookahead>=E;){let m=i.strstart,r=i.lookahead-(E-1);do i.ins_h=oe(i,i.ins_h,i.window[m+E-1]),i.prev[m&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=m,m++;while(--r);i.strstart=m,i.lookahead=E-1,xe(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=E-1,i.match_available=0,e.next_in=c,e.input=s,e.avail_in=a,i.wrap=o,F};var Wo=Zo,Ko=_n,Go=vn,Xo=bn,qo=Vo,Yo=Po,Jo=jo,Qo=Ho,ea="pako deflate (from Nodeca project)",De={deflateInit:Wo,deflateInit2:Ko,deflateReset:Go,deflateResetKeep:Xo,deflateSetHeader:qo,deflate:Yo,deflateEnd:Jo,deflateSetDictionary:Qo,deflateInfo:ea};const ta=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var na=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(!!t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)ta(t,i)&&(e[i]=t[i])}}return e},ia=e=>{let n=0;for(let i=0,o=e.length;i=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Re[254]=Re[254]=1;var oa=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,i,o,a,c=e.length,s=0;for(o=0;o>>6,n[a++]=128|t&63):t<65536?(n[a++]=224|t>>>12,n[a++]=128|t>>>6&63,n[a++]=128|t&63):(n[a++]=240|t>>>18,n[a++]=128|t>>>12&63,n[a++]=128|t>>>6&63,n[a++]=128|t&63);return n};const aa=(e,n)=>{if(n<65534&&e.subarray&&wn)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let i=0;i{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let i,o;const a=new Array(t*2);for(o=0,i=0;i4){a[o++]=65533,i+=s-1;continue}for(c&=s===2?31:s===3?15:7;s>1&&i1){a[o++]=65533;continue}c<65536?a[o++]=c:(c-=65536,a[o++]=55296|c>>10&1023,a[o++]=56320|c&1023)}return aa(a,o)},ra=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+Re[e[t]]>n?t:n},Oe={string2buf:oa,buf2string:sa,utf8border:ra};function ca(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var xn=ca;const yn=Object.prototype.toString,{Z_NO_FLUSH:la,Z_SYNC_FLUSH:da,Z_FULL_FLUSH:ma,Z_FINISH:fa,Z_OK:Ge,Z_STREAM_END:ha,Z_DEFAULT_COMPRESSION:pa,Z_DEFAULT_STRATEGY:ua,Z_DEFLATED:ga}=Ne;function Ue(e){this.options=Ke.assign({level:pa,method:ga,chunkSize:16384,windowBits:15,memLevel:8,strategy:ua},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new xn,this.strm.avail_out=0;let t=De.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==Ge)throw new Error(be[t]);if(n.header&&De.deflateSetHeader(this.strm,n.header),n.dictionary){let i;if(typeof n.dictionary=="string"?i=Oe.string2buf(n.dictionary):yn.call(n.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(n.dictionary):i=n.dictionary,t=De.deflateSetDictionary(this.strm,i),t!==Ge)throw new Error(be[t]);this._dict_set=!0}}Ue.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize;let o,a;if(this.ended)return!1;for(n===~~n?a=n:a=n===!0?fa:la,typeof e=="string"?t.input=Oe.string2buf(e):yn.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(a===da||a===ma)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(o=De.deflate(t,a),o===ha)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),o=De.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Ge;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},Ue.prototype.onData=function(e){this.chunks.push(e)},Ue.prototype.onEnd=function(e){e===Ge&&(this.result=Ke.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function zt(e,n){const t=new Ue(n);if(t.push(e,!0),t.err)throw t.msg||be[t.err];return t.result}function ba(e,n){return n=n||{},n.raw=!0,zt(e,n)}function va(e,n){return n=n||{},n.gzip=!0,zt(e,n)}var _a=Ue,wa=zt,xa=ba,ya=va,ka=Ne,Ea={Deflate:_a,deflate:wa,deflateRaw:xa,gzip:ya,constants:ka};const Xe=16209,Sa=16191;var La=function(n,t){let i,o,a,c,s,m,r,l,b,h,f,g,I,y,w,T,k,u,z,B,v,A,L,_;const S=n.state;i=n.next_in,L=n.input,o=i+(n.avail_in-5),a=n.next_out,_=n.output,c=a-(t-n.avail_out),s=a+(n.avail_out-257),m=S.dmax,r=S.wsize,l=S.whave,b=S.wnext,h=S.window,f=S.hold,g=S.bits,I=S.lencode,y=S.distcode,w=(1<>>24,f>>>=u,g-=u,u=k>>>16&255,u===0)_[a++]=k&65535;else if(u&16){z=k&65535,u&=15,u&&(g>>=u,g-=u),g<15&&(f+=L[i++]<>>24,f>>>=u,g-=u,u=k>>>16&255,u&16){if(B=k&65535,u&=15,gm){n.msg="invalid distance too far back",S.mode=Xe;break e}if(f>>>=u,g-=u,u=a-c,B>u){if(u=B-u,u>l&&S.sane){n.msg="invalid distance too far back",S.mode=Xe;break e}if(v=0,A=h,b===0){if(v+=r-u,u2;)_[a++]=A[v++],_[a++]=A[v++],_[a++]=A[v++],z-=3;z&&(_[a++]=A[v++],z>1&&(_[a++]=A[v++]))}else{v=a-B;do _[a++]=_[v++],_[a++]=_[v++],_[a++]=_[v++],z-=3;while(z>2);z&&(_[a++]=_[v++],z>1&&(_[a++]=_[v++]))}}else if((u&64)===0){k=y[(k&65535)+(f&(1<>3,i-=z,g-=z<<3,f&=(1<{const m=s.bits;let r=0,l=0,b=0,h=0,f=0,g=0,I=0,y=0,w=0,T=0,k,u,z,B,v,A=null,L;const _=new Uint16Array(ke+1),S=new Uint16Array(ke+1);let he=null,pi,nt,it;for(r=0;r<=ke;r++)_[r]=0;for(l=0;l=1&&_[h]===0;h--);if(f>h&&(f=h),h===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,s.bits=1,0;for(b=1;b0&&(e===Sn||h!==1))return-1;for(S[1]=0,r=1;rkn||e===Ln&&w>En)return 1;for(;;){pi=r-I,c[l]+1=L?(nt=he[c[l]-L],it=A[c[l]-L]):(nt=32+64,it=0),k=1<>I)+u]=pi<<24|nt<<16|it|0;while(u!==0);for(k=1<>=1;if(k!==0?(T&=k-1,T+=k):T=0,l++,--_[r]===0){if(r===h)break;r=n[t+c[l]]}if(r>f&&(T&B)!==z){for(I===0&&(I=f),v+=b,g=r-I,y=1<kn||e===Ln&&w>En)return 1;z=T&B,o[z]=f<<24|g<<16|v-a|0}}return T!==0&&(o[v+T]=r-I<<24|64<<16|0),s.bits=f,0};const Aa=0,Tn=1,Cn=2,{Z_FINISH:zn,Z_BLOCK:Na,Z_TREES:qe,Z_OK:me,Z_STREAM_END:Ma,Z_NEED_DICT:$a,Z_STREAM_ERROR:Z,Z_DATA_ERROR:In,Z_MEM_ERROR:An,Z_BUF_ERROR:Ba,Z_DEFLATED:Nn}=Ne,Ye=16180,Mn=16181,$n=16182,Bn=16183,Fn=16184,Dn=16185,Rn=16186,On=16187,Un=16188,Vn=16189,Je=16190,q=16191,At=16192,Zn=16193,Nt=16194,Pn=16195,jn=16196,Hn=16197,Wn=16198,Qe=16199,et=16200,Kn=16201,Gn=16202,Xn=16203,qn=16204,Yn=16205,Mt=16206,Jn=16207,Qn=16208,N=16209,ei=16210,ti=16211,Fa=852,Da=592,Ra=15,ni=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Oa(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const fe=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.modeti?1:0},ii=e=>{if(fe(e))return Z;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=Ye,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(Fa),n.distcode=n.distdyn=new Int32Array(Da),n.sane=1,n.back=-1,me},oi=e=>{if(fe(e))return Z;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,ii(e)},ai=(e,n)=>{let t;if(fe(e))return Z;const i=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+5,n<48&&(n&=15)),n&&(n<8||n>15)?Z:(i.window!==null&&i.wbits!==n&&(i.window=null),i.wrap=t,i.wbits=n,oi(e))},si=(e,n)=>{if(!e)return Z;const t=new Oa;e.state=t,t.strm=e,t.window=null,t.mode=Ye;const i=ai(e,n);return i!==me&&(e.state=null),i},Ua=e=>si(e,Ra);let ri=!0,$t,Bt;const Va=e=>{if(ri){$t=new Int32Array(512),Bt=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Ve(Tn,e.lens,0,288,$t,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Ve(Cn,e.lens,0,32,Bt,0,e.work,{bits:5}),ri=!1}e.lencode=$t,e.lenbits=9,e.distcode=Bt,e.distbits=5},ci=(e,n,t,i)=>{let o;const a=e.state;return a.window===null&&(a.wsize=1<=a.wsize?(a.window.set(n.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(o=a.wsize-a.wnext,o>i&&(o=i),a.window.set(n.subarray(t-i,t-i+o),a.wnext),i-=o,i?(a.window.set(n.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave{let t,i,o,a,c,s,m,r,l,b,h,f,g,I,y=0,w,T,k,u,z,B,v,A;const L=new Uint8Array(4);let _,S;const he=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(fe(e)||!e.output||!e.input&&e.avail_in!==0)return Z;t=e.state,t.mode===q&&(t.mode=At),c=e.next_out,o=e.output,m=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,r=t.hold,l=t.bits,b=s,h=m,A=me;e:for(;;)switch(t.mode){case Ye:if(t.wrap===0){t.mode=At;break}for(;l<16;){if(s===0)break e;s--,r+=i[a++]<>>8&255,t.check=M(t.check,L,2,0),r=0,l=0,t.mode=Mn;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((r&255)<<8)+(r>>8))%31){e.msg="incorrect header check",t.mode=N;break}if((r&15)!==Nn){e.msg="unknown compression method",t.mode=N;break}if(r>>>=4,l-=4,v=(r&15)+8,t.wbits===0&&(t.wbits=v),v>15||v>t.wbits){e.msg="invalid window size",t.mode=N;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(L[0]=r&255,L[1]=r>>>8&255,t.check=M(t.check,L,2,0)),r=0,l=0,t.mode=$n;case $n:for(;l<32;){if(s===0)break e;s--,r+=i[a++]<>>8&255,L[2]=r>>>16&255,L[3]=r>>>24&255,t.check=M(t.check,L,4,0)),r=0,l=0,t.mode=Bn;case Bn:for(;l<16;){if(s===0)break e;s--,r+=i[a++]<>8),t.flags&512&&t.wrap&4&&(L[0]=r&255,L[1]=r>>>8&255,t.check=M(t.check,L,2,0)),r=0,l=0,t.mode=Fn;case Fn:if(t.flags&1024){for(;l<16;){if(s===0)break e;s--,r+=i[a++]<>>8&255,t.check=M(t.check,L,2,0)),r=0,l=0}else t.head&&(t.head.extra=null);t.mode=Dn;case Dn:if(t.flags&1024&&(f=t.length,f>s&&(f=s),f&&(t.head&&(v=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+f),v)),t.flags&512&&t.wrap&4&&(t.check=M(t.check,i,f,a)),s-=f,a+=f,t.length-=f),t.length))break e;t.length=0,t.mode=Rn;case Rn:if(t.flags&2048){if(s===0)break e;f=0;do v=i[a+f++],t.head&&v&&t.length<65536&&(t.head.name+=String.fromCharCode(v));while(v&&f>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=q;break;case Vn:for(;l<32;){if(s===0)break e;s--,r+=i[a++]<>>=l&7,l-=l&7,t.mode=Mt;break}for(;l<3;){if(s===0)break e;s--,r+=i[a++]<>>=1,l-=1,r&3){case 0:t.mode=Zn;break;case 1:if(Va(t),t.mode=Qe,n===qe){r>>>=2,l-=2;break e}break;case 2:t.mode=jn;break;case 3:e.msg="invalid block type",t.mode=N}r>>>=2,l-=2;break;case Zn:for(r>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,r+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=N;break}if(t.length=r&65535,r=0,l=0,t.mode=Nt,n===qe)break e;case Nt:t.mode=Pn;case Pn:if(f=t.length,f){if(f>s&&(f=s),f>m&&(f=m),f===0)break e;o.set(i.subarray(a,a+f),c),s-=f,a+=f,m-=f,c+=f,t.length-=f;break}t.mode=q;break;case jn:for(;l<14;){if(s===0)break e;s--,r+=i[a++]<>>=5,l-=5,t.ndist=(r&31)+1,r>>>=5,l-=5,t.ncode=(r&15)+4,r>>>=4,l-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=N;break}t.have=0,t.mode=Hn;case Hn:for(;t.have>>=3,l-=3}for(;t.have<19;)t.lens[he[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,_={bits:t.lenbits},A=Ve(Aa,t.lens,0,19,t.lencode,0,t.work,_),t.lenbits=_.bits,A){e.msg="invalid code lengths set",t.mode=N;break}t.have=0,t.mode=Wn;case Wn:for(;t.have>>24,T=y>>>16&255,k=y&65535,!(w<=l);){if(s===0)break e;s--,r+=i[a++]<>>=w,l-=w,t.lens[t.have++]=k;else{if(k===16){for(S=w+2;l>>=w,l-=w,t.have===0){e.msg="invalid bit length repeat",t.mode=N;break}v=t.lens[t.have-1],f=3+(r&3),r>>>=2,l-=2}else if(k===17){for(S=w+3;l>>=w,l-=w,v=0,f=3+(r&7),r>>>=3,l-=3}else{for(S=w+7;l>>=w,l-=w,v=0,f=11+(r&127),r>>>=7,l-=7}if(t.have+f>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=N;break}for(;f--;)t.lens[t.have++]=v}}if(t.mode===N)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=N;break}if(t.lenbits=9,_={bits:t.lenbits},A=Ve(Tn,t.lens,0,t.nlen,t.lencode,0,t.work,_),t.lenbits=_.bits,A){e.msg="invalid literal/lengths set",t.mode=N;break}if(t.distbits=6,t.distcode=t.distdyn,_={bits:t.distbits},A=Ve(Cn,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,_),t.distbits=_.bits,A){e.msg="invalid distances set",t.mode=N;break}if(t.mode=Qe,n===qe)break e;case Qe:t.mode=et;case et:if(s>=6&&m>=258){e.next_out=c,e.avail_out=m,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=l,La(e,h),c=e.next_out,o=e.output,m=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,r=t.hold,l=t.bits,t.mode===q&&(t.back=-1);break}for(t.back=0;y=t.lencode[r&(1<>>24,T=y>>>16&255,k=y&65535,!(w<=l);){if(s===0)break e;s--,r+=i[a++]<>u)],w=y>>>24,T=y>>>16&255,k=y&65535,!(u+w<=l);){if(s===0)break e;s--,r+=i[a++]<>>=u,l-=u,t.back+=u}if(r>>>=w,l-=w,t.back+=w,t.length=k,T===0){t.mode=Yn;break}if(T&32){t.back=-1,t.mode=q;break}if(T&64){e.msg="invalid literal/length code",t.mode=N;break}t.extra=T&15,t.mode=Kn;case Kn:if(t.extra){for(S=t.extra;l>>=t.extra,l-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Gn;case Gn:for(;y=t.distcode[r&(1<>>24,T=y>>>16&255,k=y&65535,!(w<=l);){if(s===0)break e;s--,r+=i[a++]<>u)],w=y>>>24,T=y>>>16&255,k=y&65535,!(u+w<=l);){if(s===0)break e;s--,r+=i[a++]<>>=u,l-=u,t.back+=u}if(r>>>=w,l-=w,t.back+=w,T&64){e.msg="invalid distance code",t.mode=N;break}t.offset=k,t.extra=T&15,t.mode=Xn;case Xn:if(t.extra){for(S=t.extra;l>>=t.extra,l-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=N;break}t.mode=qn;case qn:if(m===0)break e;if(f=h-m,t.offset>f){if(f=t.offset-f,f>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=N;break}f>t.wnext?(f-=t.wnext,g=t.wsize-f):g=t.wnext-f,f>t.length&&(f=t.length),I=t.window}else I=o,g=c-t.offset,f=t.length;f>m&&(f=m),m-=f,t.length-=f;do o[c++]=I[g++];while(--f);t.length===0&&(t.mode=et);break;case Yn:if(m===0)break e;o[c++]=t.length,m--,t.mode=et;break;case Mt:if(t.wrap){for(;l<32;){if(s===0)break e;s--,r|=i[a++]<{if(fe(e))return Z;let n=e.state;return n.window&&(n.window=null),e.state=null,me},ja=(e,n)=>{if(fe(e))return Z;const t=e.state;return(t.wrap&2)===0?Z:(t.head=n,n.done=!1,me)},Ha=(e,n)=>{const t=n.length;let i,o,a;return fe(e)||(i=e.state,i.wrap!==0&&i.mode!==Je)?Z:i.mode===Je&&(o=1,o=Ae(o,n,t,0),o!==i.check)?In:(a=ci(e,n,t,t),a?(i.mode=ei,An):(i.havedict=1,me))};var Wa=oi,Ka=ai,Ga=ii,Xa=Ua,qa=si,Ya=Za,Ja=Pa,Qa=ja,es=Ha,ts="pako inflate (from Nodeca project)",Y={inflateReset:Wa,inflateReset2:Ka,inflateResetKeep:Ga,inflateInit:Xa,inflateInit2:qa,inflate:Ya,inflateEnd:Ja,inflateGetHeader:Qa,inflateSetDictionary:es,inflateInfo:ts};function ns(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var is=ns;const li=Object.prototype.toString,{Z_NO_FLUSH:os,Z_FINISH:as,Z_OK:Ze,Z_STREAM_END:Ft,Z_NEED_DICT:Dt,Z_STREAM_ERROR:ss,Z_DATA_ERROR:di,Z_MEM_ERROR:rs}=Ne;function Rt(e){this.options=Ke.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15)===0&&(n.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new xn,this.strm.avail_out=0;let t=Y.inflateInit2(this.strm,n.windowBits);if(t!==Ze)throw new Error(be[t]);if(this.header=new is,Y.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Oe.string2buf(n.dictionary):li.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=Y.inflateSetDictionary(this.strm,n.dictionary),t!==Ze)))throw new Error(be[t])}Rt.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize,o=this.options.dictionary;let a,c,s;if(this.ended)return!1;for(n===~~n?c=n:c=n===!0?as:os,li.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=Y.inflate(t,c),a===Dt&&o&&(a=Y.inflateSetDictionary(t,o),a===Ze?a=Y.inflate(t,c):a===di&&(a=Dt));t.avail_in>0&&a===Ft&&t.state.wrap>0&&e[t.next_in]!==0;)Y.inflateReset(t),a=Y.inflate(t,c);switch(a){case ss:case di:case Dt:case rs:return this.onEnd(a),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||a===Ft))if(this.options.to==="string"){let m=Oe.utf8border(t.output,t.next_out),r=t.next_out-m,l=Oe.buf2string(t.output,m);t.next_out=r,t.avail_out=i-r,r&&t.output.set(t.output.subarray(m,m+r),0),this.onData(l)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===Ze&&s===0)){if(a===Ft)return a=Y.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},Rt.prototype.onData=function(e){this.chunks.push(e)},Rt.prototype.onEnd=function(e){e===Ze&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ke.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const{Deflate:Ms,deflate:cs,deflateRaw:$s,gzip:Bs}=Ea;var ls=cs;const Ot="viewed_posts",Ut="viewed_posts_binary",ds="viewed_posts_backup",mi="X-pr0gramm-Bits-Version",ms="X-pr0gramm-Nonce";class tt{constructor(){d(this,"id","ViewedPostsMarker");d(this,"name",'"Bereits gesehen"-Markierung');d(this,"description","Markiert bereits gesehene Medien.");d(this,"markOwnFavoritesAsViewed",x.get("ViewedPostsMarker.settings.mark_own_favorites_as_viewed"));d(this,"syncRead",x.get("ViewedPostsMarker.settings.sync_read",!1));d(this,"syncWrite",x.get("ViewedPostsMarker.settings.sync_write",!1));d(this,"syncVersion",null);d(this,"viewedPosts",[]);d(this,"needsSync",!1)}async load(){var i;let n=this;this.needsMigration()&&(Zt("Starting migration..."),this.migrate(),Zt("Migration complete!"));const t=this.loadFromLocalStorage();if(this.updateViewedPosts(t),window.addEventListener("userSync",()=>this.sync()),window.addEventListener("streamLoaded",o=>{var m,r;const a=(r=(m=p.currentView)==null?void 0:m.stream)==null?void 0:r.options;if((a==null?void 0:a.collection)==="favoriten"&&(a==null?void 0:a.self)&&!n.markOwnFavoritesAsViewed)return;const{items:s}=o.data;n.checkAndMarkItems(s.map(l=>l.id))}),(i=p.currentView)!=null&&i.stream){const{items:o}=p.currentView.stream;n.checkAndMarkItems(Object.keys(o).map(a=>Number(a)))}window.addEventListener("itemOpened",o=>{const a=Number(o.data.itemData.id);n.mergeIntoViewedPosts([a]),tt.markAsViewed(a)}),G.addVideoConstants(),P(Oi)}static markAsViewed(n){let t=document.querySelector(`#item-${n} > p-thumbnail`);t&&t.setAttribute("seen","")}getSettings(){return[{id:"mark_own_favorites_as_viewed",title:"Eigene Favoriten ebenfalls als gelesen markieren",description:"Markiert Posts in den pers\xF6nlichen Sammlungen als gelesen",type:"checkbox"},{id:"sync_read",title:"Lesend Synchronisieren",description:"Synchronisiert LESEND mit den pr0gramm Servern. Das bedeutet, dass gesehene Posts aus der App in p0weruser \xFCbertragen werden, aber nicht umgekehrt",type:"checkbox"},{id:"sync_write",title:"Schreibend Synchronisieren !!! VORSICHT !!!",description:"Synchronisiert SCHREIBEND mit den pr0gramm Servern. Funktioniert nur in Verbindung mit der Lesenden Option. \xC4nderungen an der Schnittstelle oder ein Bug in p0weruser kann die Posts kaputt machen. Au\xDFerdem ist das Feature noch nicht ausgiebig getestet. Benutzung auf eigene Gefahr!",type:"checkbox"}]}async sync(){if(p.user.id!==void 0)try{if(this.syncRead){const n=await this.loadFromApi();this.mergeIntoViewedPosts(n),this.syncWrite&&this.syncVersion!==null&&this.needsSync&&await this.writeToApi(this.viewedPosts)}}catch(n){console.error("Synchronization failed",n)}this.writeToLocalStorage(this.viewedPosts)}checkAndMarkItems(n){for(const t of n){const i=Number(t);this.isSeen(i)&&tt.markAsViewed(i)}}async loadFromApi(){const n=await fetch("/api/seen/data?compressed=false&binary=true");if(!n.ok)return[];const t=await n.arrayBuffer(),i=Number(n.headers.get(mi));return this.syncVersion===i?this.viewedPosts:(this.syncVersion=i,this.parseSeenPostIdsFromBinary(new Uint8Array(t)))}loadFromLocalStorage(){const n=window.localStorage.getItem(Ut)||"",t=Uint8Array.from(atob(n),i=>i.charCodeAt(0));return this.parseSeenPostIdsFromBinary(t)}async writeToApi(n){if(this.syncVersion===null)throw new Error("Version is null");const{id:t}=p.user;if(t===void 0)throw new Error("Not logged In");const i=this.convertPostIdsToBinary(n),o=ls(i,{level:9}),a=await fetch("/api/seen/update",{method:"POST",body:new Blob([o]),headers:{"Content-Type":"application/octet",[mi]:`${this.syncVersion}`,[ms]:t.substring(0,16)}});if(!a.ok)throw new Error("Could not update seen bits");const c=await a.json();if(!c.success)throw new Error("Could not update seen bits");this.syncVersion=c.version}writeToLocalStorage(n){const t=this.convertPostIdsToBinary(n);let i="";for(let o=0;o0}mergeIntoViewedPosts(n){const t=(i,o)=>{let a=0,c=o.length;for(;a>>1;o[s]t-i)}isSeen(n){let t=0,i=this.viewedPosts.length-1;for(;t<=i;){const o=Math.floor((t+i)/2);if(this.viewedPosts[o]===n)return!0;n=t.length)throw new Error(`ID ${i} exceeded limit`);const c=t[o]|1<<7-i%8;t[o]=c}return t}parseSeenPostIdsFromBinary(n){let t=[];for(let i=0;i.side-wide-skyscraper{display:none}body[class] #page.desktop,body[class] #page #head{padding:0 20px;width:100%!important}body[class] #page.desktop #pr0-miner,body[class] #page #head #pr0-miner{display:none}body[class] #page #main-view #stream{text-align:center;display:block;margin:0 auto}body[class] #page #main-view #stream a.thumb{display:block;float:left}body[class] #page #main-view #stream .stream-row{clear:none;text-align:center}body[class] #page #head{background:rgba(0,0,0,.8);width:100%!important}body[class] #page #head #head-content{background:none;display:flex;align-items:center}body[class] #page #head #head-content #loader{left:-20px;right:-20px}body[class] #page #head #head-content #filter-menu{left:calc(50% - 135px)}body[class] #page #head #head-content>.user-info{order:20;margin:0}body[class] #page #head #head-content>#head-menu{padding:0;order:3;flex-grow:1;display:flex;align-items:center;justify-content:center}body[class] #page #head #head-content>#pr0gramm-logo-link{order:1;height:24px;margin:0}body[class] #page #head #head-content a[id*=badge]{order:2;position:relative;top:0;left:0;margin-left:5px;transform:scale(.75)}body[class] #page #head #head-content .sidebar-toggle{order:0;color:#fff;font-size:20px;margin-right:10px}body[class] #page #head #head-content .sidebar-toggle.active{color:#ee4d2e}body[class]>#footer-links{width:250px;left:-250px!important;position:fixed;margin:0;top:52px;border-right:3px solid #2a2e31;background:#161618;transition:left .2s linear;z-index:500}body[class]>#footer-links.open{left:0!important;box-shadow:2px 0 10px #000}body[class]>#footer-links a{color:#fff;display:block;text-align:left;padding:10px 20px;margin-right:0;font-size:16px}body[class]>#footer-links a:hover{color:#ee4d2e}body[class]>#footer-links a:before{font-family:FontAwesome;margin-right:10px;display:inline-block;width:20px}body[class]>#footer-links a[href="/faq"]:before{content:"\\f059"}body[class]>#footer-links a[href="/contact"]:before{content:"\\f0e0"}body[class]>#footer-links a[href*="//miner.pr0gramm.com"]:before{content:"\\f15a"}body[class]>#footer-links a[href*="/datasafety"]:before{content:"\\f06e"}body[class]>#footer-links a[href="http://app.pr0gramm.com"]:before{content:"\\f10b"}body[class]>#footer-links a[href="https://twitter.com/pr0gramm"]:before{content:"\\f099"}body[class]>#footer-links a[href="https://pr0mart.com"]:before{content:"\\f07a"}#stream .item-container{margin:0;max-height:calc(100vh - 52px);display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.9);position:fixed;top:52px;right:0;left:-20px;bottom:-20px;padding:0;z-index:10}#stream .item-container .item-pointer{display:none}#stream .item-container .item-container-content{display:flex;overflow:unset;height:100%;width:100%}#stream .item-container .item-container-content.right{flex-direction:row-reverse}#stream .item-container .item-container-content.right .comments-switch{transform:rotate(180deg)}#stream .item-container .item-container-content.right .video-controls{padding-left:30px}#stream .item-container .item-container-content .image-main{position:relative;display:flex;width:100%;flex-direction:column}#stream .item-container .item-container-content .image-main .item-info{display:flex;align-items:center;justify-content:center;min-height:120px}#stream .item-container .item-container-content .image-main .item-info>div{position:relative;display:flex;width:90%;max-width:980px}#stream .item-container .item-container-content .image-main .item-info>div .item-details,#stream .item-container .item-container-content .image-main .item-info>div .item-tags{padding:5px 20px 5px 40px}#stream .item-container .item-container-content .image-main .item-info>div .item-details .item-report{margin-left:10px}#stream .item-container .item-container-content .image-main .item-info>div .item-vote{display:flex;align-items:center;left:0;top:0;position:relative}#stream .item-container .item-container-content .image-main .item-info>div .item-vote .collect{position:relative;left:0;top:0}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div{display:flex;align-items:center;position:relative;min-width:80px}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .vote-fav{position:relative;margin-left:20px;font-size:32px;left:0;top:0}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .score,#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .score-hidden{position:relative;top:0;left:10px}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .benisbar{height:3px;display:none;position:absolute;bottom:-5px;left:0;right:0;background-color:#5cb85c}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .benisbar.show{display:block}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .benisbar:after{content:attr(data-after-text);bottom:-20px;position:absolute;color:#bbb;white-space:nowrap}#stream .item-container .item-container-content .image-main .item-image-wrapper{flex-grow:1;overflow:hidden;display:flex;align-items:center;justify-content:center;padding:40px}#stream .item-container .item-container-content .image-main .item-image-wrapper .move-link{position:absolute;color:#fff;opacity:.7;padding:0 24px;font-size:26px;right:0;top:24px;text-shadow:0 0 3px #000;z-index:99999}#stream .item-container .item-container-content .image-main .item-image-wrapper .move-link:hover{color:#ee4d2e}#stream .item-container .item-container-content .image-main .item-image-wrapper div.stream-next,#stream .item-container .item-container-content .image-main .item-image-wrapper div.stream-prev{top:unset;bottom:unset;padding:128px 24px!important}#stream .item-container .item-container-content .image-main .item-image-wrapper .item-fullsize-link+.move-link{top:60px}#stream .item-container .item-container-content .image-main .item-image-wrapper .video-controls{height:50px}#stream .item-container .item-container-content .image-main .item-image-wrapper.resized .item-image{max-height:calc(100vh - 200px);top:auto!important;left:auto!important}#stream .item-container .item-container-content .image-main .item-image-wrapper.oversize:not(.resized) .item-image{cursor:move}#stream .item-container .item-container-content .image-main .item-image-wrapper.oversize:not(.resized) img{max-height:none!important;align-self:flex-start}#stream .item-container .item-container-content .image-main .item-image-wrapper .video-controls{width:100%!important}#stream .item-container .item-container-content .image-main .item-image-wrapper .video-controls .video-position-bar-background{min-height:2px}#stream .item-container .item-container-content .image-main .item-image-wrapper .item-image{outline:none;display:flex;align-items:center;justify-content:center;max-width:100%;max-height:100%;width:auto!important}#stream .item-container .item-container-content .image-main .item-image-wrapper .item-image .item-image-thumb{display:none!important}#stream .item-container .item-container-content .image-main .item-image-wrapper .item-image .item-image-actual{height:auto!important;width:auto!important;max-width:100%;max-height:100%;position:relative;margin:0 auto}#stream .item-container .item-container-content .item-comments{background:#161618;flex-grow:0;flex-shrink:0;border-right:3px solid #2a2e31;transition:width .2s ease-out}#stream .item-container .item-container-content .item-comments.loaded{width:30vw}#stream .item-container .item-container-content .item-comments.loaded.wide{width:40vw}#stream .item-container .item-container-content .item-comments.closed,#stream .item-container .item-container-content .item-comments.closed .comment-count{width:60px!important}#stream .item-container .item-container-content .item-comments.closed .count,#stream .item-container .item-container-content .item-comments.closed .comments-head,#stream .item-container .item-container-content .item-comments.closed .comments-switch{display:none}#stream .item-container .item-container-content .item-comments .vote-cfav{color:#888;font-size:16px;cursor:pointer;position:relative;padding:0 5px 0 0;top:4px}#stream .item-container .item-container-content .item-comments .vote-cfav.faved,#stream .item-container .item-container-content .item-comments .vote-cfav:hover,#stream .item-container .item-container-content .item-comments .comment[voted-up] .vote-up{color:var(--theme-main-color)}#stream .item-container .item-container-content .item-comments .comment[voted-up] .vote-down,#stream .item-container .item-container-content .item-comments .comment[voted-down] .vote-up{color:#3c3c3c}#stream .item-container .item-container-content .item-comments .comment[voted-down] .vote-down{color:#f5f7f6}#stream .item-container .item-container-content .item-comments .comment[voted-down] .comment-content{color:#666}#stream .item-container .item-container-content .item-comments.toggled{transition:width .2s ease-out}#stream .item-container .item-container-content .item-comments.wide{width:40vw}#stream .item-container .item-container-content .item-comments.wide .comments-switch:before{content:"\\f053"}#stream .item-container .item-container-content .item-comments.wide .comment-count{width:40vw}#stream .item-container .item-container-content .item-comments .comments-head{padding:10px 10px 10px 30px;opacity:1;transition:opacity .2s;overflow-y:auto;height:calc(100vh - 90px)}#stream .item-container .item-container-content .item-comments .comments-head .comment-content,#stream .item-container .item-container-content .item-comments .comments-head .comment-foot,#stream .item-container .item-container-content .item-comments .comments-head .comment{max-width:100%}#stream .item-container .item-container-content .item-comments .comments-head .comment-report{margin-right:5px}#stream .item-container .item-container-content .item-comments .comment-count{display:flex;align-items:center;background-color:#2a2e31;text-align:left;padding:10px 10px 10px 35px;transition:width .2s ease-out;z-index:400;width:30vw}#stream .item-container .item-container-content .item-comments .comment-count>div:first-child{flex-grow:1}#stream .item-container .item-container-content .item-comments .comment-count .fa{cursor:pointer}#stream .item-container .item-container-content .item-comments .comment-count .fa:not(:last-child){margin-right:10px}#stream .item-container .item-container-content .item-comments textarea{transition:height .2s ease-out}#stream .item-container .item-container-content .item-comments textarea.comment:focus,#stream .item-container .item-container-content .item-comments textarea.comment:valid,#stream .item-container .item-container-content .item-comments textarea.reply{height:75px} +`;/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Ui=4,Pt=0,jt=1,Vi=2;function ue(e){let n=e.length;for(;--n>=0;)e[n]=0}const Zi=0,Ht=1,Pi=2,ji=3,Hi=258,lt=29,Se=256,Le=Se+1+lt,ge=30,dt=19,Wt=2*Le+1,re=15,mt=16,Wi=7,ft=256,Kt=16,Gt=17,Xt=18,ht=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Pe=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Ki=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),qt=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gi=512,X=new Array((Le+2)*2);ue(X);const Te=new Array(ge*2);ue(Te);const Ce=new Array(Gi);ue(Ce);const ze=new Array(Hi-ji+1);ue(ze);const pt=new Array(lt);ue(pt);const je=new Array(ge);ue(je);function ut(e,n,t,i,o){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=i,this.max_length=o,this.has_stree=e&&e.length}let Yt,Jt,Qt;function gt(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}const en=e=>e<256?Ce[e]:Ce[256+(e>>>7)],Ie=(e,n)=>{e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255},R=(e,n,t)=>{e.bi_valid>mt-t?(e.bi_buf|=n<>mt-e.bi_valid,e.bi_valid+=t-mt):(e.bi_buf|=n<{R(e,t[n*2],t[n*2+1])},tn=(e,n)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1},Xi=e=>{e.bi_valid===16?(Ie(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},qi=(e,n)=>{const t=n.dyn_tree,i=n.max_code,o=n.stat_desc.static_tree,a=n.stat_desc.has_stree,c=n.stat_desc.extra_bits,s=n.stat_desc.extra_base,m=n.stat_desc.max_length;let r,l,b,h,f,g,I=0;for(h=0;h<=re;h++)e.bl_count[h]=0;for(t[e.heap[e.heap_max]*2+1]=0,r=e.heap_max+1;rm&&(h=m,I++),t[l*2+1]=h,!(l>i)&&(e.bl_count[h]++,f=0,l>=s&&(f=c[l-s]),g=t[l*2],e.opt_len+=g*(h+f),a&&(e.static_len+=g*(o[l*2+1]+f)));if(I!==0){do{for(h=m-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[m]--,I-=2}while(I>0);for(h=m;h!==0;h--)for(l=e.bl_count[h];l!==0;)b=e.heap[--r],!(b>i)&&(t[b*2+1]!==h&&(e.opt_len+=(h-t[b*2+1])*t[b*2],t[b*2+1]=h),l--)}},nn=(e,n,t)=>{const i=new Array(re+1);let o=0,a,c;for(a=1;a<=re;a++)o=o+t[a-1]<<1,i[a]=o;for(c=0;c<=n;c++){let s=e[c*2+1];s!==0&&(e[c*2]=tn(i[s]++,s))}},Yi=()=>{let e,n,t,i,o;const a=new Array(re+1);for(t=0,i=0;i>=7;i{let n;for(n=0;n{e.bi_valid>8?Ie(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},sn=(e,n,t,i)=>{const o=n*2,a=t*2;return e[o]{const i=e.heap[t];let o=t<<1;for(;o<=e.heap_len&&(o{let i,o,a=0,c,s;if(e.sym_next!==0)do i=e.pending_buf[e.sym_buf+a++]&255,i+=(e.pending_buf[e.sym_buf+a++]&255)<<8,o=e.pending_buf[e.sym_buf+a++],i===0?j(e,o,n):(c=ze[o],j(e,c+Se+1,n),s=ht[c],s!==0&&(o-=pt[c],R(e,o,s)),i--,c=en(i),j(e,c,t),s=Pe[c],s!==0&&(i-=je[c],R(e,i,s)));while(a{const t=n.dyn_tree,i=n.stat_desc.static_tree,o=n.stat_desc.has_stree,a=n.stat_desc.elems;let c,s,m=-1,r;for(e.heap_len=0,e.heap_max=Wt,c=0;c>1;c>=1;c--)bt(e,t,c);r=a;do c=e.heap[1],e.heap[1]=e.heap[e.heap_len--],bt(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=c,e.heap[--e.heap_max]=s,t[r*2]=t[c*2]+t[s*2],e.depth[r]=(e.depth[c]>=e.depth[s]?e.depth[c]:e.depth[s])+1,t[c*2+1]=t[s*2+1]=r,e.heap[1]=r++,bt(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],qi(e,n),nn(t,m,e.bl_count)},cn=(e,n,t)=>{let i,o=-1,a,c=n[0*2+1],s=0,m=7,r=4;for(c===0&&(m=138,r=3),n[(t+1)*2+1]=65535,i=0;i<=t;i++)a=c,c=n[(i+1)*2+1],!(++s{let i,o=-1,a,c=n[0*2+1],s=0,m=7,r=4;for(c===0&&(m=138,r=3),i=0;i<=t;i++)if(a=c,c=n[(i+1)*2+1],!(++s{let n;for(cn(e,e.dyn_ltree,e.l_desc.max_code),cn(e,e.dyn_dtree,e.d_desc.max_code),vt(e,e.bl_desc),n=dt-1;n>=3&&e.bl_tree[qt[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n},Qi=(e,n,t,i)=>{let o;for(R(e,n-257,5),R(e,t-1,5),R(e,i-4,4),o=0;o{let n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return Pt;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return jt;for(t=32;t{dn||(Yi(),dn=!0),e.l_desc=new gt(e.dyn_ltree,Yt),e.d_desc=new gt(e.dyn_dtree,Jt),e.bl_desc=new gt(e.bl_tree,Qt),e.bi_buf=0,e.bi_valid=0,on(e)},mn=(e,n,t,i)=>{R(e,(Zi<<1)+(i?1:0),3),an(e),Ie(e,t),Ie(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t},no=e=>{R(e,Ht<<1,3),j(e,ft,X),Xi(e)},io=(e,n,t,i)=>{let o,a,c=0;e.level>0?(e.strm.data_type===Vi&&(e.strm.data_type=eo(e)),vt(e,e.l_desc),vt(e,e.d_desc),c=Ji(e),o=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=o&&(o=a)):o=a=t+5,t+4<=o&&n!==-1?mn(e,n,t,i):e.strategy===Ui||a===o?(R(e,(Ht<<1)+(i?1:0),3),rn(e,X,Te)):(R(e,(Pi<<1)+(i?1:0),3),Qi(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),rn(e,e.dyn_ltree,e.dyn_dtree)),on(e),i&&an(e)},oo=(e,n,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(ze[t]+Se+1)*2]++,e.dyn_dtree[en(n)*2]++),e.sym_next===e.sym_end);var ao=to,so=mn,ro=io,co=oo,lo=no,mo={_tr_init:ao,_tr_stored_block:so,_tr_flush_block:ro,_tr_tally:co,_tr_align:lo},Ae=(e,n,t,i)=>{let o=e&65535|0,a=e>>>16&65535|0,c=0;for(;t!==0;){c=t>2e3?2e3:t,t-=c;do o=o+n[i++]|0,a=a+o|0;while(--c);o%=65521,a%=65521}return o|a<<16|0};const fo=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},ho=new Uint32Array(fo());var M=(e,n,t,i)=>{const o=ho,a=i+t;e^=-1;for(let c=i;c>>8^o[(e^n[c])&255];return e^-1},be={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ne={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:po,_tr_stored_block:_t,_tr_flush_block:uo,_tr_tally:ee,_tr_align:go}=mo,{Z_NO_FLUSH:te,Z_PARTIAL_FLUSH:bo,Z_FULL_FLUSH:vo,Z_FINISH:V,Z_BLOCK:fn,Z_OK:F,Z_STREAM_END:hn,Z_STREAM_ERROR:H,Z_DATA_ERROR:_o,Z_BUF_ERROR:wt,Z_DEFAULT_COMPRESSION:wo,Z_FILTERED:xo,Z_HUFFMAN_ONLY:He,Z_RLE:yo,Z_FIXED:ko,Z_DEFAULT_STRATEGY:Eo,Z_UNKNOWN:So,Z_DEFLATED:We}=Ne,Lo=9,To=15,Co=8,zo=29,xt=256+1+zo,Io=30,Ao=19,No=2*xt+1,Mo=15,E=3,ne=258,W=ne+E+1,$o=32,ve=42,yt=57,kt=69,Et=73,St=91,Lt=103,ce=113,Me=666,D=1,_e=2,le=3,we=4,Bo=3,de=(e,n)=>(e.msg=be[n],n),pn=e=>e*2-(e>4?9:0),ie=e=>{let n=e.length;for(;--n>=0;)e[n]=0},Fo=e=>{let n,t,i,o=e.w_size;n=e.hash_size,i=n;do t=e.head[--i],e.head[i]=t>=o?t-o:0;while(--n);n=o,i=n;do t=e.prev[--i],e.prev[i]=t>=o?t-o:0;while(--n)};let oe=(e,n,t)=>(n<{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},U=(e,n)=>{uo(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,O(e.strm)},C=(e,n)=>{e.pending_buf[e.pending++]=n},$e=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255},Tt=(e,n,t,i)=>{let o=e.avail_in;return o>i&&(o=i),o===0?0:(e.avail_in-=o,n.set(e.input.subarray(e.next_in,e.next_in+o),t),e.state.wrap===1?e.adler=Ae(e.adler,n,o,t):e.state.wrap===2&&(e.adler=M(e.adler,n,o,t)),e.next_in+=o,e.total_in+=o,o)},un=(e,n)=>{let t=e.max_chain_length,i=e.strstart,o,a,c=e.prev_length,s=e.nice_match;const m=e.strstart>e.w_size-W?e.strstart-(e.w_size-W):0,r=e.window,l=e.w_mask,b=e.prev,h=e.strstart+ne;let f=r[i+c-1],g=r[i+c];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(o=n,!(r[o+c]!==g||r[o+c-1]!==f||r[o]!==r[i]||r[++o]!==r[i+1])){i+=2,o++;do;while(r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&r[++i]===r[++o]&&ic){if(e.match_start=n,c=a,a>=s)break;f=r[i+c-1],g=r[i+c]}}while((n=b[n&l])>m&&--t!==0);return c<=e.lookahead?c:e.lookahead},xe=e=>{const n=e.w_size;let t,i,o;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-W)&&(e.window.set(e.window.subarray(n,n+n-i),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),Fo(e),i+=n),e.strm.avail_in===0)break;if(t=Tt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=E)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=oe(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=oe(e,e.ins_h,e.window[o+E-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,i,o,a,c=0,s=e.strm.avail_in;do{if(i=65535,a=e.bi_valid+42>>3,e.strm.avail_outo+e.strm.avail_in&&(i=o+e.strm.avail_in),i>a&&(i=a),i>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,O(e.strm),o&&(o>i&&(o=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+o),e.strm.next_out),e.strm.next_out+=o,e.strm.avail_out-=o,e.strm.total_out+=o,e.block_start+=o,i-=o),i&&(Tt(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(c===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_watera&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Tt(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,t=a>e.w_size?e.w_size:a,o=e.strstart-e.block_start,(o>=t||(o||n===V)&&n!==te&&e.strm.avail_in===0&&o<=a)&&(i=o>a?a:o,c=n===V&&e.strm.avail_in===0&&i===o?1:0,_t(e,e.block_start,i,c),e.block_start+=i,O(e.strm)),c?le:D)},Ct=(e,n)=>{let t,i;for(;;){if(e.lookahead=E&&(e.ins_h=oe(e,e.ins_h,e.window[e.strstart+E-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-W&&(e.match_length=un(e,t)),e.match_length>=E)if(i=ee(e,e.strstart-e.match_start,e.match_length-E),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=E){e.match_length--;do e.strstart++,e.ins_h=oe(e,e.ins_h,e.window[e.strstart+E-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=oe(e,e.ins_h,e.window[e.strstart+1]);else i=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(U(e,!1),e.strm.avail_out===0))return D}return e.insert=e.strstart{let t,i,o;for(;;){if(e.lookahead=E&&(e.ins_h=oe(e,e.ins_h,e.window[e.strstart+E-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=E-1,t!==0&&e.prev_length4096)&&(e.match_length=E-1)),e.prev_length>=E&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-E,i=ee(e,e.strstart-1-e.prev_match,e.prev_length-E),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=oe(e,e.ins_h,e.window[e.strstart+E-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=E-1,e.strstart++,i&&(U(e,!1),e.strm.avail_out===0))return D}else if(e.match_available){if(i=ee(e,0,e.window[e.strstart-1]),i&&U(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return D}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=ee(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let t,i,o,a;const c=e.window;for(;;){if(e.lookahead<=ne){if(xe(e),e.lookahead<=ne&&n===te)return D;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=E&&e.strstart>0&&(o=e.strstart-1,i=c[o],i===c[++o]&&i===c[++o]&&i===c[++o])){a=e.strstart+ne;do;while(i===c[++o]&&i===c[++o]&&i===c[++o]&&i===c[++o]&&i===c[++o]&&i===c[++o]&&i===c[++o]&&i===c[++o]&&oe.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=E?(t=ee(e,1,e.match_length-E),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(U(e,!1),e.strm.avail_out===0))return D}return e.insert=0,n===V?(U(e,!0),e.strm.avail_out===0?le:we):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?D:_e},Ro=(e,n)=>{let t;for(;;){if(e.lookahead===0&&(xe(e),e.lookahead===0)){if(n===te)return D;break}if(e.match_length=0,t=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(U(e,!1),e.strm.avail_out===0))return D}return e.insert=0,n===V?(U(e,!0),e.strm.avail_out===0?le:we):e.sym_next&&(U(e,!1),e.strm.avail_out===0)?D:_e};function K(e,n,t,i,o){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=i,this.func=o}const Be=[new K(0,0,0,0,gn),new K(4,4,8,4,Ct),new K(4,5,16,8,Ct),new K(4,6,32,32,Ct),new K(4,4,16,16,ye),new K(8,16,32,32,ye),new K(8,16,128,128,ye),new K(8,32,128,256,ye),new K(32,128,258,1024,ye),new K(32,258,258,4096,ye)],Oo=e=>{e.window_size=2*e.w_size,ie(e.head),e.max_lazy_match=Be[e.level].max_lazy,e.good_match=Be[e.level].good_length,e.nice_match=Be[e.level].nice_length,e.max_chain_length=Be[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=E-1,e.match_available=0,e.ins_h=0};function Uo(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=We,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(No*2),this.dyn_dtree=new Uint16Array((2*Io+1)*2),this.bl_tree=new Uint16Array((2*Ao+1)*2),ie(this.dyn_ltree),ie(this.dyn_dtree),ie(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Mo+1),this.heap=new Uint16Array(2*xt+1),ie(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*xt+1),ie(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Fe=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.status!==ve&&n.status!==yt&&n.status!==kt&&n.status!==Et&&n.status!==St&&n.status!==Lt&&n.status!==ce&&n.status!==Me?1:0},bn=e=>{if(Fe(e))return de(e,H);e.total_in=e.total_out=0,e.data_type=So;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?yt:n.wrap?ve:ce,e.adler=n.wrap===2?0:1,n.last_flush=-2,po(n),F},vn=e=>{const n=bn(e);return n===F&&Oo(e.state),n},Vo=(e,n)=>Fe(e)||e.state.wrap!==2?H:(e.state.gzhead=n,F),_n=(e,n,t,i,o,a)=>{if(!e)return H;let c=1;if(n===wo&&(n=6),i<0?(c=0,i=-i):i>15&&(c=2,i-=16),o<1||o>Lo||t!==We||i<8||i>15||n<0||n>9||a<0||a>ko||i===8&&c!==1)return de(e,H);i===8&&(i=9);const s=new Uo;return e.state=s,s.strm=e,s.status=ve,s.wrap=c,s.gzhead=null,s.w_bits=i,s.w_size=1<_n(e,n,We,To,Co,Eo),Po=(e,n)=>{if(Fe(e)||n>fn||n<0)return e?de(e,H):H;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===Me&&n!==V)return de(e,e.avail_out===0?wt:H);const i=t.last_flush;if(t.last_flush=n,t.pending!==0){if(O(e),e.avail_out===0)return t.last_flush=-1,F}else if(e.avail_in===0&&pn(n)<=pn(i)&&n!==V)return de(e,wt);if(t.status===Me&&e.avail_in!==0)return de(e,wt);if(t.status===ve&&t.wrap===0&&(t.status=ce),t.status===ve){let o=We+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=He||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,o|=a<<6,t.strstart!==0&&(o|=$o),o+=31-o%31,$e(t,o),t.strstart!==0&&($e(t,e.adler>>>16),$e(t,e.adler&65535)),e.adler=1,t.status=ce,O(e),t.pending!==0)return t.last_flush=-1,F}if(t.status===yt){if(e.adler=0,C(t,31),C(t,139),C(t,8),t.gzhead)C(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),C(t,t.gzhead.time&255),C(t,t.gzhead.time>>8&255),C(t,t.gzhead.time>>16&255),C(t,t.gzhead.time>>24&255),C(t,t.level===9?2:t.strategy>=He||t.level<2?4:0),C(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(C(t,t.gzhead.extra.length&255),C(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=M(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=kt;else if(C(t,0),C(t,0),C(t,0),C(t,0),C(t,0),C(t,t.level===9?2:t.strategy>=He||t.level<2?4:0),C(t,Bo),t.status=ce,O(e),t.pending!==0)return t.last_flush=-1,F}if(t.status===kt){if(t.gzhead.extra){let o=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let s=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>o&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o)),t.gzindex+=s,O(e),t.pending!==0)return t.last_flush=-1,F;o=0,a-=s}let c=new Uint8Array(t.gzhead.extra);t.pending_buf.set(c.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>o&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o)),t.gzindex=0}t.status=Et}if(t.status===Et){if(t.gzhead.name){let o=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>o&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o)),O(e),t.pending!==0)return t.last_flush=-1,F;o=0}t.gzindexo&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o)),t.gzindex=0}t.status=St}if(t.status===St){if(t.gzhead.comment){let o=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>o&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o)),O(e),t.pending!==0)return t.last_flush=-1,F;o=0}t.gzindexo&&(e.adler=M(e.adler,t.pending_buf,t.pending-o,o))}t.status=Lt}if(t.status===Lt){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(O(e),t.pending!==0))return t.last_flush=-1,F;C(t,e.adler&255),C(t,e.adler>>8&255),e.adler=0}if(t.status=ce,O(e),t.pending!==0)return t.last_flush=-1,F}if(e.avail_in!==0||t.lookahead!==0||n!==te&&t.status!==Me){let o=t.level===0?gn(t,n):t.strategy===He?Ro(t,n):t.strategy===yo?Do(t,n):Be[t.level].func(t,n);if((o===le||o===we)&&(t.status=Me),o===D||o===le)return e.avail_out===0&&(t.last_flush=-1),F;if(o===_e&&(n===bo?go(t):n!==fn&&(_t(t,0,0,!1),n===vo&&(ie(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),O(e),e.avail_out===0))return t.last_flush=-1,F}return n!==V?F:t.wrap<=0?hn:(t.wrap===2?(C(t,e.adler&255),C(t,e.adler>>8&255),C(t,e.adler>>16&255),C(t,e.adler>>24&255),C(t,e.total_in&255),C(t,e.total_in>>8&255),C(t,e.total_in>>16&255),C(t,e.total_in>>24&255)):($e(t,e.adler>>>16),$e(t,e.adler&65535)),O(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?F:hn)},jo=e=>{if(Fe(e))return H;const n=e.state.status;return e.state=null,n===ce?de(e,_o):F},Ho=(e,n)=>{let t=n.length;if(Fe(e))return H;const i=e.state,o=i.wrap;if(o===2||o===1&&i.status!==ve||i.lookahead)return H;if(o===1&&(e.adler=Ae(e.adler,n,t,0)),i.wrap=0,t>=i.w_size){o===0&&(ie(i.head),i.strstart=0,i.block_start=0,i.insert=0);let m=new Uint8Array(i.w_size);m.set(n.subarray(t-i.w_size,t),0),n=m,t=i.w_size}const a=e.avail_in,c=e.next_in,s=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,xe(i);i.lookahead>=E;){let m=i.strstart,r=i.lookahead-(E-1);do i.ins_h=oe(i,i.ins_h,i.window[m+E-1]),i.prev[m&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=m,m++;while(--r);i.strstart=m,i.lookahead=E-1,xe(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=E-1,i.match_available=0,e.next_in=c,e.input=s,e.avail_in=a,i.wrap=o,F};var Wo=Zo,Ko=_n,Go=vn,Xo=bn,qo=Vo,Yo=Po,Jo=jo,Qo=Ho,ea="pako deflate (from Nodeca project)",De={deflateInit:Wo,deflateInit2:Ko,deflateReset:Go,deflateResetKeep:Xo,deflateSetHeader:qo,deflate:Yo,deflateEnd:Jo,deflateSetDictionary:Qo,deflateInfo:ea};const ta=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var na=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(!!t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)ta(t,i)&&(e[i]=t[i])}}return e},ia=e=>{let n=0;for(let i=0,o=e.length;i=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Re[254]=Re[254]=1;var oa=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,i,o,a,c=e.length,s=0;for(o=0;o>>6,n[a++]=128|t&63):t<65536?(n[a++]=224|t>>>12,n[a++]=128|t>>>6&63,n[a++]=128|t&63):(n[a++]=240|t>>>18,n[a++]=128|t>>>12&63,n[a++]=128|t>>>6&63,n[a++]=128|t&63);return n};const aa=(e,n)=>{if(n<65534&&e.subarray&&wn)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let i=0;i{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let i,o;const a=new Array(t*2);for(o=0,i=0;i4){a[o++]=65533,i+=s-1;continue}for(c&=s===2?31:s===3?15:7;s>1&&i1){a[o++]=65533;continue}c<65536?a[o++]=c:(c-=65536,a[o++]=55296|c>>10&1023,a[o++]=56320|c&1023)}return aa(a,o)},ra=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+Re[e[t]]>n?t:n},Oe={string2buf:oa,buf2string:sa,utf8border:ra};function ca(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var xn=ca;const yn=Object.prototype.toString,{Z_NO_FLUSH:la,Z_SYNC_FLUSH:da,Z_FULL_FLUSH:ma,Z_FINISH:fa,Z_OK:Ge,Z_STREAM_END:ha,Z_DEFAULT_COMPRESSION:pa,Z_DEFAULT_STRATEGY:ua,Z_DEFLATED:ga}=Ne;function Ue(e){this.options=Ke.assign({level:pa,method:ga,chunkSize:16384,windowBits:15,memLevel:8,strategy:ua},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new xn,this.strm.avail_out=0;let t=De.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==Ge)throw new Error(be[t]);if(n.header&&De.deflateSetHeader(this.strm,n.header),n.dictionary){let i;if(typeof n.dictionary=="string"?i=Oe.string2buf(n.dictionary):yn.call(n.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(n.dictionary):i=n.dictionary,t=De.deflateSetDictionary(this.strm,i),t!==Ge)throw new Error(be[t]);this._dict_set=!0}}Ue.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize;let o,a;if(this.ended)return!1;for(n===~~n?a=n:a=n===!0?fa:la,typeof e=="string"?t.input=Oe.string2buf(e):yn.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(a===da||a===ma)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(o=De.deflate(t,a),o===ha)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),o=De.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Ge;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},Ue.prototype.onData=function(e){this.chunks.push(e)},Ue.prototype.onEnd=function(e){e===Ge&&(this.result=Ke.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function zt(e,n){const t=new Ue(n);if(t.push(e,!0),t.err)throw t.msg||be[t.err];return t.result}function ba(e,n){return n=n||{},n.raw=!0,zt(e,n)}function va(e,n){return n=n||{},n.gzip=!0,zt(e,n)}var _a=Ue,wa=zt,xa=ba,ya=va,ka=Ne,Ea={Deflate:_a,deflate:wa,deflateRaw:xa,gzip:ya,constants:ka};const Xe=16209,Sa=16191;var La=function(n,t){let i,o,a,c,s,m,r,l,b,h,f,g,I,y,_,T,k,u,z,B,v,A,L,w;const S=n.state;i=n.next_in,L=n.input,o=i+(n.avail_in-5),a=n.next_out,w=n.output,c=a-(t-n.avail_out),s=a+(n.avail_out-257),m=S.dmax,r=S.wsize,l=S.whave,b=S.wnext,h=S.window,f=S.hold,g=S.bits,I=S.lencode,y=S.distcode,_=(1<>>24,f>>>=u,g-=u,u=k>>>16&255,u===0)w[a++]=k&65535;else if(u&16){z=k&65535,u&=15,u&&(g>>=u,g-=u),g<15&&(f+=L[i++]<>>24,f>>>=u,g-=u,u=k>>>16&255,u&16){if(B=k&65535,u&=15,gm){n.msg="invalid distance too far back",S.mode=Xe;break e}if(f>>>=u,g-=u,u=a-c,B>u){if(u=B-u,u>l&&S.sane){n.msg="invalid distance too far back",S.mode=Xe;break e}if(v=0,A=h,b===0){if(v+=r-u,u2;)w[a++]=A[v++],w[a++]=A[v++],w[a++]=A[v++],z-=3;z&&(w[a++]=A[v++],z>1&&(w[a++]=A[v++]))}else{v=a-B;do w[a++]=w[v++],w[a++]=w[v++],w[a++]=w[v++],z-=3;while(z>2);z&&(w[a++]=w[v++],z>1&&(w[a++]=w[v++]))}}else if((u&64)===0){k=y[(k&65535)+(f&(1<>3,i-=z,g-=z<<3,f&=(1<{const m=s.bits;let r=0,l=0,b=0,h=0,f=0,g=0,I=0,y=0,_=0,T=0,k,u,z,B,v,A=null,L;const w=new Uint16Array(ke+1),S=new Uint16Array(ke+1);let he=null,pi,nt,it;for(r=0;r<=ke;r++)w[r]=0;for(l=0;l=1&&w[h]===0;h--);if(f>h&&(f=h),h===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,s.bits=1,0;for(b=1;b0&&(e===Sn||h!==1))return-1;for(S[1]=0,r=1;rkn||e===Ln&&_>En)return 1;for(;;){pi=r-I,c[l]+1=L?(nt=he[c[l]-L],it=A[c[l]-L]):(nt=32+64,it=0),k=1<>I)+u]=pi<<24|nt<<16|it|0;while(u!==0);for(k=1<>=1;if(k!==0?(T&=k-1,T+=k):T=0,l++,--w[r]===0){if(r===h)break;r=n[t+c[l]]}if(r>f&&(T&B)!==z){for(I===0&&(I=f),v+=b,g=r-I,y=1<kn||e===Ln&&_>En)return 1;z=T&B,o[z]=f<<24|g<<16|v-a|0}}return T!==0&&(o[v+T]=r-I<<24|64<<16|0),s.bits=f,0};const Aa=0,Tn=1,Cn=2,{Z_FINISH:zn,Z_BLOCK:Na,Z_TREES:qe,Z_OK:me,Z_STREAM_END:Ma,Z_NEED_DICT:$a,Z_STREAM_ERROR:Z,Z_DATA_ERROR:In,Z_MEM_ERROR:An,Z_BUF_ERROR:Ba,Z_DEFLATED:Nn}=Ne,Ye=16180,Mn=16181,$n=16182,Bn=16183,Fn=16184,Dn=16185,Rn=16186,On=16187,Un=16188,Vn=16189,Je=16190,q=16191,At=16192,Zn=16193,Nt=16194,Pn=16195,jn=16196,Hn=16197,Wn=16198,Qe=16199,et=16200,Kn=16201,Gn=16202,Xn=16203,qn=16204,Yn=16205,Mt=16206,Jn=16207,Qn=16208,N=16209,ei=16210,ti=16211,Fa=852,Da=592,Ra=15,ni=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Oa(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const fe=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.modeti?1:0},ii=e=>{if(fe(e))return Z;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=Ye,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(Fa),n.distcode=n.distdyn=new Int32Array(Da),n.sane=1,n.back=-1,me},oi=e=>{if(fe(e))return Z;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,ii(e)},ai=(e,n)=>{let t;if(fe(e))return Z;const i=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+5,n<48&&(n&=15)),n&&(n<8||n>15)?Z:(i.window!==null&&i.wbits!==n&&(i.window=null),i.wrap=t,i.wbits=n,oi(e))},si=(e,n)=>{if(!e)return Z;const t=new Oa;e.state=t,t.strm=e,t.window=null,t.mode=Ye;const i=ai(e,n);return i!==me&&(e.state=null),i},Ua=e=>si(e,Ra);let ri=!0,$t,Bt;const Va=e=>{if(ri){$t=new Int32Array(512),Bt=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Ve(Tn,e.lens,0,288,$t,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Ve(Cn,e.lens,0,32,Bt,0,e.work,{bits:5}),ri=!1}e.lencode=$t,e.lenbits=9,e.distcode=Bt,e.distbits=5},ci=(e,n,t,i)=>{let o;const a=e.state;return a.window===null&&(a.wsize=1<=a.wsize?(a.window.set(n.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(o=a.wsize-a.wnext,o>i&&(o=i),a.window.set(n.subarray(t-i,t-i+o),a.wnext),i-=o,i?(a.window.set(n.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave{let t,i,o,a,c,s,m,r,l,b,h,f,g,I,y=0,_,T,k,u,z,B,v,A;const L=new Uint8Array(4);let w,S;const he=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(fe(e)||!e.output||!e.input&&e.avail_in!==0)return Z;t=e.state,t.mode===q&&(t.mode=At),c=e.next_out,o=e.output,m=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,r=t.hold,l=t.bits,b=s,h=m,A=me;e:for(;;)switch(t.mode){case Ye:if(t.wrap===0){t.mode=At;break}for(;l<16;){if(s===0)break e;s--,r+=i[a++]<>>8&255,t.check=M(t.check,L,2,0),r=0,l=0,t.mode=Mn;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((r&255)<<8)+(r>>8))%31){e.msg="incorrect header check",t.mode=N;break}if((r&15)!==Nn){e.msg="unknown compression method",t.mode=N;break}if(r>>>=4,l-=4,v=(r&15)+8,t.wbits===0&&(t.wbits=v),v>15||v>t.wbits){e.msg="invalid window size",t.mode=N;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(L[0]=r&255,L[1]=r>>>8&255,t.check=M(t.check,L,2,0)),r=0,l=0,t.mode=$n;case $n:for(;l<32;){if(s===0)break e;s--,r+=i[a++]<>>8&255,L[2]=r>>>16&255,L[3]=r>>>24&255,t.check=M(t.check,L,4,0)),r=0,l=0,t.mode=Bn;case Bn:for(;l<16;){if(s===0)break e;s--,r+=i[a++]<>8),t.flags&512&&t.wrap&4&&(L[0]=r&255,L[1]=r>>>8&255,t.check=M(t.check,L,2,0)),r=0,l=0,t.mode=Fn;case Fn:if(t.flags&1024){for(;l<16;){if(s===0)break e;s--,r+=i[a++]<>>8&255,t.check=M(t.check,L,2,0)),r=0,l=0}else t.head&&(t.head.extra=null);t.mode=Dn;case Dn:if(t.flags&1024&&(f=t.length,f>s&&(f=s),f&&(t.head&&(v=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+f),v)),t.flags&512&&t.wrap&4&&(t.check=M(t.check,i,f,a)),s-=f,a+=f,t.length-=f),t.length))break e;t.length=0,t.mode=Rn;case Rn:if(t.flags&2048){if(s===0)break e;f=0;do v=i[a+f++],t.head&&v&&t.length<65536&&(t.head.name+=String.fromCharCode(v));while(v&&f>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=q;break;case Vn:for(;l<32;){if(s===0)break e;s--,r+=i[a++]<>>=l&7,l-=l&7,t.mode=Mt;break}for(;l<3;){if(s===0)break e;s--,r+=i[a++]<>>=1,l-=1,r&3){case 0:t.mode=Zn;break;case 1:if(Va(t),t.mode=Qe,n===qe){r>>>=2,l-=2;break e}break;case 2:t.mode=jn;break;case 3:e.msg="invalid block type",t.mode=N}r>>>=2,l-=2;break;case Zn:for(r>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,r+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=N;break}if(t.length=r&65535,r=0,l=0,t.mode=Nt,n===qe)break e;case Nt:t.mode=Pn;case Pn:if(f=t.length,f){if(f>s&&(f=s),f>m&&(f=m),f===0)break e;o.set(i.subarray(a,a+f),c),s-=f,a+=f,m-=f,c+=f,t.length-=f;break}t.mode=q;break;case jn:for(;l<14;){if(s===0)break e;s--,r+=i[a++]<>>=5,l-=5,t.ndist=(r&31)+1,r>>>=5,l-=5,t.ncode=(r&15)+4,r>>>=4,l-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=N;break}t.have=0,t.mode=Hn;case Hn:for(;t.have>>=3,l-=3}for(;t.have<19;)t.lens[he[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,w={bits:t.lenbits},A=Ve(Aa,t.lens,0,19,t.lencode,0,t.work,w),t.lenbits=w.bits,A){e.msg="invalid code lengths set",t.mode=N;break}t.have=0,t.mode=Wn;case Wn:for(;t.have>>24,T=y>>>16&255,k=y&65535,!(_<=l);){if(s===0)break e;s--,r+=i[a++]<>>=_,l-=_,t.lens[t.have++]=k;else{if(k===16){for(S=_+2;l>>=_,l-=_,t.have===0){e.msg="invalid bit length repeat",t.mode=N;break}v=t.lens[t.have-1],f=3+(r&3),r>>>=2,l-=2}else if(k===17){for(S=_+3;l>>=_,l-=_,v=0,f=3+(r&7),r>>>=3,l-=3}else{for(S=_+7;l>>=_,l-=_,v=0,f=11+(r&127),r>>>=7,l-=7}if(t.have+f>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=N;break}for(;f--;)t.lens[t.have++]=v}}if(t.mode===N)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=N;break}if(t.lenbits=9,w={bits:t.lenbits},A=Ve(Tn,t.lens,0,t.nlen,t.lencode,0,t.work,w),t.lenbits=w.bits,A){e.msg="invalid literal/lengths set",t.mode=N;break}if(t.distbits=6,t.distcode=t.distdyn,w={bits:t.distbits},A=Ve(Cn,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,w),t.distbits=w.bits,A){e.msg="invalid distances set",t.mode=N;break}if(t.mode=Qe,n===qe)break e;case Qe:t.mode=et;case et:if(s>=6&&m>=258){e.next_out=c,e.avail_out=m,e.next_in=a,e.avail_in=s,t.hold=r,t.bits=l,La(e,h),c=e.next_out,o=e.output,m=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,r=t.hold,l=t.bits,t.mode===q&&(t.back=-1);break}for(t.back=0;y=t.lencode[r&(1<>>24,T=y>>>16&255,k=y&65535,!(_<=l);){if(s===0)break e;s--,r+=i[a++]<>u)],_=y>>>24,T=y>>>16&255,k=y&65535,!(u+_<=l);){if(s===0)break e;s--,r+=i[a++]<>>=u,l-=u,t.back+=u}if(r>>>=_,l-=_,t.back+=_,t.length=k,T===0){t.mode=Yn;break}if(T&32){t.back=-1,t.mode=q;break}if(T&64){e.msg="invalid literal/length code",t.mode=N;break}t.extra=T&15,t.mode=Kn;case Kn:if(t.extra){for(S=t.extra;l>>=t.extra,l-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Gn;case Gn:for(;y=t.distcode[r&(1<>>24,T=y>>>16&255,k=y&65535,!(_<=l);){if(s===0)break e;s--,r+=i[a++]<>u)],_=y>>>24,T=y>>>16&255,k=y&65535,!(u+_<=l);){if(s===0)break e;s--,r+=i[a++]<>>=u,l-=u,t.back+=u}if(r>>>=_,l-=_,t.back+=_,T&64){e.msg="invalid distance code",t.mode=N;break}t.offset=k,t.extra=T&15,t.mode=Xn;case Xn:if(t.extra){for(S=t.extra;l>>=t.extra,l-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=N;break}t.mode=qn;case qn:if(m===0)break e;if(f=h-m,t.offset>f){if(f=t.offset-f,f>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=N;break}f>t.wnext?(f-=t.wnext,g=t.wsize-f):g=t.wnext-f,f>t.length&&(f=t.length),I=t.window}else I=o,g=c-t.offset,f=t.length;f>m&&(f=m),m-=f,t.length-=f;do o[c++]=I[g++];while(--f);t.length===0&&(t.mode=et);break;case Yn:if(m===0)break e;o[c++]=t.length,m--,t.mode=et;break;case Mt:if(t.wrap){for(;l<32;){if(s===0)break e;s--,r|=i[a++]<{if(fe(e))return Z;let n=e.state;return n.window&&(n.window=null),e.state=null,me},ja=(e,n)=>{if(fe(e))return Z;const t=e.state;return(t.wrap&2)===0?Z:(t.head=n,n.done=!1,me)},Ha=(e,n)=>{const t=n.length;let i,o,a;return fe(e)||(i=e.state,i.wrap!==0&&i.mode!==Je)?Z:i.mode===Je&&(o=1,o=Ae(o,n,t,0),o!==i.check)?In:(a=ci(e,n,t,t),a?(i.mode=ei,An):(i.havedict=1,me))};var Wa=oi,Ka=ai,Ga=ii,Xa=Ua,qa=si,Ya=Za,Ja=Pa,Qa=ja,es=Ha,ts="pako inflate (from Nodeca project)",Y={inflateReset:Wa,inflateReset2:Ka,inflateResetKeep:Ga,inflateInit:Xa,inflateInit2:qa,inflate:Ya,inflateEnd:Ja,inflateGetHeader:Qa,inflateSetDictionary:es,inflateInfo:ts};function ns(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var is=ns;const li=Object.prototype.toString,{Z_NO_FLUSH:os,Z_FINISH:as,Z_OK:Ze,Z_STREAM_END:Ft,Z_NEED_DICT:Dt,Z_STREAM_ERROR:ss,Z_DATA_ERROR:di,Z_MEM_ERROR:rs}=Ne;function Rt(e){this.options=Ke.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15)===0&&(n.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new xn,this.strm.avail_out=0;let t=Y.inflateInit2(this.strm,n.windowBits);if(t!==Ze)throw new Error(be[t]);if(this.header=new is,Y.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Oe.string2buf(n.dictionary):li.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=Y.inflateSetDictionary(this.strm,n.dictionary),t!==Ze)))throw new Error(be[t])}Rt.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize,o=this.options.dictionary;let a,c,s;if(this.ended)return!1;for(n===~~n?c=n:c=n===!0?as:os,li.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=Y.inflate(t,c),a===Dt&&o&&(a=Y.inflateSetDictionary(t,o),a===Ze?a=Y.inflate(t,c):a===di&&(a=Dt));t.avail_in>0&&a===Ft&&t.state.wrap>0&&e[t.next_in]!==0;)Y.inflateReset(t),a=Y.inflate(t,c);switch(a){case ss:case di:case Dt:case rs:return this.onEnd(a),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||a===Ft))if(this.options.to==="string"){let m=Oe.utf8border(t.output,t.next_out),r=t.next_out-m,l=Oe.buf2string(t.output,m);t.next_out=r,t.avail_out=i-r,r&&t.output.set(t.output.subarray(m,m+r),0),this.onData(l)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===Ze&&s===0)){if(a===Ft)return a=Y.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},Rt.prototype.onData=function(e){this.chunks.push(e)},Rt.prototype.onEnd=function(e){e===Ze&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ke.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const{Deflate:Ms,deflate:cs,deflateRaw:$s,gzip:Bs}=Ea;var ls=cs;const Ot="viewed_posts",Ut="viewed_posts_binary",ds="viewed_posts_backup",mi="X-pr0gramm-Bits-Version",ms="X-pr0gramm-Nonce";class tt{constructor(){d(this,"id","ViewedPostsMarker");d(this,"name",'"Bereits gesehen"-Markierung');d(this,"description","Markiert bereits gesehene Medien.");d(this,"markOwnFavoritesAsViewed",x.get("ViewedPostsMarker.settings.mark_own_favorites_as_viewed"));d(this,"syncRead",x.get("ViewedPostsMarker.settings.sync_read",!1));d(this,"syncWrite",x.get("ViewedPostsMarker.settings.sync_write",!1));d(this,"syncVersion",null);d(this,"viewedPosts",[]);d(this,"needsSync",!1)}async load(){var i;let n=this;this.needsMigration()&&(Zt("Starting migration..."),this.migrate(),Zt("Migration complete!"));const t=this.loadFromLocalStorage();if(this.updateViewedPosts(t),window.addEventListener("userSync",()=>this.sync()),window.addEventListener("streamLoaded",o=>{var m,r;const a=(r=(m=p.currentView)==null?void 0:m.stream)==null?void 0:r.options;if((a==null?void 0:a.collection)==="favoriten"&&(a==null?void 0:a.self)&&!n.markOwnFavoritesAsViewed)return;const{items:s}=o.data;n.checkAndMarkItems(s.map(l=>l.id))}),(i=p.currentView)!=null&&i.stream){const{items:o}=p.currentView.stream;n.checkAndMarkItems(Object.keys(o).map(a=>Number(a)))}window.addEventListener("itemOpened",o=>{const a=Number(o.data.itemData.id);n.mergeIntoViewedPosts([a]),tt.markAsViewed(a)}),G.addVideoConstants(),P(Oi)}static markAsViewed(n){let t=document.querySelector(`#item-${n} > p-thumbnail`);t&&t.setAttribute("seen","")}getSettings(){return[{id:"mark_own_favorites_as_viewed",title:"Eigene Favoriten ebenfalls als gelesen markieren",description:"Markiert Posts in den pers\xF6nlichen Sammlungen als gelesen",type:"checkbox"},{id:"sync_read",title:"Lesend Synchronisieren",description:"Synchronisiert LESEND mit den pr0gramm Servern. Das bedeutet, dass gesehene Posts aus der App in p0weruser \xFCbertragen werden, aber nicht umgekehrt",type:"checkbox"},{id:"sync_write",title:"Schreibend Synchronisieren !!! VORSICHT !!!",description:"Synchronisiert SCHREIBEND mit den pr0gramm Servern. Funktioniert nur in Verbindung mit der Lesenden Option. \xC4nderungen an der Schnittstelle oder ein Bug in p0weruser kann die Posts kaputt machen. Au\xDFerdem ist das Feature noch nicht ausgiebig getestet. Benutzung auf eigene Gefahr!",type:"checkbox"}]}async sync(){if(p.user.id!==void 0)try{if(this.syncRead){const n=await this.loadFromApi();this.mergeIntoViewedPosts(n),this.syncWrite&&this.syncVersion!==null&&this.needsSync&&await this.writeToApi(this.viewedPosts)}}catch(n){console.error("Synchronization failed",n)}this.writeToLocalStorage(this.viewedPosts)}checkAndMarkItems(n){for(const t of n){const i=Number(t);this.isSeen(i)&&tt.markAsViewed(i)}}async loadFromApi(){const n=await fetch("/api/seen/data?compressed=false&binary=true");if(!n.ok)return[];const t=await n.arrayBuffer(),i=Number(n.headers.get(mi));return this.syncVersion===i?this.viewedPosts:(this.syncVersion=i,this.parseSeenPostIdsFromBinary(new Uint8Array(t)))}loadFromLocalStorage(){const n=window.localStorage.getItem(Ut)||"",t=Uint8Array.from(atob(n),i=>i.charCodeAt(0));return this.parseSeenPostIdsFromBinary(t)}async writeToApi(n){if(this.syncVersion===null)throw new Error("Version is null");const{id:t}=p.user;if(t===void 0)throw new Error("Not logged In");const i=this.convertPostIdsToBinary(n),o=ls(i,{level:9}),a=await fetch("/api/seen/update",{method:"POST",body:new Blob([o]),headers:{"Content-Type":"application/octet",[mi]:`${this.syncVersion}`,[ms]:t.substring(0,16)}});if(!a.ok)throw new Error("Could not update seen bits");const c=await a.json();if(!c.success)throw new Error("Could not update seen bits");this.syncVersion=c.version}writeToLocalStorage(n){const t=this.convertPostIdsToBinary(n);let i="";for(let o=0;o0}mergeIntoViewedPosts(n){const t=(i,o)=>{let a=0,c=o.length;for(;a>>1;o[s]t-i)}isSeen(n){let t=0,i=this.viewedPosts.length-1;for(;t<=i;){const o=Math.floor((t+i)/2);if(this.viewedPosts[o]===n)return!0;n=t.length)throw new Error(`ID ${i} exceeded limit`);const c=t[o]|1<<7-i%8;t[o]=c}return t}parseSeenPostIdsFromBinary(n){let t=[];for(let i=0;i.side-wide-skyscraper{display:none}body[class] #page.desktop,body[class] #page #head{padding:0 20px;width:100%!important}body[class] #page.desktop #pr0-miner,body[class] #page #head #pr0-miner{display:none}body[class] #page #main-view #stream{text-align:center;display:block;margin:0 auto}body[class] #page #main-view #stream a.thumb{display:block;float:left}body[class] #page #main-view #stream .stream-row{clear:none;text-align:center}body[class] #page #head{background:rgba(0,0,0,.8);width:100%!important}body[class] #page #head #head-content{background:none;display:flex;align-items:center}body[class] #page #head #head-content #loader{left:-20px;right:-20px}body[class] #page #head #head-content #filter-menu{left:calc(50% - 135px)}body[class] #page #head #head-content>.user-info{order:20;margin:0}body[class] #page #head #head-content>#head-menu{padding:0;order:3;flex-grow:1;display:flex;align-items:center;justify-content:center}body[class] #page #head #head-content>#pr0gramm-logo-link{order:1;height:24px;margin:0}body[class] #page #head #head-content a[id*=badge]{order:2;position:relative;top:0;left:0;margin-left:5px;transform:scale(.75)}body[class] #page #head #head-content .sidebar-toggle{order:0;color:#fff;font-size:20px;margin-right:10px}body[class] #page #head #head-content .sidebar-toggle.active{color:#ee4d2e}body[class]>#footer-links{width:250px;left:-250px!important;position:fixed;margin:0;top:52px;border-right:3px solid #2a2e31;background:#161618;transition:left .2s linear;z-index:500}body[class]>#footer-links.open{left:0!important;box-shadow:2px 0 10px #000}body[class]>#footer-links a{color:#fff;display:block;text-align:left;padding:10px 20px;margin-right:0;font-size:16px}body[class]>#footer-links a:hover{color:#ee4d2e}body[class]>#footer-links a:before{font-family:FontAwesome;margin-right:10px;display:inline-block;width:20px}body[class]>#footer-links a[href="/faq"]:before{content:"\\f059"}body[class]>#footer-links a[href="/contact"]:before{content:"\\f0e0"}body[class]>#footer-links a[href*="//miner.pr0gramm.com"]:before{content:"\\f15a"}body[class]>#footer-links a[href*="/datasafety"]:before{content:"\\f06e"}body[class]>#footer-links a[href="http://app.pr0gramm.com"]:before{content:"\\f10b"}body[class]>#footer-links a[href="https://twitter.com/pr0gramm"]:before{content:"\\f099"}body[class]>#footer-links a[href="https://pr0mart.com"]:before{content:"\\f07a"}#stream .item-container{margin:0;max-height:calc(100vh - 52px);display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.9);position:fixed;top:52px;right:0;left:-20px;bottom:-20px;padding:0;z-index:10}#stream .item-container .item-pointer{display:none}#stream .item-container .item-container-content{display:flex;overflow:unset;height:100%;width:100%}#stream .item-container .item-container-content.right{flex-direction:row-reverse}#stream .item-container .item-container-content.right .comments-switch{transform:rotate(180deg)}#stream .item-container .item-container-content.right .video-controls{padding-left:30px}#stream .item-container .item-container-content .image-main{position:relative;display:flex;width:100%;flex-direction:column}#stream .item-container .item-container-content .image-main .item-info{display:flex;align-items:center;justify-content:center;min-height:120px}#stream .item-container .item-container-content .image-main .item-info>div{position:relative;display:flex;width:90%;max-width:980px}#stream .item-container .item-container-content .image-main .item-info>div .item-details,#stream .item-container .item-container-content .image-main .item-info>div .item-tags{padding:5px 20px 5px 40px}#stream .item-container .item-container-content .image-main .item-info>div .item-details .item-report{margin-left:10px}#stream .item-container .item-container-content .image-main .item-info>div .item-vote{display:flex;align-items:center;left:0;top:0;position:relative}#stream .item-container .item-container-content .image-main .item-info>div .item-vote .collect{position:relative;left:0;top:0}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div{display:flex;align-items:center;position:relative;min-width:80px}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .vote-fav{position:relative;margin-left:20px;font-size:32px;left:0;top:0}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .score,#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .score-hidden{position:relative;top:0;left:10px}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .benisbar{height:3px;display:none;position:absolute;bottom:-5px;left:0;right:0;background-color:#5cb85c}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .benisbar.show{display:block}#stream .item-container .item-container-content .image-main .item-info>div .item-vote>div .benisbar:after{content:attr(data-after-text);bottom:-20px;position:absolute;color:#bbb;white-space:nowrap}#stream .item-container .item-container-content .image-main .item-image-wrapper{flex-grow:1;overflow:hidden;display:flex;align-items:center;justify-content:center;padding:40px}#stream .item-container .item-container-content .image-main .item-image-wrapper .move-link{position:absolute;color:#fff;opacity:.7;padding:0 24px;font-size:26px;right:0;top:24px;text-shadow:0 0 3px #000;z-index:99999}#stream .item-container .item-container-content .image-main .item-image-wrapper .move-link:hover{color:#ee4d2e}#stream .item-container .item-container-content .image-main .item-image-wrapper div.stream-next,#stream .item-container .item-container-content .image-main .item-image-wrapper div.stream-prev{top:unset;bottom:unset;padding:128px 24px!important}#stream .item-container .item-container-content .image-main .item-image-wrapper .item-fullsize-link+.move-link{top:60px}#stream .item-container .item-container-content .image-main .item-image-wrapper .video-controls{height:50px}#stream .item-container .item-container-content .image-main .item-image-wrapper.resized .item-image{max-height:calc(100vh - 200px);top:auto!important;left:auto!important}#stream .item-container .item-container-content .image-main .item-image-wrapper.oversize:not(.resized) .item-image{cursor:move}#stream .item-container .item-container-content .image-main .item-image-wrapper.oversize:not(.resized) img{max-height:none!important;align-self:flex-start}#stream .item-container .item-container-content .image-main .item-image-wrapper .video-controls{width:100%!important}#stream .item-container .item-container-content .image-main .item-image-wrapper .video-controls .video-position-bar-background{min-height:2px}#stream .item-container .item-container-content .image-main .item-image-wrapper .item-image{outline:none;display:flex;align-items:center;justify-content:center;max-width:100%;max-height:100%;width:auto!important}#stream .item-container .item-container-content .image-main .item-image-wrapper .item-image .item-image-thumb{display:none!important}#stream .item-container .item-container-content .image-main .item-image-wrapper .item-image .item-image-actual{height:auto!important;width:auto!important;max-width:100%;max-height:100%;position:relative;margin:0 auto}#stream .item-container .item-container-content .item-comments{background:#161618;flex-grow:0;flex-shrink:0;border-right:3px solid #2a2e31;transition:width .2s ease-out}#stream .item-container .item-container-content .item-comments.loaded{width:30vw}#stream .item-container .item-container-content .item-comments.loaded.wide{width:40vw}#stream .item-container .item-container-content .item-comments.closed,#stream .item-container .item-container-content .item-comments.closed .comment-count{width:60px!important}#stream .item-container .item-container-content .item-comments.closed .count,#stream .item-container .item-container-content .item-comments.closed .comments-head,#stream .item-container .item-container-content .item-comments.closed .comments-switch{display:none}#stream .item-container .item-container-content .item-comments .vote-cfav{color:#888;font-size:16px;cursor:pointer;position:relative;padding:0 5px 0 0;top:4px}#stream .item-container .item-container-content .item-comments .vote-cfav.faved,#stream .item-container .item-container-content .item-comments .vote-cfav:hover,#stream .item-container .item-container-content .item-comments .comment[voted-up] .vote-up{color:var(--theme-main-color)}#stream .item-container .item-container-content .item-comments .comment[voted-up] .vote-down,#stream .item-container .item-container-content .item-comments .comment[voted-down] .vote-up{color:#3c3c3c}#stream .item-container .item-container-content .item-comments .comment[voted-down] .vote-down{color:#f5f7f6}#stream .item-container .item-container-content .item-comments .comment[voted-down] .comment-content{color:#666}#stream .item-container .item-container-content .item-comments.toggled{transition:width .2s ease-out}#stream .item-container .item-container-content .item-comments.wide{width:40vw}#stream .item-container .item-container-content .item-comments.wide .comments-switch:before{content:"\\f053"}#stream .item-container .item-container-content .item-comments.wide .comment-count{width:40vw}#stream .item-container .item-container-content .item-comments .comments-head{padding:10px 10px 10px 30px;opacity:1;transition:opacity .2s;overflow-y:auto;height:calc(100vh - 90px)}#stream .item-container .item-container-content .item-comments .comments-head .comment-content,#stream .item-container .item-container-content .item-comments .comments-head .comment-foot,#stream .item-container .item-container-content .item-comments .comments-head .comment{max-width:100%}#stream .item-container .item-container-content .item-comments .comments-head .comment-report{margin-right:5px}#stream .item-container .item-container-content .item-comments .comment-count{display:flex;align-items:center;background-color:#2a2e31;text-align:left;padding:10px 10px 10px 35px;transition:width .2s ease-out;z-index:400;width:30vw}#stream .item-container .item-container-content .item-comments .comment-count>div:first-child{flex-grow:1}#stream .item-container .item-container-content .item-comments .comment-count .fa{cursor:pointer}#stream .item-container .item-container-content .item-comments .comment-count .fa:not(:last-child){margin-right:10px}#stream .item-container .item-container-content .item-comments textarea{transition:height .2s ease-out}#stream .item-container .item-container-content .item-comments textarea.comment:focus,#stream .item-container .item-container-content .item-comments textarea.comment:valid,#stream .item-container .item-container-content .item-comments textarea.reply{height:75px} `,hs=`