@hkonda/loco-translate 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,69 @@
1
+ var Pf=Object.defineProperty;var Df=(e,t,n)=>t in e?Pf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var zn=(e,t,n)=>Df(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Be(){}function Ll(e,t){for(const n in t)e[n]=t[n];return e}function kc(e){return e()}function ao(){return Object.create(null)}function lt(e){e.forEach(kc)}function Fi(e){return typeof e=="function"}function $t(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let hl;function Nl(e,t){return e===t?!0:(hl||(hl=document.createElement("a")),hl.href=t,e===hl.href)}function Ff(e){return Object.keys(e).length===0}function wc(e,...t){if(e==null){for(const r of t)r(void 0);return Be}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Gr(e,t,n){e.$$.on_destroy.push(wc(t,n))}function fr(e,t,n){return e.set(n),t}function u(e,t){e.appendChild(t)}function R(e,t,n){e.insertBefore(t,n||null)}function j(e){e.parentNode&&e.parentNode.removeChild(e)}function ft(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function b(e){return document.createElement(e)}function de(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function O(e){return document.createTextNode(e)}function E(){return O(" ")}function Ct(){return O("")}function Q(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function nn(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function Lr(e){return function(t){t.target===this&&e.call(this,t)}}function a(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function xc(e){return e===""?null:+e}function Of(e){return Array.from(e.childNodes)}function ee(e,t){t=""+t,e.data!==t&&(e.data=t)}function Ie(e,t){e.value=t??""}function gt(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function vt(e,t,n){for(let r=0;r<e.options.length;r+=1){const l=e.options[r];if(l.__value===t){l.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function tn(e){const t=e.querySelector(":checked");return t&&t.__value}function uo(e,t,n){e.classList.toggle(t,!!n)}function jf(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}class Cc{constructor(t=!1){zn(this,"is_svg",!1);zn(this,"e");zn(this,"n");zn(this,"t");zn(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,r=null){this.e||(this.is_svg?this.e=de(n.nodeName):this.e=b(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(r)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)R(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(j)}}function zl(e,t){return new e(t)}let Kr;function Jr(e){Kr=e}function Xl(){if(!Kr)throw new Error("Function called outside component initialization");return Kr}function Nr(e){Xl().$$.on_mount.push(e)}function Rf(e){Xl().$$.after_update.push(e)}function Sc(e){Xl().$$.on_destroy.push(e)}function Oi(){const e=Xl();return(t,n,{cancelable:r=!1}={})=>{const l=e.$$.callbacks[t];if(l){const o=jf(t,n,{cancelable:r});return l.slice().forEach(i=>{i.call(e,o)}),!o.defaultPrevented}return!0}}function wr(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(r=>r.call(this,t))}const gr=[],Hn=[];let yr=[];const co=[],Ac=Promise.resolve();let ki=!1;function Tc(){ki||(ki=!0,Ac.then(Mc))}function xr(){return Tc(),Ac}function It(e){yr.push(e)}const si=new Set;let dr=0;function Mc(){if(dr!==0)return;const e=Kr;do{try{for(;dr<gr.length;){const t=gr[dr];dr++,Jr(t),Bf(t.$$)}}catch(t){throw gr.length=0,dr=0,t}for(Jr(null),gr.length=0,dr=0;Hn.length;)Hn.pop()();for(let t=0;t<yr.length;t+=1){const n=yr[t];si.has(n)||(si.add(n),n())}yr.length=0}while(gr.length);for(;co.length;)co.pop()();ki=!1,si.clear(),Jr(e)}function Bf(e){if(e.fragment!==null){e.update(),lt(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(It)}}function Uf(e){const t=[],n=[];yr.forEach(r=>e.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),yr=t}const Cl=new Set;let Wn;function Gt(){Wn={r:0,c:[],p:Wn}}function Kt(){Wn.r||lt(Wn.c),Wn=Wn.p}function st(e,t){e&&e.i&&(Cl.delete(e),e.i(t))}function ct(e,t,n,r){if(e&&e.o){if(Cl.has(e))return;Cl.add(e),Wn.c.push(()=>{Cl.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function Oe(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function ji(e,t){e.d(1),t.delete(e.key)}function Ec(e,t){ct(e,1,1,()=>{t.delete(e.key)})}function tl(e,t,n,r,l,o,i,s,c,f,d,h){let p=e.length,g=o.length,_=p;const m={};for(;_--;)m[e[_].key]=_;const y=[],v=new Map,k=new Map,C=[];for(_=g;_--;){const N=h(l,o,_),L=n(N);let I=i.get(L);I?C.push(()=>I.p(N,t)):(I=f(L,N),I.c()),v.set(L,y[_]=I),L in m&&k.set(L,Math.abs(_-m[L]))}const x=new Set,S=new Set;function M(N){st(N,1),N.m(s,d),i.set(N.key,N),d=N.first,g--}for(;p&&g;){const N=y[g-1],L=e[p-1],I=N.key,P=L.key;N===L?(d=N.first,p--,g--):v.has(P)?!i.has(I)||x.has(I)?M(N):S.has(P)?p--:k.get(I)>k.get(P)?(S.add(I),M(N)):(x.add(P),p--):(c(L,i),p--)}for(;p--;){const N=e[p];v.has(N.key)||c(N,i)}for(;g;)M(y[g-1]);return lt(C),y}function Il(e,t){const n={},r={},l={$$scope:1};let o=e.length;for(;o--;){const i=e[o],s=t[o];if(s){for(const c in i)c in s||(r[c]=1);for(const c in s)l[c]||(n[c]=s[c],l[c]=1);e[o]=s}else for(const c in i)l[c]=1}for(const i in r)i in n||(n[i]=void 0);return n}function Pl(e){return typeof e=="object"&&e!==null?e:{}}function rn(e){e&&e.c()}function Xt(e,t,n){const{fragment:r,after_update:l}=e.$$;r&&r.m(t,n),It(()=>{const o=e.$$.on_mount.map(kc).filter(Fi);e.$$.on_destroy?e.$$.on_destroy.push(...o):lt(o),e.$$.on_mount=[]}),l.forEach(It)}function Qt(e,t){const n=e.$$;n.fragment!==null&&(Uf(n.after_update),lt(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Hf(e,t){e.$$.dirty[0]===-1&&(gr.push(e),Tc(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function on(e,t,n,r,l,o,i=null,s=[-1]){const c=Kr;Jr(e);const f=e.$$={fragment:null,ctx:[],props:o,update:Be,not_equal:l,bound:ao(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:ao(),dirty:s,skip_bound:!1,root:t.target||c.$$.root};i&&i(f.root);let d=!1;if(f.ctx=n?n(e,t.props||{},(h,p,...g)=>{const _=g.length?g[0]:p;return f.ctx&&l(f.ctx[h],f.ctx[h]=_)&&(!f.skip_bound&&f.bound[h]&&f.bound[h](_),d&&Hf(e,h)),p}):[],f.update(),d=!0,lt(f.before_update),f.fragment=r?r(f.ctx):!1,t.target){if(t.hydrate){const h=Of(t.target);f.fragment&&f.fragment.l(h),h.forEach(j)}else f.fragment&&f.fragment.c();t.intro&&st(e.$$.fragment),Xt(e,t.target,t.anchor),Mc()}Jr(c)}class sn{constructor(){zn(this,"$$");zn(this,"$$set")}$destroy(){Qt(this,1),this.$destroy=Be}$on(t,n){if(!Fi(n))return Be;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const l=r.indexOf(n);l!==-1&&r.splice(l,1)}}$set(t){this.$$set&&!Ff(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Wf="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Wf);let wi=null;function Lc(e){wi=e}function Ze(e,t={}){const n={...t.headers||{}};return wi&&(n["X-API-Key"]=wi),fetch(e,{...t,headers:n})}const hr=[];function Nc(e,t){return{subscribe:Ri(e,t).subscribe}}function Ri(e,t=Be){let n;const r=new Set;function l(s){if($t(e,s)&&(e=s,n)){const c=!hr.length;for(const f of r)f[1](),hr.push(f,e);if(c){for(let f=0;f<hr.length;f+=2)hr[f][0](hr[f+1]);hr.length=0}}}function o(s){l(s(e))}function i(s,c=Be){const f=[s,c];return r.add(f),r.size===1&&(n=t(l,o)||Be),s(e),()=>{r.delete(f),r.size===0&&n&&(n(),n=null)}}return{set:l,update:o,subscribe:i}}function zc(e,t,n){const r=!Array.isArray(e),l=r?[e]:e;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const o=t.length<2;return Nc(n,(i,s)=>{let c=!1;const f=[];let d=0,h=Be;const p=()=>{if(d)return;h();const _=t(r?f[0]:f,i,s);o?i(_):h=Fi(_)?_:Be},g=l.map((_,m)=>wc(_,y=>{f[m]=y,d&=~(1<<m),c&&p()},()=>{d|=1<<m}));return c=!0,p(),function(){lt(g),h(),c=!1}})}const an=Ri(null);function Zf(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,l,o,i=[],s="",c=e.split("/");for(c[0]||c.shift();l=c.shift();)n=l[0],n==="*"?(i.push("wild"),s+="/(.*)"):n===":"?(r=l.indexOf("?",1),o=l.indexOf(".",1),i.push(l.substring(1,~r?r:~o?o:l.length)),s+=~r&&!~o?"(?:/([^/]+?))?":"/([^/]+?)",~o&&(s+=(~r?"?":"")+"\\"+l.substring(o))):s+="/"+l;return{keys:i,pattern:new RegExp("^"+s+"/?$","i")}}function Vf(e){let t,n,r;const l=[e[2]];var o=e[0];function i(s,c){let f={};for(let d=0;d<l.length;d+=1)f=Ll(f,l[d]);return c!==void 0&&c&4&&(f=Ll(f,Il(l,[Pl(s[2])]))),{props:f}}return o&&(t=zl(o,i(e)),t.$on("routeEvent",e[7])),{c(){t&&rn(t.$$.fragment),n=Ct()},m(s,c){t&&Xt(t,s,c),R(s,n,c),r=!0},p(s,c){if(c&1&&o!==(o=s[0])){if(t){Gt();const f=t;ct(f.$$.fragment,1,0,()=>{Qt(f,1)}),Kt()}o?(t=zl(o,i(s,c)),t.$on("routeEvent",s[7]),rn(t.$$.fragment),st(t.$$.fragment,1),Xt(t,n.parentNode,n)):t=null}else if(o){const f=c&4?Il(l,[Pl(s[2])]):{};t.$set(f)}},i(s){r||(t&&st(t.$$.fragment,s),r=!0)},o(s){t&&ct(t.$$.fragment,s),r=!1},d(s){s&&j(n),t&&Qt(t,s)}}}function Yf(e){let t,n,r;const l=[{params:e[1]},e[2]];var o=e[0];function i(s,c){let f={};for(let d=0;d<l.length;d+=1)f=Ll(f,l[d]);return c!==void 0&&c&6&&(f=Ll(f,Il(l,[c&2&&{params:s[1]},c&4&&Pl(s[2])]))),{props:f}}return o&&(t=zl(o,i(e)),t.$on("routeEvent",e[6])),{c(){t&&rn(t.$$.fragment),n=Ct()},m(s,c){t&&Xt(t,s,c),R(s,n,c),r=!0},p(s,c){if(c&1&&o!==(o=s[0])){if(t){Gt();const f=t;ct(f.$$.fragment,1,0,()=>{Qt(f,1)}),Kt()}o?(t=zl(o,i(s,c)),t.$on("routeEvent",s[6]),rn(t.$$.fragment),st(t.$$.fragment,1),Xt(t,n.parentNode,n)):t=null}else if(o){const f=c&6?Il(l,[c&2&&{params:s[1]},c&4&&Pl(s[2])]):{};t.$set(f)}},i(s){r||(t&&st(t.$$.fragment,s),r=!0)},o(s){t&&ct(t.$$.fragment,s),r=!1},d(s){s&&j(n),t&&Qt(t,s)}}}function qf(e){let t,n,r,l;const o=[Yf,Vf],i=[];function s(c,f){return c[1]?0:1}return t=s(e),n=i[t]=o[t](e),{c(){n.c(),r=Ct()},m(c,f){i[t].m(c,f),R(c,r,f),l=!0},p(c,[f]){let d=t;t=s(c),t===d?i[t].p(c,f):(Gt(),ct(i[d],1,1,()=>{i[d]=null}),Kt(),n=i[t],n?n.p(c,f):(n=i[t]=o[t](c),n.c()),st(n,1),n.m(r.parentNode,r))},i(c){l||(st(n),l=!0)},o(c){ct(n),l=!1},d(c){c&&j(r),i[t].d(c)}}}function fo(){const e=window.location.href.indexOf("#/");let t=e>-1?window.location.href.substr(e+1):"/";const n=t.indexOf("?");let r="";return n>-1&&(r=t.substr(n+1),t=t.substr(0,n)),{location:t,querystring:r}}const Bi=Nc(null,function(t){t(fo());const n=()=>{t(fo())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}),Jf=zc(Bi,e=>e.location);zc(Bi,e=>e.querystring);const ho=Ri(void 0);async function mr(e){if(!e||e.length<1||e.charAt(0)!="/"&&e.indexOf("#/")!==0)throw Error("Invalid parameter location");await xr(),history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=(e.charAt(0)=="#"?"":"#")+e}function Gf(e){e?window.scrollTo(e.__svelte_spa_router_scrollX,e.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function Kf(e,t,n){let{routes:r={}}=t,{prefix:l=""}=t,{restoreScrollState:o=!1}=t;class i{constructor(S,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!S||typeof S=="string"&&(S.length<1||S.charAt(0)!="/"&&S.charAt(0)!="*")||typeof S=="object"&&!(S instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:N,keys:L}=Zf(S);this.path=S,typeof M=="object"&&M._sveltesparouter===!0?(this.component=M.component,this.conditions=M.conditions||[],this.userData=M.userData,this.props=M.props||{}):(this.component=()=>Promise.resolve(M),this.conditions=[],this.props={}),this._pattern=N,this._keys=L}match(S){if(l){if(typeof l=="string")if(S.startsWith(l))S=S.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const I=S.match(l);if(I&&I[0])S=S.substr(I[0].length)||"/";else return null}}const M=this._pattern.exec(S);if(M===null)return null;if(this._keys===!1)return M;const N={};let L=0;for(;L<this._keys.length;){try{N[this._keys[L]]=decodeURIComponent(M[L+1]||"")||null}catch{N[this._keys[L]]=null}L++}return N}async checkConditions(S){for(let M=0;M<this.conditions.length;M++)if(!await this.conditions[M](S))return!1;return!0}}const s=[];r instanceof Map?r.forEach((x,S)=>{s.push(new i(S,x))}):Object.keys(r).forEach(x=>{s.push(new i(x,r[x]))});let c=null,f=null,d={};const h=Oi();async function p(x,S){await xr(),h(x,S)}let g=null,_=null;o&&(_=x=>{x.state&&(x.state.__svelte_spa_router_scrollY||x.state.__svelte_spa_router_scrollX)?g=x.state:g=null},window.addEventListener("popstate",_),Rf(()=>{Gf(g)}));let m=null,y=null;const v=Bi.subscribe(async x=>{m=x;let S=0;for(;S<s.length;){const M=s[S].match(x.location);if(!M){S++;continue}const N={route:s[S].path,location:x.location,querystring:x.querystring,userData:s[S].userData,params:M&&typeof M=="object"&&Object.keys(M).length?M:null};if(!await s[S].checkConditions(N)){n(0,c=null),y=null,p("conditionsFailed",N);return}p("routeLoading",Object.assign({},N));const L=s[S].component;if(y!=L){L.loading?(n(0,c=L.loading),y=L,n(1,f=L.loadingParams),n(2,d={}),p("routeLoaded",Object.assign({},N,{component:c,name:c.name,params:f}))):(n(0,c=null),y=null);const I=await L();if(x!=m)return;n(0,c=I&&I.default||I),y=L}M&&typeof M=="object"&&Object.keys(M).length?n(1,f=M):n(1,f=null),n(2,d=s[S].props),p("routeLoaded",Object.assign({},N,{component:c,name:c.name,params:f})).then(()=>{ho.set(f)});return}n(0,c=null),y=null,ho.set(void 0)});Sc(()=>{v(),_&&window.removeEventListener("popstate",_)});function k(x){wr.call(this,e,x)}function C(x){wr.call(this,e,x)}return e.$$set=x=>{"routes"in x&&n(3,r=x.routes),"prefix"in x&&n(4,l=x.prefix),"restoreScrollState"in x&&n(5,o=x.restoreScrollState)},e.$$.update=()=>{e.$$.dirty&32&&(history.scrollRestoration=o?"manual":"auto")},[c,f,d,r,l,o,k,C]}class Xf extends sn{constructor(t){super(),on(this,t,Kf,qf,$t,{routes:3,prefix:4,restoreScrollState:5})}}function po(e,t,n){const r=e.slice();return r[5]=t[n],r}function go(e){let t,n,r=e[5].icon+"",l,o,i,s,c,f;function d(){return e[3](e[5])}return{c(){t=b("button"),n=b("span"),l=E(),o=b("span"),o.textContent=`${e[5].label}`,i=E(),a(t,"class",s="w-full text-left px-4 py-2.5 flex items-center gap-3 text-sm transition-colors "+(e[0]===e[5].id?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))},m(h,p){R(h,t,p),u(t,n),n.innerHTML=r,u(t,l),u(t,o),u(t,i),c||(f=Q(t,"click",d),c=!0)},p(h,p){e=h,p&1&&s!==(s="w-full text-left px-4 py-2.5 flex items-center gap-3 text-sm transition-colors "+(e[0]===e[5].id?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))&&a(t,"class",s)},d(h){h&&j(t),c=!1,f()}}}function Qf(e){let t,n,r,l,o,i,s=Oe(e[1]),c=[];for(let f=0;f<s.length;f+=1)c[f]=go(po(e,s,f));return{c(){t=b("aside"),n=b("div"),n.innerHTML=`<a href="/" class="text-lg font-bold flex items-center gap-2 text-white no-underline hover:opacity-80 transition-opacity"><svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" width="28" height="28"><defs><clipPath id="sb-clip"><circle cx="100" cy="100" r="90"></circle></clipPath></defs><circle cx="100" cy="100" r="90" fill="#1a1f2e"></circle><g clip-path="url(#sb-clip)"><g transform="translate(100,108) scale(0.72) translate(-334,-198)"><ellipse cx="310" cy="318" rx="10" ry="38" fill="#2ECC88" transform="rotate(-18 310 318)"></ellipse><ellipse cx="326" cy="326" rx="9" ry="42" fill="#34D99A" transform="rotate(-6 326 326)"></ellipse><ellipse cx="342" cy="328" rx="9" ry="42" fill="#7BC74A" transform="rotate(6 342 328)"></ellipse><ellipse cx="357" cy="320" rx="9" ry="36" fill="#F07040" transform="rotate(18 357 320)"></ellipse><ellipse cx="334" cy="240" rx="62" ry="80" fill="#2ECC88"></ellipse><ellipse cx="334" cy="252" rx="36" ry="52" fill="#D4F4B0"></ellipse><path d="M275 220 Q228 190 232 265 Q248 295 280 285 Q268 255 275 220Z" fill="#3A8FE0"></path><path d="M277 225 Q238 208 240 262 Q252 285 278 277 Q268 252 277 225Z" fill="#6BB3FF" opacity="0.7"></path><path d="M393 220 Q440 190 436 265 Q420 295 388 285 Q400 255 393 220Z" fill="#3A8FE0"></path><path d="M391 225 Q430 208 428 262 Q416 285 390 277 Q400 252 391 225Z" fill="#6BB3FF" opacity="0.7"></path><ellipse cx="334" cy="172" rx="38" ry="30" fill="#2ECC88"></ellipse><circle cx="334" cy="148" r="52" fill="#2ECC88"></circle><ellipse cx="334" cy="118" rx="30" ry="18" fill="#FFB833"></ellipse><circle cx="312" cy="138" r="14" fill="white"></circle><circle cx="315" cy="140" r="9" fill="#2C2C2A"></circle><circle cx="315" cy="140" r="4" fill="#04342C"></circle><circle cx="319" cy="136" r="3.5" fill="white"></circle><circle cx="356" cy="138" r="14" fill="white"></circle><circle cx="353" cy="140" r="9" fill="#2C2C2A"></circle><circle cx="353" cy="140" r="4" fill="#04342C"></circle><circle cx="357" cy="136" r="3.5" fill="white"></circle><path d="M326 155 Q334 144 342 155 Q342 170 334 173 Q326 170 326 155Z" fill="#E8A020"></path><path d="M328 165 Q334 158 340 165 Q340 174 334 176 Q328 174 328 165Z" fill="#A06010"></path><ellipse cx="302" cy="152" rx="12" ry="8" fill="#F07040" opacity="0.8"></ellipse><ellipse cx="366" cy="152" rx="12" ry="8" fill="#F07040" opacity="0.8"></ellipse><path d="M320 100 Q316 68 308 52" stroke="#FFB833" stroke-width="6" fill="none" stroke-linecap="round"></path><path d="M334 97 Q334 64 334 46" stroke="#7BC74A" stroke-width="6" fill="none" stroke-linecap="round"></path><path d="M348 100 Q352 68 360 52" stroke="#F07040" stroke-width="6" fill="none" stroke-linecap="round"></path><circle cx="308" cy="50" r="8" fill="#FFB833"></circle><circle cx="334" cy="44" r="8" fill="#7BC74A"></circle><circle cx="360" cy="50" r="8" fill="#F07040"></circle><rect x="260" y="330" width="168" height="10" rx="5" fill="#8B5E20"></rect><path d="M310 330 L300 350 M310 330 L315 352 M310 330 L325 348" stroke="#A07030" stroke-width="4" fill="none" stroke-linecap="round"></path><path d="M360 330 L350 350 M360 330 L365 352 M360 330 L375 348" stroke="#A07030" stroke-width="4" fill="none" stroke-linecap="round"></path></g></g></svg>
2
+ Loco</a> <p class="text-xs text-gray-400 mt-1">Translation Manager</p>`,r=E(),l=b("nav");for(let f=0;f<c.length;f+=1)c[f].c();o=E(),i=b("div"),i.textContent="Loco v1.0",a(n,"class","p-4 border-b border-gray-700"),a(l,"class","flex-1 py-4"),a(i,"class","p-4 border-t border-gray-700 text-xs text-gray-500"),a(t,"class","w-56 bg-gray-900 text-white flex flex-col min-h-screen shrink-0")},m(f,d){R(f,t,d),u(t,n),u(t,r),u(t,l);for(let h=0;h<c.length;h+=1)c[h]&&c[h].m(l,null);u(t,o),u(t,i)},p(f,[d]){if(d&7){s=Oe(f[1]);let h;for(h=0;h<s.length;h+=1){const p=po(f,s,h);c[h]?c[h].p(p,d):(c[h]=go(p),c[h].c(),c[h].m(l,null))}for(;h<c.length;h+=1)c[h].d(1);c.length=s.length}},i:Be,o:Be,d(f){f&&j(t),ft(c,f)}}}function $f(e,t,n){let{currentView:r="translations"}=t;const l=Oi(),o=[{id:"translations",label:"Translation Manager",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#93c5fd" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10A15.3 15.3 0 0 1 12 2z"/></svg>'},{id:"ai-translate",label:"AI Translate",icon:'<svg viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z" fill="#FFB833"/><path d="M19 14L20 16.5L22.5 17.5L20 18.5L19 21L18 18.5L15.5 17.5L18 16.5Z" fill="#F07040"/><path d="M5 16L6 18L8 19L6 20L5 22L4 20L2 19L4 18Z" fill="#2ECC88"/></svg>'},{id:"labels",label:"Labels",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/></svg>'},{id:"analytics",label:"Analytics",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#34d399" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/><line x1="2" y1="20" x2="22" y2="20"/></svg>'},{id:"settings",label:"Settings",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>'}];function i(c){l("navigate",c)}const s=c=>i(c.id);return e.$$set=c=>{"currentView"in c&&n(0,r=c.currentView)},[r,o,i,s]}class ed extends sn{constructor(t){super(),on(this,t,$f,Qf,$t,{currentView:0})}}function mo(e,t,n){const r=e.slice();return r[32]=t[n],r}function _o(e){let t,n,r,l,o,i,s,c,f,d=Oe(e[0]),h=[];for(let m=0;m<d.length;m+=1)h[m]=yo(mo(e,d,m));function p(m,y){return m[5]?ld:m[4]?rd:m[3]?nd:td}let g=p(e),_=g(e);return{c(){t=b("div"),n=E(),r=b("div"),l=b("div"),l.innerHTML='<p class="text-xs text-gray-400 px-2 py-1 font-medium uppercase tracking-wide">Projects</p>',o=E(),i=b("div");for(let m=0;m<h.length;m+=1)h[m].c();s=E(),_.c(),a(t,"class","fixed inset-0 z-40"),a(l,"class","p-2 border-b border-gray-700"),a(i,"class","max-h-48 overflow-y-auto"),a(r,"class","absolute right-0 top-full mt-1 z-50 bg-gray-900 border border-gray-700 rounded-xl shadow-2xl w-64 overflow-hidden")},m(m,y){R(m,t,y),R(m,n,y),R(m,r,y),u(r,l),u(r,o),u(r,i);for(let v=0;v<h.length;v+=1)h[v]&&h[v].m(i,null);u(r,s),_.m(r,null),c||(f=Q(t,"click",e[13]),c=!0)},p(m,y){if(y[0]&18619){d=Oe(m[0]);let v;for(v=0;v<d.length;v+=1){const k=mo(m,d,v);h[v]?h[v].p(k,y):(h[v]=yo(k),h[v].c(),h[v].m(i,null))}for(;v<h.length;v+=1)h[v].d(1);h.length=d.length}g===(g=p(m))&&_?_.p(m,y):(_.d(1),_=g(m),_&&(_.c(),_.m(r,null)))},d(m){m&&(j(t),j(n),j(r)),ft(h,m),_.d(),c=!1,f()}}}function bo(e){let t,n;return{c(){t=de("svg"),n=de("path"),a(n,"d","M20 6L9 17l-5-5"),a(t,"viewBox","0 0 24 24"),a(t,"width","14"),a(t,"height","14"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2.5")},m(r,l){R(r,t,l),u(t,n)},d(r){r&&j(t)}}}function yo(e){var C;let t,n,r,l=e[32].name+"",o,i,s,c,f,d,h,p,g,_,m=e[32].id===((C=e[1])==null?void 0:C.id)&&bo();function y(){return e[19](e[32])}function v(){return e[20](e[32])}function k(){return e[21](e[32])}return{c(){var x;t=b("div"),n=b("button"),r=b("span"),o=O(l),i=E(),m&&m.c(),c=E(),f=b("button"),f.innerHTML='<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>',d=E(),h=b("button"),h.innerHTML='<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"></path></svg>',p=E(),a(r,"class","flex-1 truncate"),a(n,"class",s="flex-1 text-left px-2 py-2 rounded-lg text-sm transition-colors flex items-center gap-2 "+(e[32].id===((x=e[1])==null?void 0:x.id)?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white")),a(f,"class","ml-1 p-1.5 text-gray-600 hover:text-indigo-400 opacity-0 group-hover:opacity-100 transition-all rounded"),a(f,"title","Rename project"),a(h,"class","ml-0.5 p-1.5 text-gray-600 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-all rounded"),a(h,"title","Delete project"),a(t,"class","flex items-center group px-2 py-0.5")},m(x,S){R(x,t,S),u(t,n),u(n,r),u(r,o),u(n,i),m&&m.m(n,null),u(t,c),u(t,f),u(t,d),u(t,h),u(t,p),g||(_=[Q(n,"click",y),Q(f,"click",nn(v)),Q(h,"click",nn(k))],g=!0)},p(x,S){var M,N;e=x,S[0]&1&&l!==(l=e[32].name+"")&&ee(o,l),e[32].id===((M=e[1])==null?void 0:M.id)?m||(m=bo(),m.c(),m.m(n,null)):m&&(m.d(1),m=null),S[0]&3&&s!==(s="flex-1 text-left px-2 py-2 rounded-lg text-sm transition-colors flex items-center gap-2 "+(e[32].id===((N=e[1])==null?void 0:N.id)?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))&&a(n,"class",s)},d(x){x&&j(t),m&&m.d(),g=!1,lt(_)}}}function td(e){let t,n,r,l;return{c(){t=b("div"),n=b("button"),n.innerHTML=`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
3
+ New project`,a(n,"class","w-full flex items-center gap-2 px-2 py-2 text-sm text-gray-400 hover:text-white hover:bg-gray-800 rounded-lg transition-colors"),a(t,"class","border-t border-gray-700 p-2")},m(o,i){R(o,t,i),u(t,n),r||(l=Q(n,"click",e[30]),r=!0)},p:Be,d(o){o&&j(t),r=!1,l()}}}function nd(e){let t,n,r,l,o,i,s,c,f=e[8]?"Creating…":"Create",d,h,p,g,_,m,y=e[11]&&vo(e);return{c(){t=b("div"),n=b("p"),n.textContent="New project",r=E(),y&&y.c(),l=E(),o=b("input"),i=E(),s=b("div"),c=b("button"),d=O(f),p=E(),g=b("button"),g.textContent="Cancel",a(n,"class","text-xs text-gray-400 mb-2 font-medium"),a(o,"type","text"),a(o,"placeholder","Project name"),a(o,"class","w-full bg-gray-800 border border-gray-600 text-white text-sm px-2.5 py-1.5 rounded-lg mb-2 focus:outline-none focus:border-indigo-500"),c.disabled=h=e[8]||!e[6].trim(),a(c,"class","flex-1 bg-indigo-600 hover:bg-indigo-700 text-white text-xs py-1.5 rounded-lg transition-colors disabled:opacity-50"),a(g,"class","flex-1 bg-gray-700 hover:bg-gray-600 text-gray-200 text-xs py-1.5 rounded-lg transition-colors"),a(s,"class","flex gap-2"),a(t,"class","border-t border-gray-700 p-3")},m(v,k){R(v,t,k),u(t,n),u(t,r),y&&y.m(t,null),u(t,l),u(t,o),Ie(o,e[6]),u(t,i),u(t,s),u(s,c),u(c,d),u(s,p),u(s,g),_||(m=[Q(o,"input",e[27]),Q(o,"keydown",e[28]),Q(c,"click",e[15]),Q(g,"click",e[29])],_=!0)},p(v,k){v[11]?y?y.p(v,k):(y=vo(v),y.c(),y.m(t,l)):y&&(y.d(1),y=null),k[0]&64&&o.value!==v[6]&&Ie(o,v[6]),k[0]&256&&f!==(f=v[8]?"Creating…":"Create")&&ee(d,f),k[0]&320&&h!==(h=v[8]||!v[6].trim())&&(c.disabled=h)},d(v){v&&j(t),y&&y.d(),_=!1,lt(m)}}}function rd(e){let t,n,r,l,o=e[4].name+"",i,s,c,f,d,h,p=e[9]?"Deleting…":"Delete",g,_,m,y,v,k=e[11]&&ko(e);return{c(){t=b("div"),n=b("p"),r=O("Delete "),l=b("strong"),i=O(o),s=O("? This will remove all its data."),c=E(),k&&k.c(),f=E(),d=b("div"),h=b("button"),g=O(p),_=E(),m=b("button"),m.textContent="Cancel",a(n,"class","text-xs text-red-300 mb-2"),h.disabled=e[9],a(h,"class","flex-1 bg-red-600 hover:bg-red-700 text-white text-xs py-1.5 rounded-lg transition-colors disabled:opacity-50"),a(m,"class","flex-1 bg-gray-700 hover:bg-gray-600 text-gray-200 text-xs py-1.5 rounded-lg transition-colors"),a(d,"class","flex gap-2"),a(t,"class","border-t border-gray-700 p-3 bg-red-950/30")},m(C,x){R(C,t,x),u(t,n),u(n,r),u(n,l),u(l,i),u(n,s),u(t,c),k&&k.m(t,null),u(t,f),u(t,d),u(d,h),u(h,g),u(d,_),u(d,m),y||(v=[Q(h,"click",e[25]),Q(m,"click",e[26])],y=!0)},p(C,x){x[0]&16&&o!==(o=C[4].name+"")&&ee(i,o),C[11]?k?k.p(C,x):(k=ko(C),k.c(),k.m(t,f)):k&&(k.d(1),k=null),x[0]&512&&p!==(p=C[9]?"Deleting…":"Delete")&&ee(g,p),x[0]&512&&(h.disabled=C[9])},d(C){C&&j(t),k&&k.d(),y=!1,lt(v)}}}function ld(e){let t,n,r,l,o=e[5].name+"",i,s,c,f,d,h,p,g=e[10]?"Saving…":"Save",_,m,y,v,k,C,x=e[11]&&wo(e);return{c(){t=b("div"),n=b("p"),r=O("Rename "),l=b("strong"),i=O(o),s=E(),x&&x.c(),c=E(),f=b("input"),d=E(),h=b("div"),p=b("button"),_=O(g),y=E(),v=b("button"),v.textContent="Cancel",a(l,"class","text-white"),a(n,"class","text-xs text-gray-400 mb-2 font-medium"),a(f,"type","text"),a(f,"placeholder","New name"),a(f,"class","w-full bg-gray-800 border border-gray-600 text-white text-sm px-2.5 py-1.5 rounded-lg mb-2 focus:outline-none focus:border-indigo-500"),p.disabled=m=e[10]||!e[7].trim(),a(p,"class","flex-1 bg-indigo-600 hover:bg-indigo-700 text-white text-xs py-1.5 rounded-lg transition-colors disabled:opacity-50"),a(v,"class","flex-1 bg-gray-700 hover:bg-gray-600 text-gray-200 text-xs py-1.5 rounded-lg transition-colors"),a(h,"class","flex gap-2"),a(t,"class","border-t border-gray-700 p-3")},m(S,M){R(S,t,M),u(t,n),u(n,r),u(n,l),u(l,i),u(t,s),x&&x.m(t,null),u(t,c),u(t,f),Ie(f,e[7]),u(t,d),u(t,h),u(h,p),u(p,_),u(h,y),u(h,v),k||(C=[Q(f,"input",e[22]),Q(f,"keydown",e[23]),Q(p,"click",e[16]),Q(v,"click",e[24])],k=!0)},p(S,M){M[0]&32&&o!==(o=S[5].name+"")&&ee(i,o),S[11]?x?x.p(S,M):(x=wo(S),x.c(),x.m(t,c)):x&&(x.d(1),x=null),M[0]&128&&f.value!==S[7]&&Ie(f,S[7]),M[0]&1024&&g!==(g=S[10]?"Saving…":"Save")&&ee(_,g),M[0]&1152&&m!==(m=S[10]||!S[7].trim())&&(p.disabled=m)},d(S){S&&j(t),x&&x.d(),k=!1,lt(C)}}}function vo(e){let t,n;return{c(){t=b("p"),n=O(e[11]),a(t,"class","text-xs text-red-400 mb-1")},m(r,l){R(r,t,l),u(t,n)},p(r,l){l[0]&2048&&ee(n,r[11])},d(r){r&&j(t)}}}function ko(e){let t,n;return{c(){t=b("p"),n=O(e[11]),a(t,"class","text-xs text-red-400 mb-1")},m(r,l){R(r,t,l),u(t,n)},p(r,l){l[0]&2048&&ee(n,r[11])},d(r){r&&j(t)}}}function wo(e){let t,n;return{c(){t=b("p"),n=O(e[11]),a(t,"class","text-xs text-red-400 mb-1")},m(r,l){R(r,t,l),u(t,n)},p(r,l){l[0]&2048&&ee(n,r[11])},d(r){r&&j(t)}}}function id(e){var y;let t,n,r,l,o,i,s=(((y=e[1])==null?void 0:y.name)??"Select project")+"",c,f,d,h,p,g,_,m=e[2]&&_o(e);return{c(){t=b("div"),n=b("button"),r=de("svg"),l=de("path"),o=E(),i=b("span"),c=O(s),f=E(),d=de("svg"),h=de("path"),p=E(),m&&m.c(),a(l,"d","M3 7h18M3 12h18M3 17h18"),a(r,"viewBox","0 0 24 24"),a(r,"width","14"),a(r,"height","14"),a(r,"fill","none"),a(r,"stroke","currentColor"),a(r,"stroke-width","2"),a(r,"stroke-linecap","round"),a(r,"stroke-linejoin","round"),a(i,"class","max-w-[120px] truncate"),a(h,"d","M6 9l6 6 6-6"),a(d,"viewBox","0 0 24 24"),a(d,"width","12"),a(d,"height","12"),a(d,"fill","none"),a(d,"stroke","currentColor"),a(d,"stroke-width","2"),a(d,"stroke-linecap","round"),a(d,"stroke-linejoin","round"),a(d,"class","opacity-60"),a(n,"class","flex items-center gap-2 bg-gray-800 hover:bg-gray-700 text-white text-sm px-3 py-1.5 rounded-lg transition-colors border border-gray-600"),a(n,"title","Switch project"),a(t,"class","relative")},m(v,k){R(v,t,k),u(t,n),u(n,r),u(r,l),u(n,o),u(n,i),u(i,c),u(n,f),u(n,d),u(d,h),u(t,p),m&&m.m(t,null),g||(_=[Q(window,"keydown",e[18]),Q(n,"click",e[12])],g=!0)},p(v,k){var C;k[0]&2&&s!==(s=(((C=v[1])==null?void 0:C.name)??"Select project")+"")&&ee(c,s),v[2]?m?m.p(v,k):(m=_o(v),m.c(),m.m(t,null)):m&&(m.d(1),m=null)},i:Be,o:Be,d(v){v&&j(t),m&&m.d(),g=!1,lt(_)}}}function od(e,t,n){let{projects:r=[]}=t,{currentProject:l=null}=t,o=!1,i=!1,s=null,c=null,f="",d="",h=!1,p=!1,g=!1,_="";const m=Oi();function y(){n(2,o=!o),o||(n(3,i=!1),n(4,s=null),n(5,c=null),n(11,_=""))}function v(){n(2,o=!1),n(3,i=!1),n(4,s=null),n(5,c=null),n(11,_="")}function k(V){if(V.id===(l==null?void 0:l.id)){v();return}m("switch",V),v()}async function C(){if(f.trim()){n(8,h=!0),n(11,_="");try{const V=await fetch("../api/projects",{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":l==null?void 0:l.api_key},body:JSON.stringify({name:f.trim()})});if(!V.ok){const B=await V.json();throw new Error(B.message||"Failed")}const se=await V.json();n(6,f=""),n(3,i=!1),m("created",se)}catch(V){n(11,_=V.message)}finally{n(8,h=!1)}}}async function x(){if(!(!d.trim()||!c)){n(10,g=!0),n(11,_="");try{const V=await fetch("../api/project",{method:"PATCH",headers:{"Content-Type":"application/json","X-API-Key":c.api_key},body:JSON.stringify({name:d.trim()})});if(!V.ok){const B=await V.json();throw new Error(B.message||"Failed")}const se=await V.json();m("renamed",se),n(5,c=null)}catch(V){n(11,_=V.message)}finally{n(10,g=!1)}}}async function S(V){n(9,p=!0),n(11,_="");try{const se=await fetch(`../api/projects/${V.id}`,{method:"DELETE",headers:{"X-API-Key":l==null?void 0:l.api_key}});if(!se.ok){const B=await se.json();throw new Error(B.message||"Failed")}n(4,s=null),m("deleted",V)}catch(se){n(11,_=se.message)}finally{n(9,p=!1)}}function M(V){V.key==="Escape"&&v()}const N=V=>k(V),L=V=>{n(5,c=V),n(7,d=V.name),n(4,s=null),n(3,i=!1),n(11,_="")},I=V=>{n(4,s=V),n(5,c=null),n(3,i=!1),n(11,_="")};function P(){d=this.value,n(7,d)}const F=V=>V.key==="Enter"&&x(),T=()=>{n(5,c=null),n(11,_="")},z=()=>S(s),w=()=>{n(4,s=null),n(11,_="")};function D(){f=this.value,n(6,f)}const J=V=>V.key==="Enter"&&C(),Z=()=>{n(3,i=!1),n(11,_="")},$=()=>{n(3,i=!0),n(4,s=null),n(11,_="")};return e.$$set=V=>{"projects"in V&&n(0,r=V.projects),"currentProject"in V&&n(1,l=V.currentProject)},[r,l,o,i,s,c,f,d,h,p,g,_,y,v,k,C,x,S,M,N,L,I,P,F,T,z,w,D,J,Z,$]}class sd extends sn{constructor(t){super(),on(this,t,od,id,$t,{projects:0,currentProject:1},null,[-1,-1])}}function xo(e,t,n){const r=e.slice();return r[22]=t[n],r}function Co(e){let t,n,r,l=e[3]===1?"":"s",o;return{c(){t=b("span"),n=O(e[3]),r=O(" slot"),o=O(l),a(t,"class","pve-badge svelte-19itaxc")},m(i,s){R(i,t,s),u(t,n),u(t,r),u(t,o)},p(i,s){s&8&&ee(n,i[3]),s&8&&l!==(l=i[3]===1?"":"s")&&ee(o,l)},d(i){i&&j(t)}}}function ad(e){let t,n,r=e[22].originalText+"",l,o,i,s,c,f,d,h,p;function g(){return e[13](e[22])}return{c(){t=b("span"),n=b("span"),l=O(r),o=E(),i=b("button"),s=O("×"),f=E(),a(n,"class","pve-chip-label svelte-19itaxc"),a(i,"class","pve-chip-remove svelte-19itaxc"),a(i,"type","button"),a(i,"title",c="Remove "+e[22].kind+" slot — restores original text"),a(t,"class",d="pve-chip pve-chip--"+e[22].kind+" svelte-19itaxc")},m(_,m){R(_,t,m),u(t,n),u(n,l),u(t,o),u(t,i),u(i,s),u(t,f),h||(p=Q(i,"click",g),h=!0)},p(_,m){e=_,m&1&&r!==(r=e[22].originalText+"")&&ee(l,r),m&1&&c!==(c="Remove "+e[22].kind+" slot — restores original text")&&a(i,"title",c),m&1&&d!==(d="pve-chip pve-chip--"+e[22].kind+" svelte-19itaxc")&&a(t,"class",d)},d(_){_&&j(t),h=!1,p()}}}function ud(e){let t,n=e[22].text+"",r,l,o;function i(){return e[12](e[22])}return{c(){var s;t=b("span"),r=O(n),a(t,"class","pve-text-seg svelte-19itaxc"),uo(t,"pve-text-seg--active",((s=e[1])==null?void 0:s.segId)===e[22].id)},m(s,c){R(s,t,c),u(t,r),l||(o=Q(t,"mouseup",i),l=!0)},p(s,c){var f;e=s,c&1&&n!==(n=e[22].text+"")&&ee(r,n),c&3&&uo(t,"pve-text-seg--active",((f=e[1])==null?void 0:f.segId)===e[22].id)},d(s){s&&j(t),l=!1,o()}}}function So(e,t){let n,r;function l(s,c){return s[22].kind==="plain"?ud:ad}let o=l(t),i=o(t);return{key:e,first:null,c(){n=Ct(),i.c(),r=Ct(),this.first=n},m(s,c){R(s,n,c),i.m(s,c),R(s,r,c)},p(s,c){t=s,o===(o=l(t))&&i?i.p(t,c):(i.d(1),i=o(t),i&&(i.c(),i.m(r.parentNode,r)))},d(s){s&&(j(n),j(r)),i.d(s)}}}function Ao(e){let t,n,r,l,o=e[1].selectedText+"",i,s,c,f,d,h,p,g,_,m,y,v,k,C;return{c(){t=b("div"),n=b("span"),r=O("Selected: "),l=b("code"),i=O(o),s=E(),c=b("div"),f=b("button"),f.textContent="Text",d=E(),h=b("button"),h.textContent="Number",p=E(),g=b("button"),g.textContent="Decimal",_=E(),m=b("button"),m.textContent="Date",y=E(),v=b("button"),v.textContent="Cancel",a(l,"class","pve-sel-code svelte-19itaxc"),a(n,"class","pve-sel-preview svelte-19itaxc"),a(f,"type","button"),a(f,"class","pve-btn pve-btn-text svelte-19itaxc"),a(h,"type","button"),a(h,"class","pve-btn pve-btn-number svelte-19itaxc"),a(g,"type","button"),a(g,"class","pve-btn pve-btn-decimal svelte-19itaxc"),a(m,"type","button"),a(m,"class","pve-btn pve-btn-date svelte-19itaxc"),a(v,"type","button"),a(v,"class","pve-btn pve-btn-ghost svelte-19itaxc"),a(c,"class","pve-action-bar-btns svelte-19itaxc"),a(t,"class","pve-action-bar svelte-19itaxc")},m(x,S){R(x,t,S),u(t,n),u(n,r),u(n,l),u(l,i),u(t,s),u(t,c),u(c,f),u(c,d),u(c,h),u(c,p),u(c,g),u(c,_),u(c,m),u(c,y),u(c,v),k||(C=[Q(f,"click",e[14]),Q(h,"click",e[15]),Q(g,"click",e[16]),Q(m,"click",e[17]),Q(v,"click",e[7])],k=!0)},p(x,S){S&2&&o!==(o=x[1].selectedText+"")&&ee(i,o)},d(x){x&&j(t),k=!1,lt(C)}}}function cd(e){let t,n,r,l,o,i,s=[],c=new Map,f,d,h,p,g,_,m,y,v,k,C,x,S=e[3]>0&&Co(e),M=Oe(e[0]);const N=I=>I[22].id;for(let I=0;I<M.length;I+=1){let P=xo(e,M,I),F=N(P);c.set(F,s[I]=So(F,P))}let L=e[1]&&Ao(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Phrase Slot Editor",l=E(),S&&S.c(),o=E(),i=b("div");for(let I=0;I<s.length;I+=1)s[I].c();f=E(),L&&L.c(),d=E(),h=b("div"),p=b("span"),p.textContent="Resulting key",g=E(),_=b("code"),m=O(e[2]),y=E(),v=b("div"),k=b("button"),k.textContent="Save",a(r,"class","pve-title svelte-19itaxc"),a(n,"class","pve-header svelte-19itaxc"),a(i,"class","pve-canvas svelte-19itaxc"),a(p,"class","pve-preview-label svelte-19itaxc"),a(_,"class","pve-preview-code svelte-19itaxc"),a(h,"class","pve-preview svelte-19itaxc"),a(k,"type","button"),a(k,"class","pve-btn pve-btn-primary svelte-19itaxc"),a(v,"class","pve-footer svelte-19itaxc"),a(t,"class","pve svelte-19itaxc")},m(I,P){R(I,t,P),u(t,n),u(n,r),u(n,l),S&&S.m(n,null),u(t,o),u(t,i);for(let F=0;F<s.length;F+=1)s[F]&&s[F].m(i,null);u(t,f),L&&L.m(t,null),u(t,d),u(t,h),u(h,p),u(h,g),u(h,_),u(_,m),u(t,y),u(t,v),u(v,k),C||(x=Q(k,"click",e[8]),C=!0)},p(I,[P]){I[3]>0?S?S.p(I,P):(S=Co(I),S.c(),S.m(n,null)):S&&(S.d(1),S=null),P&83&&(M=Oe(I[0]),s=tl(s,P,N,1,I,M,c,i,ji,So,null,xo)),I[1]?L?L.p(I,P):(L=Ao(I),L.c(),L.m(t,d)):L&&(L.d(1),L=null),P&4&&ee(m,I[2])},i:Be,o:Be,d(I){I&&j(t),S&&S.d();for(let P=0;P<s.length;P+=1)s[P].d();L&&L.d(),C=!1,x()}}}const fd=/(\{\{(?:text|number|decimal|date):\d+\}\})/g,dd=/^\{\{(text|number|decimal|date):(\d+)\}\}$/;function To(e){return e.map(t=>t.text).join("")}function Mo(e){const t={text:0,number:0,decimal:0,date:0};return e.map(n=>{if(n.kind==="plain")return n;const r=t[n.kind]++;return{...n,slotIndex:r,text:`{{${n.kind}:${r}}}`}})}function hd(e,t,n){let r,l,o=0;function i(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"id-"+Date.now().toString(36)+"-"+ ++o}let{phraseKey:s=""}=t,{varSlots:c=[]}=t,{onSave:f=()=>{}}=t;function d(L){const I={};for(const F of c){const T=F.type||"text";I[`${T}:${F.index}`]=F.originalText}return L.split(fd).filter(F=>F!=="").map(F=>{const T=F.match(dd);if(T){const z=T[1],w=parseInt(T[2],10);return{kind:z,id:i(),slotIndex:w,originalText:I[`${z}:${w}`]??F,text:F}}return{kind:"plain",id:i(),text:F}})}let h=d(s),p=null;function g(L){if(L.kind!=="plain")return;const I=window.getSelection(),P=I?I.toString():"";if(!P){n(1,p=null);return}const F=L.text.indexOf(P);if(F===-1){n(1,p=null);return}n(1,p={segId:L.id,start:F,end:F+P.length,selectedText:P})}function _(L){if(!p)return;const{segId:I,start:P,end:F,selectedText:T}=p,z=h.findIndex(J=>J.id===I);if(z===-1){n(1,p=null);return}const w=h[z],D=[];P>0&&D.push({kind:"plain",id:i(),text:w.text.slice(0,P)}),D.push({kind:L,id:i(),slotIndex:0,originalText:T,text:`{{${L}:0}}`}),F<w.text.length&&D.push({kind:"plain",id:i(),text:w.text.slice(F)}),n(0,h=Mo([...h.slice(0,z),...D,...h.slice(z+1)])),n(1,p=null)}function m(L){const I=h.map(P=>P.id===L&&P.kind!=="plain"?{kind:"plain",id:i(),text:P.originalText}:P);n(0,h=Mo(I))}function y(){var L;n(1,p=null),(L=window.getSelection())==null||L.removeAllRanges()}function v(){const L=To(h),I=h.filter(P=>P.kind!=="plain").map(P=>({type:P.kind,index:P.slotIndex,originalText:P.originalText}));f(L,I)}const k=L=>g(L),C=L=>m(L.id),x=()=>_("text"),S=()=>_("number"),M=()=>_("decimal"),N=()=>_("date");return e.$$set=L=>{"phraseKey"in L&&n(9,s=L.phraseKey),"varSlots"in L&&n(10,c=L.varSlots),"onSave"in L&&n(11,f=L.onSave)},e.$$.update=()=>{e.$$.dirty&1&&n(3,r=h.filter(L=>L.kind!=="plain").length),e.$$.dirty&1&&n(2,l=To(h))},[h,p,l,r,g,_,m,y,v,s,c,f,k,C,x,S,M,N]}class pd extends sn{constructor(t){super(),on(this,t,hd,cd,$t,{phraseKey:9,varSlots:10,onSave:11})}}function Eo(e,t,n){const r=e.slice();return r[16]=t[n],r[17]=t,r[18]=n,r}function Lo(e){let t,n;return{c(){t=b("span"),n=O(e[1]),a(t,"class","ml-2 inline-block rounded bg-gray-100 px-1.5 py-0.5 text-[10px] text-gray-600")},m(r,l){R(r,t,l),u(t,n)},p(r,l){l&2&&ee(n,r[1])},d(r){r&&j(t)}}}function No(e){let t,n,r=e[16].label+"",l,o,i,s,c,f,d;function h(){e[12].call(i,e[16])}return{c(){t=b("div"),n=b("label"),l=O(r),o=E(),i=b("input"),s=E(),c=b("p"),c.textContent=`${e[16].hint}`,a(n,"class","block text-xs font-medium text-gray-700"),a(n,"for",`aria-${e[16].name}`),a(i,"id",`aria-${e[16].name}`),a(i,"type","text"),a(i,"placeholder",e[16].placeholder),a(i,"class","mt-1 w-full rounded border border-gray-300 px-2 py-1.5 text-sm focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500"),a(c,"class","mt-0.5 text-[11px] text-gray-400")},m(p,g){R(p,t,g),u(t,n),u(n,l),u(t,o),u(t,i),Ie(i,e[2][e[16].name]),u(t,s),u(t,c),f||(d=Q(i,"input",h),f=!0)},p(p,g){e=p,g&68&&i.value!==e[2][e[16].name]&&Ie(i,e[2][e[16].name])},d(p){p&&j(t),f=!1,d()}}}function zo(e){let t,n;return{c(){t=b("div"),n=O(e[5]),a(t,"class","rounded border border-amber-200 bg-amber-50 px-3 py-2 text-[11px] text-amber-800")},m(r,l){R(r,t,l),u(t,n)},p(r,l){l&32&&ee(n,r[5])},d(r){r&&j(t)}}}function Io(e){let t,n;return{c(){t=b("div"),n=O(e[4]),a(t,"class","rounded border border-red-200 bg-red-50 px-3 py-2 text-[11px] text-red-800")},m(r,l){R(r,t,l),u(t,n)},p(r,l){l&16&&ee(n,r[4])},d(r){r&&j(t)}}}function gd(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L=e[1]&&Lo(e),I=Oe(e[6]),P=[];for(let z=0;z<I.length;z+=1)P[z]=No(Eo(e,I,z));let F=e[5]&&zo(e),T=e[4]&&Io(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Phrase:",l=E(),o=b("span"),i=O(e[0]),s=E(),L&&L.c(),c=E(),f=b("div");for(let z=0;z<P.length;z+=1)P[z].c();d=E(),h=b("label"),p=b("input"),g=E(),_=b("span"),_.innerHTML='<span class="font-medium">aria-hidden=&quot;true&quot;</span> — hide from assistive tech (decorative)',m=E(),F&&F.c(),y=E(),T&&T.c(),v=E(),k=b("div"),C=b("button"),C.textContent="Clear all",x=E(),S=b("button"),S.textContent="Save ARIA",a(r,"class","font-medium text-gray-700"),a(o,"class","font-mono break-all"),a(n,"class","text-xs text-gray-500"),a(p,"type","checkbox"),a(p,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(h,"class","flex items-center gap-2 text-sm text-gray-700"),a(f,"class","space-y-3"),a(C,"type","button"),a(C,"class","text-xs text-gray-400 hover:text-red-500"),a(S,"type","button"),a(S,"class","rounded bg-indigo-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-indigo-700"),a(k,"class","flex items-center justify-between pt-1"),a(t,"class","space-y-4")},m(z,w){R(z,t,w),u(t,n),u(n,r),u(n,l),u(n,o),u(o,i),u(n,s),L&&L.m(n,null),u(t,c),u(t,f);for(let D=0;D<P.length;D+=1)P[D]&&P[D].m(f,null);u(f,d),u(f,h),u(h,p),p.checked=e[3],u(h,g),u(h,_),u(t,m),F&&F.m(t,null),u(t,y),T&&T.m(t,null),u(t,v),u(t,k),u(k,C),u(k,x),u(k,S),M||(N=[Q(p,"change",e[13]),Q(C,"click",e[8]),Q(S,"click",e[7])],M=!0)},p(z,[w]){if(w&1&&ee(i,z[0]),z[1]?L?L.p(z,w):(L=Lo(z),L.c(),L.m(n,null)):L&&(L.d(1),L=null),w&68){I=Oe(z[6]);let D;for(D=0;D<I.length;D+=1){const J=Eo(z,I,D);P[D]?P[D].p(J,w):(P[D]=No(J),P[D].c(),P[D].m(f,d))}for(;D<P.length;D+=1)P[D].d(1);P.length=I.length}w&8&&(p.checked=z[3]),z[5]?F?F.p(z,w):(F=zo(z),F.c(),F.m(t,y)):F&&(F.d(1),F=null),z[4]?T?T.p(z,w):(T=Io(z),T.c(),T.m(t,v)):T&&(T.d(1),T=null)},i:Be,o:Be,d(z){z&&j(t),L&&L.d(),ft(P,z),F&&F.d(),T&&T.d(),M=!1,lt(N)}}}function md(e,t,n){let r,l,o,{phraseKey:i=""}=t,{context:s=""}=t,{attributes:c={}}=t,{onSave:f=()=>{}}=t;const d=[{name:"aria-label",label:"aria-label",hint:"Accessible name read by screen readers",type:"text",placeholder:"e.g. Close dialog"},{name:"aria-labelledby",label:"aria-labelledby",hint:"ID(s) of element(s) that label this one",type:"text",placeholder:"e.g. heading-id"},{name:"aria-describedby",label:"aria-describedby",hint:"ID(s) of element(s) describing this one",type:"text",placeholder:"e.g. help-text-id"},{name:"role",label:"role",hint:"ARIA role",type:"text",placeholder:"e.g. button, navigation, alert"},{name:"alt",label:"alt",hint:"Alternative text (for images)",type:"text",placeholder:"e.g. Company logo"},{name:"title",label:"title",hint:"Tooltip / advisory text (lowest name priority)",type:"text",placeholder:"e.g. More info"}];function h(){const C={};for(const x of d)C[x.name]=c&&typeof c[x.name]=="string"?c[x.name]:"";return C}let p=h(),g=!!(c&&c["aria-hidden"]==="true");function _(){const C={};for(const x of d){const S=(p[x.name]||"").trim();S&&(C[x.name]=S)}return g&&(C["aria-hidden"]="true"),C}function m(){f(_())}function y(){const C={};for(const x of d)C[x.name]="";n(2,p=C),n(3,g=!1)}function v(C){p[C.name]=this.value,n(2,p)}function k(){g=this.checked,n(3,g)}return e.$$set=C=>{"phraseKey"in C&&n(0,i=C.phraseKey),"context"in C&&n(1,s=C.context),"attributes"in C&&n(9,c=C.attributes),"onSave"in C&&n(10,f=C.onSave)},e.$$.update=()=>{e.$$.dirty&4&&n(11,r=[p["aria-labelledby"]?"aria-labelledby":null,p["aria-label"]?"aria-label":null,p.alt?"alt":null,p.title?"title":null].filter(Boolean)),e.$$.dirty&2048&&n(5,l=r.length>1?`Multiple name sources set — screen readers will use "${r[0]}" and ignore the rest.`:""),e.$$.dirty&2056&&n(4,o=g&&r.length>0?'aria-hidden="true" removes this element from the accessibility tree, so the name above will not be announced.':"")},[i,s,p,g,o,l,d,m,y,c,f,r,v,k]}class _d extends sn{constructor(t){super(),on(this,t,md,gd,$t,{phraseKey:0,context:1,attributes:9,onSave:10})}}function Po(e,t,n){const r=e.slice();return r[34]=t[n],r[35]=t,r[36]=n,r}function Do(e,t,n){const r=e.slice();return r[37]=t[n],r}function Fo(e,t,n){const r=e.slice();return r[37]=t[n],r}function Oo(e){let t,n,r,l,o;return{c(){t=b("div"),n=b("button"),r=O("AI Translate"),a(n,"class","px-2.5 py-1 text-[11px] rounded border border-indigo-200 text-indigo-700 bg-white hover:bg-indigo-50 disabled:opacity-50 disabled:cursor-not-allowed"),a(n,"title","Open AI translate options"),n.disabled=e[3],a(t,"class","px-3 py-2 border-b border-gray-100 bg-white flex items-center justify-end")},m(i,s){R(i,t,s),u(t,n),u(n,r),l||(o=Q(n,"click",nn(e[24])),l=!0)},p(i,s){s[0]&8&&(n.disabled=i[3])},d(i){i&&j(t),l=!1,o()}}}function jo(e){let t,n,r,l,o,i=e[0].key+"",s,c,f,d;function h(_,m){return _[1]?yd:bd}let p=h(e),g=p(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Master",l=E(),o=b("span"),s=O(i),f=E(),d=b("div"),g.c(),a(r,"class","shrink-0 text-[10px] font-semibold text-indigo-400 uppercase tracking-wider"),a(o,"class","text-sm text-indigo-800 truncate min-w-0"),a(o,"title",c=e[0].key),a(n,"class","min-w-0 flex items-center gap-2"),a(d,"class","min-w-0"),a(t,"class","bg-indigo-50/60 border-b border-indigo-100 px-3 py-2 grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-3 items-center")},m(_,m){R(_,t,m),u(t,n),u(n,r),u(n,l),u(n,o),u(o,s),u(t,f),u(t,d),g.m(d,null)},p(_,m){m[0]&1&&i!==(i=_[0].key+"")&&ee(s,i),m[0]&1&&c!==(c=_[0].key)&&a(o,"title",c),p===(p=h(_))&&g?g.p(_,m):(g.d(1),g=p(_),g&&(g.c(),g.m(d,null)))},d(_){_&&j(t),g.d()}}}function bd(e){let t,n=(e[0].master_value||"(not translated)")+"",r,l,o;return{c(){t=b("div"),r=O(n),a(t,"class",l="text-sm "+(e[0].master_value?"text-indigo-900 font-medium":"text-gray-300")+" truncate"),a(t,"title",o=e[0].master_value||"(not translated)")},m(i,s){R(i,t,s),u(t,r)},p(i,s){s[0]&1&&n!==(n=(i[0].master_value||"(not translated)")+"")&&ee(r,n),s[0]&1&&l!==(l="text-sm "+(i[0].master_value?"text-indigo-900 font-medium":"text-gray-300")+" truncate")&&a(t,"class",l),s[0]&1&&o!==(o=i[0].master_value||"(not translated)")&&a(t,"title",o)},d(i){i&&j(t)}}}function yd(e){let t,n,r,l;return{c(){t=b("input"),a(t,"class","w-full px-2 py-1.5 border border-indigo-200 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 bg-white"),t.value=n=e[0].master_value||"",a(t,"placeholder","Fallback translation (no context)…")},m(o,i){R(o,t,i),r||(l=[Q(t,"input",e[25]),Q(t,"change",e[15])],r=!0)},p(o,i){i[0]&1&&n!==(n=o[0].master_value||"")&&t.value!==n&&(t.value=n)},d(o){o&&j(t),r=!1,lt(l)}}}function Ro(e){let t,n,r,l,o,i;function s(){return e[26](e[34])}return{c(){t=b("button"),n=O("ARIA"),a(t,"class",r="px-1.5 py-0.5 text-[10px] font-semibold rounded transition-colors "+(e[6](e[34])?"text-amber-700 bg-amber-100 hover:bg-amber-200":"text-gray-300 bg-gray-100 hover:bg-gray-200 hover:text-gray-500")),a(t,"title",l=e[6](e[34])?"Edit ARIA accessibility attributes":"Add ARIA accessibility attributes")},m(c,f){R(c,t,f),u(t,n),o||(i=Q(t,"click",nn(s)),o=!0)},p(c,f){e=c,f[0]&65&&r!==(r="px-1.5 py-0.5 text-[10px] font-semibold rounded transition-colors "+(e[6](e[34])?"text-amber-700 bg-amber-100 hover:bg-amber-200":"text-gray-300 bg-gray-100 hover:bg-gray-200 hover:text-gray-500"))&&a(t,"class",r),f[0]&65&&l!==(l=e[6](e[34])?"Edit ARIA accessibility attributes":"Add ARIA accessibility attributes")&&a(t,"title",l)},d(c){c&&j(t),o=!1,i()}}}function Bo(e){let t,n=Oe(e[34].labels),r=[];for(let l=0;l<n.length;l+=1)r[l]=Uo(Fo(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","flex flex-wrap gap-1 mt-0.5")},m(l,o){R(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o[0]&1){n=Oe(l[34].labels);let i;for(i=0;i<n.length;i+=1){const s=Fo(l,n,i);r[i]?r[i].p(s,o):(r[i]=Uo(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function Uo(e){let t,n=e[37].name+"",r;return{c(){t=b("span"),r=O(n),a(t,"class","inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium text-white"),gt(t,"background-color",e[37].color)},m(l,o){R(l,t,o),u(t,r)},p(l,o){o[0]&1&&n!==(n=l[37].name+"")&&ee(r,n),o[0]&1&&gt(t,"background-color",l[37].color)},d(l){l&&j(t)}}}function vd(e){let t,n=(e[34].value||"(not translated)")+"",r,l,o;return{c(){t=b("div"),r=O(n),a(t,"class",l="text-sm "+(e[34].value?"text-green-700 font-medium":"text-gray-300")+" truncate"),a(t,"title",o=e[34].value||"(not translated)")},m(i,s){R(i,t,s),u(t,r)},p(i,s){s[0]&1&&n!==(n=(i[34].value||"(not translated)")+"")&&ee(r,n),s[0]&1&&l!==(l="text-sm "+(i[34].value?"text-green-700 font-medium":"text-gray-300")+" truncate")&&a(t,"class",l),s[0]&1&&o!==(o=i[34].value||"(not translated)")&&a(t,"title",o)},d(i){i&&j(t)}}}function kd(e){let t,n,r,l,o;function i(...c){return e[27](e[34],e[35],e[36],...c)}function s(){return e[28](e[34])}return{c(){t=b("input"),a(t,"class",n="w-full px-2 py-1.5 border border-gray-200 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 "+(e[34].value?"":"bg-amber-50")),t.value=r=e[34].value||"",a(t,"placeholder","Enter translation…")},m(c,f){R(c,t,f),l||(o=[Q(t,"input",i),Q(t,"change",s),Q(t,"click",nn(e[23]))],l=!0)},p(c,f){e=c,f[0]&1&&n!==(n="w-full px-2 py-1.5 border border-gray-200 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 "+(e[34].value?"":"bg-amber-50"))&&a(t,"class",n),f[0]&1&&r!==(r=e[34].value||"")&&t.value!==r&&(t.value=r)},d(c){c&&j(t),l=!1,lt(o)}}}function Ho(e){let t,n,r;function l(){return e[29](e[34])}return{c(){t=b("button"),t.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" class="w-3.5 h-3.5" viewBox="0 0 20 20" fill="currentColor"><path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"></path></svg>',a(t,"class","p-1 text-gray-300 hover:text-indigo-500 transition-colors rounded"),a(t,"title","Edit vars")},m(o,i){R(o,t,i),n||(r=Q(t,"click",nn(l)),n=!0)},p(o,i){e=o},d(o){o&&j(t),n=!1,r()}}}function Wo(e){let t,n,r;function l(){return e[30](e[34])}return{c(){t=b("button"),t.textContent="Details",a(t,"class","px-2.5 py-1 border border-gray-200 rounded text-xs text-gray-600 hover:bg-gray-100 hover:border-gray-300 transition-colors")},m(o,i){R(o,t,i),n||(r=Q(t,"click",nn(l)),n=!0)},p(o,i){e=o},d(o){o&&j(t),n=!1,r()}}}function Zo(e){let t,n,r,l,o;function i(){return e[31](e[34])}let s=e[14]===e[34].key_id&&Vo(e);return{c(){t=b("div"),n=b("button"),n.textContent="+ Label",r=E(),s&&s.c(),a(n,"class","px-2 py-1 text-[10px] border border-dashed border-gray-300 rounded text-gray-400 hover:text-indigo-500 hover:border-indigo-300 transition-colors"),a(t,"class","relative")},m(c,f){R(c,t,f),u(t,n),u(t,r),s&&s.m(t,null),l||(o=Q(n,"click",nn(i)),l=!0)},p(c,f){e=c,e[14]===e[34].key_id?s?s.p(e,f):(s=Vo(e),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},d(c){c&&j(t),s&&s.d(),l=!1,o()}}}function Vo(e){let t,n,r,l,o,i,s=Oe(e[13]),c=[];for(let d=0;d<s.length;d+=1)c[d]=qo(Do(e,s,d));let f=e[13].length===0&&Jo();return{c(){t=b("div"),n=E(),r=b("div");for(let d=0;d<c.length;d+=1)c[d].c();l=E(),f&&f.c(),a(t,"class","fixed inset-0 z-40"),a(t,"role","presentation"),a(r,"class","absolute right-0 bottom-full mb-1 w-44 bg-white border border-gray-200 rounded-md shadow-lg z-50 max-h-48 overflow-y-auto")},m(d,h){R(d,t,h),R(d,n,h),R(d,r,h);for(let p=0;p<c.length;p+=1)c[p]&&c[p].m(r,null);u(r,l),f&&f.m(r,null),o||(i=Q(t,"click",e[32]),o=!0)},p(d,h){if(h[0]&270337){s=Oe(d[13]);let p;for(p=0;p<s.length;p+=1){const g=Do(d,s,p);c[p]?c[p].p(g,h):(c[p]=qo(g),c[p].c(),c[p].m(r,l))}for(;p<c.length;p+=1)c[p].d(1);c.length=s.length}d[13].length===0?f||(f=Jo(),f.c(),f.m(r,null)):f&&(f.d(1),f=null)},d(d){d&&(j(t),j(n),j(r)),ft(c,d),f&&f.d(),o=!1,i()}}}function Yo(e){let t,n;return{c(){t=de("svg"),n=de("path"),a(n,"fill-rule","evenodd"),a(n,"d","M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"),a(n,"clip-rule","evenodd"),a(t,"class","w-3.5 h-3.5 text-indigo-600"),a(t,"viewBox","0 0 20 20"),a(t,"fill","currentColor")},m(r,l){R(r,t,l),u(t,n)},d(r){r&&j(t)}}}function qo(e){let t,n,r,l,o=e[37].name+"",i,s,c=e[34].labels&&e[34].labels.some(h),f,d;function h(..._){return e[22](e[37],..._)}let p=c&&Yo();function g(){return e[33](e[34],e[37])}return{c(){t=b("button"),n=b("span"),r=E(),l=b("span"),i=O(o),s=E(),p&&p.c(),a(n,"class","w-3 h-3 rounded-full shrink-0"),gt(n,"background-color",e[37].color),a(l,"class","flex-1"),a(t,"class","w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 flex items-center gap-2")},m(_,m){R(_,t,m),u(t,n),u(t,r),u(t,l),u(l,i),u(t,s),p&&p.m(t,null),f||(d=Q(t,"click",g),f=!0)},p(_,m){e=_,m[0]&8192&&gt(n,"background-color",e[37].color),m[0]&8192&&o!==(o=e[37].name+"")&&ee(i,o),m[0]&8193&&(c=e[34].labels&&e[34].labels.some(h)),c?p||(p=Yo(),p.c(),p.m(t,null)):p&&(p.d(1),p=null)},d(_){_&&j(t),p&&p.d(),f=!1,d()}}}function Jo(e){let t;return{c(){t=b("p"),t.textContent="No labels yet. Create one in Labels page.",a(t,"class","px-3 py-2 text-xs text-gray-400")},m(n,r){R(n,t,r)},d(n){n&&j(t)}}}function Go(e,t){let n,r,l,o,i,s=(t[34].context||"Word (no context)")+"",c,f,d,h,p,g,_,m,y,v,k,C=t[5]&&Ro(t),x=t[34].labels&&t[34].labels.length>0&&Bo(t);function S(F,T){return F[1]?kd:vd}let M=S(t),N=M(t),L=t[8]&&Ho(t),I=t[10]&&Wo(t),P=t[12]&&Zo(t);return{key:e,first:null,c(){n=b("div"),r=b("div"),C&&C.c(),l=E(),o=b("div"),i=b("div"),c=O(s),d=E(),x&&x.c(),h=E(),p=b("div"),N.c(),g=E(),_=b("div"),L&&L.c(),m=E(),I&&I.c(),y=E(),P&&P.c(),v=E(),a(i,"class","text-sm text-gray-700 truncate"),a(i,"title",f=t[34].context||"Word (no context)"),a(o,"class","min-w-0"),a(p,"class","min-w-0"),a(_,"class","flex items-center gap-1.5 shrink-0"),a(n,"class",k=(t[36]>0?"border-t border-gray-100":"")+" px-3 py-2 grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] gap-3 items-center hover:bg-gray-50/60 transition-colors"),this.first=n},m(F,T){R(F,n,T),u(n,r),C&&C.m(r,null),u(n,l),u(n,o),u(o,i),u(i,c),u(o,d),x&&x.m(o,null),u(n,h),u(n,p),N.m(p,null),u(n,g),u(n,_),L&&L.m(_,null),u(_,m),I&&I.m(_,null),u(_,y),P&&P.m(_,null),u(n,v)},p(F,T){t=F,t[5]?C?C.p(t,T):(C=Ro(t),C.c(),C.m(r,null)):C&&(C.d(1),C=null),T[0]&1&&s!==(s=(t[34].context||"Word (no context)")+"")&&ee(c,s),T[0]&1&&f!==(f=t[34].context||"Word (no context)")&&a(i,"title",f),t[34].labels&&t[34].labels.length>0?x?x.p(t,T):(x=Bo(t),x.c(),x.m(o,null)):x&&(x.d(1),x=null),M===(M=S(t))&&N?N.p(t,T):(N.d(1),N=M(t),N&&(N.c(),N.m(p,null))),t[8]?L?L.p(t,T):(L=Ho(t),L.c(),L.m(_,m)):L&&(L.d(1),L=null),t[10]?I?I.p(t,T):(I=Wo(t),I.c(),I.m(_,y)):I&&(I.d(1),I=null),t[12]?P?P.p(t,T):(P=Zo(t),P.c(),P.m(_,null)):P&&(P.d(1),P=null),T[0]&1&&k!==(k=(t[36]>0?"border-t border-gray-100":"")+" px-3 py-2 grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] gap-3 items-center hover:bg-gray-50/60 transition-colors")&&a(n,"class",k)},d(F){F&&j(n),C&&C.d(),x&&x.d(),N.d(),L&&L.d(),I&&I.d(),P&&P.d()}}}function wd(e){let t,n,r=e[0].contexts&&e[0].contexts.some(Ko),l,o=[],i=new Map,s=e[2]&&Oo(e),c=r&&jo(e),f=Oe(e[0].contexts);const d=h=>h[34].key_id;for(let h=0;h<f.length;h+=1){let p=Po(e,f,h),g=d(p);i.set(g,o[h]=Go(g,p))}return{c(){t=b("div"),s&&s.c(),n=E(),c&&c.c(),l=E();for(let h=0;h<o.length;h+=1)o[h].c();a(t,"class","rounded-lg border border-gray-200 bg-white overflow-hidden")},m(h,p){R(h,t,p),s&&s.m(t,null),u(t,n),c&&c.m(t,null),u(t,l);for(let g=0;g<o.length;g+=1)o[g]&&o[g].m(t,null)},p(h,p){h[2]?s?s.p(h,p):(s=Oo(h),s.c(),s.m(t,n)):s&&(s.d(1),s=null),p[0]&1&&(r=h[0].contexts&&h[0].contexts.some(Ko)),r?c?c.p(h,p):(c=jo(h),c.c(),c.m(t,l)):c&&(c.d(1),c=null),p[0]&491491&&(f=Oe(h[0].contexts),o=tl(o,p,d,1,h,f,i,t,ji,Go,null,Po))},i:Be,o:Be,d(h){h&&j(t),s&&s.d(),c&&c.d();for(let p=0;p<o.length;p+=1)o[p].d()}}}const Ko=e=>!!e.context;function xd(e,t,n){let{group:r}=t,{editable:l=!1}=t,{showAiAction:o=!1}=t,{aiBusy:i=!1}=t,{onAiAction:s=null}=t,{showAria:c=!1}=t,{rowHasAria:f=()=>!1}=t,{onAriaAction:d=null}=t,{showVarEdit:h=!1}=t,{onVarEdit:p=null}=t,{showDetails:g=!1}=t,{onDetails:_=null}=t,{showLabels:m=!1}=t,{allLabels:y=[]}=t,{onToggleLabel:v=null}=t,{onSaveMasterValue:k=null}=t,{onSaveValue:C=null}=t,x=null;function S(){k&&k(r)}function M(B){C&&C(B,r)}function N(B){n(14,x=x===B?null:B)}function L(B,W){v&&(v(B.key_id,W,B.labels||[]),n(14,x=null))}const I=(B,W)=>W.id===B.id;function P(B){wr.call(this,e,B)}const F=()=>s&&s(r),T=B=>n(0,r.master_value=B.target.value,r),z=B=>d&&d(B),w=(B,W,K,te)=>n(0,W[K].value=te.target.value,r),D=B=>M(B),J=B=>p&&p(B),Z=B=>_&&_(B),$=B=>N(B.key_id),V=()=>n(14,x=null),se=(B,W)=>L(B,W.id);return e.$$set=B=>{"group"in B&&n(0,r=B.group),"editable"in B&&n(1,l=B.editable),"showAiAction"in B&&n(2,o=B.showAiAction),"aiBusy"in B&&n(3,i=B.aiBusy),"onAiAction"in B&&n(4,s=B.onAiAction),"showAria"in B&&n(5,c=B.showAria),"rowHasAria"in B&&n(6,f=B.rowHasAria),"onAriaAction"in B&&n(7,d=B.onAriaAction),"showVarEdit"in B&&n(8,h=B.showVarEdit),"onVarEdit"in B&&n(9,p=B.onVarEdit),"showDetails"in B&&n(10,g=B.showDetails),"onDetails"in B&&n(11,_=B.onDetails),"showLabels"in B&&n(12,m=B.showLabels),"allLabels"in B&&n(13,y=B.allLabels),"onToggleLabel"in B&&n(19,v=B.onToggleLabel),"onSaveMasterValue"in B&&n(20,k=B.onSaveMasterValue),"onSaveValue"in B&&n(21,C=B.onSaveValue)},[r,l,o,i,s,c,f,d,h,p,g,_,m,y,x,S,M,N,L,v,k,C,I,P,F,T,z,w,D,J,Z,$,V,se]}class Ic extends sn{constructor(t){super(),on(this,t,xd,wd,$t,{group:0,editable:1,showAiAction:2,aiBusy:3,onAiAction:4,showAria:5,rowHasAria:6,onAriaAction:7,showVarEdit:8,onVarEdit:9,showDetails:10,onDetails:11,showLabels:12,allLabels:13,onToggleLabel:19,onSaveMasterValue:20,onSaveValue:21},null,[-1,-1])}}function Xo(e,t,n){const r=e.slice();return r[9]=t[n],r}function Qo(e,t,n){const r=e.slice();return r[9]=t[n],r}function $o(e){let t,n=Oe(e[3]),r=[];for(let l=0;l<n.length;l+=1)r[l]=ls(Qo(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","mb-4 space-y-3")},m(l,o){R(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o&25){n=Oe(l[3]);let i;for(i=0;i<n.length;i+=1){const s=Qo(l,n,i);r[i]?r[i].p(s,o):(r[i]=ls(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function es(e){let t,n,r;function l(){return e[6](e[9])}return{c(){t=b("button"),t.textContent="Cancel",a(t,"class","px-3 py-1 text-xs text-red-600 border border-red-300 rounded hover:bg-red-50")},m(o,i){R(o,t,i),n||(r=Q(t,"click",l),n=!0)},p(o,i){e=o},d(o){o&&j(t),n=!1,r()}}}function ts(e){let t,n=(e[9].currentItem.source||`#${e[9].currentItem.index}`)+"",r;return{c(){t=O("Processing: "),r=O(n)},m(l,o){R(l,t,o),R(l,r,o)},p(l,o){o&8&&n!==(n=(l[9].currentItem.source||`#${l[9].currentItem.index}`)+"")&&ee(r,n)},d(l){l&&(j(t),j(r))}}}function Cd(e){let t;return{c(){t=O("—")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function Sd(e){let t,n=us(e[9].estimatedTimeRemaining)+"",r;return{c(){t=O("ETA: "),r=O(n)},m(l,o){R(l,t,o),R(l,r,o)},p(l,o){o&8&&n!==(n=us(l[9].estimatedTimeRemaining)+"")&&ee(r,n)},d(l){l&&(j(t),j(r))}}}function ns(e){let t,n=e[9].processingRate.toFixed(1)+"",r,l;return{c(){t=O("("),r=O(n),l=O("/s)")},m(o,i){R(o,t,i),R(o,r,i),R(o,l,i)},p(o,i){i&8&&n!==(n=o[9].processingRate.toFixed(1)+"")&&ee(r,n)},d(o){o&&(j(t),j(r),j(l))}}}function rs(e){let t,n=e[9].failed+"",r,l;return{c(){t=b("p"),r=O(n),l=O(" failed"),a(t,"class","text-xs text-yellow-700 mt-1")},m(o,i){R(o,t,i),u(t,r),u(t,l)},p(o,i){i&8&&n!==(n=o[9].failed+"")&&ee(r,n)},d(o){o&&j(t)}}}function ls(e){let t,n,r,l,o=e[4](e[9].status)+"",i,s,c=(e[9].promptName||"Translation Job")+"",f,d,h=e[9].langCode+"",p,g,_,m,y,v,k,C,x,S=e[9].completed+e[9].failed+"",M,N,L=e[9].total+"",I,P,F,T,z,w,D,J,Z,$=e[0]&&es(e),V=e[9].currentItem&&ts(e);function se(q,be){return q[9].estimatedTimeRemaining?Sd:Cd}let B=se(e),W=B(e),K=e[9].processingRate&&ns(e),te=e[9].failed>0&&rs(e);return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("span"),i=E(),s=b("span"),f=O(c),d=O(" — "),p=O(h),g=E(),$&&$.c(),_=E(),m=b("div"),y=b("div"),k=E(),C=b("div"),x=b("span"),M=O(S),N=O(" / "),I=O(L),P=O(" items"),F=E(),T=b("span"),V&&V.c(),z=E(),w=b("span"),W.c(),D=E(),K&&K.c(),J=E(),te&&te.c(),Z=E(),a(l,"class","inline-flex items-center"),a(s,"class","text-sm font-medium text-blue-800"),a(r,"class","flex items-center gap-2"),a(n,"class","flex items-center justify-between mb-2"),a(y,"class",v="h-full rounded-full transition-all duration-300 "+(e[9].failed>0?"bg-gradient-to-r from-blue-500 to-yellow-500":"bg-blue-500")),gt(y,"width",(e[9].total>0?(e[9].completed+e[9].failed)/e[9].total*100:0)+"%"),a(m,"class","w-full bg-blue-100 rounded-full h-3 overflow-hidden"),a(C,"class","flex items-center justify-between mt-2 text-xs text-blue-700"),a(t,"class","p-4 bg-blue-50 border border-blue-200 rounded-lg")},m(q,be){R(q,t,be),u(t,n),u(n,r),u(r,l),l.innerHTML=o,u(r,i),u(r,s),u(s,f),u(s,d),u(s,p),u(n,g),$&&$.m(n,null),u(t,_),u(t,m),u(m,y),u(t,k),u(t,C),u(C,x),u(x,M),u(x,N),u(x,I),u(x,P),u(C,F),u(C,T),V&&V.m(T,null),u(C,z),u(C,w),W.m(w,null),u(w,D),K&&K.m(w,null),u(t,J),te&&te.m(t,null),u(t,Z)},p(q,be){be&8&&o!==(o=q[4](q[9].status)+"")&&(l.innerHTML=o),be&8&&c!==(c=(q[9].promptName||"Translation Job")+"")&&ee(f,c),be&8&&h!==(h=q[9].langCode+"")&&ee(p,h),q[0]?$?$.p(q,be):($=es(q),$.c(),$.m(n,null)):$&&($.d(1),$=null),be&8&&v!==(v="h-full rounded-full transition-all duration-300 "+(q[9].failed>0?"bg-gradient-to-r from-blue-500 to-yellow-500":"bg-blue-500"))&&a(y,"class",v),be&8&&gt(y,"width",(q[9].total>0?(q[9].completed+q[9].failed)/q[9].total*100:0)+"%"),be&8&&S!==(S=q[9].completed+q[9].failed+"")&&ee(M,S),be&8&&L!==(L=q[9].total+"")&&ee(I,L),q[9].currentItem?V?V.p(q,be):(V=ts(q),V.c(),V.m(T,null)):V&&(V.d(1),V=null),B===(B=se(q))&&W?W.p(q,be):(W.d(1),W=B(q),W&&(W.c(),W.m(w,D))),q[9].processingRate?K?K.p(q,be):(K=ns(q),K.c(),K.m(w,null)):K&&(K.d(1),K=null),q[9].failed>0?te?te.p(q,be):(te=rs(q),te.c(),te.m(t,Z)):te&&(te.d(1),te=null)},d(q){q&&j(t),$&&$.d(),V&&V.d(),W.d(),K&&K.d(),te&&te.d()}}}function is(e){let t,n=Oe(e[2]),r=[];for(let l=0;l<n.length;l+=1)r[l]=ss(Xo(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","mb-4 space-y-2")},m(l,o){R(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o&22){n=Oe(l[2]);let i;for(i=0;i<n.length;i+=1){const s=Xo(l,n,i);r[i]?r[i].p(s,o):(r[i]=ss(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function os(e){let t,n,r;function l(){return e[7](e[9])}return{c(){t=b("button"),t.textContent="×",a(t,"class","w-6 h-6 flex items-center justify-center text-gray-400 hover:text-gray-700 hover:bg-gray-200 rounded text-base"),a(t,"title","Dismiss")},m(o,i){R(o,t,i),n||(r=Q(t,"click",nn(l)),n=!0)},p(o,i){e=o},d(o){o&&j(t),n=!1,r()}}}function ss(e){let t,n,r,l=e[4](e[9].status)+"",o,i,s=e[9].status+"",c,f,d,h,p=(e[9].promptName||"Job")+"",g,_,m=e[9].langCode+"",y,v,k,C,x=e[9].completed+"",S,M,N=e[9].total+"",L,I,P,F,T=e[1]&&os(e);return{c(){t=b("div"),n=b("div"),r=b("span"),o=E(),i=b("span"),c=O(s),d=E(),h=b("span"),g=O(p),_=O(" — "),y=O(m),v=E(),k=b("div"),C=b("span"),S=O(x),M=O("/"),L=O(N),I=O(" translated"),P=E(),T&&T.c(),F=E(),a(r,"class","inline-flex items-center"),a(i,"class",f="font-medium "+as(e[9].status)),a(h,"class","text-gray-500"),a(n,"class","flex items-center gap-2"),a(C,"class","text-gray-400"),a(k,"class","flex items-center gap-3"),a(t,"class","p-3 bg-gray-50 border border-gray-200 rounded-lg flex items-center justify-between text-sm")},m(z,w){R(z,t,w),u(t,n),u(n,r),r.innerHTML=l,u(n,o),u(n,i),u(i,c),u(n,d),u(n,h),u(h,g),u(h,_),u(h,y),u(t,v),u(t,k),u(k,C),u(C,S),u(C,M),u(C,L),u(C,I),u(k,P),T&&T.m(k,null),u(t,F)},p(z,w){w&4&&l!==(l=z[4](z[9].status)+"")&&(r.innerHTML=l),w&4&&s!==(s=z[9].status+"")&&ee(c,s),w&4&&f!==(f="font-medium "+as(z[9].status))&&a(i,"class",f),w&4&&p!==(p=(z[9].promptName||"Job")+"")&&ee(g,p),w&4&&m!==(m=z[9].langCode+"")&&ee(y,m),w&4&&x!==(x=z[9].completed+"")&&ee(S,x),w&4&&N!==(N=z[9].total+"")&&ee(L,N),z[1]?T?T.p(z,w):(T=os(z),T.c(),T.m(k,null)):T&&(T.d(1),T=null)},d(z){z&&j(t),T&&T.d()}}}function Ad(e){let t,n,r=e[3].length>0&&$o(e),l=e[2].length>0&&is(e);return{c(){r&&r.c(),t=E(),l&&l.c(),n=Ct()},m(o,i){r&&r.m(o,i),R(o,t,i),l&&l.m(o,i),R(o,n,i)},p(o,[i]){o[3].length>0?r?r.p(o,i):(r=$o(o),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),o[2].length>0?l?l.p(o,i):(l=is(o),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},i:Be,o:Be,d(o){o&&(j(t),j(n)),r&&r.d(o),l&&l.d(o)}}}function as(e){switch(e){case"running":return"text-blue-600";case"completed":return"text-green-600";case"failed":return"text-red-600";case"cancelled":case"cancelling":return"text-yellow-600";default:return"text-gray-500"}}function us(e){return!e||e<0?"—":e<60?`${Math.ceil(e)}s`:`${Math.floor(e/60)}m ${Math.ceil(e%60)}s`}function Td(e,t,n){let r,l,{jobs:o=[]}=t,{onCancel:i=null}=t,{onDismiss:s=null}=t;const c={pending:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',running:'<svg class="animate-spin" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#3A8FE0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',completed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#2ECC88" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',failed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',cancelled:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',cancelling:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>'};function f(p){return c[p]??'<span class="text-gray-400">&mdash;</span>'}const d=p=>i(p.id),h=p=>s(p.id);return e.$$set=p=>{"jobs"in p&&n(5,o=p.jobs),"onCancel"in p&&n(0,i=p.onCancel),"onDismiss"in p&&n(1,s=p.onDismiss)},e.$$.update=()=>{e.$$.dirty&32&&n(3,r=o.filter(p=>p.status==="running"||p.status==="pending")),e.$$.dirty&32&&n(2,l=o.filter(p=>p.status==="completed"||p.status==="failed"||p.status==="cancelled").slice(0,1))},[i,s,l,r,f,o,d,h]}class Pc extends sn{constructor(t){super(),on(this,t,Td,Ad,$t,{jobs:5,onCancel:0,onDismiss:1})}}var pl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Md(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gl(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Dc={exports:{}};/*!
4
+
5
+ JSZip v3.10.1 - A JavaScript class for generating and reading zip files
6
+ <http://stuartk.com/jszip>
7
+
8
+ (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
9
+ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
10
+
11
+ JSZip uses the library pako released under the MIT license :
12
+ https://github.com/nodeca/pako/blob/main/LICENSE
13
+ */(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,l,o){function i(f,d){if(!l[f]){if(!r[f]){var h=typeof gl=="function"&&gl;if(!d&&h)return h(f,!0);if(s)return s(f,!0);var p=new Error("Cannot find module '"+f+"'");throw p.code="MODULE_NOT_FOUND",p}var g=l[f]={exports:{}};r[f][0].call(g.exports,function(_){var m=r[f][1][_];return i(m||_)},g,g.exports,n,r,l,o)}return l[f].exports}for(var s=typeof gl=="function"&&gl,c=0;c<o.length;c++)i(o[c]);return i}({1:[function(n,r,l){var o=n("./utils"),i=n("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";l.encode=function(c){for(var f,d,h,p,g,_,m,y=[],v=0,k=c.length,C=k,x=o.getTypeOf(c)!=="string";v<c.length;)C=k-v,h=x?(f=c[v++],d=v<k?c[v++]:0,v<k?c[v++]:0):(f=c.charCodeAt(v++),d=v<k?c.charCodeAt(v++):0,v<k?c.charCodeAt(v++):0),p=f>>2,g=(3&f)<<4|d>>4,_=1<C?(15&d)<<2|h>>6:64,m=2<C?63&h:64,y.push(s.charAt(p)+s.charAt(g)+s.charAt(_)+s.charAt(m));return y.join("")},l.decode=function(c){var f,d,h,p,g,_,m=0,y=0,v="data:";if(c.substr(0,v.length)===v)throw new Error("Invalid base64 input, it looks like a data url.");var k,C=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===s.charAt(64)&&C--,c.charAt(c.length-2)===s.charAt(64)&&C--,C%1!=0)throw new Error("Invalid base64 input, bad content length.");for(k=i.uint8array?new Uint8Array(0|C):new Array(0|C);m<c.length;)f=s.indexOf(c.charAt(m++))<<2|(p=s.indexOf(c.charAt(m++)))>>4,d=(15&p)<<4|(g=s.indexOf(c.charAt(m++)))>>2,h=(3&g)<<6|(_=s.indexOf(c.charAt(m++))),k[y++]=f,g!==64&&(k[y++]=d),_!==64&&(k[y++]=h);return k}},{"./support":30,"./utils":32}],2:[function(n,r,l){var o=n("./external"),i=n("./stream/DataWorker"),s=n("./stream/Crc32Probe"),c=n("./stream/DataLengthProbe");function f(d,h,p,g,_){this.compressedSize=d,this.uncompressedSize=h,this.crc32=p,this.compression=g,this.compressedContent=_}f.prototype={getContentWorker:function(){var d=new i(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),h=this;return d.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new i(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(d,h,p){return d.pipe(new s).pipe(new c("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new c("compressedSize")).withStreamInfo("compression",h)},r.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,l){var o=n("./stream/GenericWorker");l.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},l.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,l){var o=n("./utils"),i=function(){for(var s,c=[],f=0;f<256;f++){s=f;for(var d=0;d<8;d++)s=1&s?3988292384^s>>>1:s>>>1;c[f]=s}return c}();r.exports=function(s,c){return s!==void 0&&s.length?o.getTypeOf(s)!=="string"?function(f,d,h,p){var g=i,_=p+h;f^=-1;for(var m=p;m<_;m++)f=f>>>8^g[255&(f^d[m])];return-1^f}(0|c,s,s.length,0):function(f,d,h,p){var g=i,_=p+h;f^=-1;for(var m=p;m<_;m++)f=f>>>8^g[255&(f^d.charCodeAt(m))];return-1^f}(0|c,s,s.length,0):0}},{"./utils":32}],5:[function(n,r,l){l.base64=!1,l.binary=!1,l.dir=!1,l.createFolders=!0,l.date=null,l.compression=null,l.compressionOptions=null,l.comment=null,l.unixPermissions=null,l.dosPermissions=null},{}],6:[function(n,r,l){var o=null;o=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:o}},{lie:37}],7:[function(n,r,l){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=n("pako"),s=n("./utils"),c=n("./stream/GenericWorker"),f=o?"uint8array":"array";function d(h,p){c.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}l.magic="\b\0",s.inherits(d,c),d.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(f,h.data),!1)},d.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},l.compressWorker=function(h){return new d("Deflate",h)},l.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,l){function o(g,_){var m,y="";for(m=0;m<_;m++)y+=String.fromCharCode(255&g),g>>>=8;return y}function i(g,_,m,y,v,k){var C,x,S=g.file,M=g.compression,N=k!==f.utf8encode,L=s.transformTo("string",k(S.name)),I=s.transformTo("string",f.utf8encode(S.name)),P=S.comment,F=s.transformTo("string",k(P)),T=s.transformTo("string",f.utf8encode(P)),z=I.length!==S.name.length,w=T.length!==P.length,D="",J="",Z="",$=S.dir,V=S.date,se={crc32:0,compressedSize:0,uncompressedSize:0};_&&!m||(se.crc32=g.crc32,se.compressedSize=g.compressedSize,se.uncompressedSize=g.uncompressedSize);var B=0;_&&(B|=8),N||!z&&!w||(B|=2048);var W=0,K=0;$&&(W|=16),v==="UNIX"?(K=798,W|=function(q,be){var ve=q;return q||(ve=be?16893:33204),(65535&ve)<<16}(S.unixPermissions,$)):(K=20,W|=function(q){return 63&(q||0)}(S.dosPermissions)),C=V.getUTCHours(),C<<=6,C|=V.getUTCMinutes(),C<<=5,C|=V.getUTCSeconds()/2,x=V.getUTCFullYear()-1980,x<<=4,x|=V.getUTCMonth()+1,x<<=5,x|=V.getUTCDate(),z&&(J=o(1,1)+o(d(L),4)+I,D+="up"+o(J.length,2)+J),w&&(Z=o(1,1)+o(d(F),4)+T,D+="uc"+o(Z.length,2)+Z);var te="";return te+=`
14
+ \0`,te+=o(B,2),te+=M.magic,te+=o(C,2),te+=o(x,2),te+=o(se.crc32,4),te+=o(se.compressedSize,4),te+=o(se.uncompressedSize,4),te+=o(L.length,2),te+=o(D.length,2),{fileRecord:h.LOCAL_FILE_HEADER+te+L+D,dirRecord:h.CENTRAL_FILE_HEADER+o(K,2)+te+o(F.length,2)+"\0\0\0\0"+o(W,4)+o(y,4)+L+D+F}}var s=n("../utils"),c=n("../stream/GenericWorker"),f=n("../utf8"),d=n("../crc32"),h=n("../signature");function p(g,_,m,y){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=_,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=g,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(p,c),p.prototype.push=function(g){var _=g.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(g):(this.bytesWritten+=g.data.length,c.prototype.push.call(this,{data:g.data,meta:{currentFile:this.currentFile,percent:m?(_+100*(m-y-1))/m:100}}))},p.prototype.openedSource=function(g){this.currentSourceOffset=this.bytesWritten,this.currentFile=g.file.name;var _=this.streamFiles&&!g.file.dir;if(_){var m=i(g,_,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(g){this.accumulate=!1;var _=this.streamFiles&&!g.file.dir,m=i(g,_,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),_)this.push({data:function(y){return h.DATA_DESCRIPTOR+o(y.crc32,4)+o(y.compressedSize,4)+o(y.uncompressedSize,4)}(g),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var g=this.bytesWritten,_=0;_<this.dirRecords.length;_++)this.push({data:this.dirRecords[_],meta:{percent:100}});var m=this.bytesWritten-g,y=function(v,k,C,x,S){var M=s.transformTo("string",S(x));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(v,2)+o(v,2)+o(k,4)+o(C,4)+o(M.length,2)+M}(this.dirRecords.length,m,g,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(g){this._sources.push(g);var _=this;return g.on("data",function(m){_.processChunk(m)}),g.on("end",function(){_.closedSource(_.previous.streamInfo),_._sources.length?_.prepareNextSource():_.end()}),g.on("error",function(m){_.error(m)}),this},p.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(g){var _=this._sources;if(!c.prototype.error.call(this,g))return!1;for(var m=0;m<_.length;m++)try{_[m].error(g)}catch{}return!0},p.prototype.lock=function(){c.prototype.lock.call(this);for(var g=this._sources,_=0;_<g.length;_++)g[_].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,l){var o=n("../compressions"),i=n("./ZipFileWorker");l.generateWorker=function(s,c,f){var d=new i(c.streamFiles,f,c.platform,c.encodeFileName),h=0;try{s.forEach(function(p,g){h++;var _=function(k,C){var x=k||C,S=o[x];if(!S)throw new Error(x+" is not a valid compression method !");return S}(g.options.compression,c.compression),m=g.options.compressionOptions||c.compressionOptions||{},y=g.dir,v=g.date;g._compressWorker(_,m).withStreamInfo("file",{name:p,dir:y,date:v,comment:g.comment||"",unixPermissions:g.unixPermissions,dosPermissions:g.dosPermissions}).pipe(d)}),d.entriesCount=h}catch(p){d.error(p)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,l){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var i=new o;for(var s in this)typeof this[s]!="function"&&(i[s]=this[s]);return i}}(o.prototype=n("./object")).loadAsync=n("./load"),o.support=n("./support"),o.defaults=n("./defaults"),o.version="3.10.1",o.loadAsync=function(i,s){return new o().loadAsync(i,s)},o.external=n("./external"),r.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,l){var o=n("./utils"),i=n("./external"),s=n("./utf8"),c=n("./zipEntries"),f=n("./stream/Crc32Probe"),d=n("./nodejsUtils");function h(p){return new i.Promise(function(g,_){var m=p.decompressed.getContentWorker().pipe(new f);m.on("error",function(y){_(y)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?_(new Error("Corrupted zip : CRC32 mismatch")):g()}).resume()})}r.exports=function(p,g){var _=this;return g=o.extend(g||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),d.isNode&&d.isStream(p)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",p,!0,g.optimizedBinaryString,g.base64).then(function(m){var y=new c(g);return y.load(m),y}).then(function(m){var y=[i.Promise.resolve(m)],v=m.files;if(g.checkCRC32)for(var k=0;k<v.length;k++)y.push(h(v[k]));return i.Promise.all(y)}).then(function(m){for(var y=m.shift(),v=y.files,k=0;k<v.length;k++){var C=v[k],x=C.fileNameStr,S=o.resolve(C.fileNameStr);_.file(S,C.decompressed,{binary:!0,optimizedBinaryString:!0,date:C.date,dir:C.dir,comment:C.fileCommentStr.length?C.fileCommentStr:null,unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions,createFolders:g.createFolders}),C.dir||(_.file(S).unsafeOriginalName=x)}return y.zipComment.length&&(_.comment=y.zipComment),_})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,l){var o=n("../utils"),i=n("../stream/GenericWorker");function s(c,f){i.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(f)}o.inherits(s,i),s.prototype._bindStream=function(c){var f=this;(this._stream=c).pause(),c.on("data",function(d){f.push({data:d,meta:{percent:0}})}).on("error",function(d){f.isPaused?this.generatedError=d:f.error(d)}).on("end",function(){f.isPaused?f._upstreamEnded=!0:f.end()})},s.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,l){var o=n("readable-stream").Readable;function i(s,c,f){o.call(this,c),this._helper=s;var d=this;s.on("data",function(h,p){d.push(h)||d._helper.pause(),f&&f(p)}).on("error",function(h){d.emit("error",h)}).on("end",function(){d.push(null)})}n("../utils").inherits(i,o),i.prototype._read=function(){this._helper.resume()},r.exports=i},{"../utils":32,"readable-stream":16}],14:[function(n,r,l){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,i);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,i)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var i=new Buffer(o);return i.fill(0),i},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(n,r,l){function o(S,M,N){var L,I=s.getTypeOf(M),P=s.extend(N||{},d);P.date=P.date||new Date,P.compression!==null&&(P.compression=P.compression.toUpperCase()),typeof P.unixPermissions=="string"&&(P.unixPermissions=parseInt(P.unixPermissions,8)),P.unixPermissions&&16384&P.unixPermissions&&(P.dir=!0),P.dosPermissions&&16&P.dosPermissions&&(P.dir=!0),P.dir&&(S=v(S)),P.createFolders&&(L=y(S))&&k.call(this,L,!0);var F=I==="string"&&P.binary===!1&&P.base64===!1;N&&N.binary!==void 0||(P.binary=!F),(M instanceof h&&M.uncompressedSize===0||P.dir||!M||M.length===0)&&(P.base64=!1,P.binary=!0,M="",P.compression="STORE",I="string");var T=null;T=M instanceof h||M instanceof c?M:_.isNode&&_.isStream(M)?new m(S,M):s.prepareContent(S,M,P.binary,P.optimizedBinaryString,P.base64);var z=new p(S,T,P);this.files[S]=z}var i=n("./utf8"),s=n("./utils"),c=n("./stream/GenericWorker"),f=n("./stream/StreamHelper"),d=n("./defaults"),h=n("./compressedObject"),p=n("./zipObject"),g=n("./generate"),_=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var M=S.lastIndexOf("/");return 0<M?S.substring(0,M):""},v=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},k=function(S,M){return M=M!==void 0?M:d.createFolders,S=v(S),this.files[S]||o.call(this,S,null,{dir:!0,createFolders:M}),this.files[S]};function C(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var x={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var M,N,L;for(M in this.files)L=this.files[M],(N=M.slice(this.root.length,M.length))&&M.slice(0,this.root.length)===this.root&&S(N,L)},filter:function(S){var M=[];return this.forEach(function(N,L){S(N,L)&&M.push(L)}),M},file:function(S,M,N){if(arguments.length!==1)return S=this.root+S,o.call(this,S,M,N),this;if(C(S)){var L=S;return this.filter(function(P,F){return!F.dir&&L.test(P)})}var I=this.files[this.root+S];return I&&!I.dir?I:null},folder:function(S){if(!S)return this;if(C(S))return this.filter(function(I,P){return P.dir&&S.test(I)});var M=this.root+S,N=k.call(this,M),L=this.clone();return L.root=N.name,L},remove:function(S){S=this.root+S;var M=this.files[S];if(M||(S.slice(-1)!=="/"&&(S+="/"),M=this.files[S]),M&&!M.dir)delete this.files[S];else for(var N=this.filter(function(I,P){return P.name.slice(0,S.length)===S}),L=0;L<N.length;L++)delete this.files[N[L].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var M,N={};try{if((N=s.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=N.type.toLowerCase(),N.compression=N.compression.toUpperCase(),N.type==="binarystring"&&(N.type="string"),!N.type)throw new Error("No output type specified.");s.checkSupport(N.type),N.platform!=="darwin"&&N.platform!=="freebsd"&&N.platform!=="linux"&&N.platform!=="sunos"||(N.platform="UNIX"),N.platform==="win32"&&(N.platform="DOS");var L=N.comment||this.comment||"";M=g.generateWorker(this,N,L)}catch(I){(M=new c("error")).error(I)}return new f(M,N.type||"string",N.mimeType)},generateAsync:function(S,M){return this.generateInternalStream(S).accumulate(M)},generateNodeStream:function(S,M){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(M)}};r.exports=x},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,l){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,l){var o=n("./DataReader");function i(s){o.call(this,s);for(var c=0;c<this.data.length;c++)s[c]=255&s[c]}n("../utils").inherits(i,o),i.prototype.byteAt=function(s){return this.data[this.zero+s]},i.prototype.lastIndexOfSignature=function(s){for(var c=s.charCodeAt(0),f=s.charCodeAt(1),d=s.charCodeAt(2),h=s.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===c&&this.data[p+1]===f&&this.data[p+2]===d&&this.data[p+3]===h)return p-this.zero;return-1},i.prototype.readAndCheckSignature=function(s){var c=s.charCodeAt(0),f=s.charCodeAt(1),d=s.charCodeAt(2),h=s.charCodeAt(3),p=this.readData(4);return c===p[0]&&f===p[1]&&d===p[2]&&h===p[3]},i.prototype.readData=function(s){if(this.checkOffset(s),s===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,c},r.exports=i},{"../utils":32,"./DataReader":18}],18:[function(n,r,l){var o=n("../utils");function i(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(){},readInt:function(s){var c,f=0;for(this.checkOffset(s),c=this.index+s-1;c>=this.index;c--)f=(f<<8)+this.byteAt(c);return this.index+=s,f},readString:function(s){return o.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},r.exports=i},{"../utils":32}],19:[function(n,r,l){var o=n("./Uint8ArrayReader");function i(s){o.call(this,s)}n("../utils").inherits(i,o),i.prototype.readData=function(s){this.checkOffset(s);var c=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,l){var o=n("./DataReader");function i(s){o.call(this,s)}n("../utils").inherits(i,o),i.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},i.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},i.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},i.prototype.readData=function(s){this.checkOffset(s);var c=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(n,r,l){var o=n("./ArrayReader");function i(s){o.call(this,s)}n("../utils").inherits(i,o),i.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,l){var o=n("../utils"),i=n("../support"),s=n("./ArrayReader"),c=n("./StringReader"),f=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(h){var p=o.getTypeOf(h);return o.checkSupport(p),p!=="string"||i.uint8array?p==="nodebuffer"?new f(h):i.uint8array?new d(o.transformTo("uint8array",h)):new s(o.transformTo("array",h)):new c(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,l){l.LOCAL_FILE_HEADER="PK",l.CENTRAL_FILE_HEADER="PK",l.CENTRAL_DIRECTORY_END="PK",l.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",l.ZIP64_CENTRAL_DIRECTORY_END="PK",l.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,l){var o=n("./GenericWorker"),i=n("../utils");function s(c){o.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(s,o),s.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,l){var o=n("./GenericWorker"),i=n("../crc32");function s(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(s,o),s.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,l){var o=n("../utils"),i=n("./GenericWorker");function s(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}o.inherits(s,i),s.prototype.processChunk=function(c){if(c){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,l){var o=n("../utils"),i=n("./GenericWorker");function s(c){i.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){f.dataIsReady=!0,f.data=d,f.max=d&&d.length||0,f.type=o.getTypeOf(d),f.isPaused||f._tickAndRepeat()},function(d){f.error(d)})}o.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,f);break;case"uint8array":c=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":c=this.data.slice(this.index,f)}return this.index=f,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,l){function o(i){this.name=i||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,s){return this._listeners[i].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,s){if(this._listeners[i])for(var c=0;c<this._listeners[i].length;c++)this._listeners[i][c].call(this,s)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var s=this;return i.on("data",function(c){s.processChunk(c)}),i.on("end",function(){s.end()}),i.on("error",function(c){s.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,s){return this.extraStreamInfo[i]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},r.exports=o},{}],29:[function(n,r,l){var o=n("../utils"),i=n("./ConvertWorker"),s=n("./GenericWorker"),c=n("../base64"),f=n("../support"),d=n("../external"),h=null;if(f.nodestream)try{h=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(_,m){return new d.Promise(function(y,v){var k=[],C=_._internalType,x=_._outputType,S=_._mimeType;_.on("data",function(M,N){k.push(M),m&&m(N)}).on("error",function(M){k=[],v(M)}).on("end",function(){try{var M=function(N,L,I){switch(N){case"blob":return o.newBlob(o.transformTo("arraybuffer",L),I);case"base64":return c.encode(L);default:return o.transformTo(N,L)}}(x,function(N,L){var I,P=0,F=null,T=0;for(I=0;I<L.length;I++)T+=L[I].length;switch(N){case"string":return L.join("");case"array":return Array.prototype.concat.apply([],L);case"uint8array":for(F=new Uint8Array(T),I=0;I<L.length;I++)F.set(L[I],P),P+=L[I].length;return F;case"nodebuffer":return Buffer.concat(L);default:throw new Error("concat : unsupported type '"+N+"'")}}(C,k),S);y(M)}catch(N){v(N)}k=[]}).resume()})}function g(_,m,y){var v=m;switch(m){case"blob":case"arraybuffer":v="uint8array";break;case"base64":v="string"}try{this._internalType=v,this._outputType=m,this._mimeType=y,o.checkSupport(v),this._worker=_.pipe(new i(v)),_.lock()}catch(k){this._worker=new s("error"),this._worker.error(k)}}g.prototype={accumulate:function(_){return p(this,_)},on:function(_,m){var y=this;return _==="data"?this._worker.on(_,function(v){m.call(y,v.data,v.meta)}):this._worker.on(_,function(){o.delay(m,arguments,y)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(_){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:this._outputType!=="nodebuffer"},_)}},r.exports=g},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,l){if(l.base64=!0,l.array=!0,l.string=!0,l.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",l.nodebuffer=typeof Buffer<"u",l.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")l.blob=!1;else{var o=new ArrayBuffer(0);try{l.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(o),l.blob=i.getBlob("application/zip").size===0}catch{l.blob=!1}}}try{l.nodestream=!!n("readable-stream").Readable}catch{l.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,l){for(var o=n("./utils"),i=n("./support"),s=n("./nodejsUtils"),c=n("./stream/GenericWorker"),f=new Array(256),d=0;d<256;d++)f[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;f[254]=f[254]=1;function h(){c.call(this,"utf-8 decode"),this.leftOver=null}function p(){c.call(this,"utf-8 encode")}l.utf8encode=function(g){return i.nodebuffer?s.newBufferFrom(g,"utf-8"):function(_){var m,y,v,k,C,x=_.length,S=0;for(k=0;k<x;k++)(64512&(y=_.charCodeAt(k)))==55296&&k+1<x&&(64512&(v=_.charCodeAt(k+1)))==56320&&(y=65536+(y-55296<<10)+(v-56320),k++),S+=y<128?1:y<2048?2:y<65536?3:4;for(m=i.uint8array?new Uint8Array(S):new Array(S),k=C=0;C<S;k++)(64512&(y=_.charCodeAt(k)))==55296&&k+1<x&&(64512&(v=_.charCodeAt(k+1)))==56320&&(y=65536+(y-55296<<10)+(v-56320),k++),y<128?m[C++]=y:(y<2048?m[C++]=192|y>>>6:(y<65536?m[C++]=224|y>>>12:(m[C++]=240|y>>>18,m[C++]=128|y>>>12&63),m[C++]=128|y>>>6&63),m[C++]=128|63&y);return m}(g)},l.utf8decode=function(g){return i.nodebuffer?o.transformTo("nodebuffer",g).toString("utf-8"):function(_){var m,y,v,k,C=_.length,x=new Array(2*C);for(m=y=0;m<C;)if((v=_[m++])<128)x[y++]=v;else if(4<(k=f[v]))x[y++]=65533,m+=k-1;else{for(v&=k===2?31:k===3?15:7;1<k&&m<C;)v=v<<6|63&_[m++],k--;1<k?x[y++]=65533:v<65536?x[y++]=v:(v-=65536,x[y++]=55296|v>>10&1023,x[y++]=56320|1023&v)}return x.length!==y&&(x.subarray?x=x.subarray(0,y):x.length=y),o.applyFromCharCode(x)}(g=o.transformTo(i.uint8array?"uint8array":"array",g))},o.inherits(h,c),h.prototype.processChunk=function(g){var _=o.transformTo(i.uint8array?"uint8array":"array",g.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var m=_;(_=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),_.set(m,this.leftOver.length)}else _=this.leftOver.concat(_);this.leftOver=null}var y=function(k,C){var x;for((C=C||k.length)>k.length&&(C=k.length),x=C-1;0<=x&&(192&k[x])==128;)x--;return x<0||x===0?C:x+f[k[x]]>C?x:C}(_),v=_;y!==_.length&&(i.uint8array?(v=_.subarray(0,y),this.leftOver=_.subarray(y,_.length)):(v=_.slice(0,y),this.leftOver=_.slice(y,_.length))),this.push({data:l.utf8decode(v),meta:g.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:l.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},l.Utf8DecodeWorker=h,o.inherits(p,c),p.prototype.processChunk=function(g){this.push({data:l.utf8encode(g.data),meta:g.meta})},l.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,l){var o=n("./support"),i=n("./base64"),s=n("./nodejsUtils"),c=n("./external");function f(m){return m}function d(m,y){for(var v=0;v<m.length;++v)y[v]=255&m.charCodeAt(v);return y}n("setimmediate"),l.newBlob=function(m,y){l.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var v=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return v.append(m),v.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(m,y,v){var k=[],C=0,x=m.length;if(x<=v)return String.fromCharCode.apply(null,m);for(;C<x;)y==="array"||y==="nodebuffer"?k.push(String.fromCharCode.apply(null,m.slice(C,Math.min(C+v,x)))):k.push(String.fromCharCode.apply(null,m.subarray(C,Math.min(C+v,x)))),C+=v;return k.join("")},stringifyByChar:function(m){for(var y="",v=0;v<m.length;v++)y+=String.fromCharCode(m[v]);return y},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}}()}};function p(m){var y=65536,v=l.getTypeOf(m),k=!0;if(v==="uint8array"?k=h.applyCanBeUsed.uint8array:v==="nodebuffer"&&(k=h.applyCanBeUsed.nodebuffer),k)for(;1<y;)try{return h.stringifyByChunk(m,v,y)}catch{y=Math.floor(y/2)}return h.stringifyByChar(m)}function g(m,y){for(var v=0;v<m.length;v++)y[v]=m[v];return y}l.applyFromCharCode=p;var _={};_.string={string:f,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return _.string.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:function(m){return d(m,s.allocBuffer(m.length))}},_.array={string:p,array:f,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return s.newBufferFrom(m)}},_.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return g(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:f,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return s.newBufferFrom(new Uint8Array(m))}},_.uint8array={string:p,array:function(m){return g(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:f,nodebuffer:function(m){return s.newBufferFrom(m)}},_.nodebuffer={string:p,array:function(m){return g(m,new Array(m.length))},arraybuffer:function(m){return _.nodebuffer.uint8array(m).buffer},uint8array:function(m){return g(m,new Uint8Array(m.length))},nodebuffer:f},l.transformTo=function(m,y){if(y=y||"",!m)return y;l.checkSupport(m);var v=l.getTypeOf(y);return _[v][m](y)},l.resolve=function(m){for(var y=m.split("/"),v=[],k=0;k<y.length;k++){var C=y[k];C==="."||C===""&&k!==0&&k!==y.length-1||(C===".."?v.pop():v.push(C))}return v.join("/")},l.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":o.nodebuffer&&s.isBuffer(m)?"nodebuffer":o.uint8array&&m instanceof Uint8Array?"uint8array":o.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},l.checkSupport=function(m){if(!o[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},l.MAX_VALUE_16BITS=65535,l.MAX_VALUE_32BITS=-1,l.pretty=function(m){var y,v,k="";for(v=0;v<(m||"").length;v++)k+="\\x"+((y=m.charCodeAt(v))<16?"0":"")+y.toString(16).toUpperCase();return k},l.delay=function(m,y,v){setImmediate(function(){m.apply(v||null,y||[])})},l.inherits=function(m,y){function v(){}v.prototype=y.prototype,m.prototype=new v},l.extend=function(){var m,y,v={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&v[y]===void 0&&(v[y]=arguments[m][y]);return v},l.prepareContent=function(m,y,v,k,C){return c.Promise.resolve(y).then(function(x){return o.blob&&(x instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(x))!==-1)&&typeof FileReader<"u"?new c.Promise(function(S,M){var N=new FileReader;N.onload=function(L){S(L.target.result)},N.onerror=function(L){M(L.target.error)},N.readAsArrayBuffer(x)}):x}).then(function(x){var S=l.getTypeOf(x);return S?(S==="arraybuffer"?x=l.transformTo("uint8array",x):S==="string"&&(C?x=i.decode(x):v&&k!==!0&&(x=function(M){return d(M,o.uint8array?new Uint8Array(M.length):new Array(M.length))}(x))),x):c.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,l){var o=n("./reader/readerFor"),i=n("./utils"),s=n("./signature"),c=n("./zipEntry"),f=n("./support");function d(h){this.files=[],this.loadOptions=h}d.prototype={checkSignature:function(h){if(!this.reader.readAndCheckSignature(h)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(p)+", expected "+i.pretty(h)+")")}},isSignature:function(h,p){var g=this.reader.index;this.reader.setIndex(h);var _=this.reader.readString(4)===p;return this.reader.setIndex(g),_},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var h=this.reader.readData(this.zipCommentLength),p=f.uint8array?"uint8array":"array",g=i.transformTo(p,h);this.zipComment=this.loadOptions.decodeFileName(g)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var h,p,g,_=this.zip64EndOfCentralSize-44;0<_;)h=this.reader.readInt(2),p=this.reader.readInt(4),g=this.reader.readData(p),this.zip64ExtensibleData[h]={id:h,length:p,value:g}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var h,p;for(h=0;h<this.files.length;h++)p=this.files[h],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var h;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(h=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(h);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var h=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(h<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(h);var p=h;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(h=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(h),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var g=this.centralDirOffset+this.centralDirSize;this.zip64&&(g+=20,g+=12+this.zip64EndOfCentralSize);var _=p-g;if(0<_)this.isSignature(p,s.CENTRAL_FILE_HEADER)||(this.reader.zero=_);else if(_<0)throw new Error("Corrupted zip: missing "+Math.abs(_)+" bytes.")},prepareReader:function(h){this.reader=o(h)},load:function(h){this.prepareReader(h),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,l){var o=n("./reader/readerFor"),i=n("./utils"),s=n("./compressedObject"),c=n("./crc32"),f=n("./utf8"),d=n("./compressions"),h=n("./support");function p(g,_){this.options=g,this.loadOptions=_}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(g){var _,m;if(g.skip(22),this.fileNameLength=g.readInt(2),m=g.readInt(2),this.fileName=g.readData(this.fileNameLength),g.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((_=function(y){for(var v in d)if(Object.prototype.hasOwnProperty.call(d,v)&&d[v].magic===y)return d[v];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,_,g.readData(this.compressedSize))},readCentralPart:function(g){this.versionMadeBy=g.readInt(2),g.skip(2),this.bitFlag=g.readInt(2),this.compressionMethod=g.readString(2),this.date=g.readDate(),this.crc32=g.readInt(4),this.compressedSize=g.readInt(4),this.uncompressedSize=g.readInt(4);var _=g.readInt(2);if(this.extraFieldsLength=g.readInt(2),this.fileCommentLength=g.readInt(2),this.diskNumberStart=g.readInt(2),this.internalFileAttributes=g.readInt(2),this.externalFileAttributes=g.readInt(4),this.localHeaderOffset=g.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");g.skip(_),this.readExtraFields(g),this.parseZIP64ExtraField(g),this.fileComment=g.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var g=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),g==0&&(this.dosPermissions=63&this.externalFileAttributes),g==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var g=o(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=g.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=g.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=g.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=g.readInt(4))}},readExtraFields:function(g){var _,m,y,v=g.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});g.index+4<v;)_=g.readInt(2),m=g.readInt(2),y=g.readData(m),this.extraFields[_]={id:_,length:m,value:y};g.setIndex(v)},handleUTF8:function(){var g=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=f.utf8decode(this.fileName),this.fileCommentStr=f.utf8decode(this.fileComment);else{var _=this.findExtraFieldUnicodePath();if(_!==null)this.fileNameStr=_;else{var m=i.transformTo(g,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var v=i.transformTo(g,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(v)}}},findExtraFieldUnicodePath:function(){var g=this.extraFields[28789];if(g){var _=o(g.value);return _.readInt(1)!==1||c(this.fileName)!==_.readInt(4)?null:f.utf8decode(_.readData(g.length-5))}return null},findExtraFieldUnicodeComment:function(){var g=this.extraFields[25461];if(g){var _=o(g.value);return _.readInt(1)!==1||c(this.fileComment)!==_.readInt(4)?null:f.utf8decode(_.readData(g.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,l){function o(_,m,y){this.name=_,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=m,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var i=n("./stream/StreamHelper"),s=n("./stream/DataWorker"),c=n("./utf8"),f=n("./compressedObject"),d=n("./stream/GenericWorker");o.prototype={internalStream:function(_){var m=null,y="string";try{if(!_)throw new Error("No output type specified.");var v=(y=_.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var k=!this._dataBinary;k&&!v&&(m=m.pipe(new c.Utf8EncodeWorker)),!k&&v&&(m=m.pipe(new c.Utf8DecodeWorker))}catch(C){(m=new d("error")).error(C)}return new i(m,y,"")},async:function(_,m){return this.internalStream(_).accumulate(m)},nodeStream:function(_,m){return this.internalStream(_||"nodebuffer").toNodejsStream(m)},_compressWorker:function(_,m){if(this._data instanceof f&&this._data.compression.magic===_.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new c.Utf8EncodeWorker)),f.createWorkerFrom(y,_,m)},_decompressWorker:function(){return this._data instanceof f?this._data.getContentWorker():this._data instanceof d?this._data:new s(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},g=0;g<h.length;g++)o.prototype[h[g]]=p;r.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,l){(function(o){var i,s,c=o.MutationObserver||o.WebKitMutationObserver;if(c){var f=0,d=new c(_),h=o.document.createTextNode("");d.observe(h,{characterData:!0}),i=function(){h.data=f=++f%2}}else if(o.setImmediate||o.MessageChannel===void 0)i="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var m=o.document.createElement("script");m.onreadystatechange=function(){_(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},o.document.documentElement.appendChild(m)}:function(){setTimeout(_,0)};else{var p=new o.MessageChannel;p.port1.onmessage=_,i=function(){p.port2.postMessage(0)}}var g=[];function _(){var m,y;s=!0;for(var v=g.length;v;){for(y=g,g=[],m=-1;++m<v;)y[m]();v=g.length}s=!1}r.exports=function(m){g.push(m)!==1||s||i()}}).call(this,typeof pl<"u"?pl:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,l){var o=n("immediate");function i(){}var s={},c=["REJECTED"],f=["FULFILLED"],d=["PENDING"];function h(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,v!==i&&m(this,v)}function p(v,k,C){this.promise=v,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}function g(v,k,C){o(function(){var x;try{x=k(C)}catch(S){return s.reject(v,S)}x===v?s.reject(v,new TypeError("Cannot resolve promise with itself")):s.resolve(v,x)})}function _(v){var k=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof k=="function")return function(){k.apply(v,arguments)}}function m(v,k){var C=!1;function x(N){C||(C=!0,s.reject(v,N))}function S(N){C||(C=!0,s.resolve(v,N))}var M=y(function(){k(S,x)});M.status==="error"&&x(M.value)}function y(v,k){var C={};try{C.value=v(k),C.status="success"}catch(x){C.status="error",C.value=x}return C}(r.exports=h).prototype.finally=function(v){if(typeof v!="function")return this;var k=this.constructor;return this.then(function(C){return k.resolve(v()).then(function(){return C})},function(C){return k.resolve(v()).then(function(){throw C})})},h.prototype.catch=function(v){return this.then(null,v)},h.prototype.then=function(v,k){if(typeof v!="function"&&this.state===f||typeof k!="function"&&this.state===c)return this;var C=new this.constructor(i);return this.state!==d?g(C,this.state===f?v:k,this.outcome):this.queue.push(new p(C,v,k)),C},p.prototype.callFulfilled=function(v){s.resolve(this.promise,v)},p.prototype.otherCallFulfilled=function(v){g(this.promise,this.onFulfilled,v)},p.prototype.callRejected=function(v){s.reject(this.promise,v)},p.prototype.otherCallRejected=function(v){g(this.promise,this.onRejected,v)},s.resolve=function(v,k){var C=y(_,k);if(C.status==="error")return s.reject(v,C.value);var x=C.value;if(x)m(v,x);else{v.state=f,v.outcome=k;for(var S=-1,M=v.queue.length;++S<M;)v.queue[S].callFulfilled(k)}return v},s.reject=function(v,k){v.state=c,v.outcome=k;for(var C=-1,x=v.queue.length;++C<x;)v.queue[C].callRejected(k);return v},h.resolve=function(v){return v instanceof this?v:s.resolve(new this(i),v)},h.reject=function(v){var k=new this(i);return s.reject(k,v)},h.all=function(v){var k=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=v.length,x=!1;if(!C)return this.resolve([]);for(var S=new Array(C),M=0,N=-1,L=new this(i);++N<C;)I(v[N],N);return L;function I(P,F){k.resolve(P).then(function(T){S[F]=T,++M!==C||x||(x=!0,s.resolve(L,S))},function(T){x||(x=!0,s.reject(L,T))})}},h.race=function(v){var k=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=v.length,x=!1;if(!C)return this.resolve([]);for(var S=-1,M=new this(i);++S<C;)N=v[S],k.resolve(N).then(function(L){x||(x=!0,s.resolve(M,L))},function(L){x||(x=!0,s.reject(M,L))});var N;return M}},{immediate:36}],38:[function(n,r,l){var o={};(0,n("./lib/utils/common").assign)(o,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,l){var o=n("./zlib/deflate"),i=n("./utils/common"),s=n("./utils/strings"),c=n("./zlib/messages"),f=n("./zlib/zstream"),d=Object.prototype.toString,h=0,p=-1,g=0,_=8;function m(v){if(!(this instanceof m))return new m(v);this.options=i.assign({level:p,method:_,chunkSize:16384,windowBits:15,memLevel:8,strategy:g,to:""},v||{});var k=this.options;k.raw&&0<k.windowBits?k.windowBits=-k.windowBits:k.gzip&&0<k.windowBits&&k.windowBits<16&&(k.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var C=o.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(C!==h)throw new Error(c[C]);if(k.header&&o.deflateSetHeader(this.strm,k.header),k.dictionary){var x;if(x=typeof k.dictionary=="string"?s.string2buf(k.dictionary):d.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(C=o.deflateSetDictionary(this.strm,x))!==h)throw new Error(c[C]);this._dict_set=!0}}function y(v,k){var C=new m(k);if(C.push(v,!0),C.err)throw C.msg||c[C.err];return C.result}m.prototype.push=function(v,k){var C,x,S=this.strm,M=this.options.chunkSize;if(this.ended)return!1;x=k===~~k?k:k===!0?4:0,typeof v=="string"?S.input=s.string2buf(v):d.call(v)==="[object ArrayBuffer]"?S.input=new Uint8Array(v):S.input=v,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new i.Buf8(M),S.next_out=0,S.avail_out=M),(C=o.deflate(S,x))!==1&&C!==h)return this.onEnd(C),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||x!==4&&x!==2)||(this.options.to==="string"?this.onData(s.buf2binstring(i.shrinkBuf(S.output,S.next_out))):this.onData(i.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&C!==1);return x===4?(C=o.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===h):x!==2||(this.onEnd(h),!(S.avail_out=0))},m.prototype.onData=function(v){this.chunks.push(v)},m.prototype.onEnd=function(v){v===h&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},l.Deflate=m,l.deflate=y,l.deflateRaw=function(v,k){return(k=k||{}).raw=!0,y(v,k)},l.gzip=function(v,k){return(k=k||{}).gzip=!0,y(v,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,l){var o=n("./zlib/inflate"),i=n("./utils/common"),s=n("./utils/strings"),c=n("./zlib/constants"),f=n("./zlib/messages"),d=n("./zlib/zstream"),h=n("./zlib/gzheader"),p=Object.prototype.toString;function g(m){if(!(this instanceof g))return new g(m);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},m||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||m&&m.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&!(15&y.windowBits)&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var v=o.inflateInit2(this.strm,y.windowBits);if(v!==c.Z_OK)throw new Error(f[v]);this.header=new h,o.inflateGetHeader(this.strm,this.header)}function _(m,y){var v=new g(y);if(v.push(m,!0),v.err)throw v.msg||f[v.err];return v.result}g.prototype.push=function(m,y){var v,k,C,x,S,M,N=this.strm,L=this.options.chunkSize,I=this.options.dictionary,P=!1;if(this.ended)return!1;k=y===~~y?y:y===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof m=="string"?N.input=s.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?N.input=new Uint8Array(m):N.input=m,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new i.Buf8(L),N.next_out=0,N.avail_out=L),(v=o.inflate(N,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&I&&(M=typeof I=="string"?s.string2buf(I):p.call(I)==="[object ArrayBuffer]"?new Uint8Array(I):I,v=o.inflateSetDictionary(this.strm,M)),v===c.Z_BUF_ERROR&&P===!0&&(v=c.Z_OK,P=!1),v!==c.Z_STREAM_END&&v!==c.Z_OK)return this.onEnd(v),!(this.ended=!0);N.next_out&&(N.avail_out!==0&&v!==c.Z_STREAM_END&&(N.avail_in!==0||k!==c.Z_FINISH&&k!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=s.utf8border(N.output,N.next_out),x=N.next_out-C,S=s.buf2string(N.output,C),N.next_out=x,N.avail_out=L-x,x&&i.arraySet(N.output,N.output,C,x,0),this.onData(S)):this.onData(i.shrinkBuf(N.output,N.next_out)))),N.avail_in===0&&N.avail_out===0&&(P=!0)}while((0<N.avail_in||N.avail_out===0)&&v!==c.Z_STREAM_END);return v===c.Z_STREAM_END&&(k=c.Z_FINISH),k===c.Z_FINISH?(v=o.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===c.Z_OK):k!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(N.avail_out=0))},g.prototype.onData=function(m){this.chunks.push(m)},g.prototype.onEnd=function(m){m===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},l.Inflate=g,l.inflate=_,l.inflateRaw=function(m,y){return(y=y||{}).raw=!0,_(m,y)},l.ungzip=_},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,l){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";l.assign=function(c){for(var f=Array.prototype.slice.call(arguments,1);f.length;){var d=f.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var h in d)d.hasOwnProperty(h)&&(c[h]=d[h])}}return c},l.shrinkBuf=function(c,f){return c.length===f?c:c.subarray?c.subarray(0,f):(c.length=f,c)};var i={arraySet:function(c,f,d,h,p){if(f.subarray&&c.subarray)c.set(f.subarray(d,d+h),p);else for(var g=0;g<h;g++)c[p+g]=f[d+g]},flattenChunks:function(c){var f,d,h,p,g,_;for(f=h=0,d=c.length;f<d;f++)h+=c[f].length;for(_=new Uint8Array(h),f=p=0,d=c.length;f<d;f++)g=c[f],_.set(g,p),p+=g.length;return _}},s={arraySet:function(c,f,d,h,p){for(var g=0;g<h;g++)c[p+g]=f[d+g]},flattenChunks:function(c){return[].concat.apply([],c)}};l.setTyped=function(c){c?(l.Buf8=Uint8Array,l.Buf16=Uint16Array,l.Buf32=Int32Array,l.assign(l,i)):(l.Buf8=Array,l.Buf16=Array,l.Buf32=Array,l.assign(l,s))},l.setTyped(o)},{}],42:[function(n,r,l){var o=n("./common"),i=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var c=new o.Buf8(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;function d(h,p){if(p<65537&&(h.subarray&&s||!h.subarray&&i))return String.fromCharCode.apply(null,o.shrinkBuf(h,p));for(var g="",_=0;_<p;_++)g+=String.fromCharCode(h[_]);return g}c[254]=c[254]=1,l.string2buf=function(h){var p,g,_,m,y,v=h.length,k=0;for(m=0;m<v;m++)(64512&(g=h.charCodeAt(m)))==55296&&m+1<v&&(64512&(_=h.charCodeAt(m+1)))==56320&&(g=65536+(g-55296<<10)+(_-56320),m++),k+=g<128?1:g<2048?2:g<65536?3:4;for(p=new o.Buf8(k),m=y=0;y<k;m++)(64512&(g=h.charCodeAt(m)))==55296&&m+1<v&&(64512&(_=h.charCodeAt(m+1)))==56320&&(g=65536+(g-55296<<10)+(_-56320),m++),g<128?p[y++]=g:(g<2048?p[y++]=192|g>>>6:(g<65536?p[y++]=224|g>>>12:(p[y++]=240|g>>>18,p[y++]=128|g>>>12&63),p[y++]=128|g>>>6&63),p[y++]=128|63&g);return p},l.buf2binstring=function(h){return d(h,h.length)},l.binstring2buf=function(h){for(var p=new o.Buf8(h.length),g=0,_=p.length;g<_;g++)p[g]=h.charCodeAt(g);return p},l.buf2string=function(h,p){var g,_,m,y,v=p||h.length,k=new Array(2*v);for(g=_=0;g<v;)if((m=h[g++])<128)k[_++]=m;else if(4<(y=c[m]))k[_++]=65533,g+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&g<v;)m=m<<6|63&h[g++],y--;1<y?k[_++]=65533:m<65536?k[_++]=m:(m-=65536,k[_++]=55296|m>>10&1023,k[_++]=56320|1023&m)}return d(k,_)},l.utf8border=function(h,p){var g;for((p=p||h.length)>h.length&&(p=h.length),g=p-1;0<=g&&(192&h[g])==128;)g--;return g<0||g===0?p:g+c[h[g]]>p?g:p}},{"./common":41}],43:[function(n,r,l){r.exports=function(o,i,s,c){for(var f=65535&o|0,d=o>>>16&65535|0,h=0;s!==0;){for(s-=h=2e3<s?2e3:s;d=d+(f=f+i[c++]|0)|0,--h;);f%=65521,d%=65521}return f|d<<16|0}},{}],44:[function(n,r,l){r.exports={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_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}},{}],45:[function(n,r,l){var o=function(){for(var i,s=[],c=0;c<256;c++){i=c;for(var f=0;f<8;f++)i=1&i?3988292384^i>>>1:i>>>1;s[c]=i}return s}();r.exports=function(i,s,c,f){var d=o,h=f+c;i^=-1;for(var p=f;p<h;p++)i=i>>>8^d[255&(i^s[p])];return-1^i}},{}],46:[function(n,r,l){var o,i=n("../utils/common"),s=n("./trees"),c=n("./adler32"),f=n("./crc32"),d=n("./messages"),h=0,p=4,g=0,_=-2,m=-1,y=4,v=2,k=8,C=9,x=286,S=30,M=19,N=2*x+1,L=15,I=3,P=258,F=P+I+1,T=42,z=113,w=1,D=2,J=3,Z=4;function $(A,re){return A.msg=d[re],re}function V(A){return(A<<1)-(4<A?9:0)}function se(A){for(var re=A.length;0<=--re;)A[re]=0}function B(A){var re=A.state,X=re.pending;X>A.avail_out&&(X=A.avail_out),X!==0&&(i.arraySet(A.output,re.pending_buf,re.pending_out,X,A.next_out),A.next_out+=X,re.pending_out+=X,A.total_out+=X,A.avail_out-=X,re.pending-=X,re.pending===0&&(re.pending_out=0))}function W(A,re){s._tr_flush_block(A,0<=A.block_start?A.block_start:-1,A.strstart-A.block_start,re),A.block_start=A.strstart,B(A.strm)}function K(A,re){A.pending_buf[A.pending++]=re}function te(A,re){A.pending_buf[A.pending++]=re>>>8&255,A.pending_buf[A.pending++]=255&re}function q(A,re){var X,H,U=A.max_chain_length,Y=A.strstart,ie=A.prev_length,ue=A.nice_match,G=A.strstart>A.w_size-F?A.strstart-(A.w_size-F):0,ce=A.window,ke=A.w_mask,he=A.prev,xe=A.strstart+P,Te=ce[Y+ie-1],ge=ce[Y+ie];A.prev_length>=A.good_match&&(U>>=2),ue>A.lookahead&&(ue=A.lookahead);do if(ce[(X=re)+ie]===ge&&ce[X+ie-1]===Te&&ce[X]===ce[Y]&&ce[++X]===ce[Y+1]){Y+=2,X++;do;while(ce[++Y]===ce[++X]&&ce[++Y]===ce[++X]&&ce[++Y]===ce[++X]&&ce[++Y]===ce[++X]&&ce[++Y]===ce[++X]&&ce[++Y]===ce[++X]&&ce[++Y]===ce[++X]&&ce[++Y]===ce[++X]&&Y<xe);if(H=P-(xe-Y),Y=xe-P,ie<H){if(A.match_start=re,ue<=(ie=H))break;Te=ce[Y+ie-1],ge=ce[Y+ie]}}while((re=he[re&ke])>G&&--U!=0);return ie<=A.lookahead?ie:A.lookahead}function be(A){var re,X,H,U,Y,ie,ue,G,ce,ke,he=A.w_size;do{if(U=A.window_size-A.lookahead-A.strstart,A.strstart>=he+(he-F)){for(i.arraySet(A.window,A.window,he,he,0),A.match_start-=he,A.strstart-=he,A.block_start-=he,re=X=A.hash_size;H=A.head[--re],A.head[re]=he<=H?H-he:0,--X;);for(re=X=he;H=A.prev[--re],A.prev[re]=he<=H?H-he:0,--X;);U+=he}if(A.strm.avail_in===0)break;if(ie=A.strm,ue=A.window,G=A.strstart+A.lookahead,ce=U,ke=void 0,ke=ie.avail_in,ce<ke&&(ke=ce),X=ke===0?0:(ie.avail_in-=ke,i.arraySet(ue,ie.input,ie.next_in,ke,G),ie.state.wrap===1?ie.adler=c(ie.adler,ue,ke,G):ie.state.wrap===2&&(ie.adler=f(ie.adler,ue,ke,G)),ie.next_in+=ke,ie.total_in+=ke,ke),A.lookahead+=X,A.lookahead+A.insert>=I)for(Y=A.strstart-A.insert,A.ins_h=A.window[Y],A.ins_h=(A.ins_h<<A.hash_shift^A.window[Y+1])&A.hash_mask;A.insert&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[Y+I-1])&A.hash_mask,A.prev[Y&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=Y,Y++,A.insert--,!(A.lookahead+A.insert<I)););}while(A.lookahead<F&&A.strm.avail_in!==0)}function ve(A,re){for(var X,H;;){if(A.lookahead<F){if(be(A),A.lookahead<F&&re===h)return w;if(A.lookahead===0)break}if(X=0,A.lookahead>=I&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+I-1])&A.hash_mask,X=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),X!==0&&A.strstart-X<=A.w_size-F&&(A.match_length=q(A,X)),A.match_length>=I)if(H=s._tr_tally(A,A.strstart-A.match_start,A.match_length-I),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=I){for(A.match_length--;A.strstart++,A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+I-1])&A.hash_mask,X=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart,--A.match_length!=0;);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+1])&A.hash_mask;else H=s._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(H&&(W(A,!1),A.strm.avail_out===0))return w}return A.insert=A.strstart<I-1?A.strstart:I-1,re===p?(W(A,!0),A.strm.avail_out===0?J:Z):A.last_lit&&(W(A,!1),A.strm.avail_out===0)?w:D}function Ne(A,re){for(var X,H,U;;){if(A.lookahead<F){if(be(A),A.lookahead<F&&re===h)return w;if(A.lookahead===0)break}if(X=0,A.lookahead>=I&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+I-1])&A.hash_mask,X=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=I-1,X!==0&&A.prev_length<A.max_lazy_match&&A.strstart-X<=A.w_size-F&&(A.match_length=q(A,X),A.match_length<=5&&(A.strategy===1||A.match_length===I&&4096<A.strstart-A.match_start)&&(A.match_length=I-1)),A.prev_length>=I&&A.match_length<=A.prev_length){for(U=A.strstart+A.lookahead-I,H=s._tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-I),A.lookahead-=A.prev_length-1,A.prev_length-=2;++A.strstart<=U&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+I-1])&A.hash_mask,X=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),--A.prev_length!=0;);if(A.match_available=0,A.match_length=I-1,A.strstart++,H&&(W(A,!1),A.strm.avail_out===0))return w}else if(A.match_available){if((H=s._tr_tally(A,0,A.window[A.strstart-1]))&&W(A,!1),A.strstart++,A.lookahead--,A.strm.avail_out===0)return w}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(H=s._tr_tally(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<I-1?A.strstart:I-1,re===p?(W(A,!0),A.strm.avail_out===0?J:Z):A.last_lit&&(W(A,!1),A.strm.avail_out===0)?w:D}function le(A,re,X,H,U){this.good_length=A,this.max_lazy=re,this.nice_length=X,this.max_chain=H,this.func=U}function me(){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=k,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 i.Buf16(2*N),this.dyn_dtree=new i.Buf16(2*(2*S+1)),this.bl_tree=new i.Buf16(2*(2*M+1)),se(this.dyn_ltree),se(this.dyn_dtree),se(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(L+1),this.heap=new i.Buf16(2*x+1),se(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*x+1),se(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ae(A){var re;return A&&A.state?(A.total_in=A.total_out=0,A.data_type=v,(re=A.state).pending=0,re.pending_out=0,re.wrap<0&&(re.wrap=-re.wrap),re.status=re.wrap?T:z,A.adler=re.wrap===2?0:1,re.last_flush=h,s._tr_init(re),g):$(A,_)}function ne(A){var re=ae(A);return re===g&&function(X){X.window_size=2*X.w_size,se(X.head),X.max_lazy_match=o[X.level].max_lazy,X.good_match=o[X.level].good_length,X.nice_match=o[X.level].nice_length,X.max_chain_length=o[X.level].max_chain,X.strstart=0,X.block_start=0,X.lookahead=0,X.insert=0,X.match_length=X.prev_length=I-1,X.match_available=0,X.ins_h=0}(A.state),re}function Ae(A,re,X,H,U,Y){if(!A)return _;var ie=1;if(re===m&&(re=6),H<0?(ie=0,H=-H):15<H&&(ie=2,H-=16),U<1||C<U||X!==k||H<8||15<H||re<0||9<re||Y<0||y<Y)return $(A,_);H===8&&(H=9);var ue=new me;return(A.state=ue).strm=A,ue.wrap=ie,ue.gzhead=null,ue.w_bits=H,ue.w_size=1<<ue.w_bits,ue.w_mask=ue.w_size-1,ue.hash_bits=U+7,ue.hash_size=1<<ue.hash_bits,ue.hash_mask=ue.hash_size-1,ue.hash_shift=~~((ue.hash_bits+I-1)/I),ue.window=new i.Buf8(2*ue.w_size),ue.head=new i.Buf16(ue.hash_size),ue.prev=new i.Buf16(ue.w_size),ue.lit_bufsize=1<<U+6,ue.pending_buf_size=4*ue.lit_bufsize,ue.pending_buf=new i.Buf8(ue.pending_buf_size),ue.d_buf=1*ue.lit_bufsize,ue.l_buf=3*ue.lit_bufsize,ue.level=re,ue.strategy=Y,ue.method=X,ne(A)}o=[new le(0,0,0,0,function(A,re){var X=65535;for(X>A.pending_buf_size-5&&(X=A.pending_buf_size-5);;){if(A.lookahead<=1){if(be(A),A.lookahead===0&&re===h)return w;if(A.lookahead===0)break}A.strstart+=A.lookahead,A.lookahead=0;var H=A.block_start+X;if((A.strstart===0||A.strstart>=H)&&(A.lookahead=A.strstart-H,A.strstart=H,W(A,!1),A.strm.avail_out===0)||A.strstart-A.block_start>=A.w_size-F&&(W(A,!1),A.strm.avail_out===0))return w}return A.insert=0,re===p?(W(A,!0),A.strm.avail_out===0?J:Z):(A.strstart>A.block_start&&(W(A,!1),A.strm.avail_out),w)}),new le(4,4,8,4,ve),new le(4,5,16,8,ve),new le(4,6,32,32,ve),new le(4,4,16,16,Ne),new le(8,16,32,32,Ne),new le(8,16,128,128,Ne),new le(8,32,128,256,Ne),new le(32,128,258,1024,Ne),new le(32,258,258,4096,Ne)],l.deflateInit=function(A,re){return Ae(A,re,k,15,8,0)},l.deflateInit2=Ae,l.deflateReset=ne,l.deflateResetKeep=ae,l.deflateSetHeader=function(A,re){return A&&A.state?A.state.wrap!==2?_:(A.state.gzhead=re,g):_},l.deflate=function(A,re){var X,H,U,Y;if(!A||!A.state||5<re||re<0)return A?$(A,_):_;if(H=A.state,!A.output||!A.input&&A.avail_in!==0||H.status===666&&re!==p)return $(A,A.avail_out===0?-5:_);if(H.strm=A,X=H.last_flush,H.last_flush=re,H.status===T)if(H.wrap===2)A.adler=0,K(H,31),K(H,139),K(H,8),H.gzhead?(K(H,(H.gzhead.text?1:0)+(H.gzhead.hcrc?2:0)+(H.gzhead.extra?4:0)+(H.gzhead.name?8:0)+(H.gzhead.comment?16:0)),K(H,255&H.gzhead.time),K(H,H.gzhead.time>>8&255),K(H,H.gzhead.time>>16&255),K(H,H.gzhead.time>>24&255),K(H,H.level===9?2:2<=H.strategy||H.level<2?4:0),K(H,255&H.gzhead.os),H.gzhead.extra&&H.gzhead.extra.length&&(K(H,255&H.gzhead.extra.length),K(H,H.gzhead.extra.length>>8&255)),H.gzhead.hcrc&&(A.adler=f(A.adler,H.pending_buf,H.pending,0)),H.gzindex=0,H.status=69):(K(H,0),K(H,0),K(H,0),K(H,0),K(H,0),K(H,H.level===9?2:2<=H.strategy||H.level<2?4:0),K(H,3),H.status=z);else{var ie=k+(H.w_bits-8<<4)<<8;ie|=(2<=H.strategy||H.level<2?0:H.level<6?1:H.level===6?2:3)<<6,H.strstart!==0&&(ie|=32),ie+=31-ie%31,H.status=z,te(H,ie),H.strstart!==0&&(te(H,A.adler>>>16),te(H,65535&A.adler)),A.adler=1}if(H.status===69)if(H.gzhead.extra){for(U=H.pending;H.gzindex<(65535&H.gzhead.extra.length)&&(H.pending!==H.pending_buf_size||(H.gzhead.hcrc&&H.pending>U&&(A.adler=f(A.adler,H.pending_buf,H.pending-U,U)),B(A),U=H.pending,H.pending!==H.pending_buf_size));)K(H,255&H.gzhead.extra[H.gzindex]),H.gzindex++;H.gzhead.hcrc&&H.pending>U&&(A.adler=f(A.adler,H.pending_buf,H.pending-U,U)),H.gzindex===H.gzhead.extra.length&&(H.gzindex=0,H.status=73)}else H.status=73;if(H.status===73)if(H.gzhead.name){U=H.pending;do{if(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>U&&(A.adler=f(A.adler,H.pending_buf,H.pending-U,U)),B(A),U=H.pending,H.pending===H.pending_buf_size)){Y=1;break}Y=H.gzindex<H.gzhead.name.length?255&H.gzhead.name.charCodeAt(H.gzindex++):0,K(H,Y)}while(Y!==0);H.gzhead.hcrc&&H.pending>U&&(A.adler=f(A.adler,H.pending_buf,H.pending-U,U)),Y===0&&(H.gzindex=0,H.status=91)}else H.status=91;if(H.status===91)if(H.gzhead.comment){U=H.pending;do{if(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>U&&(A.adler=f(A.adler,H.pending_buf,H.pending-U,U)),B(A),U=H.pending,H.pending===H.pending_buf_size)){Y=1;break}Y=H.gzindex<H.gzhead.comment.length?255&H.gzhead.comment.charCodeAt(H.gzindex++):0,K(H,Y)}while(Y!==0);H.gzhead.hcrc&&H.pending>U&&(A.adler=f(A.adler,H.pending_buf,H.pending-U,U)),Y===0&&(H.status=103)}else H.status=103;if(H.status===103&&(H.gzhead.hcrc?(H.pending+2>H.pending_buf_size&&B(A),H.pending+2<=H.pending_buf_size&&(K(H,255&A.adler),K(H,A.adler>>8&255),A.adler=0,H.status=z)):H.status=z),H.pending!==0){if(B(A),A.avail_out===0)return H.last_flush=-1,g}else if(A.avail_in===0&&V(re)<=V(X)&&re!==p)return $(A,-5);if(H.status===666&&A.avail_in!==0)return $(A,-5);if(A.avail_in!==0||H.lookahead!==0||re!==h&&H.status!==666){var ue=H.strategy===2?function(G,ce){for(var ke;;){if(G.lookahead===0&&(be(G),G.lookahead===0)){if(ce===h)return w;break}if(G.match_length=0,ke=s._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++,ke&&(W(G,!1),G.strm.avail_out===0))return w}return G.insert=0,ce===p?(W(G,!0),G.strm.avail_out===0?J:Z):G.last_lit&&(W(G,!1),G.strm.avail_out===0)?w:D}(H,re):H.strategy===3?function(G,ce){for(var ke,he,xe,Te,ge=G.window;;){if(G.lookahead<=P){if(be(G),G.lookahead<=P&&ce===h)return w;if(G.lookahead===0)break}if(G.match_length=0,G.lookahead>=I&&0<G.strstart&&(he=ge[xe=G.strstart-1])===ge[++xe]&&he===ge[++xe]&&he===ge[++xe]){Te=G.strstart+P;do;while(he===ge[++xe]&&he===ge[++xe]&&he===ge[++xe]&&he===ge[++xe]&&he===ge[++xe]&&he===ge[++xe]&&he===ge[++xe]&&he===ge[++xe]&&xe<Te);G.match_length=P-(Te-xe),G.match_length>G.lookahead&&(G.match_length=G.lookahead)}if(G.match_length>=I?(ke=s._tr_tally(G,1,G.match_length-I),G.lookahead-=G.match_length,G.strstart+=G.match_length,G.match_length=0):(ke=s._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++),ke&&(W(G,!1),G.strm.avail_out===0))return w}return G.insert=0,ce===p?(W(G,!0),G.strm.avail_out===0?J:Z):G.last_lit&&(W(G,!1),G.strm.avail_out===0)?w:D}(H,re):o[H.level].func(H,re);if(ue!==J&&ue!==Z||(H.status=666),ue===w||ue===J)return A.avail_out===0&&(H.last_flush=-1),g;if(ue===D&&(re===1?s._tr_align(H):re!==5&&(s._tr_stored_block(H,0,0,!1),re===3&&(se(H.head),H.lookahead===0&&(H.strstart=0,H.block_start=0,H.insert=0))),B(A),A.avail_out===0))return H.last_flush=-1,g}return re!==p?g:H.wrap<=0?1:(H.wrap===2?(K(H,255&A.adler),K(H,A.adler>>8&255),K(H,A.adler>>16&255),K(H,A.adler>>24&255),K(H,255&A.total_in),K(H,A.total_in>>8&255),K(H,A.total_in>>16&255),K(H,A.total_in>>24&255)):(te(H,A.adler>>>16),te(H,65535&A.adler)),B(A),0<H.wrap&&(H.wrap=-H.wrap),H.pending!==0?g:1)},l.deflateEnd=function(A){var re;return A&&A.state?(re=A.state.status)!==T&&re!==69&&re!==73&&re!==91&&re!==103&&re!==z&&re!==666?$(A,_):(A.state=null,re===z?$(A,-3):g):_},l.deflateSetDictionary=function(A,re){var X,H,U,Y,ie,ue,G,ce,ke=re.length;if(!A||!A.state||(Y=(X=A.state).wrap)===2||Y===1&&X.status!==T||X.lookahead)return _;for(Y===1&&(A.adler=c(A.adler,re,ke,0)),X.wrap=0,ke>=X.w_size&&(Y===0&&(se(X.head),X.strstart=0,X.block_start=0,X.insert=0),ce=new i.Buf8(X.w_size),i.arraySet(ce,re,ke-X.w_size,X.w_size,0),re=ce,ke=X.w_size),ie=A.avail_in,ue=A.next_in,G=A.input,A.avail_in=ke,A.next_in=0,A.input=re,be(X);X.lookahead>=I;){for(H=X.strstart,U=X.lookahead-(I-1);X.ins_h=(X.ins_h<<X.hash_shift^X.window[H+I-1])&X.hash_mask,X.prev[H&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=H,H++,--U;);X.strstart=H,X.lookahead=I-1,be(X)}return X.strstart+=X.lookahead,X.block_start=X.strstart,X.insert=X.lookahead,X.lookahead=0,X.match_length=X.prev_length=I-1,X.match_available=0,A.next_in=ue,A.input=G,A.avail_in=ie,X.wrap=Y,g},l.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,l){r.exports=function(){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}},{}],48:[function(n,r,l){r.exports=function(o,i){var s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L,I,P,F,T,z,w,D;s=o.state,c=o.next_in,w=o.input,f=c+(o.avail_in-5),d=o.next_out,D=o.output,h=d-(i-o.avail_out),p=d+(o.avail_out-257),g=s.dmax,_=s.wsize,m=s.whave,y=s.wnext,v=s.window,k=s.hold,C=s.bits,x=s.lencode,S=s.distcode,M=(1<<s.lenbits)-1,N=(1<<s.distbits)-1;e:do{C<15&&(k+=w[c++]<<C,C+=8,k+=w[c++]<<C,C+=8),L=x[k&M];t:for(;;){if(k>>>=I=L>>>24,C-=I,(I=L>>>16&255)===0)D[d++]=65535&L;else{if(!(16&I)){if(!(64&I)){L=x[(65535&L)+(k&(1<<I)-1)];continue t}if(32&I){s.mode=12;break e}o.msg="invalid literal/length code",s.mode=30;break e}P=65535&L,(I&=15)&&(C<I&&(k+=w[c++]<<C,C+=8),P+=k&(1<<I)-1,k>>>=I,C-=I),C<15&&(k+=w[c++]<<C,C+=8,k+=w[c++]<<C,C+=8),L=S[k&N];n:for(;;){if(k>>>=I=L>>>24,C-=I,!(16&(I=L>>>16&255))){if(!(64&I)){L=S[(65535&L)+(k&(1<<I)-1)];continue n}o.msg="invalid distance code",s.mode=30;break e}if(F=65535&L,C<(I&=15)&&(k+=w[c++]<<C,(C+=8)<I&&(k+=w[c++]<<C,C+=8)),g<(F+=k&(1<<I)-1)){o.msg="invalid distance too far back",s.mode=30;break e}if(k>>>=I,C-=I,(I=d-h)<F){if(m<(I=F-I)&&s.sane){o.msg="invalid distance too far back",s.mode=30;break e}if(z=v,(T=0)===y){if(T+=_-I,I<P){for(P-=I;D[d++]=v[T++],--I;);T=d-F,z=D}}else if(y<I){if(T+=_+y-I,(I-=y)<P){for(P-=I;D[d++]=v[T++],--I;);if(T=0,y<P){for(P-=I=y;D[d++]=v[T++],--I;);T=d-F,z=D}}}else if(T+=y-I,I<P){for(P-=I;D[d++]=v[T++],--I;);T=d-F,z=D}for(;2<P;)D[d++]=z[T++],D[d++]=z[T++],D[d++]=z[T++],P-=3;P&&(D[d++]=z[T++],1<P&&(D[d++]=z[T++]))}else{for(T=d-F;D[d++]=D[T++],D[d++]=D[T++],D[d++]=D[T++],2<(P-=3););P&&(D[d++]=D[T++],1<P&&(D[d++]=D[T++]))}break}}break}}while(c<f&&d<p);c-=P=C>>3,k&=(1<<(C-=P<<3))-1,o.next_in=c,o.next_out=d,o.avail_in=c<f?f-c+5:5-(c-f),o.avail_out=d<p?p-d+257:257-(d-p),s.hold=k,s.bits=C}},{}],49:[function(n,r,l){var o=n("../utils/common"),i=n("./adler32"),s=n("./crc32"),c=n("./inffast"),f=n("./inftrees"),d=1,h=2,p=0,g=-2,_=1,m=852,y=592;function v(T){return(T>>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function k(){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 o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function C(T){var z;return T&&T.state?(z=T.state,T.total_in=T.total_out=z.total=0,T.msg="",z.wrap&&(T.adler=1&z.wrap),z.mode=_,z.last=0,z.havedict=0,z.dmax=32768,z.head=null,z.hold=0,z.bits=0,z.lencode=z.lendyn=new o.Buf32(m),z.distcode=z.distdyn=new o.Buf32(y),z.sane=1,z.back=-1,p):g}function x(T){var z;return T&&T.state?((z=T.state).wsize=0,z.whave=0,z.wnext=0,C(T)):g}function S(T,z){var w,D;return T&&T.state?(D=T.state,z<0?(w=0,z=-z):(w=1+(z>>4),z<48&&(z&=15)),z&&(z<8||15<z)?g:(D.window!==null&&D.wbits!==z&&(D.window=null),D.wrap=w,D.wbits=z,x(T))):g}function M(T,z){var w,D;return T?(D=new k,(T.state=D).window=null,(w=S(T,z))!==p&&(T.state=null),w):g}var N,L,I=!0;function P(T){if(I){var z;for(N=new o.Buf32(512),L=new o.Buf32(32),z=0;z<144;)T.lens[z++]=8;for(;z<256;)T.lens[z++]=9;for(;z<280;)T.lens[z++]=7;for(;z<288;)T.lens[z++]=8;for(f(d,T.lens,0,288,N,0,T.work,{bits:9}),z=0;z<32;)T.lens[z++]=5;f(h,T.lens,0,32,L,0,T.work,{bits:5}),I=!1}T.lencode=N,T.lenbits=9,T.distcode=L,T.distbits=5}function F(T,z,w,D){var J,Z=T.state;return Z.window===null&&(Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new o.Buf8(Z.wsize)),D>=Z.wsize?(o.arraySet(Z.window,z,w-Z.wsize,Z.wsize,0),Z.wnext=0,Z.whave=Z.wsize):(D<(J=Z.wsize-Z.wnext)&&(J=D),o.arraySet(Z.window,z,w-D,J,Z.wnext),(D-=J)?(o.arraySet(Z.window,z,w-D,D,0),Z.wnext=D,Z.whave=Z.wsize):(Z.wnext+=J,Z.wnext===Z.wsize&&(Z.wnext=0),Z.whave<Z.wsize&&(Z.whave+=J))),0}l.inflateReset=x,l.inflateReset2=S,l.inflateResetKeep=C,l.inflateInit=function(T){return M(T,15)},l.inflateInit2=M,l.inflate=function(T,z){var w,D,J,Z,$,V,se,B,W,K,te,q,be,ve,Ne,le,me,ae,ne,Ae,A,re,X,H,U=0,Y=new o.Buf8(4),ie=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return g;(w=T.state).mode===12&&(w.mode=13),$=T.next_out,J=T.output,se=T.avail_out,Z=T.next_in,D=T.input,V=T.avail_in,B=w.hold,W=w.bits,K=V,te=se,re=p;e:for(;;)switch(w.mode){case _:if(w.wrap===0){w.mode=13;break}for(;W<16;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}if(2&w.wrap&&B===35615){Y[w.check=0]=255&B,Y[1]=B>>>8&255,w.check=s(w.check,Y,2,0),W=B=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&B)<<8)+(B>>8))%31){T.msg="incorrect header check",w.mode=30;break}if((15&B)!=8){T.msg="unknown compression method",w.mode=30;break}if(W-=4,A=8+(15&(B>>>=4)),w.wbits===0)w.wbits=A;else if(A>w.wbits){T.msg="invalid window size",w.mode=30;break}w.dmax=1<<A,T.adler=w.check=1,w.mode=512&B?10:12,W=B=0;break;case 2:for(;W<16;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}if(w.flags=B,(255&w.flags)!=8){T.msg="unknown compression method",w.mode=30;break}if(57344&w.flags){T.msg="unknown header flags set",w.mode=30;break}w.head&&(w.head.text=B>>8&1),512&w.flags&&(Y[0]=255&B,Y[1]=B>>>8&255,w.check=s(w.check,Y,2,0)),W=B=0,w.mode=3;case 3:for(;W<32;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}w.head&&(w.head.time=B),512&w.flags&&(Y[0]=255&B,Y[1]=B>>>8&255,Y[2]=B>>>16&255,Y[3]=B>>>24&255,w.check=s(w.check,Y,4,0)),W=B=0,w.mode=4;case 4:for(;W<16;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}w.head&&(w.head.xflags=255&B,w.head.os=B>>8),512&w.flags&&(Y[0]=255&B,Y[1]=B>>>8&255,w.check=s(w.check,Y,2,0)),W=B=0,w.mode=5;case 5:if(1024&w.flags){for(;W<16;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}w.length=B,w.head&&(w.head.extra_len=B),512&w.flags&&(Y[0]=255&B,Y[1]=B>>>8&255,w.check=s(w.check,Y,2,0)),W=B=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(V<(q=w.length)&&(q=V),q&&(w.head&&(A=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),o.arraySet(w.head.extra,D,Z,q,A)),512&w.flags&&(w.check=s(w.check,D,q,Z)),V-=q,Z+=q,w.length-=q),w.length))break e;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(V===0)break e;for(q=0;A=D[Z+q++],w.head&&A&&w.length<65536&&(w.head.name+=String.fromCharCode(A)),A&&q<V;);if(512&w.flags&&(w.check=s(w.check,D,q,Z)),V-=q,Z+=q,A)break e}else w.head&&(w.head.name=null);w.length=0,w.mode=8;case 8:if(4096&w.flags){if(V===0)break e;for(q=0;A=D[Z+q++],w.head&&A&&w.length<65536&&(w.head.comment+=String.fromCharCode(A)),A&&q<V;);if(512&w.flags&&(w.check=s(w.check,D,q,Z)),V-=q,Z+=q,A)break e}else w.head&&(w.head.comment=null);w.mode=9;case 9:if(512&w.flags){for(;W<16;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}if(B!==(65535&w.check)){T.msg="header crc mismatch",w.mode=30;break}W=B=0}w.head&&(w.head.hcrc=w.flags>>9&1,w.head.done=!0),T.adler=w.check=0,w.mode=12;break;case 10:for(;W<32;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}T.adler=w.check=v(B),W=B=0,w.mode=11;case 11:if(w.havedict===0)return T.next_out=$,T.avail_out=se,T.next_in=Z,T.avail_in=V,w.hold=B,w.bits=W,2;T.adler=w.check=1,w.mode=12;case 12:if(z===5||z===6)break e;case 13:if(w.last){B>>>=7&W,W-=7&W,w.mode=27;break}for(;W<3;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}switch(w.last=1&B,W-=1,3&(B>>>=1)){case 0:w.mode=14;break;case 1:if(P(w),w.mode=20,z!==6)break;B>>>=2,W-=2;break e;case 2:w.mode=17;break;case 3:T.msg="invalid block type",w.mode=30}B>>>=2,W-=2;break;case 14:for(B>>>=7&W,W-=7&W;W<32;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}if((65535&B)!=(B>>>16^65535)){T.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&B,W=B=0,w.mode=15,z===6)break e;case 15:w.mode=16;case 16:if(q=w.length){if(V<q&&(q=V),se<q&&(q=se),q===0)break e;o.arraySet(J,D,Z,q,$),V-=q,Z+=q,se-=q,$+=q,w.length-=q;break}w.mode=12;break;case 17:for(;W<14;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}if(w.nlen=257+(31&B),B>>>=5,W-=5,w.ndist=1+(31&B),B>>>=5,W-=5,w.ncode=4+(15&B),B>>>=4,W-=4,286<w.nlen||30<w.ndist){T.msg="too many length or distance symbols",w.mode=30;break}w.have=0,w.mode=18;case 18:for(;w.have<w.ncode;){for(;W<3;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}w.lens[ie[w.have++]]=7&B,B>>>=3,W-=3}for(;w.have<19;)w.lens[ie[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,X={bits:w.lenbits},re=f(0,w.lens,0,19,w.lencode,0,w.work,X),w.lenbits=X.bits,re){T.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have<w.nlen+w.ndist;){for(;le=(U=w.lencode[B&(1<<w.lenbits)-1])>>>16&255,me=65535&U,!((Ne=U>>>24)<=W);){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}if(me<16)B>>>=Ne,W-=Ne,w.lens[w.have++]=me;else{if(me===16){for(H=Ne+2;W<H;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}if(B>>>=Ne,W-=Ne,w.have===0){T.msg="invalid bit length repeat",w.mode=30;break}A=w.lens[w.have-1],q=3+(3&B),B>>>=2,W-=2}else if(me===17){for(H=Ne+3;W<H;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}W-=Ne,A=0,q=3+(7&(B>>>=Ne)),B>>>=3,W-=3}else{for(H=Ne+7;W<H;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}W-=Ne,A=0,q=11+(127&(B>>>=Ne)),B>>>=7,W-=7}if(w.have+q>w.nlen+w.ndist){T.msg="invalid bit length repeat",w.mode=30;break}for(;q--;)w.lens[w.have++]=A}}if(w.mode===30)break;if(w.lens[256]===0){T.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,X={bits:w.lenbits},re=f(d,w.lens,0,w.nlen,w.lencode,0,w.work,X),w.lenbits=X.bits,re){T.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,X={bits:w.distbits},re=f(h,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,X),w.distbits=X.bits,re){T.msg="invalid distances set",w.mode=30;break}if(w.mode=20,z===6)break e;case 20:w.mode=21;case 21:if(6<=V&&258<=se){T.next_out=$,T.avail_out=se,T.next_in=Z,T.avail_in=V,w.hold=B,w.bits=W,c(T,te),$=T.next_out,J=T.output,se=T.avail_out,Z=T.next_in,D=T.input,V=T.avail_in,B=w.hold,W=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;le=(U=w.lencode[B&(1<<w.lenbits)-1])>>>16&255,me=65535&U,!((Ne=U>>>24)<=W);){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}if(le&&!(240&le)){for(ae=Ne,ne=le,Ae=me;le=(U=w.lencode[Ae+((B&(1<<ae+ne)-1)>>ae)])>>>16&255,me=65535&U,!(ae+(Ne=U>>>24)<=W);){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}B>>>=ae,W-=ae,w.back+=ae}if(B>>>=Ne,W-=Ne,w.back+=Ne,w.length=me,le===0){w.mode=26;break}if(32&le){w.back=-1,w.mode=12;break}if(64&le){T.msg="invalid literal/length code",w.mode=30;break}w.extra=15&le,w.mode=22;case 22:if(w.extra){for(H=w.extra;W<H;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}w.length+=B&(1<<w.extra)-1,B>>>=w.extra,W-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;le=(U=w.distcode[B&(1<<w.distbits)-1])>>>16&255,me=65535&U,!((Ne=U>>>24)<=W);){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}if(!(240&le)){for(ae=Ne,ne=le,Ae=me;le=(U=w.distcode[Ae+((B&(1<<ae+ne)-1)>>ae)])>>>16&255,me=65535&U,!(ae+(Ne=U>>>24)<=W);){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}B>>>=ae,W-=ae,w.back+=ae}if(B>>>=Ne,W-=Ne,w.back+=Ne,64&le){T.msg="invalid distance code",w.mode=30;break}w.offset=me,w.extra=15&le,w.mode=24;case 24:if(w.extra){for(H=w.extra;W<H;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}w.offset+=B&(1<<w.extra)-1,B>>>=w.extra,W-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){T.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(se===0)break e;if(q=te-se,w.offset>q){if((q=w.offset-q)>w.whave&&w.sane){T.msg="invalid distance too far back",w.mode=30;break}be=q>w.wnext?(q-=w.wnext,w.wsize-q):w.wnext-q,q>w.length&&(q=w.length),ve=w.window}else ve=J,be=$-w.offset,q=w.length;for(se<q&&(q=se),se-=q,w.length-=q;J[$++]=ve[be++],--q;);w.length===0&&(w.mode=21);break;case 26:if(se===0)break e;J[$++]=w.length,se--,w.mode=21;break;case 27:if(w.wrap){for(;W<32;){if(V===0)break e;V--,B|=D[Z++]<<W,W+=8}if(te-=se,T.total_out+=te,w.total+=te,te&&(T.adler=w.check=w.flags?s(w.check,J,te,$-te):i(w.check,J,te,$-te)),te=se,(w.flags?B:v(B))!==w.check){T.msg="incorrect data check",w.mode=30;break}W=B=0}w.mode=28;case 28:if(w.wrap&&w.flags){for(;W<32;){if(V===0)break e;V--,B+=D[Z++]<<W,W+=8}if(B!==(4294967295&w.total)){T.msg="incorrect length check",w.mode=30;break}W=B=0}w.mode=29;case 29:re=1;break e;case 30:re=-3;break e;case 31:return-4;case 32:default:return g}return T.next_out=$,T.avail_out=se,T.next_in=Z,T.avail_in=V,w.hold=B,w.bits=W,(w.wsize||te!==T.avail_out&&w.mode<30&&(w.mode<27||z!==4))&&F(T,T.output,T.next_out,te-T.avail_out)?(w.mode=31,-4):(K-=T.avail_in,te-=T.avail_out,T.total_in+=K,T.total_out+=te,w.total+=te,w.wrap&&te&&(T.adler=w.check=w.flags?s(w.check,J,te,T.next_out-te):i(w.check,J,te,T.next_out-te)),T.data_type=w.bits+(w.last?64:0)+(w.mode===12?128:0)+(w.mode===20||w.mode===15?256:0),(K==0&&te===0||z===4)&&re===p&&(re=-5),re)},l.inflateEnd=function(T){if(!T||!T.state)return g;var z=T.state;return z.window&&(z.window=null),T.state=null,p},l.inflateGetHeader=function(T,z){var w;return T&&T.state&&2&(w=T.state).wrap?((w.head=z).done=!1,p):g},l.inflateSetDictionary=function(T,z){var w,D=z.length;return T&&T.state?(w=T.state).wrap!==0&&w.mode!==11?g:w.mode===11&&i(1,z,D,0)!==w.check?-3:F(T,z,D,D)?(w.mode=31,-4):(w.havedict=1,p):g},l.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,l){var o=n("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],f=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(d,h,p,g,_,m,y,v){var k,C,x,S,M,N,L,I,P,F=v.bits,T=0,z=0,w=0,D=0,J=0,Z=0,$=0,V=0,se=0,B=0,W=null,K=0,te=new o.Buf16(16),q=new o.Buf16(16),be=null,ve=0;for(T=0;T<=15;T++)te[T]=0;for(z=0;z<g;z++)te[h[p+z]]++;for(J=F,D=15;1<=D&&te[D]===0;D--);if(D<J&&(J=D),D===0)return _[m++]=20971520,_[m++]=20971520,v.bits=1,0;for(w=1;w<D&&te[w]===0;w++);for(J<w&&(J=w),T=V=1;T<=15;T++)if(V<<=1,(V-=te[T])<0)return-1;if(0<V&&(d===0||D!==1))return-1;for(q[1]=0,T=1;T<15;T++)q[T+1]=q[T]+te[T];for(z=0;z<g;z++)h[p+z]!==0&&(y[q[h[p+z]]++]=z);if(N=d===0?(W=be=y,19):d===1?(W=i,K-=257,be=s,ve-=257,256):(W=c,be=f,-1),T=w,M=m,$=z=B=0,x=-1,S=(se=1<<(Z=J))-1,d===1&&852<se||d===2&&592<se)return 1;for(;;){for(L=T-$,P=y[z]<N?(I=0,y[z]):y[z]>N?(I=be[ve+y[z]],W[K+y[z]]):(I=96,0),k=1<<T-$,w=C=1<<Z;_[M+(B>>$)+(C-=k)]=L<<24|I<<16|P|0,C!==0;);for(k=1<<T-1;B&k;)k>>=1;if(k!==0?(B&=k-1,B+=k):B=0,z++,--te[T]==0){if(T===D)break;T=h[p+y[z]]}if(J<T&&(B&S)!==x){for($===0&&($=J),M+=w,V=1<<(Z=T-$);Z+$<D&&!((V-=te[Z+$])<=0);)Z++,V<<=1;if(se+=1<<Z,d===1&&852<se||d===2&&592<se)return 1;_[x=B&S]=J<<24|Z<<16|M-m|0}}return B!==0&&(_[M+B]=T-$<<24|64<<16|0),v.bits=J,0}},{"../utils/common":41}],51:[function(n,r,l){r.exports={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"}},{}],52:[function(n,r,l){var o=n("../utils/common"),i=0,s=1;function c(U){for(var Y=U.length;0<=--Y;)U[Y]=0}var f=0,d=29,h=256,p=h+1+d,g=30,_=19,m=2*p+1,y=15,v=16,k=7,C=256,x=16,S=17,M=18,N=[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],L=[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],I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));c(F);var T=new Array(2*g);c(T);var z=new Array(512);c(z);var w=new Array(256);c(w);var D=new Array(d);c(D);var J,Z,$,V=new Array(g);function se(U,Y,ie,ue,G){this.static_tree=U,this.extra_bits=Y,this.extra_base=ie,this.elems=ue,this.max_length=G,this.has_stree=U&&U.length}function B(U,Y){this.dyn_tree=U,this.max_code=0,this.stat_desc=Y}function W(U){return U<256?z[U]:z[256+(U>>>7)]}function K(U,Y){U.pending_buf[U.pending++]=255&Y,U.pending_buf[U.pending++]=Y>>>8&255}function te(U,Y,ie){U.bi_valid>v-ie?(U.bi_buf|=Y<<U.bi_valid&65535,K(U,U.bi_buf),U.bi_buf=Y>>v-U.bi_valid,U.bi_valid+=ie-v):(U.bi_buf|=Y<<U.bi_valid&65535,U.bi_valid+=ie)}function q(U,Y,ie){te(U,ie[2*Y],ie[2*Y+1])}function be(U,Y){for(var ie=0;ie|=1&U,U>>>=1,ie<<=1,0<--Y;);return ie>>>1}function ve(U,Y,ie){var ue,G,ce=new Array(y+1),ke=0;for(ue=1;ue<=y;ue++)ce[ue]=ke=ke+ie[ue-1]<<1;for(G=0;G<=Y;G++){var he=U[2*G+1];he!==0&&(U[2*G]=be(ce[he]++,he))}}function Ne(U){var Y;for(Y=0;Y<p;Y++)U.dyn_ltree[2*Y]=0;for(Y=0;Y<g;Y++)U.dyn_dtree[2*Y]=0;for(Y=0;Y<_;Y++)U.bl_tree[2*Y]=0;U.dyn_ltree[2*C]=1,U.opt_len=U.static_len=0,U.last_lit=U.matches=0}function le(U){8<U.bi_valid?K(U,U.bi_buf):0<U.bi_valid&&(U.pending_buf[U.pending++]=U.bi_buf),U.bi_buf=0,U.bi_valid=0}function me(U,Y,ie,ue){var G=2*Y,ce=2*ie;return U[G]<U[ce]||U[G]===U[ce]&&ue[Y]<=ue[ie]}function ae(U,Y,ie){for(var ue=U.heap[ie],G=ie<<1;G<=U.heap_len&&(G<U.heap_len&&me(Y,U.heap[G+1],U.heap[G],U.depth)&&G++,!me(Y,ue,U.heap[G],U.depth));)U.heap[ie]=U.heap[G],ie=G,G<<=1;U.heap[ie]=ue}function ne(U,Y,ie){var ue,G,ce,ke,he=0;if(U.last_lit!==0)for(;ue=U.pending_buf[U.d_buf+2*he]<<8|U.pending_buf[U.d_buf+2*he+1],G=U.pending_buf[U.l_buf+he],he++,ue===0?q(U,G,Y):(q(U,(ce=w[G])+h+1,Y),(ke=N[ce])!==0&&te(U,G-=D[ce],ke),q(U,ce=W(--ue),ie),(ke=L[ce])!==0&&te(U,ue-=V[ce],ke)),he<U.last_lit;);q(U,C,Y)}function Ae(U,Y){var ie,ue,G,ce=Y.dyn_tree,ke=Y.stat_desc.static_tree,he=Y.stat_desc.has_stree,xe=Y.stat_desc.elems,Te=-1;for(U.heap_len=0,U.heap_max=m,ie=0;ie<xe;ie++)ce[2*ie]!==0?(U.heap[++U.heap_len]=Te=ie,U.depth[ie]=0):ce[2*ie+1]=0;for(;U.heap_len<2;)ce[2*(G=U.heap[++U.heap_len]=Te<2?++Te:0)]=1,U.depth[G]=0,U.opt_len--,he&&(U.static_len-=ke[2*G+1]);for(Y.max_code=Te,ie=U.heap_len>>1;1<=ie;ie--)ae(U,ce,ie);for(G=xe;ie=U.heap[1],U.heap[1]=U.heap[U.heap_len--],ae(U,ce,1),ue=U.heap[1],U.heap[--U.heap_max]=ie,U.heap[--U.heap_max]=ue,ce[2*G]=ce[2*ie]+ce[2*ue],U.depth[G]=(U.depth[ie]>=U.depth[ue]?U.depth[ie]:U.depth[ue])+1,ce[2*ie+1]=ce[2*ue+1]=G,U.heap[1]=G++,ae(U,ce,1),2<=U.heap_len;);U.heap[--U.heap_max]=U.heap[1],function(ge,je){var Fe,oe,ze,Le,Pe,Ye,et=je.dyn_tree,$e=je.max_code,we=je.stat_desc.static_tree,Ue=je.stat_desc.has_stree,_e=je.stat_desc.extra_bits,Me=je.stat_desc.extra_base,Ce=je.stat_desc.max_length,Ve=0;for(Le=0;Le<=y;Le++)ge.bl_count[Le]=0;for(et[2*ge.heap[ge.heap_max]+1]=0,Fe=ge.heap_max+1;Fe<m;Fe++)Ce<(Le=et[2*et[2*(oe=ge.heap[Fe])+1]+1]+1)&&(Le=Ce,Ve++),et[2*oe+1]=Le,$e<oe||(ge.bl_count[Le]++,Pe=0,Me<=oe&&(Pe=_e[oe-Me]),Ye=et[2*oe],ge.opt_len+=Ye*(Le+Pe),Ue&&(ge.static_len+=Ye*(we[2*oe+1]+Pe)));if(Ve!==0){do{for(Le=Ce-1;ge.bl_count[Le]===0;)Le--;ge.bl_count[Le]--,ge.bl_count[Le+1]+=2,ge.bl_count[Ce]--,Ve-=2}while(0<Ve);for(Le=Ce;Le!==0;Le--)for(oe=ge.bl_count[Le];oe!==0;)$e<(ze=ge.heap[--Fe])||(et[2*ze+1]!==Le&&(ge.opt_len+=(Le-et[2*ze+1])*et[2*ze],et[2*ze+1]=Le),oe--)}}(U,Y),ve(ce,Te,U.bl_count)}function A(U,Y,ie){var ue,G,ce=-1,ke=Y[1],he=0,xe=7,Te=4;for(ke===0&&(xe=138,Te=3),Y[2*(ie+1)+1]=65535,ue=0;ue<=ie;ue++)G=ke,ke=Y[2*(ue+1)+1],++he<xe&&G===ke||(he<Te?U.bl_tree[2*G]+=he:G!==0?(G!==ce&&U.bl_tree[2*G]++,U.bl_tree[2*x]++):he<=10?U.bl_tree[2*S]++:U.bl_tree[2*M]++,ce=G,Te=(he=0)===ke?(xe=138,3):G===ke?(xe=6,3):(xe=7,4))}function re(U,Y,ie){var ue,G,ce=-1,ke=Y[1],he=0,xe=7,Te=4;for(ke===0&&(xe=138,Te=3),ue=0;ue<=ie;ue++)if(G=ke,ke=Y[2*(ue+1)+1],!(++he<xe&&G===ke)){if(he<Te)for(;q(U,G,U.bl_tree),--he!=0;);else G!==0?(G!==ce&&(q(U,G,U.bl_tree),he--),q(U,x,U.bl_tree),te(U,he-3,2)):he<=10?(q(U,S,U.bl_tree),te(U,he-3,3)):(q(U,M,U.bl_tree),te(U,he-11,7));ce=G,Te=(he=0)===ke?(xe=138,3):G===ke?(xe=6,3):(xe=7,4)}}c(V);var X=!1;function H(U,Y,ie,ue){te(U,(f<<1)+(ue?1:0),3),function(G,ce,ke,he){le(G),K(G,ke),K(G,~ke),o.arraySet(G.pending_buf,G.window,ce,ke,G.pending),G.pending+=ke}(U,Y,ie)}l._tr_init=function(U){X||(function(){var Y,ie,ue,G,ce,ke=new Array(y+1);for(G=ue=0;G<d-1;G++)for(D[G]=ue,Y=0;Y<1<<N[G];Y++)w[ue++]=G;for(w[ue-1]=G,G=ce=0;G<16;G++)for(V[G]=ce,Y=0;Y<1<<L[G];Y++)z[ce++]=G;for(ce>>=7;G<g;G++)for(V[G]=ce<<7,Y=0;Y<1<<L[G]-7;Y++)z[256+ce++]=G;for(ie=0;ie<=y;ie++)ke[ie]=0;for(Y=0;Y<=143;)F[2*Y+1]=8,Y++,ke[8]++;for(;Y<=255;)F[2*Y+1]=9,Y++,ke[9]++;for(;Y<=279;)F[2*Y+1]=7,Y++,ke[7]++;for(;Y<=287;)F[2*Y+1]=8,Y++,ke[8]++;for(ve(F,p+1,ke),Y=0;Y<g;Y++)T[2*Y+1]=5,T[2*Y]=be(Y,5);J=new se(F,N,h+1,p,y),Z=new se(T,L,0,g,y),$=new se(new Array(0),I,0,_,k)}(),X=!0),U.l_desc=new B(U.dyn_ltree,J),U.d_desc=new B(U.dyn_dtree,Z),U.bl_desc=new B(U.bl_tree,$),U.bi_buf=0,U.bi_valid=0,Ne(U)},l._tr_stored_block=H,l._tr_flush_block=function(U,Y,ie,ue){var G,ce,ke=0;0<U.level?(U.strm.data_type===2&&(U.strm.data_type=function(he){var xe,Te=4093624447;for(xe=0;xe<=31;xe++,Te>>>=1)if(1&Te&&he.dyn_ltree[2*xe]!==0)return i;if(he.dyn_ltree[18]!==0||he.dyn_ltree[20]!==0||he.dyn_ltree[26]!==0)return s;for(xe=32;xe<h;xe++)if(he.dyn_ltree[2*xe]!==0)return s;return i}(U)),Ae(U,U.l_desc),Ae(U,U.d_desc),ke=function(he){var xe;for(A(he,he.dyn_ltree,he.l_desc.max_code),A(he,he.dyn_dtree,he.d_desc.max_code),Ae(he,he.bl_desc),xe=_-1;3<=xe&&he.bl_tree[2*P[xe]+1]===0;xe--);return he.opt_len+=3*(xe+1)+5+5+4,xe}(U),G=U.opt_len+3+7>>>3,(ce=U.static_len+3+7>>>3)<=G&&(G=ce)):G=ce=ie+5,ie+4<=G&&Y!==-1?H(U,Y,ie,ue):U.strategy===4||ce===G?(te(U,2+(ue?1:0),3),ne(U,F,T)):(te(U,4+(ue?1:0),3),function(he,xe,Te,ge){var je;for(te(he,xe-257,5),te(he,Te-1,5),te(he,ge-4,4),je=0;je<ge;je++)te(he,he.bl_tree[2*P[je]+1],3);re(he,he.dyn_ltree,xe-1),re(he,he.dyn_dtree,Te-1)}(U,U.l_desc.max_code+1,U.d_desc.max_code+1,ke+1),ne(U,U.dyn_ltree,U.dyn_dtree)),Ne(U),ue&&le(U)},l._tr_tally=function(U,Y,ie){return U.pending_buf[U.d_buf+2*U.last_lit]=Y>>>8&255,U.pending_buf[U.d_buf+2*U.last_lit+1]=255&Y,U.pending_buf[U.l_buf+U.last_lit]=255&ie,U.last_lit++,Y===0?U.dyn_ltree[2*ie]++:(U.matches++,Y--,U.dyn_ltree[2*(w[ie]+h+1)]++,U.dyn_dtree[2*W(Y)]++),U.last_lit===U.lit_bufsize-1},l._tr_align=function(U){te(U,2,3),q(U,C,F),function(Y){Y.bi_valid===16?(K(Y,Y.bi_buf),Y.bi_buf=0,Y.bi_valid=0):8<=Y.bi_valid&&(Y.pending_buf[Y.pending++]=255&Y.bi_buf,Y.bi_buf>>=8,Y.bi_valid-=8)}(U)}},{"../utils/common":41}],53:[function(n,r,l){r.exports=function(){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}},{}],54:[function(n,r,l){(function(o){(function(i,s){if(!i.setImmediate){var c,f,d,h,p=1,g={},_=!1,m=i.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(i);y=y&&y.setTimeout?y:i,c={}.toString.call(i.process)==="[object process]"?function(x){process.nextTick(function(){k(x)})}:function(){if(i.postMessage&&!i.importScripts){var x=!0,S=i.onmessage;return i.onmessage=function(){x=!1},i.postMessage("","*"),i.onmessage=S,x}}()?(h="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",C,!1):i.attachEvent("onmessage",C),function(x){i.postMessage(h+x,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(x){k(x.data)},function(x){d.port2.postMessage(x)}):m&&"onreadystatechange"in m.createElement("script")?(f=m.documentElement,function(x){var S=m.createElement("script");S.onreadystatechange=function(){k(x),S.onreadystatechange=null,f.removeChild(S),S=null},f.appendChild(S)}):function(x){setTimeout(k,0,x)},y.setImmediate=function(x){typeof x!="function"&&(x=new Function(""+x));for(var S=new Array(arguments.length-1),M=0;M<S.length;M++)S[M]=arguments[M+1];var N={callback:x,args:S};return g[p]=N,c(p),p++},y.clearImmediate=v}function v(x){delete g[x]}function k(x){if(_)setTimeout(k,0,x);else{var S=g[x];if(S){_=!0;try{(function(M){var N=M.callback,L=M.args;switch(L.length){case 0:N();break;case 1:N(L[0]);break;case 2:N(L[0],L[1]);break;case 3:N(L[0],L[1],L[2]);break;default:N.apply(s,L)}})(S)}finally{v(x),_=!1}}}}function C(x){x.source===i&&typeof x.data=="string"&&x.data.indexOf(h)===0&&k(+x.data.slice(h.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof pl<"u"?pl:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Dc);var Ed=Dc.exports;const Ld=Md(Ed);function cs(e,t,n){const r=e.slice();return r[146]=t[n],r}function fs(e,t,n){const r=e.slice();return r[149]=t[n],r}function ds(e,t,n){const r=e.slice();return r[152]=t[n],r}function hs(e,t,n){const r=e.slice();return r[152]=t[n],r}function ps(e,t,n){const r=e.slice();return r[157]=t[n],r}function gs(e,t,n){const r=e.slice();return r[152]=t[n],r}function ms(e,t,n){const r=e.slice();return r[162]=t[n],r}function _s(e,t,n){const r=e.slice();return r[165]=t[n],r}function bs(e){let t,n,r,l,o,i,s;return{c(){t=b("div"),n=b("div"),r=de("svg"),l=de("polyline"),o=E(),i=b("p"),s=O(e[18]),a(l,"points","20 6 9 17 4 12"),a(r,"class","w-5 h-5 text-green-600 flex-shrink-0"),a(r,"viewBox","0 0 24 24"),a(r,"fill","none"),a(r,"stroke","currentColor"),a(r,"stroke-width","2"),a(r,"stroke-linecap","round"),a(r,"stroke-linejoin","round"),a(i,"class","text-sm font-medium text-green-800"),a(n,"class","bg-green-50 border border-green-200 rounded-lg shadow-lg px-4 py-3 flex items-center gap-3 animate-in fade-in slide-in-from-bottom-2 duration-300"),a(t,"class","fixed bottom-4 right-4 z-50 max-w-sm")},m(c,f){R(c,t,f),u(t,n),u(n,r),u(r,l),u(n,o),u(n,i),u(i,s)},p(c,f){f[0]&262144&&ee(s,c[18])},d(c){c&&j(t)}}}function ys(e){let t,n,r=e[76][e[165]].icon+"",l,o=e[76][e[165]].label+"",i,s,c,f=(e[8][e[165]]||0)+"",d,h,p,g,_,m;function y(){return e[80](e[165])}return{c(){t=b("button"),n=b("span"),l=E(),i=O(o),s=E(),c=b("span"),d=O(f),p=E(),a(n,"class","inline-flex"),a(c,"class",h="ml-1 px-1.5 py-0.5 rounded-full text-xs "+(e[0]===e[165]?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-600")),a(t,"class",g="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px flex items-center gap-1.5 "+(e[0]===e[165]?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))},m(v,k){R(v,t,k),u(t,n),n.innerHTML=r,u(t,l),u(t,i),u(t,s),u(t,c),u(c,d),u(t,p),_||(m=Q(t,"click",y),_=!0)},p(v,k){e=v,k[0]&256&&f!==(f=(e[8][e[165]]||0)+"")&&ee(d,f),k[0]&1&&h!==(h="ml-1 px-1.5 py-0.5 rounded-full text-xs "+(e[0]===e[165]?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-600"))&&a(c,"class",h),k[0]&1&&g!==(g="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px flex items-center gap-1.5 "+(e[0]===e[165]?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))&&a(t,"class",g)},d(v){v&&j(t),_=!1,m()}}}function vs(e){let t,n,r,l=e[33]?'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="animate-spin" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>':'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',o,i=e[33]?"Exporting…":"Export JSON ▾",s,c,f,d,h,p,g,_=e[35]&&ks(e),m=e[34]&&ws(e);return{c(){t=b("div"),n=b("button"),r=new Cc(!1),o=E(),s=O(i),c=E(),_&&_.c(),f=E(),m&&m.c(),d=E(),h=b("button"),h.textContent="Import",r.a=o,a(n,"class","px-3 py-1.5 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5"),n.disabled=e[33],a(t,"class","relative"),a(h,"class","px-3 py-1.5 border border-gray-300 rounded-md text-sm hover:bg-gray-50")},m(y,v){R(y,t,v),u(t,n),r.m(l,n),u(n,o),u(n,s),u(t,c),_&&_.m(t,null),R(y,f,v),m&&m.m(y,v),R(y,d,v),R(y,h,v),p||(g=[Q(n,"click",e[81]),Q(h,"click",e[83])],p=!0)},p(y,v){v[1]&4&&l!==(l=y[33]?'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="animate-spin" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>':'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>')&&r.p(l),v[1]&4&&i!==(i=y[33]?"Exporting…":"Export JSON ▾")&&ee(s,i),v[1]&4&&(n.disabled=y[33]),y[35]?_?_.p(y,v):(_=ks(y),_.c(),_.m(t,null)):_&&(_.d(1),_=null),y[34]?m?m.p(y,v):(m=ws(y),m.c(),m.m(d.parentNode,d)):m&&(m.d(1),m=null)},d(y){y&&(j(t),j(f),j(d),j(h)),_&&_.d(),m&&m.d(y),p=!1,lt(g)}}}function ks(e){let t,n,r,l,o,i,s,c;return{c(){t=b("div"),n=E(),r=b("div"),l=b("button"),l.textContent="All languages (single file)",o=E(),i=b("button"),i.textContent="One file per language",a(t,"class","fixed inset-0 z-40"),a(t,"role","presentation"),a(l,"class","w-full text-left px-4 py-2.5 text-sm hover:bg-gray-50 rounded-t-md"),a(i,"class","w-full text-left px-4 py-2.5 text-sm hover:bg-gray-50 rounded-b-md border-t border-gray-100"),a(r,"class","absolute right-0 mt-1 w-56 bg-white border border-gray-200 rounded-md shadow-lg z-50")},m(f,d){R(f,t,d),R(f,n,d),R(f,r,d),u(r,l),u(r,o),u(r,i),s||(c=[Q(t,"click",e[82]),Q(l,"click",e[50]),Q(i,"click",e[51])],s=!0)},p:Be,d(f){f&&(j(t),j(n),j(r)),s=!1,lt(c)}}}function ws(e){let t,n,r;return{c(){t=b("span"),n=O(e[34]),a(t,"class",r="text-xs "+(e[34].includes("!")?"text-green-600":"text-red-600"))},m(l,o){R(l,t,o),u(t,n)},p(l,o){o[1]&8&&ee(n,l[34]),o[1]&8&&r!==(r="text-xs "+(l[34].includes("!")?"text-green-600":"text-red-600"))&&a(t,"class",r)},d(l){l&&j(t)}}}function xs(e){let t,n,r;return{c(){t=b("button"),t.textContent="+ Add",a(t,"class","px-3 py-1.5 border border-gray-300 rounded-md text-sm hover:bg-gray-50")},m(l,o){R(l,t,o),n||(r=Q(t,"click",e[84]),n=!0)},p:Be,d(l){l&&j(t),n=!1,r()}}}function Cs(e){let t,n=(e[162].name||e[162].code||e[162])+"",r,l;return{c(){t=b("option"),r=O(n),t.__value=l=e[162].code||e[162],Ie(t,t.__value)},m(o,i){R(o,t,i),u(t,r)},p(o,i){i[0]&64&&n!==(n=(o[162].name||o[162].code||o[162])+"")&&ee(r,n),i[0]&64&&l!==(l=o[162].code||o[162])&&(t.__value=l,Ie(t,t.__value))},d(o){o&&j(t)}}}function Ss(e){let t,n=e[152].name+"",r,l;return{c(){t=b("option"),r=O(n),t.__value=l=e[152].id,Ie(t,t.__value)},m(o,i){R(o,t,i),u(t,r)},p(o,i){i[0]&16384&&n!==(n=o[152].name+"")&&ee(r,n),i[0]&16384&&l!==(l=o[152].id)&&(t.__value=l,Ie(t,t.__value))},d(o){o&&j(t)}}}function As(e){let t,n,r,l,o,i,s,c,f,d,h,p;return{c(){t=b("div"),n=b("input"),r=E(),l=b("input"),o=E(),i=b("input"),s=E(),c=b("button"),f=O("Save"),a(n,"placeholder","Key (original text)"),a(n,"class","flex-[2] px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(l,"placeholder","Context (optional)"),a(l,"class","flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(i,"placeholder","Translated value (optional)"),a(i,"class","flex-[2] px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(c,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),c.disabled=d=!e[26].trim(),a(t,"class","flex gap-2 mb-4")},m(g,_){R(g,t,_),u(t,n),Ie(n,e[26]),u(t,r),u(t,l),Ie(l,e[27]),u(t,o),u(t,i),Ie(i,e[28]),u(t,s),u(t,c),u(c,f),h||(p=[Q(n,"input",e[93]),Q(l,"input",e[94]),Q(i,"input",e[95]),Q(c,"click",e[74])],h=!0)},p(g,_){_[0]&67108864&&n.value!==g[26]&&Ie(n,g[26]),_[0]&134217728&&l.value!==g[27]&&Ie(l,g[27]),_[0]&268435456&&i.value!==g[28]&&Ie(i,g[28]),_[0]&67108864&&d!==(d=!g[26].trim())&&(c.disabled=d)},d(g){g&&j(t),h=!1,lt(p)}}}function Ts(e){let t,n,r,l,o,i;return{c(){t=b("div"),n=b("textarea"),r=E(),l=b("button"),l.textContent="Import",a(n,"rows","4"),a(n,"placeholder",'{"Hello": "你好", "Goodbye": "再见"}'),a(n,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y"),a(l,"class","mt-2 px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700"),a(t,"class","mb-4")},m(s,c){R(s,t,c),u(t,n),Ie(n,e[29]),u(t,r),u(t,l),o||(i=[Q(n,"input",e[96]),Q(l,"click",e[75])],o=!0)},p(s,c){c[0]&536870912&&Ie(n,s[29])},d(s){s&&j(t),o=!1,lt(i)}}}function Ms(e){let t,n,r,l,o,i,s;function c(y,v){return y[21]?zd:Nd}let f=c(e),d=f(e),h=Oe(e[76][e[0]].actions),p=[];for(let y=0;y<h.length;y+=1)p[y]=Es(ps(e,h,y));let g=e[14].length>0&&Ls(e),_=e[0]==="trash"&&Ds(e),m=(e[21]||e[23]>0)&&Fs(e);return{c(){t=b("div"),n=b("span"),d.c(),r=E();for(let y=0;y<p.length;y+=1)p[y].c();l=E(),g&&g.c(),o=E(),_&&_.c(),i=E(),m&&m.c(),s=Ct(),a(n,"class","text-sm text-indigo-700 font-medium"),a(t,"class","flex items-center gap-3 mb-3 p-3 bg-indigo-50 rounded-lg border border-indigo-200")},m(y,v){R(y,t,v),u(t,n),d.m(n,null),u(t,r);for(let k=0;k<p.length;k+=1)p[k]&&p[k].m(t,null);u(t,l),g&&g.m(t,null),u(t,o),_&&_.m(t,null),R(y,i,v),m&&m.m(y,v),R(y,s,v)},p(y,v){if(f===(f=c(y))&&d?d.p(y,v):(d.d(1),d=f(y),d&&(d.c(),d.m(n,null))),v[0]&2097153|v[2]&16512){h=Oe(y[76][y[0]].actions);let k;for(k=0;k<h.length;k+=1){const C=ps(y,h,k);p[k]?p[k].p(C,v):(p[k]=Es(C),p[k].c(),p[k].m(t,l))}for(;k<p.length;k+=1)p[k].d(1);p.length=h.length}y[14].length>0?g?g.p(y,v):(g=Ls(y),g.c(),g.m(t,o)):g&&(g.d(1),g=null),y[0]==="trash"?_?_.p(y,v):(_=Ds(y),_.c(),_.m(t,null)):_&&(_.d(1),_=null),y[21]||y[23]>0?m?m.p(y,v):(m=Fs(y),m.c(),m.m(s.parentNode,s)):m&&(m.d(1),m=null)},d(y){y&&(j(t),j(i),j(s)),d.d(),ft(p,y),g&&g.d(),_&&_.d(),m&&m.d(y)}}}function Nd(e){let t=e[13].size+"",n,r;return{c(){n=O(t),r=O(" selected")},m(l,o){R(l,n,o),R(l,r,o)},p(l,o){o[0]&8192&&t!==(t=l[13].size+"")&&ee(n,t)},d(l){l&&(j(n),j(r))}}}function zd(e){let t,n,r,l,o;return{c(){t=O(e[22]),n=E(),r=O(e[4]),l=O(" / "),o=O(e[5])},m(i,s){R(i,t,s),R(i,n,s),R(i,r,s),R(i,l,s),R(i,o,s)},p(i,s){s[0]&4194304&&ee(t,i[22]),s[0]&16&&ee(r,i[4]),s[0]&32&&ee(o,i[5])},d(i){i&&(j(t),j(n),j(r),j(l),j(o))}}}function Es(e){let t,n=e[157].label+"",r,l,o,i,s;function c(){return e[97](e[157])}return{c(){t=b("button"),r=O(n),l=E(),a(t,"class",o="px-3 py-1.5 text-white text-sm rounded-md "+e[157].color+" disabled:opacity-50 disabled:cursor-not-allowed"),t.disabled=e[21]},m(f,d){R(f,t,d),u(t,r),u(t,l),i||(s=Q(t,"click",c),i=!0)},p(f,d){e=f,d[0]&1&&n!==(n=e[157].label+"")&&ee(r,n),d[0]&1&&o!==(o="px-3 py-1.5 text-white text-sm rounded-md "+e[157].color+" disabled:opacity-50 disabled:cursor-not-allowed")&&a(t,"class",o),d[0]&2097152&&(t.disabled=e[21])},d(f){f&&j(t),i=!1,s()}}}function Ls(e){let t,n,r,l,o,i,s=e[15]&&Ns(e);return{c(){t=b("div"),n=b("button"),r=O("Label ▾"),l=E(),s&&s.c(),a(n,"class","px-3 py-1.5 bg-amber-500 text-white text-sm rounded-md hover:bg-amber-600 disabled:opacity-50"),n.disabled=e[21],a(t,"class","relative")},m(c,f){R(c,t,f),u(t,n),u(n,r),u(t,l),s&&s.m(t,null),o||(i=Q(n,"click",e[98]),o=!0)},p(c,f){f[0]&2097152&&(n.disabled=c[21]),c[15]?s?s.p(c,f):(s=Ns(c),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},d(c){c&&j(t),s&&s.d(),o=!1,i()}}}function Ns(e){let t,n,r,l,o,i,s,c,f=Oe(e[14]),d=[];for(let p=0;p<f.length;p+=1)d[p]=zs(hs(e,f,p));let h=e[12]&&Is(e);return{c(){t=b("div"),n=E(),r=b("div"),l=b("div"),l.textContent="Assign Label",o=E();for(let p=0;p<d.length;p+=1)d[p].c();i=E(),h&&h.c(),a(t,"class","fixed inset-0 z-40"),a(t,"role","presentation"),a(l,"class","px-3 py-2 text-xs text-gray-400 font-semibold uppercase border-b border-gray-100"),a(r,"class","absolute left-0 mt-1 w-52 bg-white border border-gray-200 rounded-md shadow-lg z-50 max-h-60 overflow-y-auto")},m(p,g){R(p,t,g),R(p,n,g),R(p,r,g),u(r,l),u(r,o);for(let _=0;_<d.length;_+=1)d[_]&&d[_].m(r,null);u(r,i),h&&h.m(r,null),s||(c=Q(t,"click",e[99]),s=!0)},p(p,g){if(g[0]&16384|g[1]&67108864){f=Oe(p[14]);let _;for(_=0;_<f.length;_+=1){const m=hs(p,f,_);d[_]?d[_].p(m,g):(d[_]=zs(m),d[_].c(),d[_].m(r,i))}for(;_<d.length;_+=1)d[_].d(1);d.length=f.length}p[12]?h?h.p(p,g):(h=Is(p),h.c(),h.m(r,null)):h&&(h.d(1),h=null)},d(p){p&&(j(t),j(n),j(r)),ft(d,p),h&&h.d(),s=!1,c()}}}function zs(e){let t,n,r,l=e[152].name+"",o,i,s;function c(){return e[100](e[152])}return{c(){t=b("button"),n=b("span"),r=E(),o=O(l),a(n,"class","w-3 h-3 rounded-full shrink-0"),gt(n,"background-color",e[152].color),a(t,"class","w-full text-left px-3 py-2 text-sm hover:bg-gray-50 flex items-center gap-2")},m(f,d){R(f,t,d),u(t,n),u(t,r),u(t,o),i||(s=Q(t,"click",c),i=!0)},p(f,d){e=f,d[0]&16384&&gt(n,"background-color",e[152].color),d[0]&16384&&l!==(l=e[152].name+"")&&ee(o,l)},d(f){f&&j(t),i=!1,s()}}}function Is(e){let t,n,r,l=Oe(e[14]),o=[];for(let i=0;i<l.length;i+=1)o[i]=Ps(ds(e,l,i));return{c(){t=b("div"),n=b("div"),n.textContent="Remove Label",r=E();for(let i=0;i<o.length;i+=1)o[i].c();a(n,"class","px-3 py-2 text-xs text-gray-400 font-semibold uppercase"),a(t,"class","border-t border-gray-100")},m(i,s){R(i,t,s),u(t,n),u(t,r);for(let c=0;c<o.length;c+=1)o[c]&&o[c].m(t,null)},p(i,s){if(s[0]&16384|s[1]&134217728){l=Oe(i[14]);let c;for(c=0;c<l.length;c+=1){const f=ds(i,l,c);o[c]?o[c].p(f,s):(o[c]=Ps(f),o[c].c(),o[c].m(t,null))}for(;c<o.length;c+=1)o[c].d(1);o.length=l.length}},d(i){i&&j(t),ft(o,i)}}}function Ps(e){let t,n,r,l=e[152].name+"",o,i,s,c;function f(){return e[101](e[152])}return{c(){t=b("button"),n=b("span"),r=O(`
15
+ Remove "`),o=O(l),i=O(`"
16
+ `),a(n,"class","w-3 h-3 rounded-full shrink-0"),gt(n,"background-color",e[152].color),a(t,"class","w-full text-left px-3 py-2 text-sm hover:bg-red-50 text-red-600 flex items-center gap-2")},m(d,h){R(d,t,h),u(t,n),u(t,r),u(t,o),u(t,i),s||(c=Q(t,"click",f),s=!0)},p(d,h){e=d,h[0]&16384&&gt(n,"background-color",e[152].color),h[0]&16384&&l!==(l=e[152].name+"")&&ee(o,l)},d(d){d&&j(t),s=!1,c()}}}function Ds(e){let t,n=e[21]&&e[22]==="Deleting"?"Deleting…":"Delete Permanently",r,l,o;return{c(){t=b("button"),r=O(n),a(t,"class","px-3 py-1.5 bg-red-600 text-white text-sm rounded-md hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed"),t.disabled=e[21]},m(i,s){R(i,t,s),u(t,r),l||(o=Q(t,"click",e[70]),l=!0)},p(i,s){s[0]&6291456&&n!==(n=i[21]&&i[22]==="Deleting"?"Deleting…":"Delete Permanently")&&ee(r,n),s[0]&2097152&&(t.disabled=i[21])},d(i){i&&j(t),l=!1,o()}}}function Fs(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v;function k(S,M){if(S[21])return Pd;if(S[23]>0)return Id}let C=k(e),x=C&&C(e);return{c(){t=b("div"),n=b("div"),r=b("span"),x&&x.c(),l=E(),o=b("span"),i=O(e[46]),s=O("%"),c=E(),f=b("div"),d=b("div"),p=E(),g=b("div"),_=O(e[4]),m=O(" of "),y=O(e[5]),v=O(" processed"),a(n,"class","flex items-center justify-between text-xs font-medium text-gray-600"),a(d,"class","h-full bg-indigo-600 transition-all duration-200"),a(d,"style",h=`width: ${e[46]}%`),a(f,"class","mt-2 h-2 overflow-hidden rounded-full bg-indigo-100"),a(g,"class","mt-2 text-xs text-gray-500"),a(t,"class","mb-4 rounded-lg border border-indigo-200 bg-white px-3 py-3")},m(S,M){R(S,t,M),u(t,n),u(n,r),x&&x.m(r,null),u(n,l),u(n,o),u(o,i),u(o,s),u(t,c),u(t,f),u(f,d),u(t,p),u(t,g),u(g,_),u(g,m),u(g,y),u(g,v)},p(S,M){C===(C=k(S))&&x?x.p(S,M):(x&&x.d(1),x=C&&C(S),x&&(x.c(),x.m(r,null))),M[1]&32768&&ee(i,S[46]),M[1]&32768&&h!==(h=`width: ${S[46]}%`)&&a(d,"style",h),M[0]&16&&ee(_,S[4]),M[0]&32&&ee(y,S[5])},d(S){S&&j(t),x&&x.d()}}}function Id(e){let t,n,r;return{c(){t=O("Finished with "),n=O(e[23]),r=O(" failure(s)")},m(l,o){R(l,t,o),R(l,n,o),R(l,r,o)},p(l,o){o[0]&8388608&&ee(n,l[23])},d(l){l&&(j(t),j(n),j(r))}}}function Pd(e){let t,n;return{c(){t=O(e[22]),n=O(" selected items...")},m(r,l){R(r,t,l),R(r,n,l)},p(r,l){l[0]&4194304&&ee(t,r[22])},d(r){r&&(j(t),j(n))}}}function Os(e){let t,n;return t=new Pc({props:{jobs:e[42],onCancel:e[66],onDismiss:e[67]}}),{c(){rn(t.$$.fragment)},m(r,l){Xt(t,r,l),n=!0},p(r,l){const o={};l[1]&2048&&(o.jobs=r[42]),t.$set(o)},i(r){n||(st(t.$$.fragment,r),n=!0)},o(r){ct(t.$$.fragment,r),n=!1},d(r){Qt(t,r)}}}function Dd(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k=[],C=new Map,x,S,M,N,L,I,P,F,T,z=Oe(e[1]);const w=J=>J[149].key;for(let J=0;J<z.length;J+=1){let Z=fs(e,z,J),$=w(Z);C.set($,k[J]=Rs($,Z))}let D=e[47]>1&&Bs(e);return{c(){t=b("div"),n=b("table"),r=b("thead"),l=b("tr"),o=b("th"),i=b("input"),s=E(),c=b("th"),c.textContent="Key",f=E(),d=b("th"),d.textContent="DomContext",h=E(),p=b("th"),g=O("Translation ("),_=O(e[7]),m=O(")"),y=E(),v=b("tbody");for(let J=0;J<k.length;J+=1)k[J].c();x=E(),S=b("div"),M=b("p"),N=O(e[3]),L=O(" key(s)"),I=E(),D&&D.c(),a(i,"type","checkbox"),i.checked=e[16],a(i,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(o,"class","w-10 px-3 py-2.5"),a(c,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(d,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(p,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(l,"class","bg-gray-50 border-b border-gray-200"),a(n,"class","w-full"),a(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),a(M,"class","text-xs text-gray-400"),a(S,"class","flex items-center justify-between mt-3")},m(J,Z){R(J,t,Z),u(t,n),u(n,r),u(r,l),u(l,o),u(o,i),u(l,s),u(l,c),u(l,f),u(l,d),u(l,h),u(l,p),u(p,g),u(p,_),u(p,m),u(n,y),u(n,v);for(let $=0;$<k.length;$+=1)k[$]&&k[$].m(v,null);R(J,x,Z),R(J,S,Z),u(S,M),u(M,N),u(M,L),u(S,I),D&&D.m(S,null),P=!0,F||(T=Q(i,"change",e[60]),F=!0)},p(J,Z){(!P||Z[0]&65536)&&(i.checked=J[16]),(!P||Z[0]&128)&&ee(_,J[7]),Z[0]&1073766403|Z[1]&1107570816|Z[2]&3079&&(z=Oe(J[1]),Gt(),k=tl(k,Z,w,1,J,z,C,v,Ec,Rs,null,fs),Kt()),(!P||Z[0]&8)&&ee(N,J[3]),J[47]>1?D?D.p(J,Z):(D=Bs(J),D.c(),D.m(S,null)):D&&(D.d(1),D=null)},i(J){if(!P){for(let Z=0;Z<z.length;Z+=1)st(k[Z]);P=!0}},o(J){for(let Z=0;Z<k.length;Z+=1)ct(k[Z]);P=!1},d(J){J&&(j(t),j(x),j(S));for(let Z=0;Z<k.length;Z+=1)k[Z].d();D&&D.d(),F=!1,T()}}}function Fd(e){let t;function n(o,i){return o[9]?Ud:o[0]==="pending"?Bd:o[0]==="approved"?Rd:jd}let r=n(e),l=r(e);return{c(){t=b("div"),l.c(),a(t,"class","text-center py-12 text-gray-400")},m(o,i){R(o,t,i),l.m(t,null)},p(o,i){r===(r=n(o))&&l?l.p(o,i):(l.d(1),l=r(o),l&&(l.c(),l.m(t,null)))},i:Be,o:Be,d(o){o&&j(t),l.d()}}}function Od(e){let t;return{c(){t=b("div"),t.innerHTML='<svg width="40" height="40" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><defs><style>@keyframes tspin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#tr{animation:tspin 1.2s linear infinite;transform-origin:40px 40px}</style></defs><g id="tr"><circle cx="40" cy="40" r="34" fill="none" stroke="#e5e7eb" stroke-width="4"></circle><path d="M40 6 A34 34 0 0 1 74 40" fill="none" stroke="#2ECC88" stroke-width="4" stroke-linecap="round"></path><path d="M74 40 A34 34 0 0 1 56 70" fill="none" stroke="#3A8FE0" stroke-width="4" stroke-linecap="round"></path><path d="M56 70 A34 34 0 0 1 24 70" fill="none" stroke="#FFB833" stroke-width="4" stroke-linecap="round"></path></g></svg>',a(t,"class","flex justify-center py-8")},m(n,r){R(n,t,r)},p:Be,i:Be,o:Be,d(n){n&&j(t)}}}function js(e){let t,n,r,l,o;return r=new Ic({props:{group:e[149],editable:e[0]==="approved"||e[0]==="pending",showAiAction:!0,aiBusy:e[38],onAiAction:e[64],showAria:!0,rowHasAria:e[49],onAriaAction:e[104],showVarEdit:!0,onVarEdit:e[105],showDetails:!0,onDetails:e[62],showLabels:!0,allLabels:e[14],onToggleLabel:e[56],onSaveMasterValue:e[73],onSaveValue:e[106]}}),{c(){t=b("tr"),n=b("td"),rn(r.$$.fragment),l=E(),a(n,"colspan","4"),a(n,"class","px-4 py-3"),a(t,"class","bg-gray-50 border-b border-gray-200")},m(i,s){R(i,t,s),u(t,n),Xt(r,n,null),u(t,l),o=!0},p(i,s){const c={};s[0]&2&&(c.group=i[149]),s[0]&1&&(c.editable=i[0]==="approved"||i[0]==="pending"),s[1]&128&&(c.aiBusy=i[38]),s[1]&8192&&(c.onAriaAction=i[104]),s[1]&4096&&(c.onVarEdit=i[105]),s[0]&16384&&(c.allLabels=i[14]),r.$set(c)},i(i){o||(st(r.$$.fragment,i),o=!0)},o(i){ct(r.$$.fragment,i),o=!1},d(i){i&&j(t),Qt(r)}}}function Rs(e,t){let n,r,l,o,i,s,c,f,d,h,p,g,_,m=t[149].key+"",y,v,k,C=t[149].total+"",x,S,M,N,L,I=t[149].total+"",P,F,T=t[149].total===1?"context":"contexts",z,w,D,J,Z,$=t[149].translatedCount+"",V,se,B=t[149].total+"",W,K,te,q,be,ve,Ne,le;function me(){return t[102](t[149])}function ae(){return t[103](t[149])}let ne=t[30]===t[149].key&&js(t);return{key:e,first:null,c(){n=b("tr"),r=b("td"),l=b("input"),s=E(),c=b("td"),f=b("div"),d=de("svg"),h=de("path"),g=E(),_=b("span"),y=O(m),v=E(),k=b("span"),x=O(C),N=E(),L=b("td"),P=O(I),F=E(),z=O(T),w=O(" — click to expand"),D=E(),J=b("td"),Z=b("span"),V=O($),se=O("/"),W=O(B),K=O(" translated"),q=E(),ne&&ne.c(),be=Ct(),a(l,"type","checkbox"),l.checked=o=_l(t[149],t[13])==="all",l.indeterminate=i=_l(t[149],t[13])==="some",a(l,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(r,"class","px-3 py-2"),a(h,"fill-rule","evenodd"),a(h,"d","M7.293 4.293a1 1 0 011.414 0l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414-1.414L11.586 10 7.293 5.707a1 1 0 010-1.414z"),a(h,"clip-rule","evenodd"),a(d,"class",p="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[30]===t[149].key?"rotate-90":"")),a(d,"viewBox","0 0 20 20"),a(d,"fill","currentColor"),a(_,"class","truncate flex-1 min-w-0"),a(k,"class","shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded-full bg-indigo-50 text-indigo-600 border border-indigo-100"),a(k,"title",S=t[149].total+" context(s)"),a(f,"class","flex items-center gap-2 min-w-0"),a(c,"class","px-3 py-2 font-mono text-sm text-gray-700 max-w-[320px]"),a(c,"title",M=t[149].key),a(L,"class","px-3 py-2 text-sm text-gray-500 whitespace-nowrap"),a(Z,"class","font-semibold"),a(J,"class","px-3 py-2 text-sm text-gray-700 whitespace-nowrap"),a(n,"class",te="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[30]===t[149].key?"bg-indigo-50":"")),this.first=n},m(Ae,A){R(Ae,n,A),u(n,r),u(r,l),u(n,s),u(n,c),u(c,f),u(f,d),u(d,h),u(f,g),u(f,_),u(_,y),u(f,v),u(f,k),u(k,x),u(n,N),u(n,L),u(L,P),u(L,F),u(L,z),u(L,w),u(n,D),u(n,J),u(J,Z),u(Z,V),u(Z,se),u(Z,W),u(J,K),R(Ae,q,A),ne&&ne.m(Ae,A),R(Ae,be,A),ve=!0,Ne||(le=[Q(l,"change",me),Q(r,"click",nn(t[79])),Q(n,"click",ae)],Ne=!0)},p(Ae,A){t=Ae,(!ve||A[0]&8194&&o!==(o=_l(t[149],t[13])==="all"))&&(l.checked=o),(!ve||A[0]&8194&&i!==(i=_l(t[149],t[13])==="some"))&&(l.indeterminate=i),(!ve||A[0]&1073741826&&p!==(p="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[30]===t[149].key?"rotate-90":"")))&&a(d,"class",p),(!ve||A[0]&2)&&m!==(m=t[149].key+"")&&ee(y,m),(!ve||A[0]&2)&&C!==(C=t[149].total+"")&&ee(x,C),(!ve||A[0]&2&&S!==(S=t[149].total+" context(s)"))&&a(k,"title",S),(!ve||A[0]&2&&M!==(M=t[149].key))&&a(c,"title",M),(!ve||A[0]&2)&&I!==(I=t[149].total+"")&&ee(P,I),(!ve||A[0]&2)&&T!==(T=t[149].total===1?"context":"contexts")&&ee(z,T),(!ve||A[0]&2)&&$!==($=t[149].translatedCount+"")&&ee(V,$),(!ve||A[0]&2)&&B!==(B=t[149].total+"")&&ee(W,B),(!ve||A[0]&1073741826&&te!==(te="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[30]===t[149].key?"bg-indigo-50":"")))&&a(n,"class",te),t[30]===t[149].key?ne?(ne.p(t,A),A[0]&1073741826&&st(ne,1)):(ne=js(t),ne.c(),st(ne,1),ne.m(be.parentNode,be)):ne&&(Gt(),ct(ne,1,1,()=>{ne=null}),Kt())},i(Ae){ve||(st(ne),ve=!0)},o(Ae){ct(ne),ve=!1},d(Ae){Ae&&(j(n),j(q),j(be)),ne&&ne.d(Ae),Ne=!1,lt(le)}}}function Bs(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L,I,P,F,T,z;return{c(){t=b("div"),n=b("button"),r=O("«"),o=E(),i=b("button"),s=O("‹"),f=E(),d=b("span"),h=O("Page "),p=O(e[20]),g=O(" of "),_=O(e[47]),m=E(),y=b("button"),v=O("›"),C=E(),x=b("button"),S=O("»"),N=E(),L=b("select"),I=b("option"),I.textContent="25 / page",P=b("option"),P.textContent="50 / page",F=b("option"),F.textContent="100 / page",a(n,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),n.disabled=l=e[20]<=1,a(i,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),i.disabled=c=e[20]<=1,a(d,"class","px-3 py-1 text-xs text-gray-600"),a(y,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),y.disabled=k=e[20]>=e[47],a(x,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),x.disabled=M=e[20]>=e[47],I.__value=25,Ie(I,I.__value),P.__value=50,Ie(P,P.__value),F.__value=100,Ie(F,F.__value),a(L,"class","ml-2 px-2 py-1 text-xs border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[2]===void 0&&It(()=>e[111].call(L)),a(t,"class","flex items-center gap-1")},m(w,D){R(w,t,D),u(t,n),u(n,r),u(t,o),u(t,i),u(i,s),u(t,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,_),u(t,m),u(t,y),u(y,v),u(t,C),u(t,x),u(x,S),u(t,N),u(t,L),u(L,I),u(L,P),u(L,F),vt(L,e[2],!0),T||(z=[Q(n,"click",e[107]),Q(i,"click",e[108]),Q(y,"click",e[109]),Q(x,"click",e[110]),Q(L,"change",e[111]),Q(L,"change",e[112])],T=!0)},p(w,D){D[0]&1048576&&l!==(l=w[20]<=1)&&(n.disabled=l),D[0]&1048576&&c!==(c=w[20]<=1)&&(i.disabled=c),D[0]&1048576&&ee(p,w[20]),D[1]&65536&&ee(_,w[47]),D[0]&1048576|D[1]&65536&&k!==(k=w[20]>=w[47])&&(y.disabled=k),D[0]&1048576|D[1]&65536&&M!==(M=w[20]>=w[47])&&(x.disabled=M),D[0]&4&&vt(L,w[2])},d(w){w&&j(t),T=!1,lt(z)}}}function jd(e){let t;return{c(){t=b("p"),t.textContent="Trash is empty."},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function Rd(e){let t,n,r;return{c(){t=b("p"),t.textContent="No approved phrases yet.",n=E(),r=b("p"),r.textContent="Move phrases from Pending to start serving translations.",a(r,"class","text-sm mt-1")},m(l,o){R(l,t,o),R(l,n,o),R(l,r,o)},p:Be,d(l){l&&(j(t),j(n),j(r))}}}function Bd(e){let t,n,r;return{c(){t=b("p"),t.textContent="No pending phrases.",n=E(),r=b("p"),r.textContent="Add the CDN script to a page to auto-discover text.",a(r,"class","text-sm mt-1")},m(l,o){R(l,t,o),R(l,n,o),R(l,r,o)},p:Be,d(l){l&&(j(t),j(n),j(r))}}}function Ud(e){let t,n,r,l;return{c(){t=b("p"),n=O('No results for "'),r=O(e[9]),l=O('"')},m(o,i){R(o,t,i),u(t,n),u(t,r),u(t,l)},p(o,i){i[0]&512&&ee(r,o[9])},d(o){o&&j(t)}}}function Us(e){let t,n,r,l,o,i,s,c,f,d,h,p,g=e[40].key+"",_,m,y,v,k,C,x,S,M,N,L,I,P,F,T,z,w,D=e[38]?"Starting...":"Start Translation",J,Z,$,V,se=e[36].length===0&&Hs(),B=Oe(e[36]),W=[];for(let K=0;K<B.length;K+=1)W[K]=Ws(cs(e,B,K));return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("h3"),l.textContent="AI Translate Group",o=E(),i=b("button"),i.textContent="×",s=E(),c=b("div"),f=b("div"),d=b("p"),d.textContent="Key",h=E(),p=b("p"),_=O(g),m=E(),y=b("div"),v=b("label"),v.textContent="Prompt",k=E(),C=b("select"),se&&se.c(),x=Ct();for(let K=0;K<W.length;K+=1)W[K].c();S=E(),M=b("label"),N=b("input"),L=O(`
17
+ Translate all contexts + master (unchecked = master only)`),I=E(),P=b("div"),F=b("button"),T=O("Cancel"),z=E(),w=b("button"),J=O(D),a(l,"class","text-sm font-semibold text-gray-800"),a(i,"class","text-gray-400 hover:text-gray-700 text-lg leading-none"),a(r,"class","px-5 py-4 border-b border-gray-100 flex items-center justify-between"),a(d,"class","text-xs text-gray-500 mb-1"),a(p,"class","text-sm text-gray-800 font-mono break-words"),a(v,"for","tm-ai-group-prompt"),a(v,"class","block text-xs text-gray-500 font-medium mb-1"),a(C,"id","tm-ai-group-prompt"),a(C,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[37]===void 0&&It(()=>e[113].call(C)),a(N,"type","checkbox"),a(N,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(M,"class","flex items-center gap-2 text-sm text-gray-700 cursor-pointer"),a(c,"class","px-5 py-4 space-y-3"),a(F,"class","px-3 py-1.5 text-sm border border-gray-300 rounded-md hover:bg-gray-50"),F.disabled=e[38],a(w,"class","px-3 py-1.5 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed"),w.disabled=Z=!e[37]||e[38],a(P,"class","px-5 py-4 border-t border-gray-100 flex justify-end gap-2"),a(n,"class","w-full max-w-md rounded-xl bg-white shadow-2xl border border-gray-200"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),gt(t,"background","rgba(0,0,0,0.45)")},m(K,te){R(K,t,te),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(n,s),u(n,c),u(c,f),u(f,d),u(f,h),u(f,p),u(p,_),u(c,m),u(c,y),u(y,v),u(y,k),u(y,C),se&&se.m(C,null),u(C,x);for(let q=0;q<W.length;q+=1)W[q]&&W[q].m(C,null);vt(C,e[37],!0),u(c,S),u(c,M),u(M,N),N.checked=e[41],u(M,L),u(n,I),u(n,P),u(P,F),u(F,T),u(P,z),u(P,w),u(w,J),$||(V=[Q(i,"click",e[65]),Q(C,"change",e[113]),Q(N,"change",e[114]),Q(F,"click",e[65]),Q(w,"click",e[68]),Q(t,"click",Lr(e[65]))],$=!0)},p(K,te){if(te[1]&512&&g!==(g=K[40].key+"")&&ee(_,g),K[36].length===0?se||(se=Hs(),se.c(),se.m(C,x)):se&&(se.d(1),se=null),te[1]&32){B=Oe(K[36]);let q;for(q=0;q<B.length;q+=1){const be=cs(K,B,q);W[q]?W[q].p(be,te):(W[q]=Ws(be),W[q].c(),W[q].m(C,null))}for(;q<W.length;q+=1)W[q].d(1);W.length=B.length}te[1]&96&&vt(C,K[37]),te[1]&1024&&(N.checked=K[41]),te[1]&128&&(F.disabled=K[38]),te[1]&128&&D!==(D=K[38]?"Starting...":"Start Translation")&&ee(J,D),te[1]&224&&Z!==(Z=!K[37]||K[38])&&(w.disabled=Z)},d(K){K&&j(t),se&&se.d(),ft(W,K),$=!1,lt(V)}}}function Hs(e){let t;return{c(){t=b("option"),t.textContent="No prompts available",t.__value="",Ie(t,t.__value)},m(n,r){R(n,t,r)},d(n){n&&j(t)}}}function Ws(e){let t,n=e[146].name+"",r,l,o=e[146].version+"",i,s,c;return{c(){t=b("option"),r=O(n),l=O(" (v"),i=O(o),s=O(")"),t.__value=c=e[146].id,Ie(t,t.__value)},m(f,d){R(f,t,d),u(t,r),u(t,l),u(t,i),u(t,s)},p(f,d){d[1]&32&&n!==(n=f[146].name+"")&&ee(r,n),d[1]&32&&o!==(o=f[146].version+"")&&ee(i,o),d[1]&32&&c!==(c=f[146].id)&&(t.__value=c,Ie(t,t.__value))},d(f){f&&j(t)}}}function Zs(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_=e[31].key+"",m,y,v,k,C,x,S=(e[31].context||"Word (no context)")+"",M,N,L,I,P,F,T,z=e[49](e[31])?"ARIA":"TEXT",w,D,J,Z,$,V,se,B,W,K,te,q,be=(e[31].status||"pending")+"",ve,Ne,le,me,ae,ne,Ae=(e[31].created_at||"—")+"",A,re,X,H,U,Y,ie,ue;function G(ge,je){return ge[31].url?Wd:Hd}let ce=G(e),ke=ce(e);function he(ge,je){return ge[31].url&&ge[32][ge[31].url]?Yd:ge[31].url&&ge[32][ge[31].url]===null?Vd:Zd}let xe=he(e),Te=xe(e);return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("h2"),l.textContent="Phrase Details",o=E(),i=b("button"),i.textContent="×",s=E(),c=b("div"),f=b("div"),d=b("div"),h=b("p"),h.textContent="Key",p=E(),g=b("p"),m=O(_),y=E(),v=b("div"),k=b("p"),k.textContent="Dom Context",C=E(),x=b("p"),M=O(S),N=E(),L=b("div"),I=b("p"),I.textContent="Type",P=E(),F=b("div"),T=b("span"),w=O(z),J=E(),Z=b("div"),$=b("p"),$.textContent="Source URL",V=E(),ke.c(),se=E(),B=b("div"),W=b("p"),W.textContent="Status",K=E(),te=b("div"),q=b("span"),ve=O(be),Ne=E(),le=b("div"),me=b("p"),me.textContent="Discovered",ae=E(),ne=b("p"),A=O(Ae),re=E(),X=b("div"),H=b("p"),H.textContent="Screenshot",U=E(),Y=b("div"),Te.c(),a(l,"class","text-sm font-semibold text-gray-800"),a(i,"class","text-gray-400 hover:text-gray-700 text-xl leading-none"),a(r,"class","flex items-center justify-between px-6 pt-5 pb-3 border-b border-gray-100 sticky top-0 bg-white"),a(h,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(g,"class","mt-1 text-base text-gray-900 break-words"),a(k,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(x,"class","mt-1 text-base text-gray-900 break-words"),a(I,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(T,"class",D="inline-flex items-center px-2 py-0.5 rounded-md text-xs font-semibold "+(e[49](e[31])?"text-amber-700 bg-amber-100":"text-gray-600 bg-gray-100")),a(F,"class","mt-1"),a($,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(W,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(q,"class","inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold bg-amber-100 text-amber-800"),a(te,"class","mt-1"),a(me,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(ne,"class","mt-1 text-sm text-gray-700"),a(f,"class","space-y-4"),a(H,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide mb-2"),a(Y,"class","w-full h-[160px] rounded-xl border border-gray-200 bg-gray-50 flex items-center justify-center overflow-hidden"),a(X,"class","md:pt-1"),a(c,"class","px-6 py-5 grid grid-cols-1 md:grid-cols-[minmax(0,1fr)_280px] gap-6 text-sm"),a(n,"class","bg-white rounded-xl shadow-2xl w-full max-w-5xl max-h-[90vh] overflow-y-auto"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),gt(t,"background","rgba(0,0,0,0.45)")},m(ge,je){R(ge,t,je),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(n,s),u(n,c),u(c,f),u(f,d),u(d,h),u(d,p),u(d,g),u(g,m),u(f,y),u(f,v),u(v,k),u(v,C),u(v,x),u(x,M),u(f,N),u(f,L),u(L,I),u(L,P),u(L,F),u(F,T),u(T,w),u(f,J),u(f,Z),u(Z,$),u(Z,V),ke.m(Z,null),u(f,se),u(f,B),u(B,W),u(B,K),u(B,te),u(te,q),u(q,ve),u(f,Ne),u(f,le),u(le,me),u(le,ae),u(le,ne),u(ne,A),u(c,re),u(c,X),u(X,H),u(X,U),u(X,Y),Te.m(Y,null),ie||(ue=[Q(i,"click",e[115]),Q(t,"click",Lr(e[116]))],ie=!0)},p(ge,je){je[1]&1&&_!==(_=ge[31].key+"")&&ee(m,_),je[1]&1&&S!==(S=(ge[31].context||"Word (no context)")+"")&&ee(M,S),je[1]&1&&z!==(z=ge[49](ge[31])?"ARIA":"TEXT")&&ee(w,z),je[1]&1&&D!==(D="inline-flex items-center px-2 py-0.5 rounded-md text-xs font-semibold "+(ge[49](ge[31])?"text-amber-700 bg-amber-100":"text-gray-600 bg-gray-100"))&&a(T,"class",D),ce===(ce=G(ge))&&ke?ke.p(ge,je):(ke.d(1),ke=ce(ge),ke&&(ke.c(),ke.m(Z,null))),je[1]&1&&be!==(be=(ge[31].status||"pending")+"")&&ee(ve,be),je[1]&1&&Ae!==(Ae=(ge[31].created_at||"—")+"")&&ee(A,Ae),xe===(xe=he(ge))&&Te?Te.p(ge,je):(Te.d(1),Te=xe(ge),Te&&(Te.c(),Te.m(Y,null)))},d(ge){ge&&j(t),ke.d(),Te.d(),ie=!1,lt(ue)}}}function Hd(e){let t;return{c(){t=b("p"),t.textContent="—",a(t,"class","mt-1 text-sm text-gray-400")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function Wd(e){let t,n=e[31].url+"",r,l;return{c(){t=b("a"),r=O(n),a(t,"href",l=e[31].url),a(t,"target","_blank"),a(t,"rel","noopener noreferrer"),a(t,"class","mt-1 inline-block text-sm text-blue-700 underline break-all")},m(o,i){R(o,t,i),u(t,r)},p(o,i){i[1]&1&&n!==(n=o[31].url+"")&&ee(r,n),i[1]&1&&l!==(l=o[31].url)&&a(t,"href",l)},d(o){o&&j(t)}}}function Zd(e){let t;return{c(){t=b("span"),t.textContent="Page screenshot",a(t,"class","text-sm text-gray-400")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function Vd(e){let t;return{c(){t=b("span"),t.textContent="Loading screenshot...",a(t,"class","text-sm text-gray-400")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function Yd(e){let t,n;return{c(){t=b("img"),Nl(t.src,n="data:image/jpeg;base64,"+e[32][e[31].url])||a(t,"src",n),a(t,"alt","Page screenshot"),a(t,"class","max-w-full max-h-full w-auto h-auto object-contain")},m(r,l){R(r,t,l)},p(r,l){l[1]&3&&!Nl(t.src,n="data:image/jpeg;base64,"+r[32][r[31].url])&&a(t,"src",n)},d(r){r&&j(t)}}}function Vs(e){let t,n,r,l,o,i,s,c,f,d,h,p;return f=new pd({props:{phraseKey:e[43].key,varSlots:e[118](),onSave:e[71]}}),{c(){t=b("div"),n=b("div"),r=b("div"),l=b("h2"),l.textContent="Edit Phrase Slots",o=E(),i=b("button"),i.textContent="×",s=E(),c=b("div"),rn(f.$$.fragment),a(l,"class","text-sm font-semibold text-gray-800"),a(i,"class","text-gray-400 hover:text-gray-700 text-xl leading-none"),a(r,"class","flex items-center justify-between px-6 pt-5 pb-3 border-b border-gray-100"),a(c,"class","px-6 py-5"),a(n,"class","bg-white rounded-xl shadow-2xl w-full max-w-xl"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),gt(t,"background","rgba(0,0,0,0.45)")},m(g,_){R(g,t,_),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(n,s),u(n,c),Xt(f,c,null),d=!0,h||(p=[Q(i,"click",e[117]),Q(t,"click",Lr(e[119]))],h=!0)},p(g,_){const m={};_[1]&4096&&(m.phraseKey=g[43].key),_[1]&4096&&(m.varSlots=g[118]()),f.$set(m)},i(g){d||(st(f.$$.fragment,g),d=!0)},o(g){ct(f.$$.fragment,g),d=!1},d(g){g&&j(t),Qt(f),h=!1,lt(p)}}}function Ys(e){let t,n,r,l,o,i,s,c,f,d,h,p;return f=new _d({props:{phraseKey:e[44].key,context:e[44].context||"",attributes:e[45][e[44].key+"\0"+(e[44].context||"")]||{},onSave:e[53]}}),{c(){t=b("div"),n=b("div"),r=b("div"),l=b("h2"),l.textContent="Accessibility (ARIA)",o=E(),i=b("button"),i.textContent="×",s=E(),c=b("div"),rn(f.$$.fragment),a(l,"class","text-sm font-semibold text-gray-800"),a(i,"class","text-gray-400 hover:text-gray-700 text-xl leading-none"),a(r,"class","flex items-center justify-between px-6 pt-5 pb-3 border-b border-gray-100 sticky top-0 bg-white"),a(c,"class","px-6 py-5"),a(n,"class","bg-white rounded-xl shadow-2xl w-full max-w-xl max-h-[90vh] overflow-y-auto"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),gt(t,"background","rgba(0,0,0,0.45)")},m(g,_){R(g,t,_),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(n,s),u(n,c),Xt(f,c,null),d=!0,h||(p=[Q(i,"click",e[120]),Q(t,"click",Lr(e[121]))],h=!0)},p(g,_){const m={};_[1]&8192&&(m.phraseKey=g[44].key),_[1]&8192&&(m.context=g[44].context||""),_[1]&24576&&(m.attributes=g[45][g[44].key+"\0"+(g[44].context||"")]||{}),f.$set(m)},i(g){d||(st(f.$$.fragment,g),d=!0)},o(g){ct(f.$$.fragment,g),d=!1},d(g){g&&j(t),Qt(f),h=!1,lt(p)}}}function qd(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L,I,P,F,T,z,w,D,J,Z,$,V,se,B,W,K,te,q,be,ve,Ne,le,me,ae=e[19]&&bs(e),ne=Oe(["pending","approved","trash"]),Ae=[];for(let oe=0;oe<3;oe+=1)Ae[oe]=ys(_s(e,ne,oe));let A=e[0]==="approved"&&vs(e),re=(e[0]==="pending"||e[0]==="approved")&&xs(e),X=Oe(e[6]),H=[];for(let oe=0;oe<X.length;oe+=1)H[oe]=Cs(ms(e,X,oe));let U=Oe(e[14]),Y=[];for(let oe=0;oe<U.length;oe+=1)Y[oe]=Ss(gs(e,U,oe));let ie=e[24]&&As(e),ue=e[25]&&Ts(e),G=(e[13].size>0||e[21])&&Ms(e),ce=e[42].length>0&&Os(e);const ke=[Od,Fd,Dd],he=[];function xe(oe,ze){return oe[17]?0:oe[1].length===0?1:2}B=xe(e),W=he[B]=ke[B](e);let Te=e[39]&&e[40]&&Us(e),ge=e[31]&&Zs(e),je=e[43]&&Vs(e),Fe=e[44]&&Ys(e);return{c(){t=b("div"),ae&&ae.c(),n=E(),r=b("div"),l=b("div");for(let oe=0;oe<3;oe+=1)Ae[oe].c();o=E(),i=b("div"),A&&A.c(),s=E(),re&&re.c(),c=E(),f=b("div"),d=b("select");for(let oe=0;oe<H.length;oe+=1)H[oe].c();h=E(),p=b("div"),g=b("select"),_=b("option"),_.textContent="All fields",m=b("option"),m.textContent="Key",y=b("option"),y.textContent="Context",v=b("option"),v.textContent="Translation",k=E(),C=b("div"),x=b("input"),M=E(),N=b("span"),N.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',L=E(),I=b("select"),P=b("option"),P.textContent="All",F=b("option"),F.textContent="Translated",T=b("option"),T.textContent="Not Translated",z=E(),w=b("select"),D=b("option"),D.textContent="All Labels";for(let oe=0;oe<Y.length;oe+=1)Y[oe].c();J=E(),ie&&ie.c(),Z=E(),ue&&ue.c(),$=E(),G&&G.c(),V=E(),ce&&ce.c(),se=E(),W.c(),K=E(),Te&&Te.c(),te=E(),ge&&ge.c(),q=E(),je&&je.c(),be=E(),Fe&&Fe.c(),ve=Ct(),a(l,"class","flex items-center gap-1"),a(i,"class","flex items-center gap-2 -mb-px pb-2"),a(r,"class","flex items-center justify-between mb-4 border-b border-gray-200"),a(d,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[7]===void 0&&It(()=>e[85].call(d)),_.__value="all",Ie(_,_.__value),m.__value="key",Ie(m,m.__value),y.__value="context",Ie(y,y.__value),v.__value="translation",Ie(v,v.__value),a(g,"class","px-2 py-2 border border-r-0 border-gray-300 rounded-l-md text-xs text-gray-500 bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 min-w-[90px]"),e[10]===void 0&&It(()=>e[86].call(g)),a(x,"type","text"),a(x,"placeholder",S=e[10]==="key"?"Search by key…":e[10]==="context"?"Search by context…":e[10]==="translation"?"Search by translated value…":"Search keys, context, translations…"),a(x,"class","w-full pl-8 pr-3 py-2 border border-gray-300 rounded-r-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(N,"class","absolute left-2.5 top-2.5 text-gray-400"),a(C,"class","flex-1 relative"),a(p,"class","flex-1 flex gap-0"),P.__value="all",Ie(P,P.__value),F.__value="yes",Ie(F,F.__value),T.__value="no",Ie(T,T.__value),a(I,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[11]===void 0&&It(()=>e[89].call(I)),D.__value="",Ie(D,D.__value),a(w,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[12]===void 0&&It(()=>e[91].call(w)),a(f,"class","flex flex-wrap items-center gap-3 mb-4")},m(oe,ze){R(oe,t,ze),ae&&ae.m(t,null),u(t,n),u(t,r),u(r,l);for(let Le=0;Le<3;Le+=1)Ae[Le]&&Ae[Le].m(l,null);u(r,o),u(r,i),A&&A.m(i,null),u(i,s),re&&re.m(i,null),u(t,c),u(t,f),u(f,d);for(let Le=0;Le<H.length;Le+=1)H[Le]&&H[Le].m(d,null);vt(d,e[7],!0),u(f,h),u(f,p),u(p,g),u(g,_),u(g,m),u(g,y),u(g,v),vt(g,e[10],!0),u(p,k),u(p,C),u(C,x),Ie(x,e[9]),u(C,M),u(C,N),u(f,L),u(f,I),u(I,P),u(I,F),u(I,T),vt(I,e[11],!0),u(f,z),u(f,w),u(w,D);for(let Le=0;Le<Y.length;Le+=1)Y[Le]&&Y[Le].m(w,null);vt(w,e[12],!0),u(t,J),ie&&ie.m(t,null),u(t,Z),ue&&ue.m(t,null),u(t,$),G&&G.m(t,null),u(t,V),ce&&ce.m(t,null),u(t,se),he[B].m(t,null),R(oe,K,ze),Te&&Te.m(oe,ze),R(oe,te,ze),ge&&ge.m(oe,ze),R(oe,q,ze),je&&je.m(oe,ze),R(oe,be,ze),Fe&&Fe.m(oe,ze),R(oe,ve,ze),Ne=!0,le||(me=[Q(d,"change",e[85]),Q(d,"change",e[55]),Q(g,"change",e[86]),Q(g,"change",e[87]),Q(x,"input",e[88]),Q(x,"input",e[59]),Q(I,"change",e[89]),Q(I,"change",e[90]),Q(w,"change",e[91]),Q(w,"change",e[92])],le=!0)},p(oe,ze){if(oe[19]?ae?ae.p(oe,ze):(ae=bs(oe),ae.c(),ae.m(t,n)):ae&&(ae.d(1),ae=null),ze[0]&257|ze[1]&8388608|ze[2]&16384){ne=Oe(["pending","approved","trash"]);let Pe;for(Pe=0;Pe<3;Pe+=1){const Ye=_s(oe,ne,Pe);Ae[Pe]?Ae[Pe].p(Ye,ze):(Ae[Pe]=ys(Ye),Ae[Pe].c(),Ae[Pe].m(l,null))}for(;Pe<3;Pe+=1)Ae[Pe].d(1)}if(oe[0]==="approved"?A?A.p(oe,ze):(A=vs(oe),A.c(),A.m(i,s)):A&&(A.d(1),A=null),oe[0]==="pending"||oe[0]==="approved"?re?re.p(oe,ze):(re=xs(oe),re.c(),re.m(i,null)):re&&(re.d(1),re=null),ze[0]&64){X=Oe(oe[6]);let Pe;for(Pe=0;Pe<X.length;Pe+=1){const Ye=ms(oe,X,Pe);H[Pe]?H[Pe].p(Ye,ze):(H[Pe]=Cs(Ye),H[Pe].c(),H[Pe].m(d,null))}for(;Pe<H.length;Pe+=1)H[Pe].d(1);H.length=X.length}if(ze[0]&192&&vt(d,oe[7]),ze[0]&1024&&vt(g,oe[10]),(!Ne||ze[0]&1024&&S!==(S=oe[10]==="key"?"Search by key…":oe[10]==="context"?"Search by context…":oe[10]==="translation"?"Search by translated value…":"Search keys, context, translations…"))&&a(x,"placeholder",S),ze[0]&512&&x.value!==oe[9]&&Ie(x,oe[9]),ze[0]&2048&&vt(I,oe[11]),ze[0]&16384){U=Oe(oe[14]);let Pe;for(Pe=0;Pe<U.length;Pe+=1){const Ye=gs(oe,U,Pe);Y[Pe]?Y[Pe].p(Ye,ze):(Y[Pe]=Ss(Ye),Y[Pe].c(),Y[Pe].m(w,null))}for(;Pe<Y.length;Pe+=1)Y[Pe].d(1);Y.length=U.length}ze[0]&20480&&vt(w,oe[12]),oe[24]?ie?ie.p(oe,ze):(ie=As(oe),ie.c(),ie.m(t,Z)):ie&&(ie.d(1),ie=null),oe[25]?ue?ue.p(oe,ze):(ue=Ts(oe),ue.c(),ue.m(t,$)):ue&&(ue.d(1),ue=null),oe[13].size>0||oe[21]?G?G.p(oe,ze):(G=Ms(oe),G.c(),G.m(t,V)):G&&(G.d(1),G=null),oe[42].length>0?ce?(ce.p(oe,ze),ze[1]&2048&&st(ce,1)):(ce=Os(oe),ce.c(),st(ce,1),ce.m(t,se)):ce&&(Gt(),ct(ce,1,1,()=>{ce=null}),Kt());let Le=B;B=xe(oe),B===Le?he[B].p(oe,ze):(Gt(),ct(he[Le],1,1,()=>{he[Le]=null}),Kt(),W=he[B],W?W.p(oe,ze):(W=he[B]=ke[B](oe),W.c()),st(W,1),W.m(t,null)),oe[39]&&oe[40]?Te?Te.p(oe,ze):(Te=Us(oe),Te.c(),Te.m(te.parentNode,te)):Te&&(Te.d(1),Te=null),oe[31]?ge?ge.p(oe,ze):(ge=Zs(oe),ge.c(),ge.m(q.parentNode,q)):ge&&(ge.d(1),ge=null),oe[43]?je?(je.p(oe,ze),ze[1]&4096&&st(je,1)):(je=Vs(oe),je.c(),st(je,1),je.m(be.parentNode,be)):je&&(Gt(),ct(je,1,1,()=>{je=null}),Kt()),oe[44]?Fe?(Fe.p(oe,ze),ze[1]&8192&&st(Fe,1)):(Fe=Ys(oe),Fe.c(),st(Fe,1),Fe.m(ve.parentNode,ve)):Fe&&(Gt(),ct(Fe,1,1,()=>{Fe=null}),Kt())},i(oe){Ne||(st(ce),st(W),st(je),st(Fe),Ne=!0)},o(oe){ct(ce),ct(W),ct(je),ct(Fe),Ne=!1},d(oe){oe&&(j(t),j(K),j(te),j(q),j(be),j(ve)),ae&&ae.d(),ft(Ae,oe),A&&A.d(),re&&re.d(),ft(H,oe),ft(Y,oe),ie&&ie.d(),ue&&ue.d(),G&&G.d(),ce&&ce.d(),he[B].d(),Te&&Te.d(oe),ge&&ge.d(oe),je&&je.d(oe),Fe&&Fe.d(oe),le=!1,lt(me)}}}const ml=50;function Jd(e){return e.key+"\0"+(e.context||"")}function qs(e,t){const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}function _l(e,t){const n=e.contexts.map(l=>l.key_id),r=n.filter(l=>t.has(l)).length;return r===0?"none":r===n.length?"all":"some"}function Gd(e,t){const n=e.contexts||[];if(t==="word")return e.master_key_id?[e.master_key_id]:n.length===0?[]:[n[0].key_id];const r=new Set(n.map(l=>l.key_id));return e.master_key_id&&r.add(e.master_key_id),[...r]}function Kd(e,t,n){let r,l,o,i;Gr(e,an,fe=>n(127,i=fe));let{params:s={}}=t;const c=["pending","approved","trash"],f=[25,50,100];let h=[{code:"zh-Hans",name:"Chinese (Simplified)"},{code:"zh-Hant",name:"Chinese (Traditional)"},{code:"es",name:"Spanish"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"pt",name:"Portuguese"}];function p(fe){const De=new URLSearchParams(fe||"");return{page:Math.max(1,parseInt(De.get("page"),10)||1),pageSize:f.includes(parseInt(De.get("pageSize"),10))?parseInt(De.get("pageSize"),10):50,lang:De.get("lang")||null,search:De.get("search")||"",filter:["all","yes","no"].includes(De.get("filter"))?De.get("filter"):"all",label:De.get("label")||""}}let g="zh-Hans",_=c.includes(s.tab)?s.tab:"pending",m=[],y={pending:0,approved:0,trash:0},v="",k="all",C="all",x="",S=new Set,M=!1,N=[],L=!1,I=!1,P=!1,F="",T=!1,z;function w(fe){n(18,F=fe),n(19,T=!0),z&&clearTimeout(z),z=setTimeout(()=>{n(19,T=!1)},3500)}let D=1,J=50,Z=0;function $(){const fe=new URLSearchParams;D>1&&fe.set("page",D),J!==50&&fe.set("pageSize",J),g&&fe.set("lang",g),v.trim()&&fe.set("search",v.trim()),C!=="all"&&fe.set("filter",C),x&&fe.set("label",x);const De=fe.toString(),Ge=`/translations/${c.includes(s.tab)?s.tab:_}${De?"?"+De:""}`;window.location.replace("#"+Ge)}let V=!1,se="",B=0,W=0,K=0,te=!1,q=!1,be="",ve="",Ne="",le="",me=null,ae=null,ne={},Ae=!1,A="",re=!1,X=[],H="",U=!1,Y=!1,ie=null,ue=!1,G=[],ce=null,ke=null,he=null,xe={};function Te(fe){const De=xe[Jd(fe)];return De&&Object.keys(De).length>0}async function ge(){n(33,Ae=!0),n(34,A=""),n(35,re=!1);try{const fe=await Ze("../api/export");if(!fe.ok)throw new Error("Export failed");const De=await fe.json();if(De.error)throw new Error(De.error);const rt=new Blob([JSON.stringify(De,null,2)],{type:"application/json"});qs(rt,"loco-translations.json"),n(34,A="Downloaded!"),setTimeout(()=>n(34,A=""),2e3)}catch(fe){n(34,A=fe.message||"Export failed"),setTimeout(()=>n(34,A=""),3e3)}finally{n(33,Ae=!1)}}async function je(){n(33,Ae=!0),n(34,A=""),n(35,re=!1);try{const fe=await Ze("../api/export");if(!fe.ok)throw new Error("Export failed");const De=await fe.json();if(De.error)throw new Error(De.error);const rt=De.languages||[];if(rt.length===0)throw new Error("No translations to export");const Ge=new Ld;for(const xt of rt){const Ot={languages:[xt],languageNames:De.languageNames,translations:{[xt]:De.translations[xt]},timestamp:De.timestamp};Ge.file(`${xt}.json`,JSON.stringify(Ot,null,2))}const yt=await Ge.generateAsync({type:"blob"});qs(yt,"loco-translations.zip"),n(34,A=`Downloaded ZIP with ${rt.length} language(s)!`),setTimeout(()=>n(34,A=""),2e3)}catch(fe){n(34,A=fe.message||"Export failed"),setTimeout(()=>n(34,A=""),3e3)}finally{n(33,Ae=!1)}}async function Fe(fe){if(!fe||ne[fe]!==void 0)return;n(32,ne[fe]=null,ne);const rt=await(await Ze(`../api/screenshots?url=${encodeURIComponent(fe)}`)).json();n(32,ne[fe]=rt.screenshot||!1,ne),n(32,ne)}Nr(()=>{const fe=window.location.hash||"",De=fe.indexOf("?"),rt=De>=0?fe.slice(De+1):"",Ge=p(rt);n(20,D=Ge.page),n(2,J=Ge.pageSize),n(9,v=Ge.search),n(11,C=Ge.filter),n(12,x=Ge.label);try{const yt=JSON.parse(i.settings||"{}");yt.languages&&yt.languages.length&&n(6,h=yt.languages)}catch{}return Ge.lang?n(7,g=Ge.lang):h.length&&n(7,g=h[0].code||h[0]),n(78,M=!0),$(),ze(),Ue(),oe(),()=>{z&&clearTimeout(z),Je()}});async function oe(){try{const fe=await Ze("../api/prompts");if(!fe.ok)return;const De=await fe.json();n(36,X=De||[]),n(37,H=X.length?X[0].id:"")}catch{n(36,X=[]),n(37,H="")}}async function ze(){n(17,P=!0),await Promise.all([Le(),Pe(),Ye()]),n(17,P=!1)}async function Le(){const fe=new URLSearchParams({lang:g,status:_,group:"key",page:D,limit:J});v.trim()&&(fe.set("search",v.trim()),k!=="all"&&fe.set("search_field",k)),C!=="all"&&fe.set("translated",C),x&&fe.set("label",x);const rt=await(await Ze(`../api/translations/all?${fe}`)).json();n(1,m=rt.groups||[]),n(3,Z=rt.total),n(13,S=new Set),n(16,I=!1),n(30,me=null)}async function Pe(){const fe=await Ze("../api/translations/counts");n(8,y=await fe.json())}async function Ye(){try{const fe=await Ze("../api/aria/all");if(!fe.ok)return;const De=await fe.json(),rt={};for(const Ge of De)rt[Ge.key+"\0"+(Ge.context||"")]=Ge.attributes||{};n(45,xe=rt)}catch(fe){console.warn("[loco] Failed to load ARIA rules:",fe)}}async function et(fe){const De=he;if(De){n(44,he=null);try{const rt=await Ze("../api/aria",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:De.key,context:De.context||"",attributes:fe})});if(!rt.ok)throw new Error(`Save failed (HTTP ${rt.status})`);const Ge=De.key+"\0"+(De.context||"");if(fe&&Object.keys(fe).length>0)n(45,xe={...xe,[Ge]:fe});else{const yt={...xe};delete yt[Ge],n(45,xe=yt)}w("ARIA rules saved")}catch(rt){console.warn("[loco] Failed to save ARIA rule:",rt),w("Failed to save ARIA rules")}}}function $e(fe){mr(`/translations/${fe}`)}function we(){n(20,D=1),$(),ze()}async function Ue(){const fe=await Ze("../api/labels");fe.ok&&n(14,N=await fe.json())}async function _e(fe,De,rt){rt.some(yt=>yt.id===De)?await Ze(`../api/labels/${De}/unassign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[fe]})}):await Ze(`../api/labels/${De}/assign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[fe]})}),await Le()}async function Me(fe){S.size!==0&&(await Ze(`../api/labels/${fe}/assign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[...S]})}),n(15,L=!1),await Le(),await Ue())}async function Ce(fe){S.size!==0&&(await Ze(`../api/labels/${fe}/unassign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[...S]})}),n(15,L=!1),await Le(),await Ue())}let Ve;function pe(){clearTimeout(Ve),Ve=setTimeout(()=>{n(20,D=1),$(),Le()},300)}function qe(){I?(n(13,S=new Set),n(16,I=!1)):(n(13,S=new Set(r.map(fe=>fe.key_id))),n(16,I=!0))}function Ke(fe){const De=fe.contexts.map(Ge=>Ge.key_id);De.every(Ge=>S.has(Ge))?De.forEach(Ge=>S.delete(Ge)):De.forEach(Ge=>S.add(Ge)),n(13,S=new Set(S)),n(16,I=S.size===r.length&&r.length>0)}async function bt(fe){n(31,ae=fe),fe!=null&&fe.url&&await Fe(fe.url)}function jt(fe){const De=me===fe.key;n(30,me=De?null:fe.key)}function Et(fe){U||(n(40,ie=fe),n(41,ue=!1),n(39,Y=!0))}function Rt(){n(39,Y=!1),n(40,ie=null),n(41,ue=!1)}async function Bt(fe,De,rt=H){if(U)return;if(!rt&&(await oe(),!H))return w("No prompt template found. Create one in AI Translate first."),!1;const Ge=Gd(fe,De);if(Ge.length===0)return w("No phrases available to translate in this group."),!1;n(38,U=!0);try{const yt=await Ze("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:Ge,lang:g,prompt_id:rt,include_screenshots:!1,mode:De})}),xt=await yt.json().catch(()=>({}));if(!yt.ok||xt.error)throw new Error(xt.error||`Failed to queue AI job (HTTP ${yt.status})`);return He(),ye(),!0}catch(yt){return w(yt.message||"Failed to queue AI translation job."),!1}finally{n(38,U=!1)}}async function Dt(){try{const De=await(await Ze("../api/ai-jobs")).json();n(42,G=De.jobs||[])}catch{}}async function ye(){await Promise.allSettled([Le(),Dt()])}function He(){ce||(ce=setInterval(async()=>{await Dt(),G.some(De=>De.status==="running"||De.status==="pending")||(Je(),await ze())},2e3))}function Je(){ce&&(clearInterval(ce),ce=null)}async function at(fe){await Ze(`../api/ai-jobs/${encodeURIComponent(fe)}`,{method:"DELETE"}),await Dt()}function kt(fe){n(42,G=G.filter(De=>De.id!==fe))}async function _t(){if(!ie)return;if(!H){w("Select a prompt template first.");return}await Bt(ie,ue?"context":"word",H)&&(Rt(),w("Translation job queued — watch progress below!"))}const ut={pending:"Moving to Pending",approved:"Approving",trash:"Trashing"};async function mt(fe){if(S.size===0||V)return;const De=[...S];n(21,V=!0),n(22,se=ut[fe]||"Moving"),n(4,B=0),n(5,W=De.length),n(23,K=0),await xr();try{for(let rt=0;rt<De.length;rt+=ml){const Ge=De.slice(rt,rt+ml);try{(await Ze("../api/textnodes/status",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:Ge,status:fe})})).ok||n(23,K+=Ge.length)}catch{n(23,K+=Ge.length)}n(4,B=Math.min(rt+Ge.length,De.length))}await ze(),w(K===0?`${De.length} item(s) ${se.toLowerCase()} successfully`:`${K} of ${De.length} item(s) failed`)}finally{n(21,V=!1),K===0&&(n(4,B=0),n(5,W=0))}}async function nt(){if(S.size===0||V||!confirm(`Permanently delete ${S.size} item(s)? This cannot be undone.`))return;const fe=[...S];n(21,V=!0),n(22,se="Deleting"),n(4,B=0),n(5,W=fe.length),n(23,K=0),await xr();try{for(let De=0;De<fe.length;De+=ml){const rt=fe.slice(De,De+ml);try{(await Ze("../api/textnodes/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:rt})})).ok||n(23,K+=rt.length)}catch{n(23,K+=rt.length)}n(4,B=Math.min(De+rt.length,fe.length))}await ze(),w(K===0?`${fe.length} item(s) deleted permanently`:`${K} of ${fe.length} item(s) failed to delete`)}finally{n(21,V=!1),K===0&&(n(4,B=0),n(5,W=0))}}async function We(fe,De){const rt=ke;if(rt){n(43,ke=null);try{const Ge=await Ze(`../api/phrases/${rt.key_id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:fe,varSlots:De})});if(!Ge.ok){const yt=await Ge.json().catch(()=>({}));throw new Error(yt.error||`Save failed (HTTP ${Ge.status})`)}await Promise.all([Le(),Pe()]),w("Phrase updated")}catch(Ge){console.warn("[loco] Failed to save var edits:",Ge),w("Failed to update phrase")}}}async function Re(fe){try{await Ze("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:g,translations:[{key:fe.key,context:fe.context||"",value:fe.value||""}]})}),w("Translation saved")}catch(De){console.error("Failed to save translation:",De),w("Failed to save translation")}}async function Xe(fe){const De=fe.master_value||"";try{await Ze("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:fe.key,context:"",status:"approved"})}),await Ze("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:g,translations:[{key:fe.key,context:"",value:De}]})}),w("Master translation saved")}catch(rt){console.error("Failed to save master translation:",rt),w("Failed to save master translation")}}async function At(){if(be.trim())try{await Ze("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:be.trim(),context:ve.trim(),status:_})}),Ne.trim()&&await Ze("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:g,translations:[{key:be.trim(),context:ve.trim(),value:Ne.trim()}]})}),n(26,be=""),n(27,ve=""),n(28,Ne=""),n(24,te=!1),w("Translation added"),await ze()}catch(fe){console.error("Failed to add translation:",fe),w("Failed to add translation")}}async function it(){let fe;try{fe=JSON.parse(le)}catch{w("Invalid JSON");return}try{await Ze("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:g,translations:fe})}),n(29,le=""),n(25,q=!1),w(`Imported ${fe.length||Object.keys(fe).length} translation(s)`),await ze()}catch(De){console.error("Failed to import translations:",De),w("Failed to import translations")}}const Mn={pending:{label:"Pending",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#d97706" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',actions:[{label:"Approve Selected",status:"approved",color:"bg-green-600 hover:bg-green-700"},{label:"Trash Selected",status:"trash",color:"bg-red-600 hover:bg-red-700"}]},approved:{label:"Approved",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#16a34a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',actions:[{label:"Move to Pending",status:"pending",color:"bg-yellow-600 hover:bg-yellow-700"},{label:"Trash Selected",status:"trash",color:"bg-red-600 hover:bg-red-700"}]},trash:{label:"Trash",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#dc2626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>',actions:[{label:"Restore to Pending",status:"pending",color:"bg-blue-600 hover:bg-blue-700"},{label:"Move to Approved",status:"approved",color:"bg-green-600 hover:bg-green-700"}]}};function En(fe){wr.call(this,e,fe)}const Fn=fe=>$e(fe),er=()=>n(35,re=!re),Lt=()=>n(35,re=!1),pn=()=>{n(25,q=!q),n(24,te=!1)},Ln=()=>{n(24,te=!te),n(25,q=!1)};function Se(){g=tn(this),n(7,g),n(6,h)}function Qe(){k=tn(this),n(10,k),n(78,M),n(77,s),n(0,_)}const ot=()=>{v.trim()&&(n(20,D=1),$(),Le())};function wt(){v=this.value,n(9,v),n(78,M),n(77,s),n(0,_)}function Ft(){C=tn(this),n(11,C),n(78,M),n(77,s),n(0,_)}const Ut=()=>{n(20,D=1),$(),Le()};function tr(){x=tn(this),n(12,x),n(14,N)}const Nt=()=>{n(20,D=1),$(),Le()};function nr(){be=this.value,n(26,be)}function ll(){ve=this.value,n(27,ve)}function rr(){Ne=this.value,n(28,Ne)}function il(){le=this.value,n(29,le)}const bn=fe=>mt(fe.status),lr=()=>n(15,L=!L),Ir=()=>n(15,L=!1),ol=fe=>Me(fe.id),Pr=fe=>Ce(fe.id),sl=fe=>Ke(fe),ir=fe=>jt(fe),al=fe=>{n(44,he=fe)},yn=fe=>{n(43,ke=fe)},or=fe=>Re(fe),Dr=()=>{n(20,D=1),$(),Le()},ul=()=>{n(20,D--,D),$(),Le()},vn=()=>{n(20,D++,D),$(),Le()},kn=()=>{n(20,D=l),$(),Le()};function sr(){J=tn(this),n(2,J)}const cl=()=>{n(20,D=1),$(),Le()};function ar(){H=tn(this),n(37,H),n(36,X)}function ur(){ue=this.checked,n(41,ue)}const Fr=()=>n(31,ae=null),fl=()=>n(31,ae=null),Or=()=>n(43,ke=null),On=()=>{try{return JSON.parse(ke.var_slots||"[]")}catch{return[]}},jn=()=>n(43,ke=null),Rn=()=>n(44,he=null),jr=()=>n(44,he=null);return e.$$set=fe=>{"params"in fe&&n(77,s=fe.params)},e.$$.update=()=>{if(e.$$.dirty[0]&1|e.$$.dirty[2]&98304&&M){const fe=c.includes(s.tab)?s.tab:"pending";fe!==_&&(n(0,_=fe),n(9,v=""),n(10,k="all"),n(11,C="all"),n(20,D=1),$(),ze())}e.$$.dirty[0]&2&&(r=m.flatMap(fe=>fe.contexts||[])),e.$$.dirty[0]&12&&n(47,l=Math.max(1,Math.ceil(Z/J))),e.$$.dirty[0]&48&&n(46,o=W>0?Math.round(B/W*100):0)},[_,m,J,Z,B,W,h,g,y,v,k,C,x,S,N,L,I,P,F,T,D,V,se,K,te,q,be,ve,Ne,le,me,ae,ne,Ae,A,re,X,H,U,Y,ie,ue,G,ke,he,xe,o,l,$,Te,ge,je,Le,et,$e,we,_e,Me,Ce,pe,qe,Ke,bt,jt,Et,Rt,at,kt,_t,mt,nt,We,Re,Xe,At,it,Mn,s,M,En,Fn,er,Lt,pn,Ln,Se,Qe,ot,wt,Ft,Ut,tr,Nt,nr,ll,rr,il,bn,lr,Ir,ol,Pr,sl,ir,al,yn,or,Dr,ul,vn,kn,sr,cl,ar,ur,Fr,fl,Or,On,jn,Rn,jr]}class Js extends sn{constructor(t){super(),on(this,t,Kd,qd,$t,{params:77},null,[-1,-1,-1,-1,-1,-1])}}function Gs(e,t,n){const r=e.slice();return r[118]=t[n],r}function Ks(e,t,n){const r=e.slice();return r[110]=t[n],r}function Xs(e,t,n){const r=e.slice();return r[107]=t[n],r}function Qs(e,t,n){const r=e.slice();return r[110]=t[n],r}function $s(e,t,n){const r=e.slice();return r[113]=t[n],r}function ea(e,t,n){const r=e.slice();return r[121]=t[n],r}function ta(e){let t,n,r=e[121].icon+"",l,o=e[121].label+"",i,s,c,f,d;function h(){return e[59](e[121])}return{c(){t=b("button"),n=b("span"),l=E(),i=O(o),s=E(),a(n,"class","inline-flex items-center"),a(t,"class",c="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px "+(e[21]===e[121].id?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))},m(p,g){R(p,t,g),u(t,n),n.innerHTML=r,u(t,l),u(t,i),u(t,s),f||(d=Q(t,"click",h),f=!0)},p(p,g){e=p,g[0]&2097152&&c!==(c="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px "+(e[21]===e[121].id?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))&&a(t,"class",c)},d(p){p&&j(t),f=!1,d()}}}function Xd(e){let t,n,r=e[12].length+"",l,o,i,s,c,f,d,h;function p(m,y){return m[12].length===0?t0:e0}let g=p(e),_=g(e);return{c(){t=b("div"),n=b("p"),l=O(r),o=O(" job(s) in history"),i=E(),s=b("button"),s.textContent="Refresh",c=E(),_.c(),f=Ct(),a(n,"class","text-sm text-gray-500"),a(s,"class","px-3 py-1.5 text-xs border border-gray-300 rounded hover:bg-gray-50"),a(t,"class","flex items-center justify-between mb-4")},m(m,y){R(m,t,y),u(t,n),u(n,l),u(n,o),u(t,i),u(t,s),R(m,c,y),_.m(m,y),R(m,f,y),d||(h=Q(s,"click",e[35]),d=!0)},p(m,y){y[0]&4096&&r!==(r=m[12].length+"")&&ee(l,r),g===(g=p(m))&&_?_.p(m,y):(_.d(1),_=g(m),_&&(_.c(),_.m(f.parentNode,f)))},i:Be,o:Be,d(m){m&&(j(t),j(c),j(f)),_.d(m),d=!1,h()}}}function Qd(e){let t,n,r=e[4].length+"",l,o,i,s,c,f,d,h,p,g=e[7]&&ra(e);function _(v,k){return v[4].length===0&&!v[7]?r0:n0}let m=_(e),y=m(e);return{c(){t=b("div"),n=b("p"),l=O(r),o=O(" prompt template(s)"),i=E(),s=b("button"),s.textContent="+ New Prompt",c=E(),g&&g.c(),f=E(),y.c(),d=Ct(),a(n,"class","text-sm text-gray-500"),a(s,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700"),a(t,"class","flex items-center justify-between mb-4")},m(v,k){R(v,t,k),u(t,n),u(n,l),u(n,o),u(t,i),u(t,s),R(v,c,k),g&&g.m(v,k),R(v,f,k),y.m(v,k),R(v,d,k),h||(p=Q(s,"click",e[36]),h=!0)},p(v,k){k[0]&16&&r!==(r=v[4].length+"")&&ee(l,r),v[7]?g?g.p(v,k):(g=ra(v),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null),m===(m=_(v))&&y?y.p(v,k):(y.d(1),y=m(v),y&&(y.c(),y.m(d.parentNode,d)))},i:Be,o:Be,d(v){v&&(j(t),j(c),j(f),j(d)),g&&g.d(v),y.d(v),h=!1,p()}}}function $d(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L,I,P,F,T,z,w=e[1].size+"",D,J,Z,$,V,se,B,W,K,te,q,be,ve,Ne,le,me,ae,ne,Ae,A,re,X,H,U,Y,ie,ue,G,ce,ke,he;t=new Pc({props:{jobs:e[11],onCancel:e[55],onDismiss:e[56]}});let xe=Oe(e[13]),Te=[];for(let _e=0;_e<xe.length;_e+=1)Te[_e]=sa($s(e,xe,_e));let ge=e[4].length===0&&aa(),je=Oe(e[4]),Fe=[];for(let _e=0;_e<je.length;_e+=1)Fe[_e]=ua(Qs(e,je,_e));let oe=e[18]&&e[29]==="selected"&&ca();function ze(_e,Me){return _e[18]&&_e[29]==="all"?i0:l0}let Le=ze(e),Pe=Le(e),Ye=e[28]&&fa(e),et=e[24]&&ha(e);const $e=[d0,f0],we=[];function Ue(_e,Me){return _e[14].length===0?0:1}return ie=Ue(e),ue=we[ie]=$e[ie](e),{c(){rn(t.$$.fragment),n=E(),r=b("div"),l=b("div"),o=b("label"),o.textContent="Language",i=E(),s=b("select");for(let _e=0;_e<Te.length;_e+=1)Te[_e].c();c=E(),f=b("div"),d=b("label"),d.textContent="Prompt Template",h=E(),p=b("select"),ge&&ge.c(),g=Ct();for(let _e=0;_e<Fe.length;_e+=1)Fe[_e].c();_=E(),m=b("div"),y=b("div"),y.textContent=" ",v=E(),k=b("label"),C=b("input"),x=O(`
18
+ Include screenshots`),S=E(),M=b("div"),N=E(),L=b("div"),I=b("div"),I.textContent=" ",P=E(),F=b("div"),T=b("button"),oe&&oe.c(),z=O(`
19
+ Generate (`),D=O(w),J=O(" selected)"),$=E(),V=b("button"),Pe.c(),se=O(`
20
+ Translate All`),W=E(),Ye&&Ye.c(),K=E(),et&&et.c(),te=E(),q=b("div"),be=b("div"),ve=b("input"),Ne=E(),le=b("span"),le.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#888" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',me=E(),ae=b("select"),ne=b("option"),ne.textContent="All",Ae=b("option"),Ae.textContent="Translated",A=b("option"),A.textContent="Not Translated",re=E(),X=b("span"),H=O(e[3]),U=O(" approved keys"),Y=E(),ue.c(),G=Ct(),a(o,"for","ai-translate-language"),a(o,"class","text-xs text-gray-500 font-medium"),a(s,"id","ai-translate-language"),a(s,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[0]===void 0&&It(()=>e[60].call(s)),a(l,"class","flex flex-col gap-1"),a(d,"for","ai-translate-prompt"),a(d,"class","text-xs text-gray-500 font-medium"),a(p,"id","ai-translate-prompt"),a(p,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[5]===void 0&&It(()=>e[62].call(p)),a(f,"class","flex flex-col gap-1"),a(y,"class","text-xs text-gray-500 font-medium"),a(y,"aria-hidden","true"),a(C,"type","checkbox"),a(C,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(k,"class","flex items-center gap-2 text-sm text-gray-600 cursor-pointer"),a(m,"class","flex flex-col gap-1 justify-end"),a(M,"class","flex-1"),a(I,"class","text-xs text-gray-500 font-medium"),a(I,"aria-hidden","true"),a(T,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"),T.disabled=Z=e[1].size===0||!e[5]||e[18]||e[25],a(V,"class","px-4 py-2 bg-green-600 text-white text-sm rounded-md hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"),V.disabled=B=!e[5]||e[25]||e[27]==null||e[26]==null||e[27]===0&&e[26]===0,a(F,"class","flex items-center gap-2"),a(L,"class","flex flex-col gap-1 justify-end"),a(r,"class","flex flex-wrap items-center gap-3 mb-4 p-4 bg-white border border-gray-200 rounded-lg"),a(ve,"type","text"),a(ve,"placeholder","Search approved keys…"),a(ve,"class","w-full pl-8 pr-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(le,"class","absolute left-2.5 top-2.5 text-gray-400 flex items-center"),a(be,"class","flex-1 relative"),ne.__value="all",Ie(ne,ne.__value),Ae.__value="translated",Ie(Ae,Ae.__value),A.__value="untranslated",Ie(A,A.__value),a(ae,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[20]===void 0&&It(()=>e[68].call(ae)),a(X,"class","text-xs text-gray-400"),a(q,"class","flex items-center gap-3 mb-3")},m(_e,Me){Xt(t,_e,Me),R(_e,n,Me),R(_e,r,Me),u(r,l),u(l,o),u(l,i),u(l,s);for(let Ce=0;Ce<Te.length;Ce+=1)Te[Ce]&&Te[Ce].m(s,null);vt(s,e[0],!0),u(r,c),u(r,f),u(f,d),u(f,h),u(f,p),ge&&ge.m(p,null),u(p,g);for(let Ce=0;Ce<Fe.length;Ce+=1)Fe[Ce]&&Fe[Ce].m(p,null);vt(p,e[5],!0),u(r,_),u(r,m),u(m,y),u(m,v),u(m,k),u(k,C),C.checked=e[17],u(k,x),u(r,S),u(r,M),u(r,N),u(r,L),u(L,I),u(L,P),u(L,F),u(F,T),oe&&oe.m(T,null),u(T,z),u(T,D),u(T,J),u(F,$),u(F,V),Pe.m(V,null),u(V,se),R(_e,W,Me),Ye&&Ye.m(_e,Me),R(_e,K,Me),et&&et.m(_e,Me),R(_e,te,Me),R(_e,q,Me),u(q,be),u(be,ve),Ie(ve,e[19]),u(be,Ne),u(be,le),u(q,me),u(q,ae),u(ae,ne),u(ae,Ae),u(ae,A),vt(ae,e[20],!0),u(q,re),u(q,X),u(X,H),u(X,U),R(_e,Y,Me),we[ie].m(_e,Me),R(_e,G,Me),ce=!0,ke||(he=[Q(s,"change",e[60]),Q(s,"change",e[61]),Q(p,"change",e[62]),Q(C,"change",e[63]),Q(T,"click",e[64]),Q(V,"click",e[65]),Q(ve,"input",e[67]),Q(ve,"input",e[44]),Q(ae,"change",e[68]),Q(ae,"change",e[69])],ke=!0)},p(_e,Me){const Ce={};if(Me[0]&2048&&(Ce.jobs=_e[11]),t.$set(Ce),Me[0]&8192){xe=Oe(_e[13]);let pe;for(pe=0;pe<xe.length;pe+=1){const qe=$s(_e,xe,pe);Te[pe]?Te[pe].p(qe,Me):(Te[pe]=sa(qe),Te[pe].c(),Te[pe].m(s,null))}for(;pe<Te.length;pe+=1)Te[pe].d(1);Te.length=xe.length}if(Me[0]&8193&&vt(s,_e[0]),_e[4].length===0?ge||(ge=aa(),ge.c(),ge.m(p,g)):ge&&(ge.d(1),ge=null),Me[0]&16){je=Oe(_e[4]);let pe;for(pe=0;pe<je.length;pe+=1){const qe=Qs(_e,je,pe);Fe[pe]?Fe[pe].p(qe,Me):(Fe[pe]=ua(qe),Fe[pe].c(),Fe[pe].m(p,null))}for(;pe<Fe.length;pe+=1)Fe[pe].d(1);Fe.length=je.length}Me[0]&48&&vt(p,_e[5]),Me[0]&131072&&(C.checked=_e[17]),_e[18]&&_e[29]==="selected"?oe||(oe=ca(),oe.c(),oe.m(T,z)):oe&&(oe.d(1),oe=null),(!ce||Me[0]&2)&&w!==(w=_e[1].size+"")&&ee(D,w),(!ce||Me[0]&33816626&&Z!==(Z=_e[1].size===0||!_e[5]||_e[18]||_e[25]))&&(T.disabled=Z),Le!==(Le=ze(_e))&&(Pe.d(1),Pe=Le(_e),Pe&&(Pe.c(),Pe.m(V,se))),(!ce||Me[0]&234881072&&B!==(B=!_e[5]||_e[25]||_e[27]==null||_e[26]==null||_e[27]===0&&_e[26]===0))&&(V.disabled=B),_e[28]?Ye?Ye.p(_e,Me):(Ye=fa(_e),Ye.c(),Ye.m(K.parentNode,K)):Ye&&(Ye.d(1),Ye=null),_e[24]?et?et.p(_e,Me):(et=ha(_e),et.c(),et.m(te.parentNode,te)):et&&(et.d(1),et=null),Me[0]&524288&&ve.value!==_e[19]&&Ie(ve,_e[19]),Me[0]&1048576&&vt(ae,_e[20]),(!ce||Me[0]&8)&&ee(H,_e[3]);let Ve=ie;ie=Ue(_e),ie===Ve?we[ie].p(_e,Me):(Gt(),ct(we[Ve],1,1,()=>{we[Ve]=null}),Kt(),ue=we[ie],ue?ue.p(_e,Me):(ue=we[ie]=$e[ie](_e),ue.c()),st(ue,1),ue.m(G.parentNode,G))},i(_e){ce||(st(t.$$.fragment,_e),st(ue),ce=!0)},o(_e){ct(t.$$.fragment,_e),ct(ue),ce=!1},d(_e){_e&&(j(n),j(r),j(W),j(K),j(te),j(q),j(Y),j(G)),Qt(t,_e),ft(Te,_e),ge&&ge.d(),ft(Fe,_e),oe&&oe.d(),Pe.d(),Ye&&Ye.d(_e),et&&et.d(_e),we[ie].d(_e),ke=!1,lt(he)}}}function e0(e){let t,n,r,l,o,i=Oe(e[12]),s=[];for(let c=0;c<i.length;c+=1)s[c]=na(Gs(e,i,c));return{c(){t=b("div"),n=b("table"),r=b("thead"),r.innerHTML='<tr class="bg-gray-50 border-b border-gray-200"><th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Status</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Job ID</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Prompt</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Language</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Progress</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Started</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Finished</th></tr>',l=E(),o=b("tbody");for(let c=0;c<s.length;c+=1)s[c].c();a(n,"class","w-full"),a(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(c,f){R(c,t,f),u(t,n),u(n,r),u(n,l),u(n,o);for(let d=0;d<s.length;d+=1)s[d]&&s[d].m(o,null)},p(c,f){if(f[0]&4096|f[1]&67108864){i=Oe(c[12]);let d;for(d=0;d<i.length;d+=1){const h=Gs(c,i,d);s[d]?s[d].p(h,f):(s[d]=na(h),s[d].c(),s[d].m(o,null))}for(;d<s.length;d+=1)s[d].d(1);s.length=i.length}},d(c){c&&j(t),ft(s,c)}}}function t0(e){let t;return{c(){t=b("div"),t.innerHTML="<p>No translation jobs yet.</p>",a(t,"class","text-center py-12 text-gray-400")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function na(e){let t,n,r,l,o=e[57](e[118].status)+"",i,s=e[118].status+"",c,f,d,h,p=e[118].job_id+"",g,_,m,y=(e[118].prompt_name||"—")+"",v,k,C,x=e[118].lang+"",S,M,N,L=e[118].completed+"",I,P,F=e[118].total+"",T,z,w=e[118].failed+"",D,J,Z,$,V=In(e[118].created_at)+"",se,B,W,K=In(e[118].finished_at)+"",te,q;return{c(){t=b("tr"),n=b("td"),r=b("span"),l=new Cc(!1),i=E(),c=O(s),d=E(),h=b("td"),g=O(p),_=E(),m=b("td"),v=O(y),k=E(),C=b("td"),S=O(x),M=E(),N=b("td"),I=O(L),P=O("/"),T=O(F),z=O(" ("),D=O(w),J=O(" failed)"),Z=E(),$=b("td"),se=O(V),B=E(),W=b("td"),te=O(K),q=E(),l.a=i,a(r,"class",f=ba(e[118].status)+" text-sm font-medium inline-flex items-center gap-1"),a(n,"class","px-3 py-2"),a(h,"class","px-3 py-2 text-xs font-mono text-gray-500"),a(m,"class","px-3 py-2 text-sm text-gray-700"),a(C,"class","px-3 py-2 text-sm text-gray-600"),a(N,"class","px-3 py-2 text-sm text-gray-600"),a($,"class","px-3 py-2 text-xs text-gray-400"),a(W,"class","px-3 py-2 text-xs text-gray-400"),a(t,"class","border-b border-gray-100 hover:bg-gray-50")},m(be,ve){R(be,t,ve),u(t,n),u(n,r),l.m(o,r),u(r,i),u(r,c),u(t,d),u(t,h),u(h,g),u(t,_),u(t,m),u(m,v),u(t,k),u(t,C),u(C,S),u(t,M),u(t,N),u(N,I),u(N,P),u(N,T),u(N,z),u(N,D),u(N,J),u(t,Z),u(t,$),u($,se),u(t,B),u(t,W),u(W,te),u(t,q)},p(be,ve){ve[0]&4096&&o!==(o=be[57](be[118].status)+"")&&l.p(o),ve[0]&4096&&s!==(s=be[118].status+"")&&ee(c,s),ve[0]&4096&&f!==(f=ba(be[118].status)+" text-sm font-medium inline-flex items-center gap-1")&&a(r,"class",f),ve[0]&4096&&p!==(p=be[118].job_id+"")&&ee(g,p),ve[0]&4096&&y!==(y=(be[118].prompt_name||"—")+"")&&ee(v,y),ve[0]&4096&&x!==(x=be[118].lang+"")&&ee(S,x),ve[0]&4096&&L!==(L=be[118].completed+"")&&ee(I,L),ve[0]&4096&&F!==(F=be[118].total+"")&&ee(T,F),ve[0]&4096&&w!==(w=be[118].failed+"")&&ee(D,w),ve[0]&4096&&V!==(V=In(be[118].created_at)+"")&&ee(se,V),ve[0]&4096&&K!==(K=In(be[118].finished_at)+"")&&ee(te,K)},d(be){be&&j(t)}}}function ra(e){let t,n,r=e[6]?`Edit: ${e[6].name}`:"New Prompt Template",l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L,I,P=e[6]?"Update":"Create",F,T,z,w,D;return{c(){t=b("div"),n=b("h3"),l=O(r),o=E(),i=b("div"),s=b("div"),c=b("label"),c.textContent="Name",f=E(),d=b("input"),h=E(),p=b("div"),g=b("label"),_=O("Prompt "),m=b("span"),m.textContent="(use {{TARGET_LANGUAGE}}, {{CONTEXT}}, {{TEXT}} placeholders)",y=E(),v=b("textarea"),k=E(),C=b("div"),x=b("label"),x.textContent="System Message",S=E(),M=b("textarea"),N=E(),L=b("div"),I=b("button"),F=O(P),T=E(),z=b("button"),z.textContent="Cancel",a(n,"class","text-sm font-semibold text-gray-700 mb-3"),a(c,"for","prompt-name"),a(c,"class","block text-xs text-gray-500 font-medium mb-1"),a(d,"id","prompt-name"),a(d,"placeholder","e.g. Medical Translation, Marketing Copy…"),a(d,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(m,"class","text-gray-400"),a(g,"for","prompt-template"),a(g,"class","block text-xs text-gray-500 font-medium mb-1"),a(v,"id","prompt-template"),a(v,"rows","8"),a(v,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y"),a(x,"for","prompt-system-message"),a(x,"class","block text-xs text-gray-500 font-medium mb-1"),a(M,"id","prompt-system-message"),a(M,"rows","2"),a(M,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y"),a(I,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700"),a(z,"class","px-4 py-2 border border-gray-300 text-sm rounded-md hover:bg-gray-50"),a(L,"class","flex gap-2"),a(i,"class","space-y-3"),a(t,"class","mb-6 p-5 bg-white border border-indigo-200 rounded-lg shadow-sm")},m(J,Z){R(J,t,Z),u(t,n),u(n,l),u(t,o),u(t,i),u(i,s),u(s,c),u(s,f),u(s,d),Ie(d,e[8]),u(i,h),u(i,p),u(p,g),u(g,_),u(g,m),u(p,y),u(p,v),Ie(v,e[9]),u(i,k),u(i,C),u(C,x),u(C,S),u(C,M),Ie(M,e[10]),u(i,N),u(i,L),u(L,I),u(I,F),u(L,T),u(L,z),w||(D=[Q(d,"input",e[79]),Q(v,"input",e[80]),Q(M,"input",e[81]),Q(I,"click",e[38]),Q(z,"click",e[82])],w=!0)},p(J,Z){Z[0]&64&&r!==(r=J[6]?`Edit: ${J[6].name}`:"New Prompt Template")&&ee(l,r),Z[0]&256&&d.value!==J[8]&&Ie(d,J[8]),Z[0]&512&&Ie(v,J[9]),Z[0]&1024&&Ie(M,J[10]),Z[0]&64&&P!==(P=J[6]?"Update":"Create")&&ee(F,P)},d(J){J&&j(t),w=!1,lt(D)}}}function n0(e){let t,n=Oe(e[4]),r=[];for(let l=0;l<n.length;l+=1)r[l]=oa(Ks(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","space-y-3")},m(l,o){R(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o[0]&16|o[1]&320){n=Oe(l[4]);let i;for(i=0;i<n.length;i+=1){const s=Ks(l,n,i);r[i]?r[i].p(s,o):(r[i]=oa(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function r0(e){let t;return{c(){t=b("div"),t.innerHTML='<p>No prompt templates yet.</p> <p class="text-sm mt-1">Create one to start generating AI translations.</p>',a(t,"class","text-center py-12 text-gray-400")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function la(e){let t,n=In(e[110].updated_at)+"",r;return{c(){t=O("· Updated "),r=O(n)},m(l,o){R(l,t,o),R(l,r,o)},p(l,o){o[0]&16&&n!==(n=In(l[110].updated_at)+"")&&ee(r,n)},d(l){l&&(j(t),j(r))}}}function ia(e){let t,n,r,l=e[110].system_message.substring(0,150)+"",o,i=e[110].system_message.length>150?"…":"",s;return{c(){t=b("p"),n=b("b"),n.textContent="System:",r=E(),o=O(l),s=O(i),a(t,"class","mt-1 text-xs text-gray-400")},m(c,f){R(c,t,f),u(t,n),u(t,r),u(t,o),u(t,s)},p(c,f){f[0]&16&&l!==(l=c[110].system_message.substring(0,150)+"")&&ee(o,l),f[0]&16&&i!==(i=c[110].system_message.length>150?"…":"")&&ee(s,i)},d(c){c&&j(t)}}}function oa(e){let t,n,r,l,o,i=e[110].name+"",s,c,f,d,h=e[110].version+"",p,g,_,m,y=In(e[110].created_at)+"",v,k,C,x,S=e[110].prompt.substring(0,300)+"",M,N=e[110].prompt.length>300?"…":"",L,I,P,F,T,z,w,D,J,Z,$=e[110].updated_at&&e[110].updated_at!==e[110].created_at&&la(e),V=e[110].system_message&&ia(e);function se(){return e[83](e[110])}function B(){return e[84](e[110])}return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("div"),o=b("h4"),s=O(i),c=E(),f=b("span"),d=O("v"),p=O(h),g=E(),_=b("p"),m=O("Created "),v=O(y),k=E(),$&&$.c(),C=E(),x=b("pre"),M=O(S),L=O(N),I=E(),V&&V.c(),P=E(),F=b("div"),T=b("button"),T.textContent="Edit",z=E(),w=b("button"),w.textContent="Delete",D=E(),a(o,"class","font-medium text-gray-800"),a(f,"class","px-2 py-0.5 bg-gray-100 text-gray-500 text-xs rounded-full"),a(l,"class","flex items-center gap-2"),a(_,"class","text-xs text-gray-400 mt-1"),a(x,"class","mt-2 text-xs text-gray-500 bg-gray-50 p-2 rounded max-h-24 overflow-auto whitespace-pre-wrap"),a(r,"class","flex-1"),a(T,"class","px-3 py-1.5 text-xs border border-gray-300 rounded hover:bg-gray-50"),a(w,"class","px-3 py-1.5 text-xs text-red-600 border border-red-200 rounded hover:bg-red-50"),a(F,"class","flex items-center gap-2 ml-4 shrink-0"),a(n,"class","flex items-start justify-between"),a(t,"class","p-4 bg-white border border-gray-200 rounded-lg hover:border-indigo-200 transition-colors")},m(W,K){R(W,t,K),u(t,n),u(n,r),u(r,l),u(l,o),u(o,s),u(l,c),u(l,f),u(f,d),u(f,p),u(r,g),u(r,_),u(_,m),u(_,v),u(_,k),$&&$.m(_,null),u(r,C),u(r,x),u(x,M),u(x,L),u(r,I),V&&V.m(r,null),u(n,P),u(n,F),u(F,T),u(F,z),u(F,w),u(t,D),J||(Z=[Q(T,"click",se),Q(w,"click",B)],J=!0)},p(W,K){e=W,K[0]&16&&i!==(i=e[110].name+"")&&ee(s,i),K[0]&16&&h!==(h=e[110].version+"")&&ee(p,h),K[0]&16&&y!==(y=In(e[110].created_at)+"")&&ee(v,y),e[110].updated_at&&e[110].updated_at!==e[110].created_at?$?$.p(e,K):($=la(e),$.c(),$.m(_,null)):$&&($.d(1),$=null),K[0]&16&&S!==(S=e[110].prompt.substring(0,300)+"")&&ee(M,S),K[0]&16&&N!==(N=e[110].prompt.length>300?"…":"")&&ee(L,N),e[110].system_message?V?V.p(e,K):(V=ia(e),V.c(),V.m(r,null)):V&&(V.d(1),V=null)},d(W){W&&j(t),$&&$.d(),V&&V.d(),J=!1,lt(Z)}}}function sa(e){let t,n=(e[113].name||e[113].code||e[113])+"",r,l;return{c(){t=b("option"),r=O(n),t.__value=l=e[113].code||e[113],Ie(t,t.__value)},m(o,i){R(o,t,i),u(t,r)},p(o,i){i[0]&8192&&n!==(n=(o[113].name||o[113].code||o[113])+"")&&ee(r,n),i[0]&8192&&l!==(l=o[113].code||o[113])&&(t.__value=l,Ie(t,t.__value))},d(o){o&&j(t)}}}function aa(e){let t;return{c(){t=b("option"),t.textContent="— No prompts. Create one first. —",t.__value="",Ie(t,t.__value)},m(n,r){R(n,t,r)},d(n){n&&j(t)}}}function ua(e){let t,n=e[110].name+"",r,l,o=e[110].version+"",i,s,c;return{c(){t=b("option"),r=O(n),l=O(" (v"),i=O(o),s=O(")"),t.__value=c=e[110].id,Ie(t,t.__value)},m(f,d){R(f,t,d),u(t,r),u(t,l),u(t,i),u(t,s)},p(f,d){d[0]&16&&n!==(n=f[110].name+"")&&ee(r,n),d[0]&16&&o!==(o=f[110].version+"")&&ee(i,o),d[0]&16&&c!==(c=f[110].id)&&(t.__value=c,Ie(t,t.__value))},d(f){f&&j(t)}}}function ca(e){let t,n;return{c(){t=de("svg"),n=de("path"),a(n,"d","M21 12a9 9 0 1 1-6.219-8.56"),a(t,"class","animate-spin"),a(t,"width","14"),a(t,"height","14"),a(t,"viewBox","0 0 24 24"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2"),a(t,"stroke-linecap","round")},m(r,l){R(r,t,l),u(t,n)},d(r){r&&j(t)}}}function l0(e){let t,n,r,l;return{c(){t=de("svg"),n=de("circle"),r=de("line"),l=de("path"),a(n,"cx","12"),a(n,"cy","12"),a(n,"r","10"),a(r,"x1","2"),a(r,"y1","12"),a(r,"x2","22"),a(r,"y2","12"),a(l,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10A15.3 15.3 0 0 1 12 2z"),a(t,"width","14"),a(t,"height","14"),a(t,"viewBox","0 0 24 24"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2"),a(t,"stroke-linecap","round"),a(t,"stroke-linejoin","round")},m(o,i){R(o,t,i),u(t,n),u(t,r),u(t,l)},d(o){o&&j(t)}}}function i0(e){let t,n;return{c(){t=de("svg"),n=de("path"),a(n,"d","M21 12a9 9 0 1 1-6.219-8.56"),a(t,"class","animate-spin"),a(t,"width","14"),a(t,"height","14"),a(t,"viewBox","0 0 24 24"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2"),a(t,"stroke-linecap","round")},m(r,l){R(r,t,l),u(t,n)},d(r){r&&j(t)}}}function fa(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L,I,P,F=e[18]||e[25]?"Starting...":"Start Translation",T,z,w,D;function J(K,te){return K[30]?s0:o0}let Z=J(e),$=Z(e);function V(K,te){return K[32]?c0:(k==null&&(k=K[49]()!=null),k?u0:a0)}let se=V(e),B=se(e),W=e[31]&&da(e);return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("h3"),l.textContent=`${e[52]()}`,o=E(),i=b("button"),i.textContent="×",s=E(),c=b("div"),f=b("p"),f.textContent=`${e[53]()}`,d=E(),h=b("label"),p=b("input"),g=O(`
21
+ Include contexts`),_=E(),m=b("p"),$.c(),y=E(),v=b("p"),B.c(),C=E(),W&&W.c(),x=E(),S=b("div"),M=b("button"),N=O("Cancel"),I=E(),P=b("button"),T=O(F),a(l,"class","text-sm font-semibold text-gray-800"),a(i,"class","text-gray-400 hover:text-gray-700 text-lg leading-none"),a(r,"class","px-5 py-4 border-b border-gray-100 flex items-center justify-between"),a(f,"class","text-sm text-gray-700 break-words"),a(p,"type","checkbox"),a(p,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(h,"class","flex items-center gap-2 text-sm text-gray-700 cursor-pointer"),a(m,"class","text-xs text-gray-500"),a(v,"class","text-sm text-gray-700 font-medium"),a(c,"class","px-5 py-4 space-y-3"),a(M,"class","px-3 py-1.5 text-sm border border-gray-300 rounded-md hover:bg-gray-50"),M.disabled=L=e[18]||e[25],a(P,"class","px-3 py-1.5 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed"),P.disabled=z=!e[5]||e[18]||e[25]||e[49]()==null||e[49]()===0,a(S,"class","px-5 py-4 border-t border-gray-100 flex justify-end gap-2"),a(n,"class","w-full max-w-md rounded-xl bg-white shadow-2xl border border-gray-200"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),gt(t,"background","rgba(0,0,0,0.45)")},m(K,te){R(K,t,te),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(n,s),u(n,c),u(c,f),u(c,d),u(c,h),u(h,p),p.checked=e[30],u(h,g),u(c,_),u(c,m),$.m(m,null),u(c,y),u(c,v),B.m(v,null),u(c,C),W&&W.m(c,null),u(n,x),u(n,S),u(S,M),u(M,N),u(S,I),u(S,P),u(P,T),w||(D=[Q(i,"click",e[48]),Q(p,"change",e[66]),Q(p,"change",e[51]),Q(M,"click",e[48]),Q(P,"click",e[54]),Q(t,"click",Lr(e[48]))],w=!0)},p(K,te){te[0]&1073741824&&(p.checked=K[30]),Z!==(Z=J(K))&&($.d(1),$=Z(K),$&&($.c(),$.m(m,null))),se===(se=V(K))&&B?B.p(K,te):(B.d(1),B=se(K),B&&(B.c(),B.m(v,null))),K[31]?W?W.p(K,te):(W=da(K),W.c(),W.m(c,null)):W&&(W.d(1),W=null),te[0]&33816576&&L!==(L=K[18]||K[25])&&(M.disabled=L),te[0]&33816576&&F!==(F=K[18]||K[25]?"Starting...":"Start Translation")&&ee(T,F),te[0]&33816624&&z!==(z=!K[5]||K[18]||K[25]||K[49]()==null||K[49]()===0)&&(P.disabled=z)},d(K){K&&j(t),$.d(),B.d(),W&&W.d(),w=!1,lt(D)}}}function o0(e){let t;return{c(){t=O("Will translate master only (one approved key fallback each).")},m(n,r){R(n,t,r)},d(n){n&&j(t)}}}function s0(e){let t;return{c(){t=O("Will translate master + context pairs.")},m(n,r){R(n,t,r)},d(n){n&&j(t)}}}function a0(e){let t;return{c(){t=O("Loading count...")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function u0(e){let t=e[49]()+"",n,r,l=e[50]()+"",o,i;return{c(){n=O(t),r=E(),o=O(l),i=O(" to queue")},m(s,c){R(s,n,c),R(s,r,c),R(s,o,c),R(s,i,c)},p:Be,d(s){s&&(j(n),j(r),j(o),j(i))}}}function c0(e){let t;return{c(){t=O("Loading count...")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function da(e){let t,n;return{c(){t=b("p"),n=O(e[31]),a(t,"class","text-sm text-red-600")},m(r,l){R(r,t,l),u(t,n)},p(r,l){l[1]&1&&ee(n,r[31])},d(r){r&&j(t)}}}function ha(e){let t,n,r,l,o,i,s;return{c(){t=b("div"),n=b("div"),r=de("svg"),l=de("polyline"),o=E(),i=b("p"),s=O(e[23]),a(l,"points","20 6 9 17 4 12"),a(r,"class","w-5 h-5 text-green-600 flex-shrink-0"),a(r,"viewBox","0 0 24 24"),a(r,"fill","none"),a(r,"stroke","currentColor"),a(r,"stroke-width","2"),a(r,"stroke-linecap","round"),a(r,"stroke-linejoin","round"),a(i,"class","text-sm font-medium text-green-800"),a(n,"class","bg-green-50 border border-green-200 rounded-lg shadow-lg px-4 py-3 flex items-center gap-3 animate-in fade-in slide-in-from-bottom-2 duration-300"),a(t,"class","fixed bottom-4 right-4 z-50 max-w-sm")},m(c,f){R(c,t,f),u(t,n),u(n,r),u(r,l),u(n,o),u(n,i),u(i,s)},p(c,f){f[0]&8388608&&ee(s,c[23])},d(c){c&&j(t)}}}function f0(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k=[],C=new Map,x,S,M,N,L,I,P,F,T,z=Oe(e[14]);const w=J=>J[107].key;for(let J=0;J<z.length;J+=1){let Z=Xs(e,z,J),$=w(Z);C.set($,k[J]=ga($,Z))}let D=e[33]>1&&ma(e);return{c(){t=b("div"),n=b("table"),r=b("thead"),l=b("tr"),o=b("th"),i=b("input"),s=E(),c=b("th"),c.textContent="Key",f=E(),d=b("th"),d.textContent="Contexts",h=E(),p=b("th"),g=O("Translation ("),_=O(e[0]),m=O(")"),y=E(),v=b("tbody");for(let J=0;J<k.length;J+=1)k[J].c();x=E(),S=b("div"),M=b("p"),N=O(e[3]),L=O(" key(s)"),I=E(),D&&D.c(),a(i,"type","checkbox"),i.checked=e[15],a(i,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(o,"class","w-10 px-3 py-2.5"),a(c,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(d,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(p,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),a(l,"class","bg-gray-50 border-b border-gray-200"),a(n,"class","w-full"),a(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),a(M,"class","text-xs text-gray-400"),a(S,"class","flex items-center justify-between mt-3")},m(J,Z){R(J,t,Z),u(t,n),u(n,r),u(r,l),u(l,o),u(o,i),u(l,s),u(l,c),u(l,f),u(l,d),u(l,h),u(l,p),u(p,g),u(p,_),u(p,m),u(n,y),u(n,v);for(let $=0;$<k.length;$+=1)k[$]&&k[$].m(v,null);R(J,x,Z),R(J,S,Z),u(S,M),u(M,N),u(M,L),u(S,I),D&&D.m(S,null),P=!0,F||(T=Q(i,"change",e[43]),F=!0)},p(J,Z){(!P||Z[0]&32768)&&(i.checked=J[15]),(!P||Z[0]&1)&&ee(_,J[0]),Z[0]&33898528|Z[1]&118272&&(z=Oe(J[14]),Gt(),k=tl(k,Z,w,1,J,z,C,v,Ec,ga,null,Xs),Kt()),(!P||Z[0]&8)&&ee(N,J[3]),J[33]>1?D?D.p(J,Z):(D=ma(J),D.c(),D.m(S,null)):D&&(D.d(1),D=null)},i(J){if(!P){for(let Z=0;Z<z.length;Z+=1)st(k[Z]);P=!0}},o(J){for(let Z=0;Z<k.length;Z+=1)ct(k[Z]);P=!1},d(J){J&&(j(t),j(x),j(S));for(let Z=0;Z<k.length;Z+=1)k[Z].d();D&&D.d(),F=!1,T()}}}function d0(e){let t;return{c(){t=b("div"),t.innerHTML='<p>No approved items to generate translations for.</p> <p class="text-sm mt-1">Move items from Pending to Approved in the Translation Manager first.</p>',a(t,"class","text-center py-12 text-gray-400")},m(n,r){R(n,t,r)},p:Be,i:Be,o:Be,d(n){n&&j(t)}}}function pa(e){let t,n,r,l,o;return r=new Ic({props:{group:e[107],editable:!0,showAiAction:!0,aiBusy:!e[5]||e[18]||e[25],onAiAction:e[72],onSaveMasterValue:e[46],onSaveValue:e[45]}}),{c(){t=b("tr"),n=b("td"),rn(r.$$.fragment),l=E(),a(n,"colspan","4"),a(n,"class","px-4 py-3"),a(t,"class","bg-gray-50 border-b border-gray-200")},m(i,s){R(i,t,s),u(t,n),Xt(r,n,null),u(t,l),o=!0},p(i,s){const c={};s[0]&16384&&(c.group=i[107]),s[0]&33816608&&(c.aiBusy=!i[5]||i[18]||i[25]),r.$set(c)},i(i){o||(st(r.$$.fragment,i),o=!0)},o(i){ct(r.$$.fragment,i),o=!1},d(i){i&&j(t),Qt(r)}}}function ga(e,t){let n,r,l,o,i,s,c,f,d,h,p,g,_=t[107].key+"",m,y,v,k=t[107].total+"",C,x,S,M,N,L=t[107].total+"",I,P,F=t[107].total===1?"context":"contexts",T,z,w,D,J=t[107].translatedCount+"",Z,$,V=t[107].total+"",se,B,W,K,te,q,be,ve;function Ne(){return t[70](t[107])}function le(){return t[71](t[107])}let me=t[16]===t[107].key&&pa(t);return{key:e,first:null,c(){n=b("tr"),r=b("td"),l=b("input"),i=E(),s=b("td"),c=b("div"),f=de("svg"),d=de("path"),p=E(),g=b("span"),m=O(_),y=E(),v=b("span"),C=O(k),M=E(),N=b("td"),I=O(L),P=E(),T=O(F),z=E(),w=b("td"),D=b("span"),Z=O(J),$=O("/"),se=O(V),B=O(" translated"),K=E(),me&&me.c(),te=Ct(),a(l,"type","checkbox"),l.checked=o=t[41](t[107]),a(l,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),a(r,"class","px-3 py-2"),a(d,"fill-rule","evenodd"),a(d,"d","M7.293 4.293a1 1 0 011.414 0l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414-1.414L11.586 10 7.293 5.707a1 1 0 010-1.414z"),a(d,"clip-rule","evenodd"),a(f,"class",h="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[16]===t[107].key?"rotate-90":"")),a(f,"viewBox","0 0 20 20"),a(f,"fill","currentColor"),a(g,"class","truncate flex-1 min-w-0"),a(v,"class","shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded-full bg-indigo-50 text-indigo-600 border border-indigo-100"),a(v,"title",x=t[107].total+" context(s)"),a(c,"class","flex items-center gap-2 min-w-0"),a(s,"class","px-3 py-2 font-mono text-sm text-gray-700 max-w-[320px]"),a(s,"title",S=t[107].key),a(N,"class","px-3 py-2 text-sm text-gray-500 whitespace-nowrap"),a(D,"class","font-semibold"),a(w,"class","px-3 py-2 text-sm text-gray-700 whitespace-nowrap"),a(n,"class",W="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[16]===t[107].key?"bg-indigo-50":"")),this.first=n},m(ae,ne){R(ae,n,ne),u(n,r),u(r,l),u(n,i),u(n,s),u(s,c),u(c,f),u(f,d),u(c,p),u(c,g),u(g,m),u(c,y),u(c,v),u(v,C),u(n,M),u(n,N),u(N,I),u(N,P),u(N,T),u(n,z),u(n,w),u(w,D),u(D,Z),u(D,$),u(D,se),u(w,B),R(ae,K,ne),me&&me.m(ae,ne),R(ae,te,ne),q=!0,be||(ve=[Q(l,"change",Ne),Q(r,"click",nn(t[58])),Q(n,"click",le)],be=!0)},p(ae,ne){t=ae,(!q||ne[0]&16384&&o!==(o=t[41](t[107])))&&(l.checked=o),(!q||ne[0]&81920&&h!==(h="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[16]===t[107].key?"rotate-90":"")))&&a(f,"class",h),(!q||ne[0]&16384)&&_!==(_=t[107].key+"")&&ee(m,_),(!q||ne[0]&16384)&&k!==(k=t[107].total+"")&&ee(C,k),(!q||ne[0]&16384&&x!==(x=t[107].total+" context(s)"))&&a(v,"title",x),(!q||ne[0]&16384&&S!==(S=t[107].key))&&a(s,"title",S),(!q||ne[0]&16384)&&L!==(L=t[107].total+"")&&ee(I,L),(!q||ne[0]&16384)&&F!==(F=t[107].total===1?"context":"contexts")&&ee(T,F),(!q||ne[0]&16384)&&J!==(J=t[107].translatedCount+"")&&ee(Z,J),(!q||ne[0]&16384)&&V!==(V=t[107].total+"")&&ee(se,V),(!q||ne[0]&81920&&W!==(W="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[16]===t[107].key?"bg-indigo-50":"")))&&a(n,"class",W),t[16]===t[107].key?me?(me.p(t,ne),ne[0]&81920&&st(me,1)):(me=pa(t),me.c(),st(me,1),me.m(te.parentNode,te)):me&&(Gt(),ct(me,1,1,()=>{me=null}),Kt())},i(ae){q||(st(me),q=!0)},o(ae){ct(me),q=!1},d(ae){ae&&(j(n),j(K),j(te)),me&&me.d(ae),be=!1,lt(ve)}}}function ma(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L,I,P,F,T,z;return{c(){t=b("div"),n=b("button"),r=O("«"),o=E(),i=b("button"),s=O("‹"),f=E(),d=b("span"),h=O("Page "),p=O(e[22]),g=O(" of "),_=O(e[33]),m=E(),y=b("button"),v=O("›"),C=E(),x=b("button"),S=O("»"),N=E(),L=b("select"),I=b("option"),I.textContent="25 / page",P=b("option"),P.textContent="50 / page",F=b("option"),F.textContent="100 / page",a(n,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),n.disabled=l=e[22]<=1,a(i,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),i.disabled=c=e[22]<=1,a(d,"class","px-3 py-1 text-xs text-gray-600"),a(y,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),y.disabled=k=e[22]>=e[33],a(x,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),x.disabled=M=e[22]>=e[33],I.__value=25,Ie(I,I.__value),P.__value=50,Ie(P,P.__value),F.__value=100,Ie(F,F.__value),a(L,"class","ml-2 px-2 py-1 text-xs border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[2]===void 0&&It(()=>e[77].call(L)),a(t,"class","flex items-center gap-1")},m(w,D){R(w,t,D),u(t,n),u(n,r),u(t,o),u(t,i),u(i,s),u(t,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,_),u(t,m),u(t,y),u(y,v),u(t,C),u(t,x),u(x,S),u(t,N),u(t,L),u(L,I),u(L,P),u(L,F),vt(L,e[2],!0),T||(z=[Q(n,"click",e[73]),Q(i,"click",e[74]),Q(y,"click",e[75]),Q(x,"click",e[76]),Q(L,"change",e[77]),Q(L,"change",e[78])],T=!0)},p(w,D){D[0]&4194304&&l!==(l=w[22]<=1)&&(n.disabled=l),D[0]&4194304&&c!==(c=w[22]<=1)&&(i.disabled=c),D[0]&4194304&&ee(p,w[22]),D[1]&4&&ee(_,w[33]),D[0]&4194304|D[1]&4&&k!==(k=w[22]>=w[33])&&(y.disabled=k),D[0]&4194304|D[1]&4&&M!==(M=w[22]>=w[33])&&(x.disabled=M),D[0]&4&&vt(L,w[2])},d(w){w&&j(t),T=!1,lt(z)}}}function h0(e){let t,n,r,l,o,i,s=Oe([{id:"generate",label:"Generate Translations",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z" fill="#FFB833"/><path d="M19 14L20 16.5L22.5 17.5L20 18.5L19 21L18 18.5L15.5 17.5L18 16.5Z" fill="#F07040"/></svg>'},{id:"prompts",label:"Prompt Templates",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>'},{id:"log",label:"Job Log",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>'}]),c=[];for(let p=0;p<3;p+=1)c[p]=ta(ea(e,s,p));const f=[$d,Qd,Xd],d=[];function h(p,g){return p[21]==="generate"?0:p[21]==="prompts"?1:p[21]==="log"?2:-1}return~(l=h(e))&&(o=d[l]=f[l](e)),{c(){t=b("div"),n=b("div");for(let p=0;p<3;p+=1)c[p].c();r=E(),o&&o.c(),a(n,"class","flex items-center gap-1 mb-4 border-b border-gray-200")},m(p,g){R(p,t,g),u(t,n);for(let _=0;_<3;_+=1)c[_]&&c[_].m(n,null);u(t,r),~l&&d[l].m(t,null),i=!0},p(p,g){if(g[0]&2097152|g[1]&16){s=Oe([{id:"generate",label:"Generate Translations",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z" fill="#FFB833"/><path d="M19 14L20 16.5L22.5 17.5L20 18.5L19 21L18 18.5L15.5 17.5L18 16.5Z" fill="#F07040"/></svg>'},{id:"prompts",label:"Prompt Templates",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>'},{id:"log",label:"Job Log",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>'}]);let m;for(m=0;m<3;m+=1){const y=ea(p,s,m);c[m]?c[m].p(y,g):(c[m]=ta(y),c[m].c(),c[m].m(n,null))}for(;m<3;m+=1)c[m].d(1)}let _=l;l=h(p),l===_?~l&&d[l].p(p,g):(o&&(Gt(),ct(d[_],1,1,()=>{d[_]=null}),Kt()),~l?(o=d[l],o?o.p(p,g):(o=d[l]=f[l](p),o.c()),st(o,1),o.m(t,null)):o=null)},i(p){i||(st(o),i=!0)},o(p){ct(o),i=!1},d(p){p&&j(t),ft(c,p),~l&&d[l].d()}}}const p0="You are a professional translator. Provide only the translation without any explanations or additional text.";function _a(e,t){const n=(e==null?void 0:e.contexts)||[];return t==="word"?n.length>0?[n[0]]:[]:n}function ai(e,t){var r;if(!e)return[];if(t==="word"){if(e.master_key_id)return[e.master_key_id];const l=(r=_a(e,t)[0])==null?void 0:r.key_id;return l?[l]:[]}const n=new Set(_a(e,t).map(l=>l.key_id));return e.master_key_id&&n.add(e.master_key_id),[...n]}function In(e){return e?new Date(e).toLocaleString():"—"}function ba(e){switch(e){case"running":return"text-blue-600";case"completed":return"text-green-600";case"failed":return"text-red-600";case"cancelled":case"cancelling":return"text-yellow-600";default:return"text-gray-500"}}function g0(e,t,n){let r,l;Gr(e,an,Se=>n(90,l=Se));let o=[],i="",s=null,c=!1,f="",d="",h="",p=[],g=[],_=null,m="zh-Hans",y=[],v=[],k=new Set,C=!1,x=null,S=!1,M=!1,N="",L,I="all",P="generate",F=1,T=50,z=0,w="",D=!1,J;const Z=`Translate the following text to {{TARGET_LANGUAGE}}.
22
+
23
+ Instructions:
24
+ - Ensure translations sound natural and contextually appropriate.
25
+ - Preserve formatting, punctuation, and any placeholder tokens.
26
+ - If a direct translation doesn't exist, use a descriptive equivalent.
27
+ - The context below is a breadcrumb trail: relevance decreases from right to left. Prioritize the rightmost (nearest) context elements for disambiguation.
28
+ - Return ONLY the translation, no explanations.
29
+
30
+ Context: "{{CONTEXT}}"
31
+ Text to translate: "{{TEXT}}"`;Nr(async()=>{var Se;try{const Qe=JSON.parse(l.settings||"{}");(Se=Qe.languages)!=null&&Se.length&&n(13,y=Qe.languages)}catch{}y.length||n(13,y=[{code:"zh-Hans",name:"Chinese (Simplified)"},{code:"zh-Hant",name:"Chinese (Traditional)"},{code:"es",name:"Spanish"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"pt",name:"Portuguese"}]),y.length&&n(0,m=y[0].code||y[0]),await Promise.all([se(),B(),W(),K()]),$()}),Sc(()=>{V(),J&&clearTimeout(J)});function $(){_=setInterval(async()=>{await W(),p.some(Se=>Se.status==="running"||Se.status==="pending")&&await B()},2e3)}function V(){_&&clearInterval(_)}async function se(){const Se=await Ze("../api/prompts");n(4,o=await Se.json()),o.length&&!i&&n(5,i=o[0].id)}async function B(){const Se=new URLSearchParams({lang:m,status:"approved",page:F,limit:T});Se.set("group","key"),N.trim()&&Se.set("search",N.trim()),I==="translated"?Se.set("translated","yes"):I==="untranslated"&&Se.set("translated","no");const ot=await(await Ze(`../api/translations/all?${Se}`)).json();n(14,v=ot.groups||[]),n(3,z=ot.total);const wt=new Set(v.flatMap(Ut=>(Ut.contexts||[]).map(tr=>tr.key_id)));n(1,k=new Set([...k].filter(Ut=>wt.has(Ut)))),v.some(Ut=>Ut.key===x)||n(16,x=null)}async function W(){const Qe=await(await Ze("../api/ai-jobs")).json();n(11,p=Qe.jobs||[])}async function K(){const Se=await Ze("../api/ai-jobs/log");n(12,g=await Se.json())}function te(){n(6,s=null),n(8,f=""),n(9,d=Z),n(10,h=p0),n(7,c=!0)}function q(Se){n(6,s=Se),n(8,f=Se.name),n(9,d=Se.prompt),n(10,h=Se.system_message),n(7,c=!0)}async function be(){!f.trim()||!d.trim()||(await Ze("../api/prompts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:(s==null?void 0:s.id)||null,name:f.trim(),prompt:d,system_message:h})}),n(7,c=!1),n(6,s=null),await se())}async function ve(Se){confirm("Delete this prompt template?")&&(await Ze(`../api/prompts/${encodeURIComponent(Se)}`,{method:"DELETE"}),i===Se&&n(5,i=""),await se())}function Ne(){return[...new Set(v.flatMap(Se=>(Se.contexts||[]).map(Qe=>Qe.key_id)))]}function le(Se){if(Se==="context"){const Qe=new Set(k);for(const ot of v)(ot.contexts||[]).some(wt=>k.has(wt.key_id))&&ot.master_key_id&&Qe.add(ot.master_key_id);return[...Qe]}return v.filter(Qe=>(Qe.contexts||[]).some(ot=>k.has(ot.key_id))).map(Qe=>ai(Qe,"word")[0]).filter(Boolean)}function me(Se){const Qe=(Se.contexts||[]).map(wt=>wt.key_id);if(Qe.length===0)return;Qe.every(wt=>k.has(wt))?Qe.forEach(wt=>k.delete(wt)):Qe.forEach(wt=>k.add(wt)),n(1,k=new Set(k))}function ae(Se){const Qe=(Se.contexts||[]).map(ot=>ot.key_id);return Qe.length>0&&Qe.every(ot=>k.has(ot))}function ne(Se){n(16,x=x===Se.key?null:Se.key)}function Ae(){const Se=Ne();if(Se.length>0&&Se.every(ot=>k.has(ot))){Se.forEach(ot=>k.delete(ot)),n(1,k=new Set(k));return}Se.forEach(ot=>k.add(ot)),n(1,k=new Set(k))}function A(){clearTimeout(L),L=setTimeout(()=>{n(22,F=1),B()},300)}function re(Se){const Qe=Se.contexts||[],ot=Qe.filter(Ft=>Ft.value!=null&&Ft.value!=="").length,wt=Se.master_value!=null&&Se.master_value!=="";Se.translatedCount=wt?Qe.length:ot,n(14,v=[...v])}async function X(Se,Qe){await Ze("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:m,translations:[{key:Se.key,context:Se.context||"",value:Se.value||""}]})}),re(Qe)}async function H(Se){const Qe=Se.master_value||"";await Ze("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:Se.key,context:"",status:"approved"})}),await Ze("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:m,translations:[{key:Se.key,context:"",value:Qe}]})}),re(Se)}let U=!1,Y=null,ie=null,ue=!1,G="selected",ce=null,ke=!0,he="",xe=null,Te=!1;async function ge(Se){return(await(await Ze(`../api/textnodes/untranslated-ids?lang=${encodeURIComponent(m)}&mode=${Se}`)).json()).total||0}async function je(){if(G==="all"){n(32,Te=!0);try{xe=await ge(Ye())}catch{xe=null}finally{n(32,Te=!1)}}}async function Fe(){try{const[Se,Qe]=await Promise.all([ge("word"),ge("context")]);n(26,Y=Se),n(27,ie=Qe)}catch{n(26,Y=null),n(27,ie=null)}}async function oe(Se){n(25,U=!0);try{const ot=await(await Ze(`../api/textnodes/untranslated-ids?lang=${encodeURIComponent(m)}&mode=${Se}`)).json();if(!ot.ids||ot.ids.length===0)return{ok:!1,error:"No items to queue."};const Ft=await(await Ze("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:ot.ids,lang:m,prompt_id:i,include_screenshots:S,mode:Se})})).json();return Ft.error?{ok:!1,error:Ft.error}:{ok:!0}}finally{n(25,U=!1)}}function ze(Se,Qe=null){n(29,G=Se),ce=Qe,n(30,ke=!0),xe=null,n(31,he=""),n(28,ue=!0),Se==="all"&&je()}function Le(){M||U||Pe()}function Pe(){n(28,ue=!1),n(31,he=""),ce=null}function Ye(){return ke?"context":"word"}function et(){const Se=Ye();return G==="all"?xe??(Se==="context"?ie:Y):G==="group"?ce?ai(ce,Se).length:0:le(Se).length}function $e(){return Ye()==="context"?"master + context pairs":"approved keys"}function we(){G==="all"&&je()}function Ue(){return G==="all"?"Translate All":G==="group"?"AI Translate Group":"Generate Selected"}function _e(){return G==="group"&&ce?ce.key:G==="selected"?`${k.size} selected row(s)`:"Queue translations for all untranslated approved items."}async function Me(){await Promise.allSettled([W(),K(),Fe(),B()])}async function Ce(){if(!i){n(31,he="Select a prompt template first.");return}const Se=Ye();if(!et()){n(31,he="No items to queue.");return}n(18,M=!0),n(31,he="");try{let ot;if(G==="all")ot=await oe(Se);else{const wt=G==="group"?ai(ce,Se):le(Se),Ft=await Ze("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:wt,lang:m,prompt_id:i,include_screenshots:S,mode:Se})}),Ut=await Ft.json();!Ft.ok||Ut.error?ot={ok:!1,error:Ut.error||`Failed to queue job (HTTP ${Ft.status})`}:(G==="selected"&&n(1,k=new Set),n(16,x=null),ot={ok:!0})}if(ot!=null&&ot.ok){Pe(),n(23,w="Translation job queued successfully!"),n(24,D=!0),J&&clearTimeout(J),J=setTimeout(()=>{n(24,D=!1)},3500),Me();return}ot!=null&&ot.error&&n(31,he=ot.error)}finally{n(18,M=!1)}}async function Ve(Se){await Ze(`../api/ai-jobs/${encodeURIComponent(Se)}`,{method:"DELETE"}),await W()}function pe(Se){n(11,p=p.filter(Qe=>Qe.id!==Se))}const qe={pending:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',running:'<svg class="animate-spin" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#3A8FE0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',completed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#2ECC88" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',failed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',cancelled:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',cancelling:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>'};function Ke(Se){return qe[Se]??'<span class="text-gray-400">&mdash;</span>'}function bt(Se){wr.call(this,e,Se)}const jt=Se=>{n(21,P=Se.id),Se.id==="log"&&K()};function Et(){m=tn(this),n(0,m),n(13,y)}const Rt=()=>{n(22,F=1),B()};function Bt(){i=tn(this),n(5,i),n(4,o)}function Dt(){S=this.checked,n(17,S)}const ye=()=>ze("selected"),He=()=>ze("all");function Je(){ke=this.checked,n(30,ke)}function at(){N=this.value,n(19,N)}function kt(){I=tn(this),n(20,I)}const _t=()=>{n(22,F=1),B()},ut=Se=>me(Se),mt=Se=>ne(Se),nt=Se=>ze("group",Se),We=()=>{n(22,F=1),B()},Re=()=>{n(22,F--,F),B()},Xe=()=>{n(22,F++,F),B()},At=()=>{n(22,F=r),B()};function it(){T=tn(this),n(2,T)}const Mn=()=>{n(22,F=1),B()};function En(){f=this.value,n(8,f)}function Fn(){d=this.value,n(9,d)}function er(){h=this.value,n(10,h)}const Lt=()=>{n(7,c=!1),n(6,s=null)},pn=Se=>q(Se),Ln=Se=>ve(Se.id);return e.$$.update=()=>{if(e.$$.dirty[0]&12&&n(33,r=Math.max(1,Math.ceil(z/T))),e.$$.dirty[0]&1&&m&&Fe(),e.$$.dirty[0]&2){const Se=Ne();n(15,C=Se.length>0&&Se.every(Qe=>k.has(Qe)))}},[m,k,T,z,o,i,s,c,f,d,h,p,g,y,v,C,x,S,M,N,I,P,F,w,D,U,Y,ie,ue,G,ke,he,Te,r,B,K,te,q,be,ve,me,ae,ne,Ae,A,X,H,ze,Le,et,$e,we,Ue,_e,Ce,Ve,pe,Ke,bt,jt,Et,Rt,Bt,Dt,ye,He,Je,at,kt,_t,ut,mt,nt,We,Re,Xe,At,it,Mn,En,Fn,er,Lt,pn,Ln]}class m0 extends sn{constructor(t){super(),on(this,t,g0,h0,$t,{},null,[-1,-1,-1,-1])}}function ya(e,t,n){const r=e.slice();return r[71]=t[n],r[72]=t,r[73]=n,r}function va(e,t,n){const r=e.slice();return r[74]=t[n],r}function ka(e,t,n){const r=e.slice();return r[74]=t[n],r}function wa(e,t,n){const r=e.slice();return r[79]=t[n],r}function xa(e,t,n){const r=e.slice();return r[82]=t[n],r}function _0(e){let t,n,r;return{c(){t=b("input"),a(t,"id","bluehive-api-key"),a(t,"type","password"),a(t,"class","w-full px-3 py-2 pr-10 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"),a(t,"placeholder","sk_...")},m(l,o){R(l,t,o),Ie(t,e[4]),n||(r=Q(t,"input",e[50]),n=!0)},p(l,o){o[0]&16&&t.value!==l[4]&&Ie(t,l[4])},d(l){l&&j(t),n=!1,r()}}}function b0(e){let t,n,r;return{c(){t=b("input"),a(t,"id","bluehive-api-key"),a(t,"type","text"),a(t,"class","w-full px-3 py-2 pr-10 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"),a(t,"placeholder","sk_...")},m(l,o){R(l,t,o),Ie(t,e[4]),n||(r=Q(t,"input",e[49]),n=!0)},p(l,o){o[0]&16&&t.value!==l[4]&&Ie(t,l[4])},d(l){l&&j(t),n=!1,r()}}}function Ca(e){let t,n,r,l=e[82].name+"",o,i,s,c,f=e[82].code+"",d,h,p,g,_,m,y;function v(){return e[53](e[82])}return{c(){t=b("div"),n=b("div"),r=b("span"),o=O(l),i=E(),s=b("span"),c=O("("),d=O(f),h=O(")"),p=E(),g=b("button"),g.textContent="✕",_=E(),a(r,"class","text-gray-700"),a(s,"class","text-gray-400 text-xs"),a(n,"class","flex items-center gap-2"),a(g,"class","text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50"),a(g,"title","Remove language"),a(t,"class","flex items-center justify-between px-3 py-2 rounded-md hover:bg-gray-50 text-sm")},m(k,C){R(k,t,C),u(t,n),u(n,r),u(r,o),u(n,i),u(n,s),u(s,c),u(s,d),u(s,h),u(t,p),u(t,g),u(t,_),m||(y=Q(g,"click",v),m=!0)},p(k,C){e=k,C[0]&128&&l!==(l=e[82].name+"")&&ee(o,l),C[0]&128&&f!==(f=e[82].code+"")&&ee(d,f)},d(k){k&&j(t),m=!1,y()}}}function Sa(e){let t;return{c(){t=b("p"),t.textContent="No languages configured. Add one below.",a(t,"class","text-sm text-gray-400 mb-3")},m(n,r){R(n,t,r)},d(n){n&&j(t)}}}function y0(e){let t,n,r,l,o;return{c(){t=de("svg"),n=de("path"),r=de("polyline"),l=de("polyline"),o=O(`
32
+ Create Backup`),a(n,"d","M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"),a(r,"points","17 21 17 13 7 13 7 21"),a(l,"points","7 3 7 8 15 8"),a(t,"width","14"),a(t,"height","14"),a(t,"viewBox","0 0 24 24"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2"),a(t,"stroke-linecap","round"),a(t,"stroke-linejoin","round")},m(i,s){R(i,t,s),u(t,n),u(t,r),u(t,l),R(i,o,s)},d(i){i&&(j(t),j(o))}}}function v0(e){let t,n,r;return{c(){t=de("svg"),n=de("path"),r=O(`
33
+ Creating…`),a(n,"d","M12 2v4m0 12v4m-7.07-3.93l2.83-2.83m8.48-8.48l2.83-2.83M2 12h4m12 0h4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83"),a(t,"class","animate-spin"),a(t,"width","14"),a(t,"height","14"),a(t,"viewBox","0 0 24 24"),a(t,"fill","none"),a(t,"stroke","currentColor"),a(t,"stroke-width","2")},m(l,o){R(l,t,o),u(t,n),R(l,r,o)},d(l){l&&(j(t),j(r))}}}function Aa(e){let t,n,r;return{c(){t=b("button"),t.textContent="Load existing backups",a(t,"class","text-xs text-indigo-600 hover:text-indigo-800 hover:underline")},m(l,o){R(l,t,o),n||(r=Q(t,"click",e[43]),n=!0)},p:Be,d(l){l&&j(t),n=!1,r()}}}function k0(e){let t,n=Oe(e[18]),r=[];for(let l=0;l<n.length;l+=1)r[l]=Ta(wa(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","border border-gray-200 rounded-md divide-y divide-gray-100 max-h-64 overflow-y-auto")},m(l,o){R(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o[0]&2359296|o[1]&16384){n=Oe(l[18]);let i;for(i=0;i<n.length;i+=1){const s=wa(l,n,i);r[i]?r[i].p(s,o):(r[i]=Ta(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function w0(e){let t;return{c(){t=b("div"),t.innerHTML='<svg class="animate-spin" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2"><circle cx="12" cy="12" r="10" opacity="0.25"></circle><path d="M12 2a10 10 0 019.5 7" stroke-linecap="round"></path></svg>',a(t,"class","flex justify-center py-4")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function Ta(e){let t,n,r,l=e[79].filename+"",o,i,s,c=ja(e[79].created)+"",f,d,h=Oa(e[79].size)+"",p,g,_,m,y,v,k,C,x,S,M;function N(){return e[56](e[79])}return{c(){t=b("div"),n=b("div"),r=b("div"),o=O(l),i=E(),s=b("div"),f=O(c),d=O(" · "),p=O(h),g=E(),_=b("div"),m=b("button"),y=de("svg"),v=de("polyline"),k=de("path"),x=E(),a(r,"class","text-gray-700 font-mono text-xs truncate"),a(s,"class","text-gray-400 text-xs mt-0.5"),a(n,"class","flex-1 min-w-0"),a(v,"points","3 6 5 6 21 6"),a(k,"d","M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"),a(y,"width","14"),a(y,"height","14"),a(y,"viewBox","0 0 24 24"),a(y,"fill","none"),a(y,"stroke","currentColor"),a(y,"stroke-width","2"),a(y,"stroke-linecap","round"),a(y,"stroke-linejoin","round"),a(m,"class","px-2 py-1 text-xs rounded border border-gray-200 text-gray-400 hover:text-red-500 hover:border-red-300 hover:bg-red-50 disabled:opacity-50"),m.disabled=C=e[21]===e[79].filename,a(m,"title","Delete this backup"),a(_,"class","flex items-center gap-1.5 ml-3 shrink-0"),a(t,"class","flex items-center justify-between px-3 py-2.5 hover:bg-gray-50 text-sm")},m(L,I){R(L,t,I),u(t,n),u(n,r),u(r,o),u(n,i),u(n,s),u(s,f),u(s,d),u(s,p),u(t,g),u(t,_),u(_,m),u(m,y),u(y,v),u(y,k),u(t,x),S||(M=Q(m,"click",N),S=!0)},p(L,I){e=L,I[0]&262144&&l!==(l=e[79].filename+"")&&ee(o,l),I[0]&262144&&c!==(c=ja(e[79].created)+"")&&ee(f,c),I[0]&262144&&h!==(h=Oa(e[79].size)+"")&&ee(p,h),I[0]&2359296&&C!==(C=e[21]===e[79].filename)&&(m.disabled=C)},d(L){L&&j(t),S=!1,M()}}}function Ma(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C=e[13]>0&&Ea(e),x=Oe(e[27]),S=[];for(let M=0;M<x.length;M+=1)S[M]=Ia(ya(e,x,M));return{c(){t=b("div"),n=b("div"),r=b("h4"),r.textContent="Context Depth",l=E(),o=b("p"),o.textContent=`How many ancestor levels to walk when building the context breadcrumb.
34
+ Unlimited walks to the document root; a limit keeps context focused on nearby elements.`,i=E(),s=b("div"),c=b("button"),f=O("∞ Unlimited"),h=E(),p=b("button"),g=O("Limit depth"),m=E(),C&&C.c(),y=E();for(let M=0;M<S.length;M+=1)S[M].c();a(r,"class","text-sm font-medium text-gray-700 mb-1"),a(o,"class","text-xs text-gray-400 mb-3"),a(c,"class",d="px-3 py-1.5 rounded-l-md text-xs font-medium border transition-colors "+(e[13]===0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50")),a(p,"class",_="px-3 py-1.5 rounded-r-md text-xs font-medium border border-l-0 transition-colors "+(e[13]>0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50")),a(s,"class","flex items-center gap-2 mb-2"),a(t,"class","mt-4 space-y-6 border-t border-gray-100 pt-4")},m(M,N){R(M,t,N),u(t,n),u(n,r),u(n,l),u(n,o),u(n,i),u(n,s),u(s,c),u(c,f),u(s,h),u(s,p),u(p,g),u(n,m),C&&C.m(n,null),u(t,y);for(let L=0;L<S.length;L+=1)S[L]&&S[L].m(t,null);v||(k=[Q(c,"click",e[58]),Q(p,"click",e[59])],v=!0)},p(M,N){if(N[0]&8192&&d!==(d="px-3 py-1.5 rounded-l-md text-xs font-medium border transition-colors "+(M[13]===0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"))&&a(c,"class",d),N[0]&8192&&_!==(_="px-3 py-1.5 rounded-r-md text-xs font-medium border border-l-0 transition-colors "+(M[13]>0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"))&&a(p,"class",_),M[13]>0?C?C.p(M,N):(C=Ea(M),C.c(),C.m(n,null)):C&&(C.d(1),C=null),N[0]&201332736|N[1]&240){x=Oe(M[27]);let L;for(L=0;L<x.length;L+=1){const I=ya(M,x,L);S[L]?S[L].p(I,N):(S[L]=Ia(I),S[L].c(),S[L].m(t,null))}for(;L<S.length;L+=1)S[L].d(1);S.length=x.length}},d(M){M&&j(t),C&&C.d(),ft(S,M),v=!1,lt(k)}}}function Ea(e){let t,n,r,l,o,i,s,c,f,d,h,p;return{c(){t=b("div"),n=b("button"),r=O("−"),o=E(),i=b("input"),s=E(),c=b("button"),c.textContent="+",f=E(),d=b("span"),d.textContent="ancestor levels",a(n,"class","w-7 h-7 flex items-center justify-center rounded bg-white border border-gray-300 text-gray-600 hover:bg-gray-100 font-bold text-sm disabled:opacity-30"),n.disabled=l=e[13]<=1,a(i,"type","number"),a(i,"min","1"),a(i,"max","99"),a(i,"class","w-14 text-center text-sm font-mono border border-gray-300 rounded-md py-1 bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300"),a(c,"class","w-7 h-7 flex items-center justify-center rounded bg-white border border-gray-300 text-gray-600 hover:bg-gray-100 font-bold text-sm"),a(d,"class","text-xs text-gray-500 ml-2"),a(t,"class","flex items-center gap-2 mt-2 p-3 bg-gray-50 rounded-lg border border-gray-200")},m(g,_){R(g,t,_),u(t,n),u(n,r),u(t,o),u(t,i),Ie(i,e[13]),u(t,s),u(t,c),u(t,f),u(t,d),h||(p=[Q(n,"click",e[60]),Q(i,"input",e[61]),Q(i,"change",e[34]),Q(c,"click",e[62])],h=!0)},p(g,_){_[0]&8192&&l!==(l=g[13]<=1)&&(n.disabled=l),_[0]&8192&&xc(i.value)!==g[13]&&Ie(i,g[13])},d(g){g&&j(t),h=!1,lt(p)}}}function La(e){let t,n=e[74]+"",r,l,o;function i(){return e[63](e[71],e[74])}return{c(){t=b("button"),r=O(n),a(t,"class","px-2 py-1 rounded border text-xs transition-colors "+(e[38](e[71].key,e[74])?"bg-indigo-50 border-indigo-300 text-indigo-700":"bg-gray-100 border-gray-200 text-gray-400 line-through")),a(t,"title",e[38](e[71].key,e[74])?"Click to disable":"Click to enable")},m(s,c){R(s,t,c),u(t,r),l||(o=Q(t,"click",i),l=!0)},p(s,c){e=s},d(s){s&&j(t),l=!1,o()}}}function Na(e){let t,n=Oe(e[11][e[71].key].custom),r=[];for(let l=0;l<n.length;l+=1)r[l]=za(va(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","flex flex-wrap gap-1.5 mb-2")},m(l,o){R(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o[0]&134219776|o[1]&64){n=Oe(l[11][l[71].key].custom);let i;for(i=0;i<n.length;i+=1){const s=va(l,n,i);r[i]?r[i].p(s,o):(r[i]=za(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function za(e){let t,n=e[74]+"",r,l,o,i,s,c;function f(){return e[64](e[71],e[74])}return{c(){t=b("span"),r=O(n),l=E(),o=b("button"),o.textContent="✕",i=E(),a(o,"class","hover:text-red-500"),a(t,"class","inline-flex items-center gap-1 px-2 py-1 rounded border border-green-300 bg-green-50 text-green-700 text-xs")},m(d,h){R(d,t,h),u(t,r),u(t,l),u(t,o),u(t,i),s||(c=Q(o,"click",f),s=!0)},p(d,h){e=d,h[0]&2048&&n!==(n=e[74]+"")&&ee(r,n)},d(d){d&&j(t),s=!1,c()}}}function Ia(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k=Oe(e[26][e[71].key]),C=[];for(let L=0;L<k.length;L+=1)C[L]=La(ka(e,k,L));let x=e[11][e[71].key].custom.length>0&&Na(e);function S(){e[65].call(d,e[71])}function M(...L){return e[66](e[71],...L)}function N(){return e[67](e[71])}return{c(){var L;t=b("div"),n=b("h4"),n.textContent=`${e[71].title}`,r=E(),l=b("p"),l.textContent=`${e[71].desc}`,o=E(),i=b("div");for(let I=0;I<C.length;I+=1)C[I].c();s=E(),x&&x.c(),c=E(),f=b("div"),d=b("input"),h=E(),p=b("button"),g=O("Add"),m=E(),a(n,"class","text-sm font-medium text-gray-700 mb-1"),a(l,"class","text-xs text-gray-400 mb-2"),a(i,"class","flex flex-wrap gap-1.5 mb-2"),a(d,"class","flex-1 px-2 py-1.5 border border-gray-300 rounded-md text-xs focus:outline-none focus:ring-1 focus:ring-indigo-500"),a(d,"placeholder",e[71].placeholder),a(p,"class","px-3 py-1.5 bg-indigo-600 text-white text-xs rounded-md hover:bg-indigo-700 disabled:opacity-50"),p.disabled=_=!((L=e[12][e[71].key])!=null&&L.trim()),a(f,"class","flex gap-2")},m(L,I){R(L,t,I),u(t,n),u(t,r),u(t,l),u(t,o),u(t,i);for(let P=0;P<C.length;P+=1)C[P]&&C[P].m(i,null);u(t,s),x&&x.m(t,null),u(t,c),u(t,f),u(f,d),Ie(d,e[12][e[71].key]),u(f,h),u(f,p),u(p,g),u(t,m),y||(v=[Q(d,"input",S),Q(d,"keydown",M),Q(p,"click",N)],y=!0)},p(L,I){var P;if(e=L,I[0]&201326592|I[1]&144){k=Oe(e[26][e[71].key]);let F;for(F=0;F<k.length;F+=1){const T=ka(e,k,F);C[F]?C[F].p(T,I):(C[F]=La(T),C[F].c(),C[F].m(i,null))}for(;F<C.length;F+=1)C[F].d(1);C.length=k.length}e[11][e[71].key].custom.length>0?x?x.p(e,I):(x=Na(e),x.c(),x.m(t,c)):x&&(x.d(1),x=null),I[0]&134221824&&d.value!==e[12][e[71].key]&&Ie(d,e[12][e[71].key]),I[0]&4096&&_!==(_=!((P=e[12][e[71].key])!=null&&P.trim()))&&(p.disabled=_)},d(L){L&&j(t),ft(C,L),x&&x.d(),y=!1,lt(v)}}}function Pa(e){let t,n;function r(i,s){if(i[24]==="clearing")return C0;if(i[24]==="success")return x0}let l=r(e),o=l&&l(e);return{c(){t=b("div"),n=b("div"),o&&o.c(),a(n,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),a(t,"data-testid","clear-modal")},m(i,s){R(i,t,s),u(t,n),o&&o.m(n,null)},p(i,s){l!==(l=r(i))&&(o&&o.d(1),o=l&&l(i),o&&(o.c(),o.m(n,null)))},d(i){i&&j(t),o&&o.d()}}}function x0(e){let t,n,r,l,o,i,s,c,f,d,h,p;return{c(){t=de("svg"),n=de("defs"),r=de("style"),l=O(`#loco-clear-ok-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
35
+ #loco-clear-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
36
+ .loco-clear-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
37
+ .loco-clear-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
38
+ .loco-clear-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
39
+ .loco-clear-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
40
+ `),o=de("circle"),i=de("path"),s=de("circle"),c=de("circle"),f=de("circle"),d=de("circle"),h=E(),p=b("p"),p.textContent="Pending cleared!",a(o,"id","loco-clear-ok-circle"),a(o,"cx","40"),a(o,"cy","40"),a(o,"r","30"),a(o,"fill","#2ECC88"),a(i,"id","loco-clear-checkmark"),a(i,"d","M25 40 L35 50 L55 30"),a(i,"fill","none"),a(i,"stroke","white"),a(i,"stroke-width","5"),a(i,"stroke-linecap","round"),a(i,"stroke-linejoin","round"),a(s,"class","loco-clear-spark1"),a(s,"cx","12"),a(s,"cy","15"),a(s,"r","3"),a(s,"fill","#FFB833"),a(c,"class","loco-clear-spark2"),a(c,"cx","68"),a(c,"cy","18"),a(c,"r","2.5"),a(c,"fill","#3A8FE0"),a(f,"class","loco-clear-spark3"),a(f,"cx","65"),a(f,"cy","65"),a(f,"r","2"),a(f,"fill","#F07040"),a(d,"class","loco-clear-spark4"),a(d,"cx","15"),a(d,"cy","62"),a(d,"r","2.5"),a(d,"fill","#7BC74A"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(p,"class","text-sm font-medium text-gray-700")},m(g,_){R(g,t,_),u(t,n),u(n,r),u(r,l),u(t,o),u(t,i),u(t,s),u(t,c),u(t,f),u(t,d),R(g,h,_),R(g,p,_)},d(g){g&&(j(t),j(h),j(p))}}}function C0(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L,I;return{c(){t=de("svg"),n=de("defs"),r=de("style"),l=O(`#loco-clear-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
41
+ #loco-clear-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
42
+ `),o=de("g"),i=de("circle"),s=de("path"),c=de("path"),f=de("path"),d=de("g"),h=de("circle"),p=de("circle"),g=de("circle"),_=de("circle"),m=de("circle"),y=de("circle"),v=de("path"),k=de("line"),C=de("line"),x=de("line"),S=de("circle"),M=de("circle"),N=de("circle"),L=E(),I=b("p"),I.textContent="Clearing pending…",a(i,"cx","40"),a(i,"cy","40"),a(i,"r","34"),a(i,"fill","none"),a(i,"stroke","#2a3040"),a(i,"stroke-width","4"),a(s,"d","M40 6 A34 34 0 0 1 74 40"),a(s,"fill","none"),a(s,"stroke","#2ECC88"),a(s,"stroke-width","4"),a(s,"stroke-linecap","round"),a(c,"d","M74 40 A34 34 0 0 1 56 70"),a(c,"fill","none"),a(c,"stroke","#3A8FE0"),a(c,"stroke-width","4"),a(c,"stroke-linecap","round"),a(f,"d","M56 70 A34 34 0 0 1 24 70"),a(f,"fill","none"),a(f,"stroke","#FFB833"),a(f,"stroke-width","4"),a(f,"stroke-linecap","round"),a(o,"id","loco-clear-ring"),a(h,"cx","40"),a(h,"cy","40"),a(h,"r","16"),a(h,"fill","#1a1f2e"),a(p,"cx","40"),a(p,"cy","38"),a(p,"r","10"),a(p,"fill","#2ECC88"),a(g,"cx","37"),a(g,"cy","37"),a(g,"r","2.5"),a(g,"fill","white"),a(_,"cx","37.5"),a(_,"cy","37.5"),a(_,"r","1.5"),a(_,"fill","#2C2C2A"),a(m,"cx","43"),a(m,"cy","37"),a(m,"r","2.5"),a(m,"fill","white"),a(y,"cx","42.5"),a(y,"cy","37.5"),a(y,"r","1.5"),a(y,"fill","#2C2C2A"),a(v,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),a(v,"fill","#E8A020"),a(k,"x1","38"),a(k,"y1","30"),a(k,"x2","36"),a(k,"y2","26"),a(k,"stroke","#FFB833"),a(k,"stroke-width","1.5"),a(k,"stroke-linecap","round"),a(C,"x1","40"),a(C,"y1","29"),a(C,"x2","40"),a(C,"y2","24"),a(C,"stroke","#7BC74A"),a(C,"stroke-width","1.5"),a(C,"stroke-linecap","round"),a(x,"x1","42"),a(x,"y1","30"),a(x,"x2","44"),a(x,"y2","26"),a(x,"stroke","#F07040"),a(x,"stroke-width","1.5"),a(x,"stroke-linecap","round"),a(S,"cx","36"),a(S,"cy","25.5"),a(S,"r","1.5"),a(S,"fill","#FFB833"),a(M,"cx","40"),a(M,"cy","23.5"),a(M,"r","1.5"),a(M,"fill","#7BC74A"),a(N,"cx","44"),a(N,"cy","25.5"),a(N,"r","1.5"),a(N,"fill","#F07040"),a(d,"id","loco-clear-parrot"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(I,"class","text-sm font-medium text-gray-700")},m(P,F){R(P,t,F),u(t,n),u(n,r),u(r,l),u(t,o),u(o,i),u(o,s),u(o,c),u(o,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,_),u(d,m),u(d,y),u(d,v),u(d,k),u(d,C),u(d,x),u(d,S),u(d,M),u(d,N),R(P,L,F),R(P,I,F)},d(P){P&&(j(t),j(L),j(I))}}}function Da(e){let t,n;function r(i,s){if(i[23]==="resetting")return A0;if(i[23]==="success")return S0}let l=r(e),o=l&&l(e);return{c(){t=b("div"),n=b("div"),o&&o.c(),a(n,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),a(t,"data-testid","reset-modal")},m(i,s){R(i,t,s),u(t,n),o&&o.m(n,null)},p(i,s){l!==(l=r(i))&&(o&&o.d(1),o=l&&l(i),o&&(o.c(),o.m(n,null)))},d(i){i&&j(t),o&&o.d()}}}function S0(e){let t,n,r,l,o,i,s,c,f,d,h,p;return{c(){t=de("svg"),n=de("defs"),r=de("style"),l=O(`#loco-reset-ok-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
43
+ #loco-reset-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
44
+ .loco-reset-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
45
+ .loco-reset-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
46
+ .loco-reset-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
47
+ .loco-reset-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
48
+ `),o=de("circle"),i=de("path"),s=de("circle"),c=de("circle"),f=de("circle"),d=de("circle"),h=E(),p=b("p"),p.textContent="Database reset!",a(o,"id","loco-reset-ok-circle"),a(o,"cx","40"),a(o,"cy","40"),a(o,"r","30"),a(o,"fill","#2ECC88"),a(i,"id","loco-reset-checkmark"),a(i,"d","M25 40 L35 50 L55 30"),a(i,"fill","none"),a(i,"stroke","white"),a(i,"stroke-width","5"),a(i,"stroke-linecap","round"),a(i,"stroke-linejoin","round"),a(s,"class","loco-reset-spark1"),a(s,"cx","12"),a(s,"cy","15"),a(s,"r","3"),a(s,"fill","#FFB833"),a(c,"class","loco-reset-spark2"),a(c,"cx","68"),a(c,"cy","18"),a(c,"r","2.5"),a(c,"fill","#3A8FE0"),a(f,"class","loco-reset-spark3"),a(f,"cx","65"),a(f,"cy","65"),a(f,"r","2"),a(f,"fill","#F07040"),a(d,"class","loco-reset-spark4"),a(d,"cx","15"),a(d,"cy","62"),a(d,"r","2.5"),a(d,"fill","#7BC74A"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(p,"class","text-sm font-medium text-gray-700")},m(g,_){R(g,t,_),u(t,n),u(n,r),u(r,l),u(t,o),u(t,i),u(t,s),u(t,c),u(t,f),u(t,d),R(g,h,_),R(g,p,_)},d(g){g&&(j(t),j(h),j(p))}}}function A0(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L,I;return{c(){t=de("svg"),n=de("defs"),r=de("style"),l=O(`#loco-reset-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
49
+ #loco-reset-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
50
+ `),o=de("g"),i=de("circle"),s=de("path"),c=de("path"),f=de("path"),d=de("g"),h=de("circle"),p=de("circle"),g=de("circle"),_=de("circle"),m=de("circle"),y=de("circle"),v=de("path"),k=de("line"),C=de("line"),x=de("line"),S=de("circle"),M=de("circle"),N=de("circle"),L=E(),I=b("p"),I.textContent="Resetting database…",a(i,"cx","40"),a(i,"cy","40"),a(i,"r","34"),a(i,"fill","none"),a(i,"stroke","#2a3040"),a(i,"stroke-width","4"),a(s,"d","M40 6 A34 34 0 0 1 74 40"),a(s,"fill","none"),a(s,"stroke","#ef4444"),a(s,"stroke-width","4"),a(s,"stroke-linecap","round"),a(c,"d","M74 40 A34 34 0 0 1 56 70"),a(c,"fill","none"),a(c,"stroke","#f97316"),a(c,"stroke-width","4"),a(c,"stroke-linecap","round"),a(f,"d","M56 70 A34 34 0 0 1 24 70"),a(f,"fill","none"),a(f,"stroke","#eab308"),a(f,"stroke-width","4"),a(f,"stroke-linecap","round"),a(o,"id","loco-reset-ring"),a(h,"cx","40"),a(h,"cy","40"),a(h,"r","16"),a(h,"fill","#1a1f2e"),a(p,"cx","40"),a(p,"cy","38"),a(p,"r","10"),a(p,"fill","#2ECC88"),a(g,"cx","37"),a(g,"cy","37"),a(g,"r","2.5"),a(g,"fill","white"),a(_,"cx","37.5"),a(_,"cy","37.5"),a(_,"r","1.5"),a(_,"fill","#2C2C2A"),a(m,"cx","43"),a(m,"cy","37"),a(m,"r","2.5"),a(m,"fill","white"),a(y,"cx","42.5"),a(y,"cy","37.5"),a(y,"r","1.5"),a(y,"fill","#2C2C2A"),a(v,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),a(v,"fill","#E8A020"),a(k,"x1","38"),a(k,"y1","30"),a(k,"x2","36"),a(k,"y2","26"),a(k,"stroke","#FFB833"),a(k,"stroke-width","1.5"),a(k,"stroke-linecap","round"),a(C,"x1","40"),a(C,"y1","29"),a(C,"x2","40"),a(C,"y2","24"),a(C,"stroke","#7BC74A"),a(C,"stroke-width","1.5"),a(C,"stroke-linecap","round"),a(x,"x1","42"),a(x,"y1","30"),a(x,"x2","44"),a(x,"y2","26"),a(x,"stroke","#F07040"),a(x,"stroke-width","1.5"),a(x,"stroke-linecap","round"),a(S,"cx","36"),a(S,"cy","25.5"),a(S,"r","1.5"),a(S,"fill","#FFB833"),a(M,"cx","40"),a(M,"cy","23.5"),a(M,"r","1.5"),a(M,"fill","#7BC74A"),a(N,"cx","44"),a(N,"cy","25.5"),a(N,"r","1.5"),a(N,"fill","#F07040"),a(d,"id","loco-reset-parrot"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(I,"class","text-sm font-medium text-gray-700")},m(P,F){R(P,t,F),u(t,n),u(n,r),u(r,l),u(t,o),u(o,i),u(o,s),u(o,c),u(o,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,_),u(d,m),u(d,y),u(d,v),u(d,k),u(d,C),u(d,x),u(d,S),u(d,M),u(d,N),R(P,L,F),R(P,I,F)},d(P){P&&(j(t),j(L),j(I))}}}function Fa(e){let t,n;function r(i,s){if(i[22]==="backing-up")return M0;if(i[22]==="success")return T0}let l=r(e),o=l&&l(e);return{c(){t=b("div"),n=b("div"),o&&o.c(),a(n,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),a(t,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),a(t,"data-testid","backup-modal")},m(i,s){R(i,t,s),u(t,n),o&&o.m(n,null)},p(i,s){l!==(l=r(i))&&(o&&o.d(1),o=l&&l(i),o&&(o.c(),o.m(n,null)))},d(i){i&&j(t),o&&o.d()}}}function T0(e){let t,n,r,l,o,i,s,c,f,d,h,p;return{c(){t=de("svg"),n=de("defs"),r=de("style"),l=O(`@keyframes loco-circle-grow { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
51
+ @keyframes loco-check-draw { 0% { stroke-dashoffset: 30; } 100% { stroke-dashoffset: 0; } }
52
+ @keyframes loco-sparkle { 0%, 100% { opacity: 0; transform: scale(0); } 50% { opacity: 1; transform: scale(1); } }
53
+ #loco-success-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
54
+ #loco-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
55
+ .loco-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
56
+ .loco-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
57
+ .loco-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
58
+ .loco-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
59
+ `),o=de("circle"),i=de("path"),s=de("circle"),c=de("circle"),f=de("circle"),d=de("circle"),h=E(),p=b("p"),p.textContent="Backup created!",a(o,"id","loco-success-circle"),a(o,"cx","40"),a(o,"cy","40"),a(o,"r","30"),a(o,"fill","#2ECC88"),a(i,"id","loco-checkmark"),a(i,"d","M25 40 L35 50 L55 30"),a(i,"fill","none"),a(i,"stroke","white"),a(i,"stroke-width","5"),a(i,"stroke-linecap","round"),a(i,"stroke-linejoin","round"),a(s,"class","loco-spark1"),a(s,"cx","12"),a(s,"cy","15"),a(s,"r","3"),a(s,"fill","#FFB833"),a(c,"class","loco-spark2"),a(c,"cx","68"),a(c,"cy","18"),a(c,"r","2.5"),a(c,"fill","#3A8FE0"),a(f,"class","loco-spark3"),a(f,"cx","65"),a(f,"cy","65"),a(f,"r","2"),a(f,"fill","#F07040"),a(d,"class","loco-spark4"),a(d,"cx","15"),a(d,"cy","62"),a(d,"r","2.5"),a(d,"fill","#7BC74A"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(p,"class","text-sm font-medium text-gray-700")},m(g,_){R(g,t,_),u(t,n),u(n,r),u(r,l),u(t,o),u(t,i),u(t,s),u(t,c),u(t,f),u(t,d),R(g,h,_),R(g,p,_)},d(g){g&&(j(t),j(h),j(p))}}}function M0(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M,N,L,I;return{c(){t=de("svg"),n=de("defs"),r=de("style"),l=O(`@keyframes loco-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
60
+ @keyframes loco-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(0.92); } }
61
+ #loco-spinner-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
62
+ #loco-center-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
63
+ `),o=de("g"),i=de("circle"),s=de("path"),c=de("path"),f=de("path"),d=de("g"),h=de("circle"),p=de("circle"),g=de("circle"),_=de("circle"),m=de("circle"),y=de("circle"),v=de("path"),k=de("line"),C=de("line"),x=de("line"),S=de("circle"),M=de("circle"),N=de("circle"),L=E(),I=b("p"),I.textContent="Creating backup…",a(i,"cx","40"),a(i,"cy","40"),a(i,"r","34"),a(i,"fill","none"),a(i,"stroke","#2a3040"),a(i,"stroke-width","4"),a(s,"d","M40 6 A34 34 0 0 1 74 40"),a(s,"fill","none"),a(s,"stroke","#2ECC88"),a(s,"stroke-width","4"),a(s,"stroke-linecap","round"),a(c,"d","M74 40 A34 34 0 0 1 56 70"),a(c,"fill","none"),a(c,"stroke","#3A8FE0"),a(c,"stroke-width","4"),a(c,"stroke-linecap","round"),a(f,"d","M56 70 A34 34 0 0 1 24 70"),a(f,"fill","none"),a(f,"stroke","#FFB833"),a(f,"stroke-width","4"),a(f,"stroke-linecap","round"),a(o,"id","loco-spinner-ring"),a(h,"cx","40"),a(h,"cy","40"),a(h,"r","16"),a(h,"fill","#1a1f2e"),a(p,"cx","40"),a(p,"cy","38"),a(p,"r","10"),a(p,"fill","#2ECC88"),a(g,"cx","37"),a(g,"cy","37"),a(g,"r","2.5"),a(g,"fill","white"),a(_,"cx","37.5"),a(_,"cy","37.5"),a(_,"r","1.5"),a(_,"fill","#2C2C2A"),a(m,"cx","43"),a(m,"cy","37"),a(m,"r","2.5"),a(m,"fill","white"),a(y,"cx","42.5"),a(y,"cy","37.5"),a(y,"r","1.5"),a(y,"fill","#2C2C2A"),a(v,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),a(v,"fill","#E8A020"),a(k,"x1","38"),a(k,"y1","30"),a(k,"x2","36"),a(k,"y2","26"),a(k,"stroke","#FFB833"),a(k,"stroke-width","1.5"),a(k,"stroke-linecap","round"),a(C,"x1","40"),a(C,"y1","29"),a(C,"x2","40"),a(C,"y2","24"),a(C,"stroke","#7BC74A"),a(C,"stroke-width","1.5"),a(C,"stroke-linecap","round"),a(x,"x1","42"),a(x,"y1","30"),a(x,"x2","44"),a(x,"y2","26"),a(x,"stroke","#F07040"),a(x,"stroke-width","1.5"),a(x,"stroke-linecap","round"),a(S,"cx","36"),a(S,"cy","25.5"),a(S,"r","1.5"),a(S,"fill","#FFB833"),a(M,"cx","40"),a(M,"cy","23.5"),a(M,"r","1.5"),a(M,"fill","#7BC74A"),a(N,"cx","44"),a(N,"cy","25.5"),a(N,"r","1.5"),a(N,"fill","#F07040"),a(d,"id","loco-center-parrot"),a(t,"width","80"),a(t,"height","80"),a(t,"viewBox","0 0 80 80"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(I,"class","text-sm font-medium text-gray-700")},m(P,F){R(P,t,F),u(t,n),u(n,r),u(r,l),u(t,o),u(o,i),u(o,s),u(o,c),u(o,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,_),u(d,m),u(d,y),u(d,v),u(d,k),u(d,C),u(d,x),u(d,S),u(d,M),u(d,N),R(P,L,F),R(P,I,F)},d(P){P&&(j(t),j(L),j(I))}}}function E0(e){let t,n,r,l,o,i,s,c,f,d,h=e[2]?"Saving…":"Save",p,g,_,m,y,v,k,C,x=e[25].api_key+"",S,M,N,L=e[1]==="key"?"Copied":"Copy",I,P,F,T=e[3]?"Regenerating…":"Regenerate API Key",z,w,D,J,Z,$,V,se,B,W,K,te=e[6]?"🙈":"👁️",q,be,ve,Ne=e[5]?"Saving…":"Save",le,me,ae,ne,Ae,A,re,X,H=e[1]==="snippet"?"Copied":"Copy Snippet",U,Y,ie,ue,G,ce,ke,he,xe,Te,ge,je,Fe,oe,ze,Le,Pe,Ye,et,$e,we,Ue,_e,Me,Ce,Ve,pe,qe,Ke,bt,jt,Et,Rt,Bt,Dt,ye=e[14]?"Enabled":"Disabled",He,Je,at,kt,_t,ut,mt,nt,We,Re,Xe,At,it,Mn,En=e[15]?"Enabled":"Disabled",Fn,er,Lt,pn,Ln,Se,Qe,ot,wt,Ft,Ut,tr,Nt,nr,ll,rr,il,bn,lr=e[16]?"Clearing…":"Clear All Pending",Ir,ol,Pr,sl,ir,al,yn,or=e[17]?"Resetting…":"Reset Entire Database",Dr,ul,vn,kn,sr,cl,ar,ur=e[10]?"▲":"▼",Fr,fl,Or,On,jn,Rn,jr,fe;function De(Ee,tt){return Ee[6]?b0:_0}let rt=De(e),Ge=rt(e),yt=Oe(e[7]),xt=[];for(let Ee=0;Ee<yt.length;Ee+=1)xt[Ee]=Ca(xa(e,yt,Ee));let Ot=e[7].length===0&&Sa();function io(Ee,tt){return Ee[20]?v0:y0}let dl=io(e),Nn=dl(e),Ht=!e[18].length&&!e[19]&&Aa(e);function oo(Ee,tt){if(Ee[19])return w0;if(Ee[18].length>0)return k0}let cr=oo(e),Wt=cr&&cr(e),Zt=e[10]&&Ma(e),Vt=e[24]&&Pa(e),Yt=e[23]&&Da(e),qt=e[22]&&Fa(e);return{c(){t=b("div"),n=b("h2"),n.textContent="Settings",r=E(),l=b("div"),o=b("label"),o.textContent="Project Name",i=E(),s=b("div"),c=b("input"),f=E(),d=b("button"),p=O(h),_=E(),m=b("div"),y=b("div"),y.textContent="API Key",v=E(),k=b("div"),C=b("code"),S=O(x),M=E(),N=b("button"),I=O(L),P=E(),F=b("button"),z=O(T),w=E(),D=b("div"),J=b("label"),J.textContent="BlueHive API Key",Z=E(),$=b("p"),$.innerHTML='Required for AI-powered translations. Get your key from <a href="https://app.ozwell.ai" target="_blank" class="text-indigo-600 hover:underline">app.ozwell.ai</a>',V=E(),se=b("div"),B=b("div"),Ge.c(),W=E(),K=b("button"),q=O(te),be=E(),ve=b("button"),le=O(Ne),me=E(),ae=b("div"),ne=b("div"),ne.textContent="CDN Script Snippet",Ae=E(),A=b("pre"),A.textContent=`${e[28]()}`,re=E(),X=b("button"),U=O(H),Y=E(),ie=b("div"),ue=b("div"),ue.textContent="Target Languages",G=E(),ce=b("div");for(let Ee=0;Ee<xt.length;Ee+=1)xt[Ee].c();ke=E(),Ot&&Ot.c(),he=E(),xe=b("div"),Te=b("div"),ge=b("label"),ge.textContent="Language Code",je=E(),Fe=b("input"),oe=E(),ze=b("div"),Le=b("label"),Le.textContent="Language Name",Pe=E(),Ye=b("input"),et=E(),$e=b("button"),we=O("Add"),_e=E(),Me=b("div"),Ce=b("div"),Ce.textContent="DOM Context",Ve=E(),pe=b("p"),pe.textContent="When enabled, the Loco client builds context breadcrumbs (headings, labels, sections) for each phrase. This helps distinguish identical text in different parts of the page. Disable to simplify phrase collection and improve performance on large pages.",qe=E(),Ke=b("label"),bt=b("button"),jt=b("span"),Bt=E(),Dt=b("span"),He=O(ye),Je=E(),at=b("div"),kt=b("div"),kt.textContent="Page Screenshots",_t=E(),ut=b("p"),ut.textContent="When enabled, the Loco client will capture a page screenshot and send it to the dashboard for context during translation.",mt=E(),nt=b("label"),We=b("button"),Re=b("span"),it=E(),Mn=b("span"),Fn=O(En),er=E(),Lt=b("div"),pn=b("div"),Ln=b("div"),Ln.textContent="Backups",Se=E(),Qe=b("button"),Nn.c(),ot=E(),wt=b("p"),wt.innerHTML='Create point-in-time snapshots of your database. To restore, stop the server and replace <code class="bg-gray-100 px-1 rounded">server/data/loco.db</code> with a backup file.',Ft=E(),Ht&&Ht.c(),Ut=E(),Wt&&Wt.c(),tr=E(),Nt=b("div"),nr=b("div"),nr.textContent="Danger Zone",ll=E(),rr=b("p"),rr.textContent="Delete all pending text nodes from the database. Approved and trashed items are not affected.",il=E(),bn=b("button"),Ir=O(lr),ol=E(),Pr=b("hr"),sl=E(),ir=b("p"),ir.textContent="Delete ALL text nodes, translations, and screenshots. The project and its settings will be kept.",al=E(),yn=b("button"),Dr=O(or),ul=E(),vn=b("div"),kn=b("button"),sr=b("span"),sr.textContent="Crawler Configuration",cl=E(),ar=b("span"),Fr=O(ur),fl=E(),Zt&&Zt.c(),Or=E(),Vt&&Vt.c(),On=E(),Yt&&Yt.c(),jn=E(),qt&&qt.c(),Rn=Ct(),a(n,"class","text-xl font-semibold text-gray-800 mb-6"),a(o,"for","project-name"),a(o,"class","block text-sm font-medium text-gray-600 mb-2"),a(c,"id","project-name"),a(c,"class","flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"),a(c,"placeholder","Project name"),a(d,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),d.disabled=g=e[2]||e[0]===e[25].name,a(s,"class","flex gap-2"),a(l,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(y,"class","block text-sm font-medium text-gray-600 mb-2"),a(C,"class","flex-1 px-3 py-2 bg-gray-50 border border-gray-200 rounded-md text-sm font-mono text-gray-700 select-all"),a(N,"class","px-3 py-2 border border-gray-300 rounded-md text-sm hover:bg-gray-50"),a(k,"class","flex gap-2 items-center"),a(F,"class","mt-3 px-3 py-1.5 border border-red-300 text-red-600 text-xs rounded-md hover:bg-red-50 disabled:opacity-50"),F.disabled=e[3],a(m,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(J,"for","bluehive-api-key"),a(J,"class","block text-sm font-medium text-gray-600 mb-2"),a($,"class","text-xs text-gray-400 mb-2"),a(K,"class","absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 text-xs"),a(K,"type","button"),a(B,"class","relative flex-1"),a(ve,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),ve.disabled=e[5],a(se,"class","flex gap-2"),a(D,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(ne,"class","block text-sm font-medium text-gray-600 mb-2"),a(A,"class","px-3 py-2 bg-gray-50 border border-gray-200 rounded-md text-xs font-mono text-gray-700 overflow-x-auto whitespace-pre-wrap"),a(X,"class","mt-2 px-3 py-1.5 border border-gray-300 rounded-md text-sm hover:bg-gray-50"),a(ae,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(ue,"class","block text-sm font-medium text-gray-600 mb-3"),a(ce,"class","space-y-1 mb-4"),a(ge,"for","new-language-code"),a(ge,"class","block text-xs text-gray-500 mb-1"),a(Fe,"id","new-language-code"),a(Fe,"placeholder","e.g. zh-Hans"),a(Fe,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(Te,"class","flex-1"),a(Le,"for","new-language-name"),a(Le,"class","block text-xs text-gray-500 mb-1"),a(Ye,"id","new-language-name"),a(Ye,"placeholder","e.g. Chinese (Simplified)"),a(Ye,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(ze,"class","flex-1"),a($e,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),$e.disabled=Ue=!e[8].trim()||!e[9].trim(),a(xe,"class","flex gap-2 items-end"),a(ie,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(Ce,"class","block text-sm font-medium text-gray-700 mb-2"),a(pe,"class","text-xs text-gray-500 mb-3"),a(jt,"class",Et="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(e[14]?"translate-x-6":"translate-x-1")),a(bt,"class",Rt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e[14]?"bg-indigo-600":"bg-gray-300")),a(bt,"role","switch"),a(bt,"aria-checked",e[14]),a(Dt,"class","text-sm text-gray-700"),a(Ke,"class","flex items-center gap-3 cursor-pointer"),a(Me,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(kt,"class","block text-sm font-medium text-gray-700 mb-2"),a(ut,"class","text-xs text-gray-500 mb-3"),a(Re,"class",Xe="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(e[15]?"translate-x-6":"translate-x-1")),a(We,"class",At="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e[15]?"bg-indigo-600":"bg-gray-300")),a(We,"role","switch"),a(We,"aria-checked",e[15]),a(Mn,"class","text-sm text-gray-700"),a(nt,"class","flex items-center gap-3 cursor-pointer"),a(at,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(Ln,"class","text-sm font-medium text-gray-700"),a(Qe,"class","px-3 py-1.5 bg-indigo-600 text-white text-xs rounded-md hover:bg-indigo-700 disabled:opacity-50 flex items-center gap-1.5"),Qe.disabled=e[20],a(pn,"class","flex items-center justify-between mb-3"),a(wt,"class","text-xs text-gray-400 mb-3"),a(Lt,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(nr,"class","block text-sm font-medium text-red-600 mb-2"),a(rr,"class","text-xs text-gray-500 mb-3"),a(bn,"class","px-4 py-2 bg-red-600 text-white text-sm rounded-md hover:bg-red-700 disabled:opacity-50"),bn.disabled=e[16],a(Pr,"class","my-4 border-red-100"),a(ir,"class","text-xs text-gray-500 mb-3"),a(yn,"class","px-4 py-2 bg-red-700 text-white text-sm rounded-md hover:bg-red-800 disabled:opacity-50"),yn.disabled=e[17],a(Nt,"class","bg-white rounded-lg border border-red-200 p-5 mb-4"),a(sr,"class","text-sm font-medium text-gray-600"),a(ar,"class","text-gray-400 text-xs"),a(kn,"class","flex items-center justify-between w-full text-left"),a(vn,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),a(t,"class","max-w-2xl")},m(Ee,tt){R(Ee,t,tt),u(t,n),u(t,r),u(t,l),u(l,o),u(l,i),u(l,s),u(s,c),Ie(c,e[0]),u(s,f),u(s,d),u(d,p),u(t,_),u(t,m),u(m,y),u(m,v),u(m,k),u(k,C),u(C,S),u(k,M),u(k,N),u(N,I),u(m,P),u(m,F),u(F,z),u(t,w),u(t,D),u(D,J),u(D,Z),u(D,$),u(D,V),u(D,se),u(se,B),Ge.m(B,null),u(B,W),u(B,K),u(K,q),u(se,be),u(se,ve),u(ve,le),u(t,me),u(t,ae),u(ae,ne),u(ae,Ae),u(ae,A),u(ae,re),u(ae,X),u(X,U),u(t,Y),u(t,ie),u(ie,ue),u(ie,G),u(ie,ce);for(let Mt=0;Mt<xt.length;Mt+=1)xt[Mt]&&xt[Mt].m(ce,null);u(ie,ke),Ot&&Ot.m(ie,null),u(ie,he),u(ie,xe),u(xe,Te),u(Te,ge),u(Te,je),u(Te,Fe),Ie(Fe,e[8]),u(xe,oe),u(xe,ze),u(ze,Le),u(ze,Pe),u(ze,Ye),Ie(Ye,e[9]),u(xe,et),u(xe,$e),u($e,we),u(t,_e),u(t,Me),u(Me,Ce),u(Me,Ve),u(Me,pe),u(Me,qe),u(Me,Ke),u(Ke,bt),u(bt,jt),u(Ke,Bt),u(Ke,Dt),u(Dt,He),u(t,Je),u(t,at),u(at,kt),u(at,_t),u(at,ut),u(at,mt),u(at,nt),u(nt,We),u(We,Re),u(nt,it),u(nt,Mn),u(Mn,Fn),u(t,er),u(t,Lt),u(Lt,pn),u(pn,Ln),u(pn,Se),u(pn,Qe),Nn.m(Qe,null),u(Lt,ot),u(Lt,wt),u(Lt,Ft),Ht&&Ht.m(Lt,null),u(Lt,Ut),Wt&&Wt.m(Lt,null),u(t,tr),u(t,Nt),u(Nt,nr),u(Nt,ll),u(Nt,rr),u(Nt,il),u(Nt,bn),u(bn,Ir),u(Nt,ol),u(Nt,Pr),u(Nt,sl),u(Nt,ir),u(Nt,al),u(Nt,yn),u(yn,Dr),u(t,ul),u(t,vn),u(vn,kn),u(kn,sr),u(kn,cl),u(kn,ar),u(ar,Fr),u(vn,fl),Zt&&Zt.m(vn,null),R(Ee,Or,tt),Vt&&Vt.m(Ee,tt),R(Ee,On,tt),Yt&&Yt.m(Ee,tt),R(Ee,jn,tt),qt&&qt.m(Ee,tt),R(Ee,Rn,tt),jr||(fe=[Q(c,"input",e[47]),Q(d,"click",e[30]),Q(N,"click",e[48]),Q(F,"click",e[31]),Q(K,"click",e[51]),Q(ve,"click",e[29]),Q(X,"click",e[52]),Q(Fe,"input",e[54]),Q(Ye,"input",e[55]),Q($e,"click",e[32]),Q(bt,"click",e[40]),Q(We,"click",e[39]),Q(Qe,"click",e[44]),Q(bn,"click",e[41]),Q(yn,"click",e[42]),Q(kn,"click",e[57])],jr=!0)},p(Ee,tt){if(tt[0]&1&&c.value!==Ee[0]&&Ie(c,Ee[0]),tt[0]&4&&h!==(h=Ee[2]?"Saving…":"Save")&&ee(p,h),tt[0]&33554437&&g!==(g=Ee[2]||Ee[0]===Ee[25].name)&&(d.disabled=g),tt[0]&33554432&&x!==(x=Ee[25].api_key+"")&&ee(S,x),tt[0]&2&&L!==(L=Ee[1]==="key"?"Copied":"Copy")&&ee(I,L),tt[0]&8&&T!==(T=Ee[3]?"Regenerating…":"Regenerate API Key")&&ee(z,T),tt[0]&8&&(F.disabled=Ee[3]),rt===(rt=De(Ee))&&Ge?Ge.p(Ee,tt):(Ge.d(1),Ge=rt(Ee),Ge&&(Ge.c(),Ge.m(B,W))),tt[0]&64&&te!==(te=Ee[6]?"🙈":"👁️")&&ee(q,te),tt[0]&32&&Ne!==(Ne=Ee[5]?"Saving…":"Save")&&ee(le,Ne),tt[0]&32&&(ve.disabled=Ee[5]),tt[0]&2&&H!==(H=Ee[1]==="snippet"?"Copied":"Copy Snippet")&&ee(U,H),tt[0]&128|tt[1]&4){yt=Oe(Ee[7]);let Mt;for(Mt=0;Mt<yt.length;Mt+=1){const so=xa(Ee,yt,Mt);xt[Mt]?xt[Mt].p(so,tt):(xt[Mt]=Ca(so),xt[Mt].c(),xt[Mt].m(ce,null))}for(;Mt<xt.length;Mt+=1)xt[Mt].d(1);xt.length=yt.length}Ee[7].length===0?Ot||(Ot=Sa(),Ot.c(),Ot.m(ie,he)):Ot&&(Ot.d(1),Ot=null),tt[0]&256&&Fe.value!==Ee[8]&&Ie(Fe,Ee[8]),tt[0]&512&&Ye.value!==Ee[9]&&Ie(Ye,Ee[9]),tt[0]&768&&Ue!==(Ue=!Ee[8].trim()||!Ee[9].trim())&&($e.disabled=Ue),tt[0]&16384&&Et!==(Et="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(Ee[14]?"translate-x-6":"translate-x-1"))&&a(jt,"class",Et),tt[0]&16384&&Rt!==(Rt="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(Ee[14]?"bg-indigo-600":"bg-gray-300"))&&a(bt,"class",Rt),tt[0]&16384&&a(bt,"aria-checked",Ee[14]),tt[0]&16384&&ye!==(ye=Ee[14]?"Enabled":"Disabled")&&ee(He,ye),tt[0]&32768&&Xe!==(Xe="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(Ee[15]?"translate-x-6":"translate-x-1"))&&a(Re,"class",Xe),tt[0]&32768&&At!==(At="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(Ee[15]?"bg-indigo-600":"bg-gray-300"))&&a(We,"class",At),tt[0]&32768&&a(We,"aria-checked",Ee[15]),tt[0]&32768&&En!==(En=Ee[15]?"Enabled":"Disabled")&&ee(Fn,En),dl!==(dl=io(Ee))&&(Nn.d(1),Nn=dl(Ee),Nn&&(Nn.c(),Nn.m(Qe,null))),tt[0]&1048576&&(Qe.disabled=Ee[20]),!Ee[18].length&&!Ee[19]?Ht?Ht.p(Ee,tt):(Ht=Aa(Ee),Ht.c(),Ht.m(Lt,Ut)):Ht&&(Ht.d(1),Ht=null),cr===(cr=oo(Ee))&&Wt?Wt.p(Ee,tt):(Wt&&Wt.d(1),Wt=cr&&cr(Ee),Wt&&(Wt.c(),Wt.m(Lt,null))),tt[0]&65536&&lr!==(lr=Ee[16]?"Clearing…":"Clear All Pending")&&ee(Ir,lr),tt[0]&65536&&(bn.disabled=Ee[16]),tt[0]&131072&&or!==(or=Ee[17]?"Resetting…":"Reset Entire Database")&&ee(Dr,or),tt[0]&131072&&(yn.disabled=Ee[17]),tt[0]&1024&&ur!==(ur=Ee[10]?"▲":"▼")&&ee(Fr,ur),Ee[10]?Zt?Zt.p(Ee,tt):(Zt=Ma(Ee),Zt.c(),Zt.m(vn,null)):Zt&&(Zt.d(1),Zt=null),Ee[24]?Vt?Vt.p(Ee,tt):(Vt=Pa(Ee),Vt.c(),Vt.m(On.parentNode,On)):Vt&&(Vt.d(1),Vt=null),Ee[23]?Yt?Yt.p(Ee,tt):(Yt=Da(Ee),Yt.c(),Yt.m(jn.parentNode,jn)):Yt&&(Yt.d(1),Yt=null),Ee[22]?qt?qt.p(Ee,tt):(qt=Fa(Ee),qt.c(),qt.m(Rn.parentNode,Rn)):qt&&(qt.d(1),qt=null)},i:Be,o:Be,d(Ee){Ee&&(j(t),j(Or),j(On),j(jn),j(Rn)),Ge.d(),ft(xt,Ee),Ot&&Ot.d(),Nn.d(),Ht&&Ht.d(),Wt&&Wt.d(),Zt&&Zt.d(),Vt&&Vt.d(Ee),Yt&&Yt.d(Ee),qt&&qt.d(Ee),jr=!1,lt(fe)}}}function Oa(e){return e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}function ja(e){return new Date(e).toLocaleString()}function L0(e,t,n){let r;Gr(e,an,we=>n(25,r=we));const l=[{code:"zh-Hans",name:"Chinese (Simplified)"},{code:"zh-Hant",name:"Chinese (Traditional)"},{code:"es",name:"Spanish"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"pt",name:"Portuguese"}],o={blockedTags:["SCRIPT","STYLE","NOSCRIPT","IFRAME","CODE","SVG","AUDIO","VIDEO","LINK"],inlineTags:["VAR","STRONG","EM","B","I","SPAN","A","ABBR","MARK","SMALL","SUB","SUP","U","S","TIME"],domContextSelectors:["h1","h2","h3","h4","h5","h6","label","legend","caption","figcaption","nav","header","footer","main","section","article","form",".portlet-header",".admin-card",".wc_win_title",".miewin_title_bar",".ui-dialog-title",".ui-dialog-titlebar",".wc_tab_title"]},i=[{key:"blockedTags",title:"Blocked Tags",desc:"HTML tags to skip during text extraction.",placeholder:"e.g. CANVAS"},{key:"inlineTags",title:"Inline Tags",desc:"Tags treated as inline content in mixed-content extraction.",placeholder:"e.g. CITE"},{key:"domContextSelectors",title:"DOM Context Selectors",desc:"CSS selectors used to build context breadcrumbs for each phrase.",placeholder:"e.g. .my-header"}];let s="",c="",f=!1,d=!1,h={},p="",g=!1,_=!1,m=[],y="",v="",k=!1,C={blockedTags:{disabled:[],custom:[]},inlineTags:{disabled:[],custom:[]},domContextSelectors:{disabled:[],custom:[]}},x={blockedTags:"",inlineTags:"",domContextSelectors:""},S=0,M=!0,N=!0,L=!1,I=!1,P=[],F=!1,T=!1,z=null,w=!1,D=!1,J=!1;Nr(()=>{n(0,s=r.name||"");try{h=JSON.parse(r.settings||"{}")}catch{h={}}n(7,m=h.languages||l.map(we=>({...we}))),n(4,p=h.bluehiveApiKey||""),n(11,C={blockedTags:{disabled:[],custom:[],...h.blockedTags||{}},inlineTags:{disabled:[],custom:[],...h.inlineTags||{}},domContextSelectors:{disabled:[],custom:[],...h.domContextSelectors||{}}}),n(13,S=typeof h.contextDepth=="number"?h.contextDepth:0),n(14,M=h.domContextEnabled!==!1),n(15,N=h.screenshotsEnabled!==!1)});function Z(){const we=window.location.pathname.replace(/\/dashboard\/?$/,""),Ue=window.location.origin+we;return`<script src="${Ue}/cdn/loco.js"><\/script>
64
+ <script>Loco.init({ apiUrl: '${Ue}', apiKey: '${r.api_key}' });<\/script>`}async function $(){n(5,g=!0),h.bluehiveApiKey=p.trim();const we=await Ze("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});fr(an,r=await we.json(),r),n(5,g=!1)}async function V(){n(2,f=!0);const we=await Ze("../api/project",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s})});fr(an,r=await we.json(),r),n(2,f=!1)}async function se(){if(!confirm("Are you sure? This will invalidate the current API key. All pages using the old key will stop receiving translations."))return;n(3,d=!0);const we=await Ze("../api/project/regenerate-key",{method:"POST"});fr(an,r=await we.json(),r),r&&r.api_key&&Lc(r.api_key),n(3,d=!1)}async function B(){h.languages=m;const we=await Ze("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});fr(an,r=await we.json(),r)}function W(){const we=y.trim(),Ue=v.trim();!we||!Ue||m.some(_e=>_e.code===we)||(n(7,m=[...m,{code:we,name:Ue}]),n(8,y=""),n(9,v=""),B())}function K(we){n(7,m=m.filter(Ue=>Ue.code!==we)),B()}async function te(){h.blockedTags=C.blockedTags,h.inlineTags=C.inlineTags,h.domContextSelectors=C.domContextSelectors,h.contextDepth=S;const we=await Ze("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});fr(an,r=await we.json(),r)}function q(we,Ue){const _e=C[we].disabled,Me=_e.indexOf(Ue);Me>=0?_e.splice(Me,1):_e.push(Ue),n(11,C),te()}function be(we){const Ue=x[we].trim();!Ue||C[we].custom.includes(Ue)||(n(11,C[we].custom=[...C[we].custom,Ue],C),n(12,x[we]="",x),n(12,x),te())}function ve(we,Ue){n(11,C[we].custom=C[we].custom.filter(_e=>_e!==Ue),C),n(11,C),te()}function Ne(we,Ue){return!C[we].disabled.includes(Ue)}async function le(){n(15,N=!N),h.screenshotsEnabled=N,await Ze("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})})}async function me(){n(14,M=!M),h.domContextEnabled=M;const we=await Ze("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});fr(an,r=await we.json(),r)}async function ae(){if(confirm("Delete ALL pending text nodes? This cannot be undone.")){n(16,L=!0),n(24,J="clearing");try{await Ze("../api/textnodes/clear-pending",{method:"POST"}),n(24,J="success"),await new Promise(we=>setTimeout(we,1500))}catch{}n(24,J=!1),n(16,L=!1)}}async function ne(){if(confirm("This will permanently delete ALL text nodes, translations, and screenshots. This cannot be undone. Are you sure?")){n(17,I=!0),n(23,D="resetting");try{await Ze("../api/project/reset-database",{method:"POST"}),n(23,D="success"),await new Promise(we=>setTimeout(we,1500))}catch{}n(23,D=!1),n(17,I=!1)}}async function Ae(){n(19,F=!0);try{const we=await Ze("../api/backups");n(18,P=await we.json())}catch{n(18,P=[])}n(19,F=!1)}async function A(){n(20,T=!0),n(22,w="backing-up");try{await Ze("../api/backups",{method:"POST"}),await Ae(),n(22,w="success"),await new Promise(we=>setTimeout(we,1500))}catch{}n(22,w=!1),n(20,T=!1)}async function re(we){if(confirm(`Delete backup "${we}"? This cannot be undone.`)){n(21,z=we);try{await Ze(`../api/backups/${encodeURIComponent(we)}`,{method:"DELETE"}),await Ae()}catch{}n(21,z=null)}}async function X(we,Ue){await navigator.clipboard.writeText(we),n(1,c=Ue),setTimeout(()=>{n(1,c="")},2e3)}function H(){s=this.value,n(0,s)}const U=()=>X(r.api_key,"key");function Y(){p=this.value,n(4,p)}function ie(){p=this.value,n(4,p)}const ue=()=>n(6,_=!_),G=()=>X(Z(),"snippet"),ce=we=>K(we.code);function ke(){y=this.value,n(8,y)}function he(){v=this.value,n(9,v)}const xe=we=>re(we.filename),Te=()=>n(10,k=!k),ge=()=>{n(13,S=0),te()},je=()=>{S===0&&(n(13,S=5),te())},Fe=()=>{n(13,S=Math.max(1,S-1)),te()};function oe(){S=xc(this.value),n(13,S)}const ze=()=>{n(13,S=S+1),te()},Le=(we,Ue)=>q(we.key,Ue),Pe=(we,Ue)=>ve(we.key,Ue);function Ye(we){x[we.key]=this.value,n(12,x)}return[s,c,f,d,p,g,_,m,y,v,k,C,x,S,M,N,L,I,P,F,T,z,w,D,J,r,o,i,Z,$,V,se,W,K,te,q,be,ve,Ne,le,me,ae,ne,Ae,A,re,X,H,U,Y,ie,ue,G,ce,ke,he,xe,Te,ge,je,Fe,oe,ze,Le,Pe,Ye,(we,Ue)=>{Ue.key==="Enter"&&be(we.key)},we=>be(we.key)]}class N0 extends sn{constructor(t){super(),on(this,t,L0,E0,$t,{},null,[-1,-1,-1])}}function Sl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function z0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ui(e){let t,n,r;e.length!==2?(t=Sl,n=(s,c)=>Sl(e(s),c),r=(s,c)=>e(s)-c):(t=e===Sl||e===z0?e:I0,n=e,r=e);function l(s,c,f=0,d=s.length){if(f<d){if(t(c,c)!==0)return d;do{const h=f+d>>>1;n(s[h],c)<0?f=h+1:d=h}while(f<d)}return f}function o(s,c,f=0,d=s.length){if(f<d){if(t(c,c)!==0)return d;do{const h=f+d>>>1;n(s[h],c)<=0?f=h+1:d=h}while(f<d)}return f}function i(s,c,f=0,d=s.length){const h=l(s,c,f,d-1);return h>f&&r(s[h-1],c)>-r(s[h],c)?h-1:h}return{left:l,center:i,right:o}}function I0(){return 0}function P0(e){return e===null?NaN:+e}const D0=Ui(Sl),F0=D0.right;Ui(P0).center;function O0(e,t){let n,r;if(t===void 0)for(const l of e)l!=null&&(n===void 0?l>=l&&(n=r=l):(n>l&&(n=l),r<l&&(r=l)));else{let l=-1;for(let o of e)(o=t(o,++l,e))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Ra extends Map{constructor(t,n=B0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,l]of t)this.set(r,l)}get(t){return super.get(Ba(this,t))}has(t){return super.has(Ba(this,t))}set(t,n){return super.set(j0(this,t),n)}delete(t){return super.delete(R0(this,t))}}function Ba({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function j0({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function R0({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function B0(e){return e!==null&&typeof e=="object"?e.valueOf():e}const U0=Math.sqrt(50),H0=Math.sqrt(10),W0=Math.sqrt(2);function Dl(e,t,n){const r=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(r)),o=r/Math.pow(10,l),i=o>=U0?10:o>=H0?5:o>=W0?2:1;let s,c,f;return l<0?(f=Math.pow(10,-l)/i,s=Math.round(e*f),c=Math.round(t*f),s/f<e&&++s,c/f>t&&--c,f=-f):(f=Math.pow(10,l)*i,s=Math.round(e/f),c=Math.round(t/f),s*f<e&&++s,c*f>t&&--c),c<s&&.5<=n&&n<2?Dl(e,t,n*2):[s,c,f]}function Z0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[l,o,i]=r?Dl(t,e,n):Dl(e,t,n);if(!(o>=l))return[];const s=o-l+1,c=new Array(s);if(r)if(i<0)for(let f=0;f<s;++f)c[f]=(o-f)/-i;else for(let f=0;f<s;++f)c[f]=(o-f)*i;else if(i<0)for(let f=0;f<s;++f)c[f]=(l+f)/-i;else for(let f=0;f<s;++f)c[f]=(l+f)*i;return c}function xi(e,t,n){return t=+t,e=+e,n=+n,Dl(e,t,n)[2]}function Ci(e,t,n){t=+t,e=+e,n=+n;const r=t<e,l=r?xi(t,e,n):xi(e,t,n);return(r?-1:1)*(l<0?1/-l:l)}function bl(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let l of e)(l=t(l,++r,e))!=null&&(n<l||n===void 0&&l>=l)&&(n=l)}return n}function V0(e,t,n){e=+e,t=+t,n=(l=arguments.length)<2?(t=e,e=0,1):l<3?1:+n;for(var r=-1,l=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(l);++r<l;)o[r]=e+r*n;return o}function Y0(e){return e}var ui=1,ci=2,Si=3,Wr=4,Ua=1e-6;function q0(e){return"translate("+e+",0)"}function J0(e){return"translate(0,"+e+")"}function G0(e){return t=>+e(t)}function K0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function X0(){return!this.__axis}function Fc(e,t){var n=[],r=null,l=null,o=6,i=6,s=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=e===ui||e===Wr?-1:1,d=e===Wr||e===ci?"x":"y",h=e===ui||e===Si?q0:J0;function p(g){var _=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=l??(t.tickFormat?t.tickFormat.apply(t,n):Y0),y=Math.max(o,0)+s,v=t.range(),k=+v[0]+c,C=+v[v.length-1]+c,x=(t.bandwidth?K0:G0)(t.copy(),c),S=g.selection?g.selection():g,M=S.selectAll(".domain").data([null]),N=S.selectAll(".tick").data(_,t).order(),L=N.exit(),I=N.enter().append("g").attr("class","tick"),P=N.select("line"),F=N.select("text");M=M.merge(M.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),N=N.merge(I),P=P.merge(I.append("line").attr("stroke","currentColor").attr(d+"2",f*o)),F=F.merge(I.append("text").attr("fill","currentColor").attr(d,f*y).attr("dy",e===ui?"0em":e===Si?"0.71em":"0.32em")),g!==S&&(M=M.transition(g),N=N.transition(g),P=P.transition(g),F=F.transition(g),L=L.transition(g).attr("opacity",Ua).attr("transform",function(T){return isFinite(T=x(T))?h(T+c):this.getAttribute("transform")}),I.attr("opacity",Ua).attr("transform",function(T){var z=this.parentNode.__axis;return h((z&&isFinite(z=z(T))?z:x(T))+c)})),L.remove(),M.attr("d",e===Wr||e===ci?i?"M"+f*i+","+k+"H"+c+"V"+C+"H"+f*i:"M"+c+","+k+"V"+C:i?"M"+k+","+f*i+"V"+c+"H"+C+"V"+f*i:"M"+k+","+c+"H"+C),N.attr("opacity",1).attr("transform",function(T){return h(x(T)+c)}),P.attr(d+"2",f*o),F.attr(d,f*y).text(m),S.filter(X0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===ci?"start":e===Wr?"end":"middle"),S.each(function(){this.__axis=x})}return p.scale=function(g){return arguments.length?(t=g,p):t},p.ticks=function(){return n=Array.from(arguments),p},p.tickArguments=function(g){return arguments.length?(n=g==null?[]:Array.from(g),p):n.slice()},p.tickValues=function(g){return arguments.length?(r=g==null?null:Array.from(g),p):r&&r.slice()},p.tickFormat=function(g){return arguments.length?(l=g,p):l},p.tickSize=function(g){return arguments.length?(o=i=+g,p):o},p.tickSizeInner=function(g){return arguments.length?(o=+g,p):o},p.tickSizeOuter=function(g){return arguments.length?(i=+g,p):i},p.tickPadding=function(g){return arguments.length?(s=+g,p):s},p.offset=function(g){return arguments.length?(c=+g,p):c},p}function Ha(e){return Fc(Si,e)}function Wa(e){return Fc(Wr,e)}var Q0={value:()=>{}};function Oc(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Al(n)}function Al(e){this._=e}function $0(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",l=n.indexOf(".");if(l>=0&&(r=n.slice(l+1),n=n.slice(0,l)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Al.prototype=Oc.prototype={constructor:Al,on:function(e,t){var n=this._,r=$0(e+"",n),l,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((l=(e=r[o]).type)&&(l=eh(n[l],e.name)))return l;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(l=(e=r[o]).type)n[l]=Za(n[l],e.name,t);else if(t==null)for(l in n)n[l]=Za(n[l],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Al(e)},call:function(e,t){if((l=arguments.length-2)>0)for(var n=new Array(l),r=0,l,o;r<l;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,l=o.length;r<l;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],l=0,o=r.length;l<o;++l)r[l].value.apply(t,n)}};function eh(e,t){for(var n=0,r=e.length,l;n<r;++n)if((l=e[n]).name===t)return l.value}function Za(e,t,n){for(var r=0,l=e.length;r<l;++r)if(e[r].name===t){e[r]=Q0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ai="http://www.w3.org/1999/xhtml";const Va={svg:"http://www.w3.org/2000/svg",xhtml:Ai,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ql(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Va.hasOwnProperty(t)?{space:Va[t],local:e}:e}function th(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ai&&t.documentElement.namespaceURI===Ai?t.createElement(e):t.createElementNS(n,e)}}function nh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jc(e){var t=Ql(e);return(t.local?nh:th)(t)}function rh(){}function Hi(e){return e==null?rh:function(){return this.querySelector(e)}}function lh(e){typeof e!="function"&&(e=Hi(e));for(var t=this._groups,n=t.length,r=new Array(n),l=0;l<n;++l)for(var o=t[l],i=o.length,s=r[l]=new Array(i),c,f,d=0;d<i;++d)(c=o[d])&&(f=e.call(c,c.__data__,d,o))&&("__data__"in c&&(f.__data__=c.__data__),s[d]=f);return new ln(r,this._parents)}function ih(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function oh(){return[]}function Rc(e){return e==null?oh:function(){return this.querySelectorAll(e)}}function sh(e){return function(){return ih(e.apply(this,arguments))}}function ah(e){typeof e=="function"?e=sh(e):e=Rc(e);for(var t=this._groups,n=t.length,r=[],l=[],o=0;o<n;++o)for(var i=t[o],s=i.length,c,f=0;f<s;++f)(c=i[f])&&(r.push(e.call(c,c.__data__,f,i)),l.push(c));return new ln(r,l)}function Bc(e){return function(){return this.matches(e)}}function Uc(e){return function(t){return t.matches(e)}}var uh=Array.prototype.find;function ch(e){return function(){return uh.call(this.children,e)}}function fh(){return this.firstElementChild}function dh(e){return this.select(e==null?fh:ch(typeof e=="function"?e:Uc(e)))}var hh=Array.prototype.filter;function ph(){return Array.from(this.children)}function gh(e){return function(){return hh.call(this.children,e)}}function mh(e){return this.selectAll(e==null?ph:gh(typeof e=="function"?e:Uc(e)))}function _h(e){typeof e!="function"&&(e=Bc(e));for(var t=this._groups,n=t.length,r=new Array(n),l=0;l<n;++l)for(var o=t[l],i=o.length,s=r[l]=[],c,f=0;f<i;++f)(c=o[f])&&e.call(c,c.__data__,f,o)&&s.push(c);return new ln(r,this._parents)}function Hc(e){return new Array(e.length)}function bh(){return new ln(this._enter||this._groups.map(Hc),this._parents)}function Fl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Fl.prototype={constructor:Fl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function yh(e){return function(){return e}}function vh(e,t,n,r,l,o){for(var i=0,s,c=t.length,f=o.length;i<f;++i)(s=t[i])?(s.__data__=o[i],r[i]=s):n[i]=new Fl(e,o[i]);for(;i<c;++i)(s=t[i])&&(l[i]=s)}function kh(e,t,n,r,l,o,i){var s,c,f=new Map,d=t.length,h=o.length,p=new Array(d),g;for(s=0;s<d;++s)(c=t[s])&&(p[s]=g=i.call(c,c.__data__,s,t)+"",f.has(g)?l[s]=c:f.set(g,c));for(s=0;s<h;++s)g=i.call(e,o[s],s,o)+"",(c=f.get(g))?(r[s]=c,c.__data__=o[s],f.delete(g)):n[s]=new Fl(e,o[s]);for(s=0;s<d;++s)(c=t[s])&&f.get(p[s])===c&&(l[s]=c)}function wh(e){return e.__data__}function xh(e,t){if(!arguments.length)return Array.from(this,wh);var n=t?kh:vh,r=this._parents,l=this._groups;typeof e!="function"&&(e=yh(e));for(var o=l.length,i=new Array(o),s=new Array(o),c=new Array(o),f=0;f<o;++f){var d=r[f],h=l[f],p=h.length,g=Ch(e.call(d,d&&d.__data__,f,r)),_=g.length,m=s[f]=new Array(_),y=i[f]=new Array(_),v=c[f]=new Array(p);n(d,h,m,y,v,g,t);for(var k=0,C=0,x,S;k<_;++k)if(x=m[k]){for(k>=C&&(C=k+1);!(S=y[C])&&++C<_;);x._next=S||null}}return i=new ln(i,r),i._enter=s,i._exit=c,i}function Ch(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Sh(){return new ln(this._exit||this._groups.map(Hc),this._parents)}function Ah(e,t,n){var r=this.enter(),l=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(l=t(l),l&&(l=l.selection())),n==null?o.remove():n(o),r&&l?r.merge(l).order():l}function Th(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,l=n.length,o=r.length,i=Math.min(l,o),s=new Array(l),c=0;c<i;++c)for(var f=n[c],d=r[c],h=f.length,p=s[c]=new Array(h),g,_=0;_<h;++_)(g=f[_]||d[_])&&(p[_]=g);for(;c<l;++c)s[c]=n[c];return new ln(s,this._parents)}function Mh(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],l=r.length-1,o=r[l],i;--l>=0;)(i=r[l])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function Eh(e){e||(e=Lh);function t(h,p){return h&&p?e(h.__data__,p.__data__):!h-!p}for(var n=this._groups,r=n.length,l=new Array(r),o=0;o<r;++o){for(var i=n[o],s=i.length,c=l[o]=new Array(s),f,d=0;d<s;++d)(f=i[d])&&(c[d]=f);c.sort(t)}return new ln(l,this._parents).order()}function Lh(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Nh(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zh(){return Array.from(this)}function Ih(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],l=0,o=r.length;l<o;++l){var i=r[l];if(i)return i}return null}function Ph(){let e=0;for(const t of this)++e;return e}function Dh(){return!this.node()}function Fh(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var l=t[n],o=0,i=l.length,s;o<i;++o)(s=l[o])&&e.call(s,s.__data__,o,l);return this}function Oh(e){return function(){this.removeAttribute(e)}}function jh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Rh(e,t){return function(){this.setAttribute(e,t)}}function Bh(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Uh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Hh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Wh(e,t){var n=Ql(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?jh:Oh:typeof t=="function"?n.local?Hh:Uh:n.local?Bh:Rh)(n,t))}function Wc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Zh(e){return function(){this.style.removeProperty(e)}}function Vh(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Yh(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function qh(e,t,n){return arguments.length>1?this.each((t==null?Zh:typeof t=="function"?Yh:Vh)(e,t,n??"")):Cr(this.node(),e)}function Cr(e,t){return e.style.getPropertyValue(t)||Wc(e).getComputedStyle(e,null).getPropertyValue(t)}function Jh(e){return function(){delete this[e]}}function Gh(e,t){return function(){this[e]=t}}function Kh(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Xh(e,t){return arguments.length>1?this.each((t==null?Jh:typeof t=="function"?Kh:Gh)(e,t)):this.node()[e]}function Zc(e){return e.trim().split(/^|\s+/)}function Wi(e){return e.classList||new Vc(e)}function Vc(e){this._node=e,this._names=Zc(e.getAttribute("class")||"")}Vc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Yc(e,t){for(var n=Wi(e),r=-1,l=t.length;++r<l;)n.add(t[r])}function qc(e,t){for(var n=Wi(e),r=-1,l=t.length;++r<l;)n.remove(t[r])}function Qh(e){return function(){Yc(this,e)}}function $h(e){return function(){qc(this,e)}}function e1(e,t){return function(){(t.apply(this,arguments)?Yc:qc)(this,e)}}function t1(e,t){var n=Zc(e+"");if(arguments.length<2){for(var r=Wi(this.node()),l=-1,o=n.length;++l<o;)if(!r.contains(n[l]))return!1;return!0}return this.each((typeof t=="function"?e1:t?Qh:$h)(n,t))}function n1(){this.textContent=""}function r1(e){return function(){this.textContent=e}}function l1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function i1(e){return arguments.length?this.each(e==null?n1:(typeof e=="function"?l1:r1)(e)):this.node().textContent}function o1(){this.innerHTML=""}function s1(e){return function(){this.innerHTML=e}}function a1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function u1(e){return arguments.length?this.each(e==null?o1:(typeof e=="function"?a1:s1)(e)):this.node().innerHTML}function c1(){this.nextSibling&&this.parentNode.appendChild(this)}function f1(){return this.each(c1)}function d1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function h1(){return this.each(d1)}function p1(e){var t=typeof e=="function"?e:jc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function g1(){return null}function m1(e,t){var n=typeof e=="function"?e:jc(e),r=t==null?g1:typeof t=="function"?t:Hi(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function _1(){var e=this.parentNode;e&&e.removeChild(this)}function b1(){return this.each(_1)}function y1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function v1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function k1(e){return this.select(e?v1:y1)}function w1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function x1(e){return function(t){e.call(this,t,this.__data__)}}function C1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function S1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,l=t.length,o;n<l;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function A1(e,t,n){return function(){var r=this.__on,l,o=x1(t);if(r){for(var i=0,s=r.length;i<s;++i)if((l=r[i]).type===e.type&&l.name===e.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=o,l.options=n),l.value=t;return}}this.addEventListener(e.type,o,n),l={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(l):this.__on=[l]}}function T1(e,t,n){var r=C1(e+""),l,o=r.length,i;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,f=s.length,d;c<f;++c)for(l=0,d=s[c];l<o;++l)if((i=r[l]).type===d.type&&i.name===d.name)return d.value}return}for(s=t?A1:S1,l=0;l<o;++l)this.each(s(r[l],t,n));return this}function Jc(e,t,n){var r=Wc(e),l=r.CustomEvent;typeof l=="function"?l=new l(t,n):(l=r.document.createEvent("Event"),n?(l.initEvent(t,n.bubbles,n.cancelable),l.detail=n.detail):l.initEvent(t,!1,!1)),e.dispatchEvent(l)}function M1(e,t){return function(){return Jc(this,e,t)}}function E1(e,t){return function(){return Jc(this,e,t.apply(this,arguments))}}function L1(e,t){return this.each((typeof t=="function"?E1:M1)(e,t))}function*N1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],l=0,o=r.length,i;l<o;++l)(i=r[l])&&(yield i)}var Gc=[null];function ln(e,t){this._groups=e,this._parents=t}function nl(){return new ln([[document.documentElement]],Gc)}function z1(){return this}ln.prototype=nl.prototype={constructor:ln,select:lh,selectAll:ah,selectChild:dh,selectChildren:mh,filter:_h,data:xh,enter:bh,exit:Sh,join:Ah,merge:Th,selection:z1,order:Mh,sort:Eh,call:Nh,nodes:zh,node:Ih,size:Ph,empty:Dh,each:Fh,attr:Wh,style:qh,property:Xh,classed:t1,text:i1,html:u1,raise:f1,lower:h1,append:p1,insert:m1,remove:b1,clone:k1,datum:w1,on:T1,dispatch:L1,[Symbol.iterator]:N1};function en(e){return typeof e=="string"?new ln([[document.querySelector(e)]],[document.documentElement]):new ln([[e]],Gc)}function $l(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Zi(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zr(){}var Jn=.7,Sr=1/Jn,vr="\\s*([+-]?\\d+)\\s*",Xr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",I1=/^#([0-9a-f]{3,8})$/,P1=new RegExp(`^rgb\\(${vr},${vr},${vr}\\)$`),D1=new RegExp(`^rgb\\(${mn},${mn},${mn}\\)$`),F1=new RegExp(`^rgba\\(${vr},${vr},${vr},${Xr}\\)$`),O1=new RegExp(`^rgba\\(${mn},${mn},${mn},${Xr}\\)$`),j1=new RegExp(`^hsl\\(${Xr},${mn},${mn}\\)$`),R1=new RegExp(`^hsla\\(${Xr},${mn},${mn},${Xr}\\)$`),Ya={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};$l(zr,Gn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qa,formatHex:qa,formatHex8:B1,formatHsl:U1,formatRgb:Ja,toString:Ja});function qa(){return this.rgb().formatHex()}function B1(){return this.rgb().formatHex8()}function U1(){return Xc(this).formatHsl()}function Ja(){return this.rgb().formatRgb()}function Gn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=I1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ga(t):n===3?new Pt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?yl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?yl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=P1.exec(e))?new Pt(t[1],t[2],t[3],1):(t=D1.exec(e))?new Pt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=F1.exec(e))?yl(t[1],t[2],t[3],t[4]):(t=O1.exec(e))?yl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=j1.exec(e))?Qa(t[1],t[2]/100,t[3]/100,1):(t=R1.exec(e))?Qa(t[1],t[2]/100,t[3]/100,t[4]):Ya.hasOwnProperty(e)?Ga(Ya[e]):e==="transparent"?new Pt(NaN,NaN,NaN,0):null}function Ga(e){return new Pt(e>>16&255,e>>8&255,e&255,1)}function yl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Pt(e,t,n,r)}function Kc(e){return e instanceof zr||(e=Gn(e)),e?(e=e.rgb(),new Pt(e.r,e.g,e.b,e.opacity)):new Pt}function Ti(e,t,n,r){return arguments.length===1?Kc(e):new Pt(e,t,n,r??1)}function Pt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}$l(Pt,Ti,Zi(zr,{brighter(e){return e=e==null?Sr:Math.pow(Sr,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jn:Math.pow(Jn,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pt(Yn(this.r),Yn(this.g),Yn(this.b),Ol(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ka,formatHex:Ka,formatHex8:H1,formatRgb:Xa,toString:Xa}));function Ka(){return`#${Zn(this.r)}${Zn(this.g)}${Zn(this.b)}`}function H1(){return`#${Zn(this.r)}${Zn(this.g)}${Zn(this.b)}${Zn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xa(){const e=Ol(this.opacity);return`${e===1?"rgb(":"rgba("}${Yn(this.r)}, ${Yn(this.g)}, ${Yn(this.b)}${e===1?")":`, ${e})`}`}function Ol(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Zn(e){return e=Yn(e),(e<16?"0":"")+e.toString(16)}function Qa(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new dn(e,t,n,r)}function Xc(e){if(e instanceof dn)return new dn(e.h,e.s,e.l,e.opacity);if(e instanceof zr||(e=Gn(e)),!e)return new dn;if(e instanceof dn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,l=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,s=o-l,c=(o+l)/2;return s?(t===o?i=(n-r)/s+(n<r)*6:n===o?i=(r-t)/s+2:i=(t-n)/s+4,s/=c<.5?o+l:2-o-l,i*=60):s=c>0&&c<1?0:i,new dn(i,s,c,e.opacity)}function W1(e,t,n,r){return arguments.length===1?Xc(e):new dn(e,t,n,r??1)}function dn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}$l(dn,W1,Zi(zr,{brighter(e){return e=e==null?Sr:Math.pow(Sr,e),new dn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jn:Math.pow(Jn,e),new dn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,l=2*n-r;return new Pt(fi(e>=240?e-240:e+120,l,r),fi(e,l,r),fi(e<120?e+240:e-120,l,r),this.opacity)},clamp(){return new dn($a(this.h),vl(this.s),vl(this.l),Ol(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ol(this.opacity);return`${e===1?"hsl(":"hsla("}${$a(this.h)}, ${vl(this.s)*100}%, ${vl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $a(e){return e=(e||0)%360,e<0?e+360:e}function vl(e){return Math.max(0,Math.min(1,e||0))}function fi(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Z1=Math.PI/180,V1=180/Math.PI;var Qc=-.14861,Vi=1.78277,Yi=-.29227,ei=-.90649,Qr=1.97294,eu=Qr*ei,tu=Qr*Vi,nu=Vi*Yi-ei*Qc;function Y1(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);e instanceof Pt||(e=Kc(e));var t=e.r/255,n=e.g/255,r=e.b/255,l=(nu*r+eu*t-tu*n)/(nu+eu-tu),o=r-l,i=(Qr*(n-l)-Yi*o)/ei,s=Math.sqrt(i*i+o*o)/(Qr*l*(1-l)),c=s?Math.atan2(i,o)*V1-120:NaN;return new qn(c<0?c+360:c,s,l,e.opacity)}function Dn(e,t,n,r){return arguments.length===1?Y1(e):new qn(e,t,n,r??1)}function qn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}$l(qn,Dn,Zi(zr,{brighter(e){return e=e==null?Sr:Math.pow(Sr,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jn:Math.pow(Jn,e),new qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Z1,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),l=Math.sin(e);return new Pt(255*(t+n*(Qc*r+Vi*l)),255*(t+n*(Yi*r+ei*l)),255*(t+n*(Qr*r)),this.opacity)}}));const ti=e=>()=>e;function $c(e,t){return function(n){return e+n*t}}function q1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function J1(e,t){var n=t-e;return n?$c(e,n>180||n<-180?n-360*Math.round(n/360):n):ti(isNaN(e)?t:e)}function G1(e){return(e=+e)==1?kr:function(t,n){return n-t?q1(t,n,e):ti(isNaN(t)?n:t)}}function kr(e,t){var n=t-e;return n?$c(e,n):ti(isNaN(e)?t:e)}const jl=function e(t){var n=G1(t);function r(l,o){var i=n((l=Ti(l)).r,(o=Ti(o)).r),s=n(l.g,o.g),c=n(l.b,o.b),f=kr(l.opacity,o.opacity);return function(d){return l.r=i(d),l.g=s(d),l.b=c(d),l.opacity=f(d),l+""}}return r.gamma=e,r}(1);function K1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),l;return function(o){for(l=0;l<n;++l)r[l]=e[l]*(1-o)+t[l]*o;return r}}function X1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Q1(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,l=new Array(r),o=new Array(n),i;for(i=0;i<r;++i)l[i]=ni(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(s){for(i=0;i<r;++i)o[i]=l[i](s);return o}}function $1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function fn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ep(e,t){var n={},r={},l;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(l in t)l in e?n[l]=ni(e[l],t[l]):r[l]=t[l];return function(o){for(l in n)r[l]=n[l](o);return r}}var Mi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,di=new RegExp(Mi.source,"g");function tp(e){return function(){return e}}function np(e){return function(t){return e(t)+""}}function ef(e,t){var n=Mi.lastIndex=di.lastIndex=0,r,l,o,i=-1,s=[],c=[];for(e=e+"",t=t+"";(r=Mi.exec(e))&&(l=di.exec(t));)(o=l.index)>n&&(o=t.slice(n,o),s[i]?s[i]+=o:s[++i]=o),(r=r[0])===(l=l[0])?s[i]?s[i]+=l:s[++i]=l:(s[++i]=null,c.push({i,x:fn(r,l)})),n=di.lastIndex;return n<t.length&&(o=t.slice(n),s[i]?s[i]+=o:s[++i]=o),s.length<2?c[0]?np(c[0].x):tp(t):(t=c.length,function(f){for(var d=0,h;d<t;++d)s[(h=c[d]).i]=h.x(f);return s.join("")})}function ni(e,t){var n=typeof t,r;return t==null||n==="boolean"?ti(t):(n==="number"?fn:n==="string"?(r=Gn(t))?(t=r,jl):ef:t instanceof Gn?jl:t instanceof Date?$1:X1(t)?K1:Array.isArray(t)?Q1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ep:fn)(e,t)}function tf(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var ru=180/Math.PI,Ei={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nf(e,t,n,r,l,o){var i,s,c;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,i=-i),{translateX:l,translateY:o,rotate:Math.atan2(t,e)*ru,skewX:Math.atan(c)*ru,scaleX:i,scaleY:s}}var kl;function rp(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ei:nf(t.a,t.b,t.c,t.d,t.e,t.f)}function lp(e){return e==null||(kl||(kl=document.createElementNS("http://www.w3.org/2000/svg","g")),kl.setAttribute("transform",e),!(e=kl.transform.baseVal.consolidate()))?Ei:(e=e.matrix,nf(e.a,e.b,e.c,e.d,e.e,e.f))}function rf(e,t,n,r){function l(f){return f.length?f.pop()+" ":""}function o(f,d,h,p,g,_){if(f!==h||d!==p){var m=g.push("translate(",null,t,null,n);_.push({i:m-4,x:fn(f,h)},{i:m-2,x:fn(d,p)})}else(h||p)&&g.push("translate("+h+t+p+n)}function i(f,d,h,p){f!==d?(f-d>180?d+=360:d-f>180&&(f+=360),p.push({i:h.push(l(h)+"rotate(",null,r)-2,x:fn(f,d)})):d&&h.push(l(h)+"rotate("+d+r)}function s(f,d,h,p){f!==d?p.push({i:h.push(l(h)+"skewX(",null,r)-2,x:fn(f,d)}):d&&h.push(l(h)+"skewX("+d+r)}function c(f,d,h,p,g,_){if(f!==h||d!==p){var m=g.push(l(g)+"scale(",null,",",null,")");_.push({i:m-4,x:fn(f,h)},{i:m-2,x:fn(d,p)})}else(h!==1||p!==1)&&g.push(l(g)+"scale("+h+","+p+")")}return function(f,d){var h=[],p=[];return f=e(f),d=e(d),o(f.translateX,f.translateY,d.translateX,d.translateY,h,p),i(f.rotate,d.rotate,h,p),s(f.skewX,d.skewX,h,p),c(f.scaleX,f.scaleY,d.scaleX,d.scaleY,h,p),f=d=null,function(g){for(var _=-1,m=p.length,y;++_<m;)h[(y=p[_]).i]=y.x(g);return h.join("")}}}var ip=rf(rp,"px, ","px)","deg)"),op=rf(lp,", ",")",")");function lf(e){return function t(n){n=+n;function r(l,o){var i=e((l=Dn(l)).h,(o=Dn(o)).h),s=kr(l.s,o.s),c=kr(l.l,o.l),f=kr(l.opacity,o.opacity);return function(d){return l.h=i(d),l.s=s(d),l.l=c(Math.pow(d,n)),l.opacity=f(d),l+""}}return r.gamma=t,r}(1)}lf(J1);var of=lf(kr),Ar=0,Zr=0,Rr=0,sf=1e3,Rl,Vr,Bl=0,Kn=0,ri=0,$r=typeof performance=="object"&&performance.now?performance:Date,af=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qi(){return Kn||(af(sp),Kn=$r.now()+ri)}function sp(){Kn=0}function Ul(){this._call=this._time=this._next=null}Ul.prototype=uf.prototype={constructor:Ul,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?qi():+n)+(t==null?0:+t),!this._next&&Vr!==this&&(Vr?Vr._next=this:Rl=this,Vr=this),this._call=e,this._time=n,Li()},stop:function(){this._call&&(this._call=null,this._time=1/0,Li())}};function uf(e,t,n){var r=new Ul;return r.restart(e,t,n),r}function ap(){qi(),++Ar;for(var e=Rl,t;e;)(t=Kn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ar}function lu(){Kn=(Bl=$r.now())+ri,Ar=Zr=0;try{ap()}finally{Ar=0,cp(),Kn=0}}function up(){var e=$r.now(),t=e-Bl;t>sf&&(ri-=t,Bl=e)}function cp(){for(var e,t=Rl,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Rl=n);Vr=e,Li(r)}function Li(e){if(!Ar){Zr&&(Zr=clearTimeout(Zr));var t=e-Kn;t>24?(e<1/0&&(Zr=setTimeout(lu,e-$r.now()-ri)),Rr&&(Rr=clearInterval(Rr))):(Rr||(Bl=$r.now(),Rr=setInterval(up,sf)),Ar=1,af(lu))}}function iu(e,t,n){var r=new Ul;return t=t==null?0:+t,r.restart(l=>{r.stop(),e(l+t)},t,n),r}var fp=Oc("start","end","cancel","interrupt"),dp=[],cf=0,ou=1,Ni=2,Tl=3,su=4,zi=5,Ml=6;function li(e,t,n,r,l,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;hp(e,n,{name:t,index:r,group:l,on:fp,tween:dp,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:cf})}function Ji(e,t){var n=hn(e,t);if(n.state>cf)throw new Error("too late; already scheduled");return n}function _n(e,t){var n=hn(e,t);if(n.state>Tl)throw new Error("too late; already running");return n}function hn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function hp(e,t,n){var r=e.__transition,l;r[t]=n,n.timer=uf(o,0,n.time);function o(f){n.state=ou,n.timer.restart(i,n.delay,n.time),n.delay<=f&&i(f-n.delay)}function i(f){var d,h,p,g;if(n.state!==ou)return c();for(d in r)if(g=r[d],g.name===n.name){if(g.state===Tl)return iu(i);g.state===su?(g.state=Ml,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=Ml,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(iu(function(){n.state===Tl&&(n.state=su,n.timer.restart(s,n.delay,n.time),s(f))}),n.state=Ni,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ni){for(n.state=Tl,l=new Array(p=n.tween.length),d=0,h=-1;d<p;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(l[++h]=g);l.length=h+1}}function s(f){for(var d=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=zi,1),h=-1,p=l.length;++h<p;)l[h].call(e,d);n.state===zi&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Ml,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function pp(e,t){var n=e.__transition,r,l,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){o=!1;continue}l=r.state>Ni&&r.state<zi,r.state=Ml,r.timer.stop(),r.on.call(l?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function gp(e){return this.each(function(){pp(this,e)})}function mp(e,t){var n,r;return function(){var l=_n(this,e),o=l.tween;if(o!==n){r=n=o;for(var i=0,s=r.length;i<s;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}l.tween=r}}function _p(e,t,n){var r,l;if(typeof n!="function")throw new Error;return function(){var o=_n(this,e),i=o.tween;if(i!==r){l=(r=i).slice();for(var s={name:t,value:n},c=0,f=l.length;c<f;++c)if(l[c].name===t){l[c]=s;break}c===f&&l.push(s)}o.tween=l}}function bp(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=hn(this.node(),n).tween,l=0,o=r.length,i;l<o;++l)if((i=r[l]).name===e)return i.value;return null}return this.each((t==null?mp:_p)(n,e,t))}function Gi(e,t,n){var r=e._id;return e.each(function(){var l=_n(this,r);(l.value||(l.value={}))[t]=n.apply(this,arguments)}),function(l){return hn(l,r).value[t]}}function ff(e,t){var n;return(typeof t=="number"?fn:t instanceof Gn?jl:(n=Gn(t))?(t=n,jl):ef)(e,t)}function yp(e){return function(){this.removeAttribute(e)}}function vp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kp(e,t,n){var r,l=n+"",o;return function(){var i=this.getAttribute(e);return i===l?null:i===r?o:o=t(r=i,n)}}function wp(e,t,n){var r,l=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===l?null:i===r?o:o=t(r=i,n)}}function xp(e,t,n){var r,l,o;return function(){var i,s=n(this),c;return s==null?void this.removeAttribute(e):(i=this.getAttribute(e),c=s+"",i===c?null:i===r&&c===l?o:(l=c,o=t(r=i,s)))}}function Cp(e,t,n){var r,l,o;return function(){var i,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),c=s+"",i===c?null:i===r&&c===l?o:(l=c,o=t(r=i,s)))}}function Sp(e,t){var n=Ql(e),r=n==="transform"?op:ff;return this.attrTween(e,typeof t=="function"?(n.local?Cp:xp)(n,r,Gi(this,"attr."+e,t)):t==null?(n.local?vp:yp)(n):(n.local?wp:kp)(n,r,t))}function Ap(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Tp(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Mp(e,t){var n,r;function l(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&Tp(e,o)),n}return l._value=t,l}function Ep(e,t){var n,r;function l(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&Ap(e,o)),n}return l._value=t,l}function Lp(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Ql(e);return this.tween(n,(r.local?Mp:Ep)(r,t))}function Np(e,t){return function(){Ji(this,e).delay=+t.apply(this,arguments)}}function zp(e,t){return t=+t,function(){Ji(this,e).delay=t}}function Ip(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Np:zp)(t,e)):hn(this.node(),t).delay}function Pp(e,t){return function(){_n(this,e).duration=+t.apply(this,arguments)}}function Dp(e,t){return t=+t,function(){_n(this,e).duration=t}}function Fp(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Pp:Dp)(t,e)):hn(this.node(),t).duration}function Op(e,t){if(typeof t!="function")throw new Error;return function(){_n(this,e).ease=t}}function jp(e){var t=this._id;return arguments.length?this.each(Op(t,e)):hn(this.node(),t).ease}function Rp(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;_n(this,e).ease=n}}function Bp(e){if(typeof e!="function")throw new Error;return this.each(Rp(this._id,e))}function Up(e){typeof e!="function"&&(e=Bc(e));for(var t=this._groups,n=t.length,r=new Array(n),l=0;l<n;++l)for(var o=t[l],i=o.length,s=r[l]=[],c,f=0;f<i;++f)(c=o[f])&&e.call(c,c.__data__,f,o)&&s.push(c);return new Sn(r,this._parents,this._name,this._id)}function Hp(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,l=n.length,o=Math.min(r,l),i=new Array(r),s=0;s<o;++s)for(var c=t[s],f=n[s],d=c.length,h=i[s]=new Array(d),p,g=0;g<d;++g)(p=c[g]||f[g])&&(h[g]=p);for(;s<r;++s)i[s]=t[s];return new Sn(i,this._parents,this._name,this._id)}function Wp(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Zp(e,t,n){var r,l,o=Wp(t)?Ji:_n;return function(){var i=o(this,e),s=i.on;s!==r&&(l=(r=s).copy()).on(t,n),i.on=l}}function Vp(e,t){var n=this._id;return arguments.length<2?hn(this.node(),n).on.on(e):this.each(Zp(n,e,t))}function Yp(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function qp(){return this.on("end.remove",Yp(this._id))}function Jp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Hi(e));for(var r=this._groups,l=r.length,o=new Array(l),i=0;i<l;++i)for(var s=r[i],c=s.length,f=o[i]=new Array(c),d,h,p=0;p<c;++p)(d=s[p])&&(h=e.call(d,d.__data__,p,s))&&("__data__"in d&&(h.__data__=d.__data__),f[p]=h,li(f[p],t,n,p,f,hn(d,n)));return new Sn(o,this._parents,t,n)}function Gp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Rc(e));for(var r=this._groups,l=r.length,o=[],i=[],s=0;s<l;++s)for(var c=r[s],f=c.length,d,h=0;h<f;++h)if(d=c[h]){for(var p=e.call(d,d.__data__,h,c),g,_=hn(d,n),m=0,y=p.length;m<y;++m)(g=p[m])&&li(g,t,n,m,p,_);o.push(p),i.push(d)}return new Sn(o,i,t,n)}var Kp=nl.prototype.constructor;function Xp(){return new Kp(this._groups,this._parents)}function Qp(e,t){var n,r,l;return function(){var o=Cr(this,e),i=(this.style.removeProperty(e),Cr(this,e));return o===i?null:o===n&&i===r?l:l=t(n=o,r=i)}}function df(e){return function(){this.style.removeProperty(e)}}function $p(e,t,n){var r,l=n+"",o;return function(){var i=Cr(this,e);return i===l?null:i===r?o:o=t(r=i,n)}}function eg(e,t,n){var r,l,o;return function(){var i=Cr(this,e),s=n(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Cr(this,e))),i===c?null:i===r&&c===l?o:(l=c,o=t(r=i,s))}}function tg(e,t){var n,r,l,o="style."+t,i="end."+o,s;return function(){var c=_n(this,e),f=c.on,d=c.value[o]==null?s||(s=df(t)):void 0;(f!==n||l!==d)&&(r=(n=f).copy()).on(i,l=d),c.on=r}}function ng(e,t,n){var r=(e+="")=="transform"?ip:ff;return t==null?this.styleTween(e,Qp(e,r)).on("end.style."+e,df(e)):typeof t=="function"?this.styleTween(e,eg(e,r,Gi(this,"style."+e,t))).each(tg(this._id,e)):this.styleTween(e,$p(e,r,t),n).on("end.style."+e,null)}function rg(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function lg(e,t,n){var r,l;function o(){var i=t.apply(this,arguments);return i!==l&&(r=(l=i)&&rg(e,i,n)),r}return o._value=t,o}function ig(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,lg(e,t,n??""))}function og(e){return function(){this.textContent=e}}function sg(e){return function(){var t=e(this);this.textContent=t??""}}function ag(e){return this.tween("text",typeof e=="function"?sg(Gi(this,"text",e)):og(e==null?"":e+""))}function ug(e){return function(t){this.textContent=e.call(this,t)}}function cg(e){var t,n;function r(){var l=e.apply(this,arguments);return l!==n&&(t=(n=l)&&ug(l)),t}return r._value=e,r}function fg(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,cg(e))}function dg(){for(var e=this._name,t=this._id,n=hf(),r=this._groups,l=r.length,o=0;o<l;++o)for(var i=r[o],s=i.length,c,f=0;f<s;++f)if(c=i[f]){var d=hn(c,t);li(c,e,n,f,i,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Sn(r,this._parents,e,n)}function hg(){var e,t,n=this,r=n._id,l=n.size();return new Promise(function(o,i){var s={value:i},c={value:function(){--l===0&&o()}};n.each(function(){var f=_n(this,r),d=f.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),f.on=t}),l===0&&o()})}var pg=0;function Sn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function hf(){return++pg}var wn=nl.prototype;Sn.prototype={constructor:Sn,select:Jp,selectAll:Gp,selectChild:wn.selectChild,selectChildren:wn.selectChildren,filter:Up,merge:Hp,selection:Xp,transition:dg,call:wn.call,nodes:wn.nodes,node:wn.node,size:wn.size,empty:wn.empty,each:wn.each,on:Vp,attr:Sp,attrTween:Lp,style:ng,styleTween:ig,text:ag,textTween:fg,remove:qp,tween:bp,delay:Ip,duration:Fp,ease:jp,easeVarying:Bp,end:hg,[Symbol.iterator]:wn[Symbol.iterator]};function gg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var mg={time:null,delay:0,duration:250,ease:gg};function _g(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function bg(e){var t,n;e instanceof Sn?(t=e._id,e=e._name):(t=hf(),(n=mg).time=qi(),e=e==null?null:e+"");for(var r=this._groups,l=r.length,o=0;o<l;++o)for(var i=r[o],s=i.length,c,f=0;f<s;++f)(c=i[f])&&li(c,e,t,f,i,n||_g(c,t));return new Sn(r,this._parents,e,t)}nl.prototype.interrupt=gp;nl.prototype.transition=bg;const Ii=Math.PI,Pi=2*Ii,Un=1e-6,yg=Pi-Un;function pf(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function vg(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return pf;const n=10**t;return function(r){this._+=r[0];for(let l=1,o=r.length;l<o;++l)this._+=Math.round(arguments[l]*n)/n+r[l]}}class kg{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?pf:vg(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,l){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+l}`}bezierCurveTo(t,n,r,l,o,i){this._append`C${+t},${+n},${+r},${+l},${this._x1=+o},${this._y1=+i}`}arcTo(t,n,r,l,o){if(t=+t,n=+n,r=+r,l=+l,o=+o,o<0)throw new Error(`negative radius: ${o}`);let i=this._x1,s=this._y1,c=r-t,f=l-n,d=i-t,h=s-n,p=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(p>Un)if(!(Math.abs(h*c-f*d)>Un)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-i,_=l-s,m=c*c+f*f,y=g*g+_*_,v=Math.sqrt(m),k=Math.sqrt(p),C=o*Math.tan((Ii-Math.acos((m+p-y)/(2*v*k)))/2),x=C/k,S=C/v;Math.abs(x-1)>Un&&this._append`L${t+x*d},${n+x*h}`,this._append`A${o},${o},0,0,${+(h*g>d*_)},${this._x1=t+S*c},${this._y1=n+S*f}`}}arc(t,n,r,l,o,i){if(t=+t,n=+n,r=+r,i=!!i,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(l),c=r*Math.sin(l),f=t+s,d=n+c,h=1^i,p=i?l-o:o-l;this._x1===null?this._append`M${f},${d}`:(Math.abs(this._x1-f)>Un||Math.abs(this._y1-d)>Un)&&this._append`L${f},${d}`,r&&(p<0&&(p=p%Pi+Pi),p>yg?this._append`A${r},${r},0,1,${h},${t-s},${n-c}A${r},${r},0,1,${h},${this._x1=f},${this._y1=d}`:p>Un&&this._append`A${r},${r},0,${+(p>=Ii)},${h},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,l){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+l}h${-r}Z`}toString(){return this._}}function wg(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Hl(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Tr(e){return e=Hl(Math.abs(e)),e?e[1]:NaN}function xg(e,t){return function(n,r){for(var l=n.length,o=[],i=0,s=e[0],c=0;l>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(n.substring(l-=s,l+s)),!((c+=s+1)>r));)s=e[i=(i+1)%e.length];return o.reverse().join(t)}}function Cg(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Sg=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Wl(e){if(!(t=Sg.exec(e)))throw new Error("invalid format: "+e);var t;return new Ki({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Wl.prototype=Ki.prototype;function Ki(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ki.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Ag(e){e:for(var t=e.length,n=1,r=-1,l;n<t;++n)switch(e[n]){case".":r=l=n;break;case"0":r===0&&(r=n),l=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(l+1):e}var Zl;function Tg(e,t){var n=Hl(e,t);if(!n)return Zl=void 0,e.toPrecision(t);var r=n[0],l=n[1],o=l-(Zl=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,i=r.length;return o===i?r:o>i?r+new Array(o-i+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Hl(e,Math.max(0,t+o-1))[0]}function au(e,t){var n=Hl(e,t);if(!n)return e+"";var r=n[0],l=n[1];return l<0?"0."+new Array(-l).join("0")+r:r.length>l+1?r.slice(0,l+1)+"."+r.slice(l+1):r+new Array(l-r.length+2).join("0")}const uu={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:wg,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>au(e*100,t),r:au,s:Tg,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cu(e){return e}var fu=Array.prototype.map,du=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Mg(e){var t=e.grouping===void 0||e.thousands===void 0?cu:xg(fu.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",l=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?cu:Cg(fu.call(e.numerals,String)),i=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(h,p){h=Wl(h);var g=h.fill,_=h.align,m=h.sign,y=h.symbol,v=h.zero,k=h.width,C=h.comma,x=h.precision,S=h.trim,M=h.type;M==="n"?(C=!0,M="g"):uu[M]||(x===void 0&&(x=12),S=!0,M="g"),(v||g==="0"&&_==="=")&&(v=!0,g="0",_="=");var N=(p&&p.prefix!==void 0?p.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():""),L=(y==="$"?r:/[%p]/.test(M)?i:"")+(p&&p.suffix!==void 0?p.suffix:""),I=uu[M],P=/[defgprs%]/.test(M);x=x===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function F(T){var z=N,w=L,D,J,Z;if(M==="c")w=I(T)+w,T="";else{T=+T;var $=T<0||1/T<0;if(T=isNaN(T)?c:I(Math.abs(T),x),S&&(T=Ag(T)),$&&+T==0&&m!=="+"&&($=!1),z=($?m==="("?m:s:m==="-"||m==="("?"":m)+z,w=(M==="s"&&!isNaN(T)&&Zl!==void 0?du[8+Zl/3]:"")+w+($&&m==="("?")":""),P){for(D=-1,J=T.length;++D<J;)if(Z=T.charCodeAt(D),48>Z||Z>57){w=(Z===46?l+T.slice(D+1):T.slice(D))+w,T=T.slice(0,D);break}}}C&&!v&&(T=t(T,1/0));var V=z.length+T.length+w.length,se=V<k?new Array(k-V+1).join(g):"";switch(C&&v&&(T=t(se+T,se.length?k-w.length:1/0),se=""),_){case"<":T=z+T+w+se;break;case"=":T=z+se+T+w;break;case"^":T=se.slice(0,V=se.length>>1)+z+T+w+se.slice(V);break;default:T=se+z+T+w;break}return o(T)}return F.toString=function(){return h+""},F}function d(h,p){var g=Math.max(-8,Math.min(8,Math.floor(Tr(p)/3)))*3,_=Math.pow(10,-g),m=f((h=Wl(h),h.type="f",h),{suffix:du[8+g/3]});return function(y){return m(_*y)}}return{format:f,formatPrefix:d}}var wl,Vl,gf;Eg({thousands:",",grouping:[3],currency:["$",""]});function Eg(e){return wl=Mg(e),Vl=wl.format,gf=wl.formatPrefix,wl}function Lg(e){return Math.max(0,-Tr(Math.abs(e)))}function Ng(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Tr(t)/3)))*3-Tr(Math.abs(e)))}function zg(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Tr(t)-Tr(e))+1}function ii(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ig(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const hu=Symbol("implicit");function mf(){var e=new Ra,t=[],n=[],r=hu;function l(o){let i=e.get(o);if(i===void 0){if(r!==hu)return r;e.set(o,i=t.push(o)-1)}return n[i%n.length]}return l.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Ra;for(const i of o)e.has(i)||e.set(i,t.push(i)-1);return l},l.range=function(o){return arguments.length?(n=Array.from(o),l):n.slice()},l.unknown=function(o){return arguments.length?(r=o,l):r},l.copy=function(){return mf(t,n).unknown(r)},ii.apply(l,arguments),l}function _f(){var e=mf().unknown(void 0),t=e.domain,n=e.range,r=0,l=1,o,i,s=!1,c=0,f=0,d=.5;delete e.unknown;function h(){var p=t().length,g=l<r,_=g?l:r,m=g?r:l;o=(m-_)/Math.max(1,p-c+f*2),s&&(o=Math.floor(o)),_+=(m-_-o*(p-c))*d,i=o*(1-c),s&&(_=Math.round(_),i=Math.round(i));var y=V0(p).map(function(v){return _+o*v});return n(g?y.reverse():y)}return e.domain=function(p){return arguments.length?(t(p),h()):t()},e.range=function(p){return arguments.length?([r,l]=p,r=+r,l=+l,h()):[r,l]},e.rangeRound=function(p){return[r,l]=p,r=+r,l=+l,s=!0,h()},e.bandwidth=function(){return i},e.step=function(){return o},e.round=function(p){return arguments.length?(s=!!p,h()):s},e.padding=function(p){return arguments.length?(c=Math.min(1,f=+p),h()):c},e.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),h()):c},e.paddingOuter=function(p){return arguments.length?(f=+p,h()):f},e.align=function(p){return arguments.length?(d=Math.max(0,Math.min(1,p)),h()):d},e.copy=function(){return _f(t(),[r,l]).round(s).paddingInner(c).paddingOuter(f).align(d)},ii.apply(h(),arguments)}function Pg(e){return function(){return e}}function Dg(e){return+e}var pu=[0,1];function Pn(e){return e}function Di(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Pg(isNaN(t)?NaN:.5)}function Fg(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Og(e,t,n){var r=e[0],l=e[1],o=t[0],i=t[1];return l<r?(r=Di(l,r),o=n(i,o)):(r=Di(r,l),o=n(o,i)),function(s){return o(r(s))}}function jg(e,t,n){var r=Math.min(e.length,t.length)-1,l=new Array(r),o=new Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)l[i]=Di(e[i],e[i+1]),o[i]=n(t[i],t[i+1]);return function(s){var c=F0(e,s,1,r)-1;return o[c](l[c](s))}}function bf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Rg(){var e=pu,t=pu,n=ni,r,l,o,i=Pn,s,c,f;function d(){var p=Math.min(e.length,t.length);return i!==Pn&&(i=Fg(e[0],e[p-1])),s=p>2?jg:Og,c=f=null,h}function h(p){return p==null||isNaN(p=+p)?o:(c||(c=s(e.map(r),t,n)))(r(i(p)))}return h.invert=function(p){return i(l((f||(f=s(t,e.map(r),fn)))(p)))},h.domain=function(p){return arguments.length?(e=Array.from(p,Dg),d()):e.slice()},h.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},h.rangeRound=function(p){return t=Array.from(p),n=tf,d()},h.clamp=function(p){return arguments.length?(i=p?!0:Pn,d()):i!==Pn},h.interpolate=function(p){return arguments.length?(n=p,d()):n},h.unknown=function(p){return arguments.length?(o=p,h):o},function(p,g){return r=p,l=g,d()}}function yf(){return Rg()(Pn,Pn)}function Bg(e,t,n,r){var l=Ci(e,t,n),o;switch(r=Wl(r??",f"),r.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Ng(l,i))&&(r.precision=o),gf(r,i)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=zg(l,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Lg(l))&&(r.precision=o-(r.type==="%")*2);break}}return Vl(r)}function vf(e){var t=e.domain;return e.ticks=function(n){var r=t();return Z0(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var l=t();return Bg(l[0],l[l.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),l=0,o=r.length-1,i=r[l],s=r[o],c,f,d=10;for(s<i&&(f=i,i=s,s=f,f=l,l=o,o=f);d-- >0;){if(f=xi(i,s,n),f===c)return r[l]=i,r[o]=s,t(r);if(f>0)i=Math.floor(i/f)*f,s=Math.ceil(s/f)*f;else if(f<0)i=Math.ceil(i*f)/f,s=Math.floor(s*f)/f;else break;c=f}return e},e}function Yr(){var e=yf();return e.copy=function(){return bf(e,Yr())},ii.apply(e,arguments),vf(e)}function Ug(e,t){e=e.slice();var n=0,r=e.length-1,l=e[n],o=e[r],i;return o<l&&(i=n,n=r,r=i,i=l,l=o,o=i),e[n]=t.floor(l),e[r]=t.ceil(o),e}const hi=new Date,pi=new Date;function St(e,t,n,r){function l(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return l.floor=o=>(e(o=new Date(+o)),o),l.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),l.round=o=>{const i=l(o),s=l.ceil(o);return o-i<s-o?i:s},l.offset=(o,i)=>(t(o=new Date(+o),i==null?1:Math.floor(i)),o),l.range=(o,i,s)=>{const c=[];if(o=l.ceil(o),s=s==null?1:Math.floor(s),!(o<i)||!(s>0))return c;let f;do c.push(f=new Date(+o)),t(o,s),e(o);while(f<o&&o<i);return c},l.filter=o=>St(i=>{if(i>=i)for(;e(i),!o(i);)i.setTime(i-1)},(i,s)=>{if(i>=i)if(s<0)for(;++s<=0;)for(;t(i,-1),!o(i););else for(;--s>=0;)for(;t(i,1),!o(i););}),n&&(l.count=(o,i)=>(hi.setTime(+o),pi.setTime(+i),e(hi),e(pi),Math.floor(n(hi,pi))),l.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?l.filter(r?i=>r(i)%o===0:i=>l.count(0,i)%o===0):l)),l}const Yl=St(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Yl.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?St(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Yl);Yl.range;const xn=1e3,cn=xn*60,Cn=cn*60,An=Cn*24,Xi=An*7,gu=An*30,gi=An*365,_r=St(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*xn)},(e,t)=>(t-e)/xn,e=>e.getUTCSeconds());_r.range;const Qi=St(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*xn)},(e,t)=>{e.setTime(+e+t*cn)},(e,t)=>(t-e)/cn,e=>e.getMinutes());Qi.range;const Hg=St(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*cn)},(e,t)=>(t-e)/cn,e=>e.getUTCMinutes());Hg.range;const $i=St(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*xn-e.getMinutes()*cn)},(e,t)=>{e.setTime(+e+t*Cn)},(e,t)=>(t-e)/Cn,e=>e.getHours());$i.range;const Wg=St(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Cn)},(e,t)=>(t-e)/Cn,e=>e.getUTCHours());Wg.range;const rl=St(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*cn)/An,e=>e.getDate()-1);rl.range;const eo=St(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/An,e=>e.getUTCDate()-1);eo.range;const Zg=St(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/An,e=>Math.floor(e/An));Zg.range;function Qn(e){return St(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*cn)/Xi)}const oi=Qn(0),ql=Qn(1),Vg=Qn(2),Yg=Qn(3),Mr=Qn(4),qg=Qn(5),Jg=Qn(6);oi.range;ql.range;Vg.range;Yg.range;Mr.range;qg.range;Jg.range;function $n(e){return St(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Xi)}const kf=$n(0),Jl=$n(1),Gg=$n(2),Kg=$n(3),Er=$n(4),Xg=$n(5),Qg=$n(6);kf.range;Jl.range;Gg.range;Kg.range;Er.range;Xg.range;Qg.range;const to=St(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());to.range;const $g=St(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());$g.range;const Tn=St(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Tn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:St(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Tn.range;const Xn=St(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Xn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:St(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Xn.range;function em(e,t,n,r,l,o){const i=[[_r,1,xn],[_r,5,5*xn],[_r,15,15*xn],[_r,30,30*xn],[o,1,cn],[o,5,5*cn],[o,15,15*cn],[o,30,30*cn],[l,1,Cn],[l,3,3*Cn],[l,6,6*Cn],[l,12,12*Cn],[r,1,An],[r,2,2*An],[n,1,Xi],[t,1,gu],[t,3,3*gu],[e,1,gi]];function s(f,d,h){const p=d<f;p&&([f,d]=[d,f]);const g=h&&typeof h.range=="function"?h:c(f,d,h),_=g?g.range(f,+d+1):[];return p?_.reverse():_}function c(f,d,h){const p=Math.abs(d-f)/h,g=Ui(([,,y])=>y).right(i,p);if(g===i.length)return e.every(Ci(f/gi,d/gi,h));if(g===0)return Yl.every(Math.max(Ci(f,d,h),1));const[_,m]=i[p/i[g-1][2]<i[g][2]/p?g-1:g];return _.every(m)}return[s,c]}const[tm,nm]=em(Tn,to,oi,rl,$i,Qi);function mi(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function _i(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Br(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function rm(e){var t=e.dateTime,n=e.date,r=e.time,l=e.periods,o=e.days,i=e.shortDays,s=e.months,c=e.shortMonths,f=Ur(l),d=Hr(l),h=Ur(o),p=Hr(o),g=Ur(i),_=Hr(i),m=Ur(s),y=Hr(s),v=Ur(c),k=Hr(c),C={a:Z,A:$,b:V,B:se,c:null,d:ku,e:ku,f:Am,g:Fm,G:jm,H:xm,I:Cm,j:Sm,L:wf,m:Tm,M:Mm,p:B,q:W,Q:Cu,s:Su,S:Em,u:Lm,U:Nm,V:zm,w:Im,W:Pm,x:null,X:null,y:Dm,Y:Om,Z:Rm,"%":xu},x={a:K,A:te,b:q,B:be,c:null,d:wu,e:wu,f:Wm,g:$m,G:t_,H:Bm,I:Um,j:Hm,L:Cf,m:Zm,M:Vm,p:ve,q:Ne,Q:Cu,s:Su,S:Ym,u:qm,U:Jm,V:Gm,w:Km,W:Xm,x:null,X:null,y:Qm,Y:e_,Z:n_,"%":xu},S={a:P,A:F,b:T,B:z,c:w,d:yu,e:yu,f:ym,g:bu,G:_u,H:vu,I:vu,j:gm,L:bm,m:pm,M:mm,p:I,q:hm,Q:km,s:wm,S:_m,u:am,U:um,V:cm,w:sm,W:fm,x:D,X:J,y:bu,Y:_u,Z:dm,"%":vm};C.x=M(n,C),C.X=M(r,C),C.c=M(t,C),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x);function M(le,me){return function(ae){var ne=[],Ae=-1,A=0,re=le.length,X,H,U;for(ae instanceof Date||(ae=new Date(+ae));++Ae<re;)le.charCodeAt(Ae)===37&&(ne.push(le.slice(A,Ae)),(H=mu[X=le.charAt(++Ae)])!=null?X=le.charAt(++Ae):H=X==="e"?" ":"0",(U=me[X])&&(X=U(ae,H)),ne.push(X),A=Ae+1);return ne.push(le.slice(A,Ae)),ne.join("")}}function N(le,me){return function(ae){var ne=Br(1900,void 0,1),Ae=L(ne,le,ae+="",0),A,re;if(Ae!=ae.length)return null;if("Q"in ne)return new Date(ne.Q);if("s"in ne)return new Date(ne.s*1e3+("L"in ne?ne.L:0));if(me&&!("Z"in ne)&&(ne.Z=0),"p"in ne&&(ne.H=ne.H%12+ne.p*12),ne.m===void 0&&(ne.m="q"in ne?ne.q:0),"V"in ne){if(ne.V<1||ne.V>53)return null;"w"in ne||(ne.w=1),"Z"in ne?(A=_i(Br(ne.y,0,1)),re=A.getUTCDay(),A=re>4||re===0?Jl.ceil(A):Jl(A),A=eo.offset(A,(ne.V-1)*7),ne.y=A.getUTCFullYear(),ne.m=A.getUTCMonth(),ne.d=A.getUTCDate()+(ne.w+6)%7):(A=mi(Br(ne.y,0,1)),re=A.getDay(),A=re>4||re===0?ql.ceil(A):ql(A),A=rl.offset(A,(ne.V-1)*7),ne.y=A.getFullYear(),ne.m=A.getMonth(),ne.d=A.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),re="Z"in ne?_i(Br(ne.y,0,1)).getUTCDay():mi(Br(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(re+5)%7:ne.w+ne.U*7-(re+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,_i(ne)):mi(ne)}}function L(le,me,ae,ne){for(var Ae=0,A=me.length,re=ae.length,X,H;Ae<A;){if(ne>=re)return-1;if(X=me.charCodeAt(Ae++),X===37){if(X=me.charAt(Ae++),H=S[X in mu?me.charAt(Ae++):X],!H||(ne=H(le,ae,ne))<0)return-1}else if(X!=ae.charCodeAt(ne++))return-1}return ne}function I(le,me,ae){var ne=f.exec(me.slice(ae));return ne?(le.p=d.get(ne[0].toLowerCase()),ae+ne[0].length):-1}function P(le,me,ae){var ne=g.exec(me.slice(ae));return ne?(le.w=_.get(ne[0].toLowerCase()),ae+ne[0].length):-1}function F(le,me,ae){var ne=h.exec(me.slice(ae));return ne?(le.w=p.get(ne[0].toLowerCase()),ae+ne[0].length):-1}function T(le,me,ae){var ne=v.exec(me.slice(ae));return ne?(le.m=k.get(ne[0].toLowerCase()),ae+ne[0].length):-1}function z(le,me,ae){var ne=m.exec(me.slice(ae));return ne?(le.m=y.get(ne[0].toLowerCase()),ae+ne[0].length):-1}function w(le,me,ae){return L(le,t,me,ae)}function D(le,me,ae){return L(le,n,me,ae)}function J(le,me,ae){return L(le,r,me,ae)}function Z(le){return i[le.getDay()]}function $(le){return o[le.getDay()]}function V(le){return c[le.getMonth()]}function se(le){return s[le.getMonth()]}function B(le){return l[+(le.getHours()>=12)]}function W(le){return 1+~~(le.getMonth()/3)}function K(le){return i[le.getUTCDay()]}function te(le){return o[le.getUTCDay()]}function q(le){return c[le.getUTCMonth()]}function be(le){return s[le.getUTCMonth()]}function ve(le){return l[+(le.getUTCHours()>=12)]}function Ne(le){return 1+~~(le.getUTCMonth()/3)}return{format:function(le){var me=M(le+="",C);return me.toString=function(){return le},me},parse:function(le){var me=N(le+="",!1);return me.toString=function(){return le},me},utcFormat:function(le){var me=M(le+="",x);return me.toString=function(){return le},me},utcParse:function(le){var me=N(le+="",!0);return me.toString=function(){return le},me}}}var mu={"-":"",_:" ",0:"0"},Tt=/^\s*\d+/,lm=/^%/,im=/[\\^$*+?|[\]().{}]/g;function pt(e,t,n){var r=e<0?"-":"",l=(r?-e:e)+"",o=l.length;return r+(o<n?new Array(n-o+1).join(t)+l:l)}function om(e){return e.replace(im,"\\$&")}function Ur(e){return new RegExp("^(?:"+e.map(om).join("|")+")","i")}function Hr(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function sm(e,t,n){var r=Tt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function am(e,t,n){var r=Tt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function um(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function cm(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function fm(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function _u(e,t,n){var r=Tt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function bu(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function dm(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function hm(e,t,n){var r=Tt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function pm(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function yu(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function gm(e,t,n){var r=Tt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function vu(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function mm(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function _m(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function bm(e,t,n){var r=Tt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ym(e,t,n){var r=Tt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function vm(e,t,n){var r=lm.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function km(e,t,n){var r=Tt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function wm(e,t,n){var r=Tt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ku(e,t){return pt(e.getDate(),t,2)}function xm(e,t){return pt(e.getHours(),t,2)}function Cm(e,t){return pt(e.getHours()%12||12,t,2)}function Sm(e,t){return pt(1+rl.count(Tn(e),e),t,3)}function wf(e,t){return pt(e.getMilliseconds(),t,3)}function Am(e,t){return wf(e,t)+"000"}function Tm(e,t){return pt(e.getMonth()+1,t,2)}function Mm(e,t){return pt(e.getMinutes(),t,2)}function Em(e,t){return pt(e.getSeconds(),t,2)}function Lm(e){var t=e.getDay();return t===0?7:t}function Nm(e,t){return pt(oi.count(Tn(e)-1,e),t,2)}function xf(e){var t=e.getDay();return t>=4||t===0?Mr(e):Mr.ceil(e)}function zm(e,t){return e=xf(e),pt(Mr.count(Tn(e),e)+(Tn(e).getDay()===4),t,2)}function Im(e){return e.getDay()}function Pm(e,t){return pt(ql.count(Tn(e)-1,e),t,2)}function Dm(e,t){return pt(e.getFullYear()%100,t,2)}function Fm(e,t){return e=xf(e),pt(e.getFullYear()%100,t,2)}function Om(e,t){return pt(e.getFullYear()%1e4,t,4)}function jm(e,t){var n=e.getDay();return e=n>=4||n===0?Mr(e):Mr.ceil(e),pt(e.getFullYear()%1e4,t,4)}function Rm(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+pt(t/60|0,"0",2)+pt(t%60,"0",2)}function wu(e,t){return pt(e.getUTCDate(),t,2)}function Bm(e,t){return pt(e.getUTCHours(),t,2)}function Um(e,t){return pt(e.getUTCHours()%12||12,t,2)}function Hm(e,t){return pt(1+eo.count(Xn(e),e),t,3)}function Cf(e,t){return pt(e.getUTCMilliseconds(),t,3)}function Wm(e,t){return Cf(e,t)+"000"}function Zm(e,t){return pt(e.getUTCMonth()+1,t,2)}function Vm(e,t){return pt(e.getUTCMinutes(),t,2)}function Ym(e,t){return pt(e.getUTCSeconds(),t,2)}function qm(e){var t=e.getUTCDay();return t===0?7:t}function Jm(e,t){return pt(kf.count(Xn(e)-1,e),t,2)}function Sf(e){var t=e.getUTCDay();return t>=4||t===0?Er(e):Er.ceil(e)}function Gm(e,t){return e=Sf(e),pt(Er.count(Xn(e),e)+(Xn(e).getUTCDay()===4),t,2)}function Km(e){return e.getUTCDay()}function Xm(e,t){return pt(Jl.count(Xn(e)-1,e),t,2)}function Qm(e,t){return pt(e.getUTCFullYear()%100,t,2)}function $m(e,t){return e=Sf(e),pt(e.getUTCFullYear()%100,t,2)}function e_(e,t){return pt(e.getUTCFullYear()%1e4,t,4)}function t_(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Er(e):Er.ceil(e),pt(e.getUTCFullYear()%1e4,t,4)}function n_(){return"+0000"}function xu(){return"%"}function Cu(e){return+e}function Su(e){return Math.floor(+e/1e3)}var pr,no,Af;r_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function r_(e){return pr=rm(e),no=pr.format,Af=pr.parse,pr.utcFormat,pr.utcParse,pr}function l_(e){return new Date(e)}function i_(e){return e instanceof Date?+e:+new Date(+e)}function Tf(e,t,n,r,l,o,i,s,c,f){var d=yf(),h=d.invert,p=d.domain,g=f(".%L"),_=f(":%S"),m=f("%I:%M"),y=f("%I %p"),v=f("%a %d"),k=f("%b %d"),C=f("%B"),x=f("%Y");function S(M){return(c(M)<M?g:s(M)<M?_:i(M)<M?m:o(M)<M?y:r(M)<M?l(M)<M?v:k:n(M)<M?C:x)(M)}return d.invert=function(M){return new Date(h(M))},d.domain=function(M){return arguments.length?p(Array.from(M,i_)):p().map(l_)},d.ticks=function(M){var N=p();return e(N[0],N[N.length-1],M??10)},d.tickFormat=function(M,N){return N==null?S:f(N)},d.nice=function(M){var N=p();return(!M||typeof M.range!="function")&&(M=t(N[0],N[N.length-1],M??10)),M?p(Ug(N,M)):d},d.copy=function(){return bf(d,Tf(e,t,n,r,l,o,i,s,c,f))},d}function o_(){return ii.apply(Tf(tm,nm,Tn,to,oi,rl,$i,Qi,_r,no).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function s_(){var e=0,t=1,n,r,l,o,i=Pn,s=!1,c;function f(h){return h==null||isNaN(h=+h)?c:i(l===0?.5:(h=(o(h)-n)*l,s?Math.max(0,Math.min(1,h)):h))}f.domain=function(h){return arguments.length?([e,t]=h,n=o(e=+e),r=o(t=+t),l=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(h){return arguments.length?(s=!!h,f):s},f.interpolator=function(h){return arguments.length?(i=h,f):i};function d(h){return function(p){var g,_;return arguments.length?([g,_]=p,i=h(g,_),f):[i(0),i(1)]}}return f.range=d(ni),f.rangeRound=d(tf),f.unknown=function(h){return arguments.length?(c=h,f):c},function(h){return o=h,n=h(e),r=h(t),l=n===r?0:1/(r-n),f}}function a_(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Mf(){var e=vf(s_()(Pn));return e.copy=function(){return a_(e,Mf())},Ig.apply(e,arguments)}of(Dn(-100,.75,.35),Dn(80,1.5,.8));var u_=of(Dn(260,.75,.35),Dn(80,1.5,.8));Dn();function ht(e){return function(){return e}}const Au=Math.abs,zt=Math.atan2,Bn=Math.cos,c_=Math.max,bi=Math.min,gn=Math.sin,br=Math.sqrt,Jt=1e-12,el=Math.PI,Gl=el/2,El=2*el;function f_(e){return e>1?0:e<-1?el:Math.acos(e)}function Tu(e){return e>=1?Gl:e<=-1?-Gl:Math.asin(e)}function ro(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new kg(t)}function d_(e){return e.innerRadius}function h_(e){return e.outerRadius}function p_(e){return e.startAngle}function g_(e){return e.endAngle}function m_(e){return e&&e.padAngle}function __(e,t,n,r,l,o,i,s){var c=n-e,f=r-t,d=i-l,h=s-o,p=h*c-d*f;if(!(p*p<Jt))return p=(d*(t-o)-h*(e-l))/p,[e+p*c,t+p*f]}function xl(e,t,n,r,l,o,i){var s=e-n,c=t-r,f=(i?o:-o)/br(s*s+c*c),d=f*c,h=-f*s,p=e+d,g=t+h,_=n+d,m=r+h,y=(p+_)/2,v=(g+m)/2,k=_-p,C=m-g,x=k*k+C*C,S=l-o,M=p*m-_*g,N=(C<0?-1:1)*br(c_(0,S*S*x-M*M)),L=(M*C-k*N)/x,I=(-M*k-C*N)/x,P=(M*C+k*N)/x,F=(-M*k+C*N)/x,T=L-y,z=I-v,w=P-y,D=F-v;return T*T+z*z>w*w+D*D&&(L=P,I=F),{cx:L,cy:I,x01:-d,y01:-h,x11:L*(l/S-1),y11:I*(l/S-1)}}function Mu(){var e=d_,t=h_,n=ht(0),r=null,l=p_,o=g_,i=m_,s=null,c=ro(f);function f(){var d,h,p=+e.apply(this,arguments),g=+t.apply(this,arguments),_=l.apply(this,arguments)-Gl,m=o.apply(this,arguments)-Gl,y=Au(m-_),v=m>_;if(s||(s=d=c()),g<p&&(h=g,g=p,p=h),!(g>Jt))s.moveTo(0,0);else if(y>El-Jt)s.moveTo(g*Bn(_),g*gn(_)),s.arc(0,0,g,_,m,!v),p>Jt&&(s.moveTo(p*Bn(m),p*gn(m)),s.arc(0,0,p,m,_,v));else{var k=_,C=m,x=_,S=m,M=y,N=y,L=i.apply(this,arguments)/2,I=L>Jt&&(r?+r.apply(this,arguments):br(p*p+g*g)),P=bi(Au(g-p)/2,+n.apply(this,arguments)),F=P,T=P,z,w;if(I>Jt){var D=Tu(I/p*gn(L)),J=Tu(I/g*gn(L));(M-=D*2)>Jt?(D*=v?1:-1,x+=D,S-=D):(M=0,x=S=(_+m)/2),(N-=J*2)>Jt?(J*=v?1:-1,k+=J,C-=J):(N=0,k=C=(_+m)/2)}var Z=g*Bn(k),$=g*gn(k),V=p*Bn(S),se=p*gn(S);if(P>Jt){var B=g*Bn(C),W=g*gn(C),K=p*Bn(x),te=p*gn(x),q;if(y<el)if(q=__(Z,$,K,te,B,W,V,se)){var be=Z-q[0],ve=$-q[1],Ne=B-q[0],le=W-q[1],me=1/gn(f_((be*Ne+ve*le)/(br(be*be+ve*ve)*br(Ne*Ne+le*le)))/2),ae=br(q[0]*q[0]+q[1]*q[1]);F=bi(P,(p-ae)/(me-1)),T=bi(P,(g-ae)/(me+1))}else F=T=0}N>Jt?T>Jt?(z=xl(K,te,Z,$,g,T,v),w=xl(B,W,V,se,g,T,v),s.moveTo(z.cx+z.x01,z.cy+z.y01),T<P?s.arc(z.cx,z.cy,T,zt(z.y01,z.x01),zt(w.y01,w.x01),!v):(s.arc(z.cx,z.cy,T,zt(z.y01,z.x01),zt(z.y11,z.x11),!v),s.arc(0,0,g,zt(z.cy+z.y11,z.cx+z.x11),zt(w.cy+w.y11,w.cx+w.x11),!v),s.arc(w.cx,w.cy,T,zt(w.y11,w.x11),zt(w.y01,w.x01),!v))):(s.moveTo(Z,$),s.arc(0,0,g,k,C,!v)):s.moveTo(Z,$),!(p>Jt)||!(M>Jt)?s.lineTo(V,se):F>Jt?(z=xl(V,se,B,W,p,-F,v),w=xl(Z,$,K,te,p,-F,v),s.lineTo(z.cx+z.x01,z.cy+z.y01),F<P?s.arc(z.cx,z.cy,F,zt(z.y01,z.x01),zt(w.y01,w.x01),!v):(s.arc(z.cx,z.cy,F,zt(z.y01,z.x01),zt(z.y11,z.x11),!v),s.arc(0,0,p,zt(z.cy+z.y11,z.cx+z.x11),zt(w.cy+w.y11,w.cx+w.x11),v),s.arc(w.cx,w.cy,F,zt(w.y11,w.x11),zt(w.y01,w.x01),!v))):s.arc(0,0,p,S,x,v)}if(s.closePath(),d)return s=null,d+""||null}return f.centroid=function(){var d=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+l.apply(this,arguments)+ +o.apply(this,arguments))/2-el/2;return[Bn(h)*d,gn(h)*d]},f.innerRadius=function(d){return arguments.length?(e=typeof d=="function"?d:ht(+d),f):e},f.outerRadius=function(d){return arguments.length?(t=typeof d=="function"?d:ht(+d),f):t},f.cornerRadius=function(d){return arguments.length?(n=typeof d=="function"?d:ht(+d),f):n},f.padRadius=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:ht(+d),f):r},f.startAngle=function(d){return arguments.length?(l=typeof d=="function"?d:ht(+d),f):l},f.endAngle=function(d){return arguments.length?(o=typeof d=="function"?d:ht(+d),f):o},f.padAngle=function(d){return arguments.length?(i=typeof d=="function"?d:ht(+d),f):i},f.context=function(d){return arguments.length?(s=d??null,f):s},f}function lo(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ef(e){this._context=e}Ef.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Lf(e){return new Ef(e)}function Nf(e){return e[0]}function zf(e){return e[1]}function If(e,t){var n=ht(!0),r=null,l=Lf,o=null,i=ro(s);e=typeof e=="function"?e:e===void 0?Nf:ht(e),t=typeof t=="function"?t:t===void 0?zf:ht(t);function s(c){var f,d=(c=lo(c)).length,h,p=!1,g;for(r==null&&(o=l(g=i())),f=0;f<=d;++f)!(f<d&&n(h=c[f],f,c))===p&&((p=!p)?o.lineStart():o.lineEnd()),p&&o.point(+e(h,f,c),+t(h,f,c));if(g)return o=null,g+""||null}return s.x=function(c){return arguments.length?(e=typeof c=="function"?c:ht(+c),s):e},s.y=function(c){return arguments.length?(t=typeof c=="function"?c:ht(+c),s):t},s.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ht(!!c),s):n},s.curve=function(c){return arguments.length?(l=c,r!=null&&(o=l(r)),s):l},s.context=function(c){return arguments.length?(c==null?r=o=null:o=l(r=c),s):r},s}function b_(e,t,n){var r=null,l=ht(!0),o=null,i=Lf,s=null,c=ro(f);e=typeof e=="function"?e:e===void 0?Nf:ht(+e),t=typeof t=="function"?t:ht(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?zf:ht(+n);function f(h){var p,g,_,m=(h=lo(h)).length,y,v=!1,k,C=new Array(m),x=new Array(m);for(o==null&&(s=i(k=c())),p=0;p<=m;++p){if(!(p<m&&l(y=h[p],p,h))===v)if(v=!v)g=p,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),_=p-1;_>=g;--_)s.point(C[_],x[_]);s.lineEnd(),s.areaEnd()}v&&(C[p]=+e(y,p,h),x[p]=+t(y,p,h),s.point(r?+r(y,p,h):C[p],n?+n(y,p,h):x[p]))}if(k)return s=null,k+""||null}function d(){return If().defined(l).curve(i).context(o)}return f.x=function(h){return arguments.length?(e=typeof h=="function"?h:ht(+h),r=null,f):e},f.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ht(+h),f):e},f.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:ht(+h),f):r},f.y=function(h){return arguments.length?(t=typeof h=="function"?h:ht(+h),n=null,f):t},f.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ht(+h),f):t},f.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ht(+h),f):n},f.lineX0=f.lineY0=function(){return d().x(e).y(t)},f.lineY1=function(){return d().x(e).y(n)},f.lineX1=function(){return d().x(r).y(t)},f.defined=function(h){return arguments.length?(l=typeof h=="function"?h:ht(!!h),f):l},f.curve=function(h){return arguments.length?(i=h,o!=null&&(s=i(o)),f):i},f.context=function(h){return arguments.length?(h==null?o=s=null:s=i(o=h),f):o},f}function y_(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function v_(e){return e}function k_(){var e=v_,t=y_,n=null,r=ht(0),l=ht(El),o=ht(0);function i(s){var c,f=(s=lo(s)).length,d,h,p=0,g=new Array(f),_=new Array(f),m=+r.apply(this,arguments),y=Math.min(El,Math.max(-El,l.apply(this,arguments)-m)),v,k=Math.min(Math.abs(y)/f,o.apply(this,arguments)),C=k*(y<0?-1:1),x;for(c=0;c<f;++c)(x=_[g[c]=c]=+e(s[c],c,s))>0&&(p+=x);for(t!=null?g.sort(function(S,M){return t(_[S],_[M])}):n!=null&&g.sort(function(S,M){return n(s[S],s[M])}),c=0,h=p?(y-f*C)/p:0;c<f;++c,m=v)d=g[c],x=_[d],v=m+(x>0?x*h:0)+C,_[d]={data:s[d],index:c,value:x,startAngle:m,endAngle:v,padAngle:k};return _}return i.value=function(s){return arguments.length?(e=typeof s=="function"?s:ht(+s),i):e},i.sortValues=function(s){return arguments.length?(t=s,n=null,i):t},i.sort=function(s){return arguments.length?(n=s,t=null,i):n},i.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:ht(+s),i):r},i.endAngle=function(s){return arguments.length?(l=typeof s=="function"?s:ht(+s),i):l},i.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:ht(+s),i):o},i}function Eu(e){return e<0?-1:1}function Lu(e,t,n){var r=e._x1-e._x0,l=t-e._x1,o=(e._y1-e._y0)/(r||l<0&&-0),i=(n-e._y1)/(l||r<0&&-0),s=(o*l+i*r)/(r+l);return(Eu(o)+Eu(i))*Math.min(Math.abs(o),Math.abs(i),.5*Math.abs(s))||0}function Nu(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function yi(e,t,n){var r=e._x0,l=e._y0,o=e._x1,i=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,l+s*t,o-s,i-s*n,o,i)}function Kl(e){this._context=e}Kl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:yi(this,this._t0,Nu(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,yi(this,Nu(this,n=Lu(this,e,t)),n);break;default:yi(this,this._t0,n=Lu(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};Object.create(Kl.prototype).point=function(e,t){Kl.prototype.point.call(this,t,e)};function zu(e){return new Kl(e)}function qr(e,t,n){this.k=e,this.x=t,this.y=n}qr.prototype={constructor:qr,scale:function(e){return e===1?this:new qr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};qr.prototype;function Iu(e,t,n){const r=e.slice();return r[88]=t[n],r}function vi(e){const t=e.slice(),n=new Set(t[24].translations.map(l=>l.lang));t[86]=n;const r=t[5].filter(function(...o){return e[74](t[86],...o)});return t[87]=r,t}function Pu(e,t,n){const r=e.slice();return r[91]=t[n],r}function Du(e,t,n){const r=e.slice();return r[88]=t[n],r}function Fu(e,t,n){const r=e.slice();return r[114]=t[n],r[116]=n,r}function Ou(e,t,n){const r=e.slice();r[99]=t[n];const l=q_(r[99].url);r[100]=l;const o=r[99].phraseCount>0?Math.round(r[99].approved/r[99].phraseCount*100):0;return r[101]=o,r}function ju(e,t,n){const r=e.slice();return r[104]=t[n],r}function Ru(e,t,n){const r=e.slice();return r[88]=t[n],r}function Bu(e,t,n){const r=e.slice();return r[109]=t[n],r}function Uu(e,t,n){const r=e.slice();return r[96]=t[n],r}function Hu(e,t,n){const r=e.slice();return r[96]=t[n],r}function Wu(e,t,n){const r=e.slice();return r[117]=t[n][0],r[118]=t[n][1],r}function Zu(e){let t,n=dt(e[4].totalPhrases)+"",r,l,o=dt(e[4].uniqueUrls)+"",i,s,c=dt(e[4].languageCount)+"",f,d;return{c(){t=b("span"),r=O(n),l=O(" phrases · "),i=O(o),s=O(" pages · "),f=O(c),d=O(" languages"),a(t,"class","text-xs text-gray-500 bg-gray-800 px-3 py-1.5 rounded-lg border border-gray-700")},m(h,p){R(h,t,p),u(t,r),u(t,l),u(t,i),u(t,s),u(t,f),u(t,d)},p(h,p){p[0]&16&&n!==(n=dt(h[4].totalPhrases)+"")&&ee(r,n),p[0]&16&&o!==(o=dt(h[4].uniqueUrls)+"")&&ee(i,o),p[0]&16&&c!==(c=dt(h[4].languageCount)+"")&&ee(f,c)},d(h){h&&j(t)}}}function w_(e){let t,n,r,l=Oe([["overview","Overview"],["pages","Pages & URLs"],["languages","Languages"]]),o=[];for(let f=0;f<3;f+=1)o[f]=Vu(Wu(e,l,f));function i(f,d){if(f[27]==="overview")return A_;if(f[27]==="pages")return S_;if(f[27]==="languages")return C_}let s=i(e),c=s&&s(e);return{c(){t=b("div");for(let f=0;f<3;f+=1)o[f].c();n=E(),c&&c.c(),r=Ct(),a(t,"class","flex gap-1 bg-gray-800 border border-gray-700 rounded-lg p-1 w-fit")},m(f,d){R(f,t,d);for(let h=0;h<3;h+=1)o[h]&&o[h].m(t,null);R(f,n,d),c&&c.m(f,d),R(f,r,d)},p(f,d){if(d[0]&134217728|d[1]&32768){l=Oe([["overview","Overview"],["pages","Pages & URLs"],["languages","Languages"]]);let h;for(h=0;h<3;h+=1){const p=Wu(f,l,h);o[h]?o[h].p(p,d):(o[h]=Vu(p),o[h].c(),o[h].m(t,null))}for(;h<3;h+=1)o[h].d(1)}s===(s=i(f))&&c?c.p(f,d):(c&&c.d(1),c=s&&s(f),c&&(c.c(),c.m(r.parentNode,r)))},d(f){f&&(j(t),j(n),j(r)),ft(o,f),c&&c.d(f)}}}function x_(e){let t;return{c(){t=b("div"),t.innerHTML=`<svg class="animate-spin w-5 h-5 mr-2" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" stroke-dasharray="60 20"></circle></svg>
65
+ Loading analytics…`,a(t,"class","flex items-center justify-center py-24 text-gray-500")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function Vu(e){let t,n,r,l,o;function i(){return e[48](e[117])}return{c(){t=b("button"),n=O(e[118]),a(t,"class",r="px-4 py-1.5 rounded-md text-xs font-medium transition-colors "+(e[27]===e[117]?"bg-indigo-600 text-white":"text-gray-400 hover:text-white"))},m(s,c){R(s,t,c),u(t,n),l||(o=Q(t,"click",i),l=!0)},p(s,c){e=s,c[0]&134217728&&r!==(r="px-4 py-1.5 rounded-md text-xs font-medium transition-colors "+(e[27]===e[117]?"bg-indigo-600 text-white":"text-gray-400 hover:text-white"))&&a(t,"class",r)},d(s){s&&j(t),l=!1,o()}}}function C_(e){let t,n,r,l,o,i,s,c,f,d,h,p=Oe(e[5]),g=[];for(let _=0;_<p.length;_+=1)g[_]=Yu(Fu(e,p,_));return{c(){t=b("div"),n=b("div"),r=b("h3"),r.textContent="Translations per Language",l=E(),o=b("div"),i=E(),s=b("div"),c=b("table"),f=b("thead"),f.innerHTML='<tr class="text-gray-400 uppercase text-[10px]"><th class="text-left px-4 py-2.5">Language</th> <th class="text-right px-4 py-2.5 w-28">Translated</th> <th class="text-left px-4 py-2.5">Coverage</th></tr>',d=E(),h=b("tbody");for(let _=0;_<g.length;_+=1)g[_].c();a(r,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),a(o,"class","w-full"),gt(o,"min-height","200px"),a(n,"class","bg-gray-800 border border-gray-700 rounded-xl p-4 lg:col-span-2"),a(t,"class","grid grid-cols-1 lg:grid-cols-2 gap-4"),a(f,"class","border-b border-gray-700"),a(c,"class","w-full text-xs"),a(s,"class","bg-gray-800 border border-gray-700 rounded-xl overflow-hidden")},m(_,m){R(_,t,m),u(t,n),u(n,r),u(n,l),u(n,o),e[70](o),R(_,i,m),R(_,s,m),u(s,c),u(c,f),u(c,d),u(c,h);for(let y=0;y<g.length;y+=1)g[y]&&g[y].m(h,null)},p(_,m){if(m[0]&32){p=Oe(_[5]);let y;for(y=0;y<p.length;y+=1){const v=Fu(_,p,y);g[y]?g[y].p(v,m):(g[y]=Yu(v),g[y].c(),g[y].m(h,null))}for(;y<g.length;y+=1)g[y].d(1);g.length=p.length}},d(_){_&&(j(t),j(i),j(s)),e[70](null),ft(g,_)}}}function S_(e){let t,n,r,l,o,i,s,c,f,d,h,p,g=dt(e[9])+"",_,m,y,v,k,C,x=Oe(e[6]),S=[];for(let F=0;F<x.length;F+=1)S[F]=qu(Uu(e,x,F));let M=Oe(e[7].filter(pc)),N=[];for(let F=0;F<M.length;F+=1)N[F]=Ju(Bu(e,M,F));function L(F,T){return F[11]?E_:F[8].length===0?M_:T_}let I=L(e),P=I(e);return{c(){t=b("div"),n=b("div"),r=de("svg"),l=de("path"),o=E(),i=b("input"),s=E(),c=b("div");for(let F=0;F<S.length;F+=1)S[F].c();f=E(),d=b("div");for(let F=0;F<N.length;F+=1)N[F].c();h=E(),p=b("span"),_=O(g),m=O(" pages"),y=E(),P.c(),v=Ct(),a(l,"fill-rule","evenodd"),a(l,"d","M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"),a(l,"clip-rule","evenodd"),a(r,"class","absolute left-2.5 top-2 w-4 h-4 text-gray-500"),a(r,"viewBox","0 0 20 20"),a(r,"fill","currentColor"),a(i,"class","bg-gray-800 border border-gray-700 rounded-lg pl-8 pr-3 py-1.5 text-sm text-gray-200 placeholder-gray-500 focus:outline-none focus:border-indigo-500 w-56"),a(i,"placeholder","Search URLs…"),a(n,"class","relative"),a(c,"class","flex gap-1.5 flex-wrap"),a(d,"class","flex gap-1.5 flex-wrap"),a(p,"class","text-xs text-gray-500 ml-auto"),a(t,"class","flex flex-wrap items-center gap-2")},m(F,T){R(F,t,T),u(t,n),u(n,r),u(r,l),u(n,o),u(n,i),Ie(i,e[12]),u(t,s),u(t,c);for(let z=0;z<S.length;z+=1)S[z]&&S[z].m(c,null);u(t,f),u(t,d);for(let z=0;z<N.length;z+=1)N[z]&&N[z].m(d,null);u(t,h),u(t,p),u(p,_),u(p,m),R(F,y,T),P.m(F,T),R(F,v,T),k||(C=[Q(i,"input",e[54]),Q(i,"input",e[41])],k=!0)},p(F,T){if(T[0]&4096&&i.value!==F[12]&&Ie(i,F[12]),T[0]&16448|T[1]&2048){x=Oe(F[6]);let z;for(z=0;z<x.length;z+=1){const w=Uu(F,x,z);S[z]?S[z].p(w,T):(S[z]=qu(w),S[z].c(),S[z].m(c,null))}for(;z<S.length;z+=1)S[z].d(1);S.length=x.length}if(T[0]&32896|T[1]&4096){M=Oe(F[7].filter(pc));let z;for(z=0;z<M.length;z+=1){const w=Bu(F,M,z);N[z]?N[z].p(w,T):(N[z]=Ju(w),N[z].c(),N[z].m(d,null))}for(;z<N.length;z+=1)N[z].d(1);N.length=M.length}T[0]&512&&g!==(g=dt(F[9])+"")&&ee(_,g),I===(I=L(F))&&P?P.p(F,T):(P.d(1),P=I(F),P&&(P.c(),P.m(v.parentNode,v)))},d(F){F&&(j(t),j(y),j(v)),ft(S,F),ft(N,F),P.d(F),k=!1,lt(C)}}}function A_(e){let t,n,r,l,o,i=un(e[4].totalPhrases)+"",s,c,f,d=dt(e[4].phrasesWithSlots)+"",h,p,g,_,m,y,v,k=un(e[4].approvedPhrases)+"",C,x,S,M=(e[4].totalPhrases?Math.round(e[4].approvedPhrases/e[4].totalPhrases*100):0)+"",N,L,I,P,F,T,z,w=e[4].languageCount+"",D,J,Z,$=un(e[4].totalTranslations)+"",V,se,B,W,K,te,q,be=dt(e[4].uniqueUrls)+"",ve,Ne,le,me,ae,ne,Ae,A,re,X,H,U,Y,ie,ue,G,ce,ke,he=dt(e[4].pendingPhrases)+"",xe,Te,ge,je,Fe,oe,ze,Le,Pe=dt(e[4].approvedPhrases)+"",Ye,et,$e,we,Ue,_e,Me,Ce,Ve,pe,qe,Ke,bt,jt,Et,Rt,Bt,Dt,ye,He,Je,at,kt,_t,ut=e[4].trashPhrases>0&&lc(e),mt=Oe(e[6]),nt=[];for(let We=0;We<mt.length;We+=1)nt[We]=ic(Hu(e,mt,We));return{c(){t=b("div"),n=b("div"),r=b("p"),r.textContent="Total Phrases",l=E(),o=b("p"),s=O(i),c=E(),f=b("p"),h=O(d),p=O(" with var-slots"),g=E(),_=b("div"),m=b("p"),m.textContent="Approved",y=E(),v=b("p"),C=O(k),x=E(),S=b("p"),N=O(M),L=O("% coverage"),I=E(),P=b("div"),F=b("p"),F.textContent="Languages",T=E(),z=b("p"),D=O(w),J=E(),Z=b("p"),V=O($),se=O(" total translations"),B=E(),W=b("div"),K=b("p"),K.textContent="Pages Crawled",te=E(),q=b("p"),ve=O(be),Ne=E(),le=b("p"),le.textContent="unique URLs",me=E(),ae=b("div"),ne=b("div"),Ae=b("h3"),Ae.textContent="Phrase Status",A=E(),re=b("div"),X=b("div"),H=E(),U=b("div"),Y=b("div"),ie=b("span"),ue=E(),G=b("span"),G.textContent="Pending",ce=E(),ke=b("span"),xe=O(he),Te=E(),ge=b("div"),je=b("span"),Fe=E(),oe=b("span"),oe.textContent="Approved",ze=E(),Le=b("span"),Ye=O(Pe),et=E(),ut&&ut.c(),$e=E(),we=b("div"),Ue=b("h3"),Ue.textContent="Discovery Activity (phrases per day)",_e=E(),Me=b("div"),Ce=E(),Ve=b("div"),pe=b("div"),qe=b("h3"),qe.textContent="Phrases by Page Section",Ke=E(),bt=b("p"),bt.innerHTML="Grouped by <code>f=</code> URL parameter. Click a bar to filter pages.",jt=E(),Et=b("div"),Rt=E(),Bt=b("div");for(let We=0;We<nt.length;We+=1)nt[We].c();Dt=E(),ye=b("div"),He=b("h3"),He.textContent="Phrases by WebChart Instance",Je=E(),at=b("p"),at.innerHTML=`<span class="text-emerald-400">■</span> approved  
66
+ <span class="text-blue-400 opacity-40">■</span> total — click to filter pages`,kt=E(),_t=b("div"),a(r,"class","text-xs text-gray-400 uppercase tracking-wide"),a(o,"class","text-3xl font-bold text-white mt-1"),a(f,"class","text-xs text-gray-500 mt-1"),a(n,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(m,"class","text-xs text-gray-400 uppercase tracking-wide"),a(v,"class","text-3xl font-bold text-emerald-400 mt-1"),a(S,"class","text-xs text-gray-500 mt-1"),a(_,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(F,"class","text-xs text-gray-400 uppercase tracking-wide"),a(z,"class","text-3xl font-bold text-indigo-400 mt-1"),a(Z,"class","text-xs text-gray-500 mt-1"),a(P,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(K,"class","text-xs text-gray-400 uppercase tracking-wide"),a(q,"class","text-3xl font-bold text-blue-400 mt-1"),a(le,"class","text-xs text-gray-500 mt-1"),a(W,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(t,"class","grid grid-cols-2 lg:grid-cols-4 gap-3"),a(Ae,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),a(X,"class","relative"),gt(X,"width","160px"),gt(X,"height","160px"),gt(X,"flex-shrink","0"),a(ie,"class","w-2.5 h-2.5 rounded-full bg-yellow-400 shrink-0"),a(G,"class","text-gray-400"),a(ke,"class","ml-auto font-mono text-gray-200"),a(Y,"class","flex items-center gap-2 text-xs"),a(je,"class","w-2.5 h-2.5 rounded-full bg-emerald-500 shrink-0"),a(oe,"class","text-gray-400"),a(Le,"class","ml-auto font-mono text-gray-200"),a(ge,"class","flex items-center gap-2 text-xs"),a(U,"class","space-y-2"),a(re,"class","flex items-center gap-6"),a(ne,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(Ue,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),a(Me,"class","w-full"),gt(Me,"min-height","130px"),a(we,"class","lg:col-span-2 bg-gray-800 border border-gray-700 rounded-xl p-4"),a(ae,"class","grid grid-cols-1 lg:grid-cols-3 gap-4"),a(qe,"class","text-xs font-semibold text-gray-400 uppercase mb-1"),a(bt,"class","text-xs text-gray-500 mb-3"),a(Et,"class","w-full"),gt(Et,"min-height","180px"),a(Bt,"class","flex flex-wrap gap-2 mt-3"),a(pe,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(He,"class","text-xs font-semibold text-gray-400 uppercase mb-1"),a(at,"class","text-xs text-gray-500 mb-3"),a(_t,"class","w-full"),gt(_t,"min-height","160px"),a(ye,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),a(Ve,"class","grid grid-cols-1 lg:grid-cols-2 gap-4")},m(We,Re){R(We,t,Re),u(t,n),u(n,r),u(n,l),u(n,o),u(o,s),u(n,c),u(n,f),u(f,h),u(f,p),u(t,g),u(t,_),u(_,m),u(_,y),u(_,v),u(v,C),u(_,x),u(_,S),u(S,N),u(S,L),u(t,I),u(t,P),u(P,F),u(P,T),u(P,z),u(z,D),u(P,J),u(P,Z),u(Z,V),u(Z,se),u(t,B),u(t,W),u(W,K),u(W,te),u(W,q),u(q,ve),u(W,Ne),u(W,le),R(We,me,Re),R(We,ae,Re),u(ae,ne),u(ne,Ae),u(ne,A),u(ne,re),u(re,X),e[49](X),u(re,H),u(re,U),u(U,Y),u(Y,ie),u(Y,ue),u(Y,G),u(Y,ce),u(Y,ke),u(ke,xe),u(U,Te),u(U,ge),u(ge,je),u(ge,Fe),u(ge,oe),u(ge,ze),u(ge,Le),u(Le,Ye),u(U,et),ut&&ut.m(U,null),u(ae,$e),u(ae,we),u(we,Ue),u(we,_e),u(we,Me),e[50](Me),R(We,Ce,Re),R(We,Ve,Re),u(Ve,pe),u(pe,qe),u(pe,Ke),u(pe,bt),u(pe,jt),u(pe,Et),e[51](Et),u(pe,Rt),u(pe,Bt);for(let Xe=0;Xe<nt.length;Xe+=1)nt[Xe]&&nt[Xe].m(Bt,null);u(Ve,Dt),u(Ve,ye),u(ye,He),u(ye,Je),u(ye,at),u(ye,kt),u(ye,_t),e[53](_t)},p(We,Re){if(Re[0]&16&&i!==(i=un(We[4].totalPhrases)+"")&&ee(s,i),Re[0]&16&&d!==(d=dt(We[4].phrasesWithSlots)+"")&&ee(h,d),Re[0]&16&&k!==(k=un(We[4].approvedPhrases)+"")&&ee(C,k),Re[0]&16&&M!==(M=(We[4].totalPhrases?Math.round(We[4].approvedPhrases/We[4].totalPhrases*100):0)+"")&&ee(N,M),Re[0]&16&&w!==(w=We[4].languageCount+"")&&ee(D,w),Re[0]&16&&$!==($=un(We[4].totalTranslations)+"")&&ee(V,$),Re[0]&16&&be!==(be=dt(We[4].uniqueUrls)+"")&&ee(ve,be),Re[0]&16&&he!==(he=dt(We[4].pendingPhrases)+"")&&ee(xe,he),Re[0]&16&&Pe!==(Pe=dt(We[4].approvedPhrases)+"")&&ee(Ye,Pe),We[4].trashPhrases>0?ut?ut.p(We,Re):(ut=lc(We),ut.c(),ut.m(U,null)):ut&&(ut.d(1),ut=null),Re[0]&16448|Re[1]&2048){mt=Oe(We[6]);let Xe;for(Xe=0;Xe<mt.length;Xe+=1){const At=Hu(We,mt,Xe);nt[Xe]?nt[Xe].p(At,Re):(nt[Xe]=ic(At),nt[Xe].c(),nt[Xe].m(Bt,null))}for(;Xe<nt.length;Xe+=1)nt[Xe].d(1);nt.length=mt.length}},d(We){We&&(j(t),j(me),j(ae),j(Ce),j(Ve)),e[49](null),ut&&ut.d(),e[50](null),e[51](null),ft(nt,We),e[53](null)}}}function Yu(e){let t,n,r=e[114].lang+"",l,o,i,s=dt(e[114].translated)+"",c,f,d,h,p,g,_,m,y=e[114].coverage+"",v,k,C;return{c(){t=b("tr"),n=b("td"),l=O(r),o=E(),i=b("td"),c=O(s),f=E(),d=b("td"),h=b("div"),p=b("div"),g=b("div"),_=E(),m=b("span"),v=O(y),k=O("%"),C=E(),a(n,"class","px-4 py-2.5 font-mono text-indigo-300"),a(i,"class","px-4 py-2.5 text-right font-mono text-gray-200"),a(g,"class","h-1.5 rounded-full transition-all"),gt(g,"width",e[114].coverage+"%"),gt(g,"background",e[114].coverage>80?"#10b981":e[114].coverage>40?"#6366f1":"#f59e0b"),a(p,"class","flex-1 bg-gray-700 rounded-full h-1.5 max-w-xs"),a(m,"class","text-gray-400 w-10 text-right"),a(h,"class","flex items-center gap-2"),a(d,"class","px-4 py-2.5"),a(t,"class","border-b border-gray-700/40")},m(x,S){R(x,t,S),u(t,n),u(n,l),u(t,o),u(t,i),u(i,c),u(t,f),u(t,d),u(d,h),u(h,p),u(p,g),u(h,_),u(h,m),u(m,v),u(m,k),u(t,C)},p(x,S){S[0]&32&&r!==(r=x[114].lang+"")&&ee(l,r),S[0]&32&&s!==(s=dt(x[114].translated)+"")&&ee(c,s),S[0]&32&&gt(g,"width",x[114].coverage+"%"),S[0]&32&&gt(g,"background",x[114].coverage>80?"#10b981":x[114].coverage>40?"#6366f1":"#f59e0b"),S[0]&32&&y!==(y=x[114].coverage+"")&&ee(v,y)},d(x){x&&j(t)}}}function qu(e){let t,n=e[96].section+"",r,l,o,i;function s(){return e[55](e[96])}return{c(){t=b("button"),r=O(n),a(t,"class",l="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))},m(c,f){R(c,t,f),u(t,r),o||(i=Q(t,"click",s),o=!0)},p(c,f){e=c,f[0]&64&&n!==(n=e[96].section+"")&&ee(r,n),f[0]&16448&&l!==(l="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))&&a(t,"class",l)},d(c){c&&j(t),o=!1,i()}}}function Ju(e){let t,n=e[109].instance+"",r,l,o,i;function s(){return e[56](e[109])}return{c(){t=b("button"),r=O(n),a(t,"class",l="text-xs px-2 py-1 rounded-full border transition-colors font-mono "+(e[15]===e[109].instance?"bg-blue-700 border-blue-500 text-white":"border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"))},m(c,f){R(c,t,f),u(t,r),o||(i=Q(t,"click",s),o=!0)},p(c,f){e=c,f[0]&128&&n!==(n=e[109].instance+"")&&ee(r,n),f[0]&32896&&l!==(l="text-xs px-2 py-1 rounded-full border transition-colors font-mono "+(e[15]===e[109].instance?"bg-blue-700 border-blue-500 text-white":"border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"))&&a(t,"class",l)},d(c){c&&j(t),o=!1,i()}}}function T_(e){let t,n,r,l,o,i,s,c,f,d=e[13]+1+"",h,p,g=Math.min(e[13]+Vn,e[9])+"",_,m,y=dt(e[9])+"",v,k,C,x,S,M,N,L,I,P,F,T,z=Oe(e[8]),w=[];for(let D=0;D<z.length;D+=1)w[D]=rc(Ou(e,z,D));return{c(){t=b("div"),n=b("table"),r=b("thead"),r.innerHTML='<tr class="text-gray-400 uppercase text-[10px]"><th class="text-left px-4 py-2.5">Page</th> <th class="text-right px-3 py-2.5 w-24">Phrases</th> <th class="text-right px-3 py-2.5 w-24">Approved</th> <th class="text-right px-3 py-2.5 w-20">Coverage</th> <th class="px-3 py-2.5 w-10"></th></tr>',l=E(),o=b("tbody");for(let D=0;D<w.length;D+=1)w[D].c();i=E(),s=b("div"),c=b("span"),f=O("Showing "),h=O(d),p=O("–"),_=O(g),m=O(" of "),v=O(y),k=E(),C=b("div"),x=b("button"),S=O("← Prev"),N=E(),L=b("button"),I=O("Next →"),a(r,"class","border-b border-gray-700 bg-gray-850"),a(n,"class","w-full text-xs"),a(t,"class","bg-gray-800 border border-gray-700 rounded-xl overflow-hidden"),a(x,"class","px-3 py-1 rounded bg-gray-800 border border-gray-700 hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed text-gray-300"),x.disabled=M=e[13]===0,a(L,"class","px-3 py-1 rounded bg-gray-800 border border-gray-700 hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed text-gray-300"),L.disabled=P=e[13]+Vn>=e[9],a(C,"class","flex gap-2"),a(s,"class","flex items-center justify-between text-xs text-gray-500")},m(D,J){R(D,t,J),u(t,n),u(n,r),u(n,l),u(n,o);for(let Z=0;Z<w.length;Z+=1)w[Z]&&w[Z].m(o,null);R(D,i,J),R(D,s,J),u(s,c),u(c,f),u(c,h),u(c,p),u(c,_),u(c,m),u(c,v),u(s,k),u(s,C),u(C,x),u(x,S),u(C,N),u(C,L),u(L,I),F||(T=[Q(x,"click",e[44]),Q(L,"click",e[45])],F=!0)},p(D,J){if(J[0]&33489199|J[1]&1012){z=Oe(D[8]);let Z;for(Z=0;Z<z.length;Z+=1){const $=Ou(D,z,Z);w[Z]?w[Z].p($,J):(w[Z]=rc($),w[Z].c(),w[Z].m(o,null))}for(;Z<w.length;Z+=1)w[Z].d(1);w.length=z.length}J[0]&8192&&d!==(d=D[13]+1+"")&&ee(h,d),J[0]&8704&&g!==(g=Math.min(D[13]+Vn,D[9])+"")&&ee(_,g),J[0]&512&&y!==(y=dt(D[9])+"")&&ee(v,y),J[0]&8192&&M!==(M=D[13]===0)&&(x.disabled=M),J[0]&8704&&P!==(P=D[13]+Vn>=D[9])&&(L.disabled=P)},d(D){D&&(j(t),j(i),j(s)),ft(w,D),F=!1,lt(T)}}}function M_(e){let t;return{c(){t=b("div"),t.textContent="No pages match your filter",a(t,"class","text-center py-10 text-gray-500 text-xs")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function E_(e){let t;return{c(){t=b("div"),t.textContent="Loading…",a(t,"class","text-center py-10 text-gray-500 text-xs")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function Gu(e){let t,n,r;function l(s,c){if(s[17])return N_;if(s[0])return L_}let o=l(e),i=o&&o(e);return{c(){t=b("tr"),n=b("td"),i&&i.c(),r=E(),a(n,"colspan","5"),a(n,"class","px-4 pb-4 pt-3 border-b border-indigo-900"),a(t,"class","bg-gray-900/80")},m(s,c){R(s,t,c),u(t,n),i&&i.m(n,null),u(t,r)},p(s,c){o===(o=l(s))&&i?i.p(s,c):(i&&i.d(1),i=o&&o(s),i&&(i.c(),i.m(n,null)))},d(s){s&&j(t),i&&i.d()}}}function L_(e){let t,n,r,l=dt(e[0].totalPhrases)+"",o,i,s,c,f=dt(e[0].approved)+"",d,h,p,g,_=dt(e[0].pending)+"",m,y,v,k,C,x,S,M,N,L,I,P,F,T,z,w,D,J=e[21]?"Queued…":`Translate all pending (${dt(e[0].pending)})`,Z,$,V,se,B,W,K,te,q,be,ve,Ne,le,me,ae,ne,Ae,A,re,X,H,U,Y,ie,ue,G=e[33].length+"",ce,ke,he=e[0].topPhrases.length+"",xe,Te,ge=e[0].topPhrases.length===200?"(200 max)":"",je,Fe,oe,ze,Le,Pe,Ye,et=Oe(e[5]),$e=[];for(let pe=0;pe<et.length;pe+=1)$e[pe]=Ku(Ru(e,et,pe));let we=e[20].size>0&&Xu(e),Ue=e[22]&&Qu(e),_e=Oe(e[33]),Me=[];for(let pe=0;pe<_e.length;pe+=1)Me[pe]=tc(ju(e,_e,pe));let Ce=null;_e.length||(Ce=$u());let Ve=e[0].topPhrases.length===200&&nc();return{c(){t=b("div"),n=b("div"),r=b("span"),o=O(l),i=O(" total"),s=E(),c=b("span"),d=O(f),h=O(" approved"),p=E(),g=b("span"),m=O(_),y=O(" pending"),v=E(),k=b("a"),C=de("svg"),x=de("path"),S=O(`
67
+ Open Page`),M=E(),N=b("div"),L=de("svg"),I=de("path"),P=E(),F=b("span"),F.textContent="Translate to",T=E(),z=b("select");for(let pe=0;pe<$e.length;pe+=1)$e[pe].c();w=E(),D=b("button"),Z=O(J),V=E(),we&&we.c(),se=E(),Ue&&Ue.c(),B=E(),W=b("div"),K=b("div"),te=b("input"),be=E(),ve=b("button"),Ne=O(".*"),me=E(),ae=b("select"),ne=b("option"),ne.textContent="All",Ae=b("option"),Ae.textContent="Pending",A=b("option"),A.textContent="Approved",re=E(),X=b("label"),H=b("input"),Y=O(`
68
+ All`),ie=E(),ue=b("span"),ce=O(G),ke=O("/"),xe=O(he),Te=E(),je=O(ge),Fe=E(),oe=b("div");for(let pe=0;pe<Me.length;pe+=1)Me[pe].c();Ce&&Ce.c(),ze=E(),Ve&&Ve.c(),Le=Ct(),a(r,"class","bg-gray-800 rounded px-2 py-1 text-[10px] font-mono text-gray-400"),a(c,"class","bg-emerald-900/50 rounded px-2 py-1 text-[10px] font-mono text-emerald-400"),a(g,"class","bg-yellow-900/50 rounded px-2 py-1 text-[10px] font-mono text-yellow-400"),a(n,"class","flex gap-2 shrink-0"),a(x,"d","M6 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-3M9 2h5m0 0v5m0-5L7 9"),a(x,"stroke-linecap","round"),a(x,"stroke-linejoin","round"),a(C,"viewBox","0 0 16 16"),a(C,"fill","none"),a(C,"class","w-3 h-3"),a(C,"stroke","currentColor"),a(C,"stroke-width","2"),a(k,"href",e[16]),a(k,"target","_blank"),a(k,"rel","noopener noreferrer"),a(k,"class","ml-auto flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-medium shrink-0 transition-colors"),a(t,"class","flex items-center gap-3 mb-3"),a(I,"d","M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z"),a(I,"fill","#FFB833"),a(L,"viewBox","0 0 24 24"),a(L,"width","14"),a(L,"height","14"),a(L,"xmlns","http://www.w3.org/2000/svg"),a(L,"class","shrink-0"),a(F,"class","text-xs text-gray-400 shrink-0"),a(z,"class","bg-gray-700 border border-gray-600 rounded px-2 py-1 text-xs text-gray-200 focus:outline-none focus:border-indigo-500"),e[18]===void 0&&It(()=>e[58].call(z)),a(D,"class","px-3 py-1 text-xs rounded-lg bg-yellow-600 hover:bg-yellow-500 text-white font-medium transition-colors disabled:opacity-40"),D.disabled=$=e[21]||e[0].pending===0,a(N,"class","flex items-center gap-2 mb-3 p-2.5 bg-gray-800 rounded-lg border border-gray-700"),a(te,"class",q="w-full bg-gray-800 border rounded px-2.5 py-1.5 pr-16 text-xs text-gray-200 placeholder-gray-500 focus:outline-none "+(e[19]?"border-red-500 focus:border-red-500":"border-gray-700 focus:border-indigo-500")),a(te,"placeholder","Search phrases… (supports regex)"),a(ve,"class",le="absolute right-1.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold transition-colors "+(e[2]?"bg-indigo-600 text-white":"bg-gray-700 text-gray-400 hover:bg-gray-600")),a(ve,"title","Toggle regex mode"),a(K,"class","flex-1 flex items-center relative"),ne.__value="",Ie(ne,ne.__value),Ae.__value="pending",Ie(Ae,Ae.__value),A.__value="approved",Ie(A,A.__value),a(ae,"class","bg-gray-800 border border-gray-700 rounded px-2 py-1.5 text-xs text-gray-400 focus:outline-none"),e[3]===void 0&&It(()=>e[64].call(ae)),a(H,"type","checkbox"),H.checked=U=e[20].size>0&&e[33].length>0&&e[33].every(e[66]),a(H,"class","accent-indigo-500"),a(X,"class","flex items-center gap-1.5 text-xs text-gray-400 cursor-pointer select-none shrink-0"),a(ue,"class","text-[10px] text-gray-600 shrink-0 whitespace-nowrap"),a(W,"class","flex items-center gap-2 mb-2"),a(oe,"class","max-h-72 overflow-y-auto space-y-0.5 pr-1")},m(pe,qe){R(pe,t,qe),u(t,n),u(n,r),u(r,o),u(r,i),u(n,s),u(n,c),u(c,d),u(c,h),u(n,p),u(n,g),u(g,m),u(g,y),u(t,v),u(t,k),u(k,C),u(C,x),u(k,S),R(pe,M,qe),R(pe,N,qe),u(N,L),u(L,I),u(N,P),u(N,F),u(N,T),u(N,z);for(let Ke=0;Ke<$e.length;Ke+=1)$e[Ke]&&$e[Ke].m(z,null);vt(z,e[18],!0),u(N,w),u(N,D),u(D,Z),u(N,V),we&&we.m(N,null),u(N,se),Ue&&Ue.m(N,null),R(pe,B,qe),R(pe,W,qe),u(W,K),u(K,te),Ie(te,e[1]),u(K,be),u(K,ve),u(ve,Ne),u(W,me),u(W,ae),u(ae,ne),u(ae,Ae),u(ae,A),vt(ae,e[3],!0),u(W,re),u(W,X),u(X,H),u(X,Y),u(W,ie),u(W,ue),u(ue,ce),u(ue,ke),u(ue,xe),u(ue,Te),u(ue,je),R(pe,Fe,qe),R(pe,oe,qe);for(let Ke=0;Ke<Me.length;Ke+=1)Me[Ke]&&Me[Ke].m(oe,null);Ce&&Ce.m(oe,null),R(pe,ze,qe),Ve&&Ve.m(pe,qe),R(pe,Le,qe),Pe||(Ye=[Q(z,"change",e[58]),Q(D,"click",e[59]),Q(te,"input",e[61]),Q(te,"input",e[62]),Q(ve,"click",e[63]),Q(ae,"change",e[64]),Q(ae,"change",e[65]),Q(H,"change",e[38])],Pe=!0)},p(pe,qe){if(qe[0]&1&&l!==(l=dt(pe[0].totalPhrases)+"")&&ee(o,l),qe[0]&1&&f!==(f=dt(pe[0].approved)+"")&&ee(d,f),qe[0]&1&&_!==(_=dt(pe[0].pending)+"")&&ee(m,_),qe[0]&65536&&a(k,"href",pe[16]),qe[0]&32){et=Oe(pe[5]);let Ke;for(Ke=0;Ke<et.length;Ke+=1){const bt=Ru(pe,et,Ke);$e[Ke]?$e[Ke].p(bt,qe):($e[Ke]=Ku(bt),$e[Ke].c(),$e[Ke].m(z,null))}for(;Ke<$e.length;Ke+=1)$e[Ke].d(1);$e.length=et.length}if(qe[0]&262176&&vt(z,pe[18]),qe[0]&2097153&&J!==(J=pe[21]?"Queued…":`Translate all pending (${dt(pe[0].pending)})`)&&ee(Z,J),qe[0]&2097153&&$!==($=pe[21]||pe[0].pending===0)&&(D.disabled=$),pe[20].size>0?we?we.p(pe,qe):(we=Xu(pe),we.c(),we.m(N,se)):we&&(we.d(1),we=null),pe[22]?Ue?Ue.p(pe,qe):(Ue=Qu(pe),Ue.c(),Ue.m(N,null)):Ue&&(Ue.d(1),Ue=null),qe[0]&524288&&q!==(q="w-full bg-gray-800 border rounded px-2.5 py-1.5 pr-16 text-xs text-gray-200 placeholder-gray-500 focus:outline-none "+(pe[19]?"border-red-500 focus:border-red-500":"border-gray-700 focus:border-indigo-500"))&&a(te,"class",q),qe[0]&2&&te.value!==pe[1]&&Ie(te,pe[1]),qe[0]&4&&le!==(le="absolute right-1.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold transition-colors "+(pe[2]?"bg-indigo-600 text-white":"bg-gray-700 text-gray-400 hover:bg-gray-600"))&&a(ve,"class",le),qe[0]&8&&vt(ae,pe[3]),qe[0]&1048576|qe[1]&4&&U!==(U=pe[20].size>0&&pe[33].length>0&&pe[33].every(pe[66]))&&(H.checked=U),qe[1]&4&&G!==(G=pe[33].length+"")&&ee(ce,G),qe[0]&1&&he!==(he=pe[0].topPhrases.length+"")&&ee(xe,he),qe[0]&1&&ge!==(ge=pe[0].topPhrases.length===200?"(200 max)":"")&&ee(je,ge),qe[0]&1310720|qe[1]&836){_e=Oe(pe[33]);let Ke;for(Ke=0;Ke<_e.length;Ke+=1){const bt=ju(pe,_e,Ke);Me[Ke]?Me[Ke].p(bt,qe):(Me[Ke]=tc(bt),Me[Ke].c(),Me[Ke].m(oe,null))}for(;Ke<Me.length;Ke+=1)Me[Ke].d(1);Me.length=_e.length,!_e.length&&Ce?Ce.p(pe,qe):_e.length?Ce&&(Ce.d(1),Ce=null):(Ce=$u(),Ce.c(),Ce.m(oe,null))}pe[0].topPhrases.length===200?Ve||(Ve=nc(),Ve.c(),Ve.m(Le.parentNode,Le)):Ve&&(Ve.d(1),Ve=null)},d(pe){pe&&(j(t),j(M),j(N),j(B),j(W),j(Fe),j(oe),j(ze),j(Le)),ft($e,pe),we&&we.d(),Ue&&Ue.d(),ft(Me,pe),Ce&&Ce.d(),Ve&&Ve.d(pe),Pe=!1,lt(Ye)}}}function N_(e){let t;return{c(){t=b("p"),t.textContent="Loading…",a(t,"class","text-gray-500 text-xs py-6 text-center")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function Ku(e){let t,n=e[88].lang+"",r,l;return{c(){t=b("option"),r=O(n),t.__value=l=e[88].lang,Ie(t,t.__value)},m(o,i){R(o,t,i),u(t,r)},p(o,i){i[0]&32&&n!==(n=o[88].lang+"")&&ee(r,n),i[0]&32&&l!==(l=o[88].lang)&&(t.__value=l,Ie(t,t.__value))},d(o){o&&j(t)}}}function Xu(e){let t,n,r=e[20].size+"",l,o,i,s;return{c(){t=b("button"),n=O("Translate selected ("),l=O(r),o=O(")"),a(t,"class","px-3 py-1 text-xs rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white font-medium transition-colors")},m(c,f){R(c,t,f),u(t,n),u(t,l),u(t,o),i||(s=Q(t,"click",e[60]),i=!0)},p(c,f){f[0]&1048576&&r!==(r=c[20].size+"")&&ee(l,r)},d(c){c&&j(t),i=!1,s()}}}function Qu(e){let t,n=e[22].text+"",r,l;return{c(){t=b("span"),r=O(n),a(t,"class",l="text-xs "+(e[22].ok?"text-emerald-400":"text-red-400")+" ml-1")},m(o,i){R(o,t,i),u(t,r)},p(o,i){i[0]&4194304&&n!==(n=o[22].text+"")&&ee(r,n),i[0]&4194304&&l!==(l="text-xs "+(o[22].ok?"text-emerald-400":"text-red-400")+" ml-1")&&a(t,"class",l)},d(o){o&&j(t)}}}function $u(e){let t;return{c(){t=b("p"),t.textContent="No phrases match",a(t,"class","text-gray-500 text-xs text-center py-6")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function ec(e){let t,n=e[104].context+"",r;return{c(){t=b("div"),r=O(n),a(t,"class","text-gray-500 text-[10px] mt-0.5 break-words whitespace-normal leading-snug")},m(l,o){R(l,t,o),u(t,r)},p(l,o){o[1]&4&&n!==(n=l[104].context+"")&&ee(r,n)},d(l){l&&j(t)}}}function tc(e){let t,n,r,l,o,i=e[104].status[0].toUpperCase()+"",s,c,f,d,h,p=e[104].key+"",g,_,m,y,v,k,C,x,S,M,N;function L(){return e[67](e[104])}function I(){return e[68](e[104])}let P=e[104].context&&ec(e);function F(){return e[69](e[104])}return{c(){t=b("div"),n=b("input"),l=E(),o=b("span"),s=O(i),f=E(),d=b("div"),h=b("button"),g=O(p),_=E(),P&&P.c(),m=E(),y=b("button"),v=de("svg"),k=de("path"),x=E(),a(n,"type","checkbox"),n.checked=r=e[20].has(e[104].id),a(n,"class","mt-0.5 accent-indigo-500 shrink-0 cursor-pointer"),a(o,"class",c="shrink-0 px-1 rounded text-[9px] font-medium mt-0.5 "+(e[104].status==="approved"?"bg-emerald-900 text-emerald-300":e[104].status==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300")),a(h,"class","font-mono text-gray-300 text-[11px] text-left hover:text-indigo-300 w-full break-words whitespace-normal leading-snug"),a(d,"class","flex-1 min-w-0"),a(k,"d","M8 1l1.5 4.5H14l-3.7 2.7 1.4 4.3L8 9.8l-3.7 2.7 1.4-4.3L2 5.5h4.5z"),a(v,"viewBox","0 0 16 16"),a(v,"fill","currentColor"),a(v,"class","w-3 h-3"),a(y,"class","shrink-0 p-0.5 rounded text-gray-600 hover:text-yellow-400 opacity-0 group-hover:opacity-100 transition-all"),a(y,"title",C="Queue AI translation → "+e[18]),a(t,"class",S="flex items-start gap-1.5 px-2 py-1.5 rounded group "+(e[20].has(e[104].id)?"bg-indigo-950/50":"hover:bg-gray-800/60"))},m(T,z){R(T,t,z),u(t,n),u(t,l),u(t,o),u(o,s),u(t,f),u(t,d),u(d,h),u(h,g),u(d,_),P&&P.m(d,null),u(t,m),u(t,y),u(y,v),u(v,k),u(t,x),M||(N=[Q(n,"change",L),Q(h,"click",I),Q(y,"click",nn(F))],M=!0)},p(T,z){e=T,z[0]&1048576|z[1]&4&&r!==(r=e[20].has(e[104].id))&&(n.checked=r),z[1]&4&&i!==(i=e[104].status[0].toUpperCase()+"")&&ee(s,i),z[1]&4&&c!==(c="shrink-0 px-1 rounded text-[9px] font-medium mt-0.5 "+(e[104].status==="approved"?"bg-emerald-900 text-emerald-300":e[104].status==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300"))&&a(o,"class",c),z[1]&4&&p!==(p=e[104].key+"")&&ee(g,p),e[104].context?P?P.p(e,z):(P=ec(e),P.c(),P.m(d,null)):P&&(P.d(1),P=null),z[0]&262176&&C!==(C="Queue AI translation → "+e[18])&&a(y,"title",C),z[0]&1048576|z[1]&4&&S!==(S="flex items-start gap-1.5 px-2 py-1.5 rounded group "+(e[20].has(e[104].id)?"bg-indigo-950/50":"hover:bg-gray-800/60"))&&a(t,"class",S)},d(T){T&&j(t),P&&P.d(),M=!1,lt(N)}}}function nc(e){let t;return{c(){t=b("p"),t.textContent="Showing first 200 — refine with search or status filter",a(t,"class","text-[10px] text-gray-600 mt-1 text-center")},m(n,r){R(n,t,r)},d(n){n&&j(t)}}}function rc(e){let t,n,r,l,o=e[100].label+"",i,s,c,f,d,h=hc(e[99].url)+"",p,g,_,m=dc(e[99].url)+"",y,v,k,C,x=dt(e[99].phraseCount)+"",S,M,N,L=dt(e[99].approved)+"",I,P,F,T,z=e[101]+"",w,D,J,Z,$,V,se,B,W,K,te,q,be,ve;function Ne(){return e[57](e[99])}let le=e[16]===e[99].url&&Gu(e);return{c(){t=b("tr"),n=b("td"),r=b("div"),l=b("span"),i=O(o),c=E(),f=b("div"),d=b("div"),p=O(h),g=E(),_=b("div"),y=O(m),k=E(),C=b("td"),S=O(x),M=E(),N=b("td"),I=O(L),P=E(),F=b("td"),T=b("span"),w=O(z),D=O("%"),Z=E(),$=b("td"),V=b("a"),se=de("svg"),B=de("path"),te=E(),le&&le.c(),q=Ct(),a(l,"class",s="text-[10px] font-medium "+e[100].color+" shrink-0"),a(d,"class","text-gray-500 text-[10px] truncate"),a(_,"class","font-mono text-gray-300 truncate max-w-sm"),a(_,"title",v=e[99].url),a(f,"class","min-w-0"),a(r,"class","flex items-center gap-2 min-w-0"),a(n,"class","px-4 py-2.5"),a(C,"class","px-3 py-2.5 text-right font-mono text-gray-200"),a(N,"class","px-3 py-2.5 text-right font-mono text-emerald-400"),a(T,"class",J="px-1.5 py-0.5 rounded-full text-[10px] font-medium "+(e[101]===100?"bg-emerald-900/60 text-emerald-300":e[101]>0?"bg-indigo-900/60 text-indigo-300":"bg-gray-700 text-gray-500")),a(F,"class","px-3 py-2.5 text-right"),a(B,"d","M6 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-3M9 2h5m0 0v5m0-5L7 9"),a(B,"stroke-linecap","round"),a(B,"stroke-linejoin","round"),a(se,"viewBox","0 0 16 16"),a(se,"fill","none"),a(se,"class","w-3.5 h-3.5"),a(se,"stroke","currentColor"),a(se,"stroke-width","1.5"),a(V,"href",W=e[99].url),a(V,"target","_blank"),a(V,"rel","noopener noreferrer"),a(V,"title","Open page"),a(V,"class","flex items-center justify-center w-6 h-6 rounded text-gray-500 hover:text-indigo-400 hover:bg-gray-600 transition-colors"),a($,"class","px-3 py-2.5"),a(t,"class",K="border-b border-gray-700/40 hover:bg-gray-700/60 cursor-pointer transition-colors "+(e[16]===e[99].url?"bg-indigo-950 border-indigo-800":""))},m(me,ae){R(me,t,ae),u(t,n),u(n,r),u(r,l),u(l,i),u(r,c),u(r,f),u(f,d),u(d,p),u(f,g),u(f,_),u(_,y),u(t,k),u(t,C),u(C,S),u(t,M),u(t,N),u(N,I),u(t,P),u(t,F),u(F,T),u(T,w),u(T,D),u(t,Z),u(t,$),u($,V),u(V,se),u(se,B),R(me,te,ae),le&&le.m(me,ae),R(me,q,ae),be||(ve=[Q(V,"click",nn(e[47])),Q(t,"click",Ne)],be=!0)},p(me,ae){e=me,ae[0]&256&&o!==(o=e[100].label+"")&&ee(i,o),ae[0]&256&&s!==(s="text-[10px] font-medium "+e[100].color+" shrink-0")&&a(l,"class",s),ae[0]&256&&h!==(h=hc(e[99].url)+"")&&ee(p,h),ae[0]&256&&m!==(m=dc(e[99].url)+"")&&ee(y,m),ae[0]&256&&v!==(v=e[99].url)&&a(_,"title",v),ae[0]&256&&x!==(x=dt(e[99].phraseCount)+"")&&ee(S,x),ae[0]&256&&L!==(L=dt(e[99].approved)+"")&&ee(I,L),ae[0]&256&&z!==(z=e[101]+"")&&ee(w,z),ae[0]&256&&J!==(J="px-1.5 py-0.5 rounded-full text-[10px] font-medium "+(e[101]===100?"bg-emerald-900/60 text-emerald-300":e[101]>0?"bg-indigo-900/60 text-indigo-300":"bg-gray-700 text-gray-500"))&&a(T,"class",J),ae[0]&256&&W!==(W=e[99].url)&&a(V,"href",W),ae[0]&65792&&K!==(K="border-b border-gray-700/40 hover:bg-gray-700/60 cursor-pointer transition-colors "+(e[16]===e[99].url?"bg-indigo-950 border-indigo-800":""))&&a(t,"class",K),e[16]===e[99].url?le?le.p(e,ae):(le=Gu(e),le.c(),le.m(q.parentNode,q)):le&&(le.d(1),le=null)},d(me){me&&(j(t),j(te),j(q)),le&&le.d(me),be=!1,lt(ve)}}}function lc(e){let t,n,r,l,o,i,s=dt(e[4].trashPhrases)+"",c;return{c(){t=b("div"),n=b("span"),r=E(),l=b("span"),l.textContent="Trash",o=E(),i=b("span"),c=O(s),a(n,"class","w-2.5 h-2.5 rounded-full bg-red-500 shrink-0"),a(l,"class","text-gray-400"),a(i,"class","ml-auto font-mono text-gray-200"),a(t,"class","flex items-center gap-2 text-xs")},m(f,d){R(f,t,d),u(t,n),u(t,r),u(t,l),u(t,o),u(t,i),u(i,c)},p(f,d){d[0]&16&&s!==(s=dt(f[4].trashPhrases)+"")&&ee(c,s)},d(f){f&&j(t)}}}function ic(e){let t,n=e[96].section+"",r,l,o=un(e[96].phrases)+"",i,s,c,f,d;function h(){return e[52](e[96])}return{c(){t=b("button"),r=O(n),l=O(" · "),i=O(o),s=E(),a(t,"class",c="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))},m(p,g){R(p,t,g),u(t,r),u(t,l),u(t,i),u(t,s),f||(d=Q(t,"click",h),f=!0)},p(p,g){e=p,g[0]&64&&n!==(n=e[96].section+"")&&ee(r,n),g[0]&64&&o!==(o=un(e[96].phrases)+"")&&ee(i,o),g[0]&16448&&c!==(c="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))&&a(t,"class",c)},d(p){p&&j(t),f=!1,d()}}}function oc(e){var C;let t,n,r,l,o,i=(((C=e[24])==null?void 0:C.status)??e[23].status).toUpperCase()+"",s,c,f,d,h,p,g,_,m;function y(x,S){if(x[25])return I_;if(x[24])return z_}let v=y(e),k=v&&v(e);return{c(){var x,S;t=b("div"),n=b("div"),r=b("div"),l=b("div"),o=b("span"),s=O(i),f=E(),d=b("h3"),d.textContent="Phrase Detail",h=E(),p=b("button"),p.innerHTML='<svg viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"></path></svg>',g=E(),k&&k.c(),a(o,"class",c="px-2 py-0.5 rounded text-[10px] font-semibold "+((((x=e[24])==null?void 0:x.status)??e[23].status)==="approved"?"bg-emerald-900 text-emerald-300":(((S=e[24])==null?void 0:S.status)??e[23].status)==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300")),a(d,"class","text-sm font-semibold text-white"),a(l,"class","flex items-center gap-2"),a(p,"class","text-gray-500 hover:text-white transition-colors p-1 rounded hover:bg-gray-700"),a(p,"aria-label","Close"),a(r,"class","flex items-center justify-between px-5 py-3.5 border-b border-gray-700 shrink-0"),a(n,"class","bg-gray-900 border border-gray-700 rounded-xl shadow-2xl w-full max-w-3xl max-h-[90vh] flex flex-col overflow-hidden"),a(t,"class","fixed inset-0 bg-black/75 z-50 flex items-center justify-center p-4"),a(t,"role","dialog"),a(t,"aria-modal","true")},m(x,S){R(x,t,S),u(t,n),u(n,r),u(r,l),u(l,o),u(o,s),u(l,f),u(l,d),u(r,h),u(r,p),u(n,g),k&&k.m(n,null),_||(m=[Q(p,"click",e[71]),Q(t,"click",Lr(e[75]))],_=!0)},p(x,S){var M,N,L;S[0]&25165824&&i!==(i=(((M=x[24])==null?void 0:M.status)??x[23].status).toUpperCase()+"")&&ee(s,i),S[0]&25165824&&c!==(c="px-2 py-0.5 rounded text-[10px] font-semibold "+((((N=x[24])==null?void 0:N.status)??x[23].status)==="approved"?"bg-emerald-900 text-emerald-300":(((L=x[24])==null?void 0:L.status)??x[23].status)==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300"))&&a(o,"class",c),v===(v=y(x))&&k?k.p(x,S):(k&&k.d(1),k=v&&v(x),k&&(k.c(),k.m(n,null)))},d(x){x&&j(t),k&&k.d(),_=!1,lt(m)}}}function z_(e){let t,n,r,l,o,i,s=e[24].key+"",c,f,d,h,p,g=(e[24].context||"—")+"",_,m,y,v,k,C=e[24].status+"",x,S,M,N,L,I=(e[24].created_at||"—")+"",P,F,T,z,w,D,J,Z,$,V,se,B=e[21]?"Queuing…":`★ AI Translate → ${e[18]}`,W,K,te,q,be,ve,Ne,le,me,ae,ne,Ae,A,re=e[24].translations.length+"",X,H,U=e[24].translations.length!==1?"s":"",Y,ie,ue,G,ce,ke,he;function xe(Ce,Ve){return Ce[24].url?D_:P_}let Te=xe(e),ge=Te(e),je=Oe(e[5]),Fe=[];for(let Ce=0;Ce<je.length;Ce+=1)Fe[Ce]=sc(Du(e,je,Ce));let oe=e[22]&&ac(e);function ze(Ce,Ve){return Ce[24].url?O_:F_}let Le=ze(e),Pe=Le(e);function Ye(Ce,Ve){return Ce[24].translations.length<Ce[5].length?W_:H_}let et=Ye(e),$e=et(e);function we(Ce,Ve){return Ce[24].translations.length===0?V_:Z_}let Ue=we(e),_e=Ue(e),Me=e[5].length>e[24].translations.length&&cc(vi(e));return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("span"),l.textContent="Key",o=E(),i=b("span"),c=O(s),f=E(),d=b("span"),d.textContent="DomContext",h=E(),p=b("span"),_=O(g),m=E(),y=b("span"),y.textContent="Status",v=E(),k=b("span"),x=O(C),S=E(),M=b("span"),M.textContent="Discovered",N=E(),L=b("span"),P=O(I),F=E(),T=b("span"),T.textContent="Source URL",z=E(),ge.c(),w=E(),D=b("span"),D.textContent="Translate",J=E(),Z=b("div"),$=b("select");for(let Ce=0;Ce<Fe.length;Ce+=1)Fe[Ce].c();V=E(),se=b("button"),W=O(B),K=E(),oe&&oe.c(),te=E(),q=b("div"),be=b("p"),be.textContent="Page Screenshot",ve=E(),Pe.c(),Ne=E(),le=b("div"),me=b("div"),ae=b("h4"),ne=O(`Translations
69
+ `),Ae=b("span"),A=O("("),X=O(re),H=O(" language"),Y=O(U),ie=O(")"),ue=E(),$e.c(),G=E(),_e.c(),ce=E(),Me&&Me.c(),a(l,"class","text-gray-400 font-medium pt-0.5"),a(i,"class","font-mono text-white break-all leading-relaxed"),a(d,"class","text-gray-400 font-medium pt-0.5"),a(p,"class","text-gray-300 break-all"),a(y,"class","text-gray-400 font-medium pt-0.5"),a(k,"class","text-gray-300"),a(M,"class","text-gray-400 font-medium pt-0.5"),a(L,"class","text-gray-300"),a(T,"class","text-gray-400 font-medium pt-0.5"),a(D,"class","text-gray-400 font-medium pt-0.5"),a($,"class","bg-gray-800 border border-gray-600 rounded px-2 py-1 text-xs text-gray-200 focus:outline-none focus:border-indigo-500"),e[18]===void 0&&It(()=>e[72].call($)),a(se,"class","px-3 py-1 text-xs rounded-lg bg-yellow-600 hover:bg-yellow-500 text-white font-medium transition-colors disabled:opacity-40"),se.disabled=e[21],a(Z,"class","flex items-center gap-2 flex-wrap"),a(r,"class","flex-1 p-5 grid grid-cols-[100px_1fr] gap-x-4 gap-y-3 text-sm content-start"),a(be,"class","text-xs text-gray-400 font-medium"),a(q,"class","w-72 shrink-0 p-4 flex flex-col gap-2"),a(n,"class","flex gap-0 divide-x divide-gray-700"),a(Ae,"class","ml-1 text-gray-600 font-normal normal-case"),a(ae,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),a(me,"class","flex items-center justify-between mb-3"),a(le,"class","border-t border-gray-700 px-5 py-4"),a(t,"class","overflow-y-auto flex-1")},m(Ce,Ve){R(Ce,t,Ve),u(t,n),u(n,r),u(r,l),u(r,o),u(r,i),u(i,c),u(r,f),u(r,d),u(r,h),u(r,p),u(p,_),u(r,m),u(r,y),u(r,v),u(r,k),u(k,x),u(r,S),u(r,M),u(r,N),u(r,L),u(L,P),u(r,F),u(r,T),u(r,z),ge.m(r,null),u(r,w),u(r,D),u(r,J),u(r,Z),u(Z,$);for(let pe=0;pe<Fe.length;pe+=1)Fe[pe]&&Fe[pe].m($,null);vt($,e[18],!0),u(Z,V),u(Z,se),u(se,W),u(Z,K),oe&&oe.m(Z,null),u(n,te),u(n,q),u(q,be),u(q,ve),Pe.m(q,null),u(t,Ne),u(t,le),u(le,me),u(me,ae),u(ae,ne),u(ae,Ae),u(Ae,A),u(Ae,X),u(Ae,H),u(Ae,Y),u(Ae,ie),u(me,ue),$e.m(me,null),u(le,G),_e.m(le,null),u(le,ce),Me&&Me.m(le,null),ke||(he=[Q($,"change",e[72]),Q(se,"click",e[73])],ke=!0)},p(Ce,Ve){if(Ve[0]&16777216&&s!==(s=Ce[24].key+"")&&ee(c,s),Ve[0]&16777216&&g!==(g=(Ce[24].context||"—")+"")&&ee(_,g),Ve[0]&16777216&&C!==(C=Ce[24].status+"")&&ee(x,C),Ve[0]&16777216&&I!==(I=(Ce[24].created_at||"—")+"")&&ee(P,I),Te===(Te=xe(Ce))&&ge?ge.p(Ce,Ve):(ge.d(1),ge=Te(Ce),ge&&(ge.c(),ge.m(r,w))),Ve[0]&32){je=Oe(Ce[5]);let pe;for(pe=0;pe<je.length;pe+=1){const qe=Du(Ce,je,pe);Fe[pe]?Fe[pe].p(qe,Ve):(Fe[pe]=sc(qe),Fe[pe].c(),Fe[pe].m($,null))}for(;pe<Fe.length;pe+=1)Fe[pe].d(1);Fe.length=je.length}Ve[0]&262176&&vt($,Ce[18]),Ve[0]&2359296&&B!==(B=Ce[21]?"Queuing…":`★ AI Translate → ${Ce[18]}`)&&ee(W,B),Ve[0]&2097152&&(se.disabled=Ce[21]),Ce[22]?oe?oe.p(Ce,Ve):(oe=ac(Ce),oe.c(),oe.m(Z,null)):oe&&(oe.d(1),oe=null),Le===(Le=ze(Ce))&&Pe?Pe.p(Ce,Ve):(Pe.d(1),Pe=Le(Ce),Pe&&(Pe.c(),Pe.m(q,null))),Ve[0]&16777216&&re!==(re=Ce[24].translations.length+"")&&ee(X,re),Ve[0]&16777216&&U!==(U=Ce[24].translations.length!==1?"s":"")&&ee(Y,U),et===(et=Ye(Ce))&&$e?$e.p(Ce,Ve):($e.d(1),$e=et(Ce),$e&&($e.c(),$e.m(me,null))),Ue===(Ue=we(Ce))&&_e?_e.p(Ce,Ve):(_e.d(1),_e=Ue(Ce),_e&&(_e.c(),_e.m(le,ce))),Ce[5].length>Ce[24].translations.length?Me?Me.p(vi(Ce),Ve):(Me=cc(vi(Ce)),Me.c(),Me.m(le,null)):Me&&(Me.d(1),Me=null)},d(Ce){Ce&&j(t),ge.d(),ft(Fe,Ce),oe&&oe.d(),Pe.d(),$e.d(),_e.d(),Me&&Me.d(),ke=!1,lt(he)}}}function I_(e){let t;return{c(){t=b("div"),t.innerHTML='<svg class="animate-spin w-6 h-6 text-indigo-500" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" opacity=".25"></circle><path d="M22 12A10 10 0 0 0 12 2" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>',a(t,"class","flex items-center justify-center py-16")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function P_(e){let t;return{c(){t=b("span"),t.textContent="—",a(t,"class","text-gray-500")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function D_(e){let t,n=e[24].url+"",r,l;return{c(){t=b("a"),r=O(n),a(t,"href",l=e[24].url),a(t,"target","_blank"),a(t,"rel","noopener noreferrer"),a(t,"class","text-indigo-400 hover:text-indigo-300 hover:underline break-all text-xs")},m(o,i){R(o,t,i),u(t,r)},p(o,i){i[0]&16777216&&n!==(n=o[24].url+"")&&ee(r,n),i[0]&16777216&&l!==(l=o[24].url)&&a(t,"href",l)},d(o){o&&j(t)}}}function sc(e){let t,n=e[88].lang+"",r,l;return{c(){t=b("option"),r=O(n),t.__value=l=e[88].lang,Ie(t,t.__value)},m(o,i){R(o,t,i),u(t,r)},p(o,i){i[0]&32&&n!==(n=o[88].lang+"")&&ee(r,n),i[0]&32&&l!==(l=o[88].lang)&&(t.__value=l,Ie(t,t.__value))},d(o){o&&j(t)}}}function ac(e){let t,n=e[22].text+"",r,l;return{c(){t=b("span"),r=O(n),a(t,"class",l="text-xs "+(e[22].ok?"text-emerald-400":"text-red-400"))},m(o,i){R(o,t,i),u(t,r)},p(o,i){i[0]&4194304&&n!==(n=o[22].text+"")&&ee(r,n),i[0]&4194304&&l!==(l="text-xs "+(o[22].ok?"text-emerald-400":"text-red-400"))&&a(t,"class",l)},d(o){o&&j(t)}}}function F_(e){let t;return{c(){t=b("div"),t.textContent="No URL",a(t,"class","flex-1 rounded border border-gray-700 bg-gray-800 flex items-center justify-center text-xs text-gray-500"),gt(t,"min-height","140px")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function O_(e){let t;function n(o,i){return o[26][o[24].url]===void 0?U_:o[26][o[24].url]===null?B_:o[26][o[24].url]===!1?R_:j_}let r=n(e),l=r(e);return{c(){l.c(),t=Ct()},m(o,i){l.m(o,i),R(o,t,i)},p(o,i){r===(r=n(o))&&l?l.p(o,i):(l.d(1),l=r(o),l&&(l.c(),l.m(t.parentNode,t)))},d(o){o&&j(t),l.d(o)}}}function j_(e){let t,n,r,l;return{c(){t=b("a"),n=b("img"),Nl(n.src,r="data:image/jpeg;base64,"+e[26][e[24].url])||a(n,"src",r),a(n,"alt","Page screenshot"),a(n,"class","rounded border border-gray-700 shadow-sm w-full hover:opacity-90 transition-opacity"),a(t,"href",l=e[24].url),a(t,"target","_blank"),a(t,"rel","noopener noreferrer")},m(o,i){R(o,t,i),u(t,n)},p(o,i){i[0]&83886080&&!Nl(n.src,r="data:image/jpeg;base64,"+o[26][o[24].url])&&a(n,"src",r),i[0]&16777216&&l!==(l=o[24].url)&&a(t,"href",l)},d(o){o&&j(t)}}}function R_(e){let t;return{c(){t=b("div"),t.textContent="No screenshot yet",a(t,"class","flex-1 rounded border border-gray-700 bg-gray-800 flex items-center justify-center text-xs text-gray-500"),gt(t,"min-height","140px")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function B_(e){let t;return{c(){t=b("div"),t.innerHTML='<svg class="animate-spin w-5 h-5 text-indigo-500" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" opacity=".25"></circle><path d="M22 12A10 10 0 0 0 12 2" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>',a(t,"class","flex-1 flex items-center justify-center")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function U_(e){let t=e[34](e[24].url)+"",n,r,l;return{c(){n=O(t),r=E(),l=b("div"),l.textContent="Loading…",a(l,"class","flex-1 flex items-center justify-center text-gray-600 text-xs")},m(o,i){R(o,n,i),R(o,r,i),R(o,l,i)},p(o,i){i[0]&16777216&&t!==(t=o[34](o[24].url)+"")&&ee(n,t)},d(o){o&&(j(n),j(r),j(l))}}}function H_(e){let t;return{c(){t=b("span"),t.textContent="All languages covered",a(t,"class","text-[10px] text-emerald-500")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function W_(e){let t,n=e[5].length-e[24].translations.length+"",r,l,o=e[5].length-e[24].translations.length!==1?"s":"",i,s;return{c(){t=b("span"),r=O(n),l=O(" language"),i=O(o),s=O(" missing"),a(t,"class","text-[10px] text-yellow-500")},m(c,f){R(c,t,f),u(t,r),u(t,l),u(t,i),u(t,s)},p(c,f){f[0]&16777248&&n!==(n=c[5].length-c[24].translations.length+"")&&ee(r,n),f[0]&16777248&&o!==(o=c[5].length-c[24].translations.length!==1?"s":"")&&ee(i,o)},d(c){c&&j(t)}}}function Z_(e){let t,n=Oe(e[24].translations),r=[];for(let l=0;l<n.length;l+=1)r[l]=uc(Pu(e,n,l));return{c(){t=b("div");for(let l=0;l<r.length;l+=1)r[l].c();a(t,"class","grid grid-cols-1 sm:grid-cols-2 gap-2")},m(l,o){R(l,t,o);for(let i=0;i<r.length;i+=1)r[i]&&r[i].m(t,null)},p(l,o){if(o[0]&16777216){n=Oe(l[24].translations);let i;for(i=0;i<n.length;i+=1){const s=Pu(l,n,i);r[i]?r[i].p(s,o):(r[i]=uc(s),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(l){l&&j(t),ft(r,l)}}}function V_(e){let t;return{c(){t=b("p"),t.textContent="No translations yet for this phrase.",a(t,"class","text-gray-500 text-sm text-center py-6")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function uc(e){let t,n,r=e[91].lang+"",l,o,i,s=e[91].value+"",c,f;return{c(){t=b("div"),n=b("span"),l=O(r),o=E(),i=b("span"),c=O(s),f=E(),a(n,"class","font-mono text-indigo-400 text-xs w-10 shrink-0 pt-0.5"),a(i,"class","text-gray-200 text-sm leading-relaxed break-words min-w-0"),a(t,"class","bg-gray-800 rounded-lg px-3 py-2.5 flex items-start gap-3")},m(d,h){R(d,t,h),u(t,n),u(n,l),u(t,o),u(t,i),u(i,c),u(t,f)},p(d,h){h[0]&16777216&&r!==(r=d[91].lang+"")&&ee(l,r),h[0]&16777216&&s!==(s=d[91].value+"")&&ee(c,s)},d(d){d&&j(t)}}}function cc(e){let t,n,r,l=Oe(e[87]),o=[];for(let i=0;i<l.length;i+=1)o[i]=fc(Iu(e,l,i));return{c(){t=b("div"),n=b("span"),n.textContent="Missing:",r=E();for(let i=0;i<o.length;i+=1)o[i].c();a(n,"class","text-[10px] text-gray-500"),a(t,"class","mt-3 flex items-center gap-2 flex-wrap")},m(i,s){R(i,t,s),u(t,n),u(t,r);for(let c=0;c<o.length;c+=1)o[c]&&o[c].m(t,null)},p(i,s){if(s[0]&16777248){l=Oe(i[87]);let c;for(c=0;c<l.length;c+=1){const f=Iu(i,l,c);o[c]?o[c].p(f,s):(o[c]=fc(f),o[c].c(),o[c].m(t,null))}for(;c<o.length;c+=1)o[c].d(1);o.length=l.length}},d(i){i&&j(t),ft(o,i)}}}function fc(e){let t,n=e[88].lang+"",r;return{c(){t=b("span"),r=O(n),a(t,"class","font-mono text-[10px] px-1.5 py-0.5 rounded bg-gray-800 text-gray-400 border border-gray-700")},m(l,o){R(l,t,o),u(t,r)},p(l,o){o[0]&16777248&&n!==(n=l[88].lang+"")&&ee(r,n)},d(l){l&&j(t)}}}function Y_(e){let t,n,r,l,o,i,s,c,f=e[4]&&Zu(e);function d(_,m){return _[10]?x_:w_}let h=d(e),p=h(e),g=e[23]&&oc(e);return{c(){t=b("div"),n=b("div"),r=b("div"),l=b("div"),l.innerHTML='<h2 class="text-xl font-bold text-white">Analytics</h2> <p class="text-gray-500 text-xs mt-0.5">Translation database overview</p>',o=E(),f&&f.c(),i=E(),p.c(),s=E(),g&&g.c(),c=Ct(),a(r,"class","flex items-center justify-between"),a(n,"class","space-y-5 text-gray-200 text-sm p-6"),a(t,"class","-m-6 min-h-screen bg-gray-900")},m(_,m){R(_,t,m),u(t,n),u(n,r),u(r,l),u(r,o),f&&f.m(r,null),u(n,i),p.m(n,null),R(_,s,m),g&&g.m(_,m),R(_,c,m)},p(_,m){_[4]?f?f.p(_,m):(f=Zu(_),f.c(),f.m(r,null)):f&&(f.d(1),f=null),h===(h=d(_))&&p?p.p(_,m):(p.d(1),p=h(_),p&&(p.c(),p.m(n,null))),_[23]?g?g.p(_,m):(g=oc(_),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null)},i:Be,o:Be,d(_){_&&(j(t),j(s),j(c)),f&&f.d(),p.d(),g&&g.d(_)}}}const Vn=50;function dt(e){return e!=null?e.toLocaleString():"—"}function un(e){return e==null?"—":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":String(e)}function dc(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean).pop()||t.pathname,r=t.searchParams,l=[n];return r.get("f")&&l.push(`f=${r.get("f")}`),r.get("s")&&l.push(`s=${r.get("s")}`),r.get("module")&&l.push(`mod=${r.get("module")}`),r.get("func")&&l.push(`func=${r.get("func")}`),l.join(" · ")}catch{return e.length>70?e.slice(0,67)+"…":e}}function hc(e){try{return new URL(e).hostname}catch{return""}}function q_(e){return e.includes("f=chart")?{label:"Chart",color:"text-indigo-400"}:e.includes("f=admin")?{label:"Admin",color:"text-yellow-400"}:e.includes("f=layout")?{label:"Layout",color:"text-emerald-400"}:e.includes("func=")?{label:"Func",color:"text-blue-400"}:{label:"Other",color:"text-purple-400"}}const pc=e=>e.phrases>=100;function J_(e,t,n){let r,l=null,o=[],i=[],s=[],c=[],f=[],d=0,h=!0,p=!1,g="",_=0,m="",y="",v=null,k=null,C=!1,x="",S="",M=!1,N=!1,L="pending",I=new Set,P=!1,F=null,T=null,z=null,w=!1,D={};function J(ye){return!ye||D[ye]!==void 0||(n(26,D[ye]=null,D),Ze(`../api/screenshots?url=${encodeURIComponent(ye)}`).then(He=>He.json()).then(He=>{n(26,D[ye]=He.screenshot||!1,D),n(26,D)}).catch(()=>{n(26,D[ye]=!1,D),n(26,D)})),""}let Z="overview",$,V,se,B,W;async function K(){n(10,h=!0);const[ye,He,Je,at,kt]=await Promise.all([Ze("../api/analytics"),Ze("../api/analytics/languages"),Ze("../api/analytics/sections"),Ze("../api/analytics/instances"),Ze("../api/analytics/activity")]);n(4,[l,o,i,s,c]=await Promise.all([ye.json(),He.json(),Je.json(),at.json(),kt.json()]),l,n(5,o),n(6,i),n(7,s)),n(10,h=!1),await xr(),ae()}async function te(){n(11,p=!0);const ye=new URLSearchParams({limit:Vn,offset:_});g&&ye.set("search",g),m&&ye.set("search",m==="chart"?"f=chart":m==="admin"?"f=admin":m==="layout"?"f=layout":m==="func"?"func=":g||""),y&&ye.set("search",y);const Je=await(await Ze(`../api/analytics/urls?${ye}`)).json();n(8,f=Je.rows),n(9,d=Je.total),n(11,p=!1)}async function q(ye){n(16,v=ye),n(0,k=null),n(17,C=!0),n(1,S=""),n(3,L="pending"),n(2,M=!1),n(19,N=!1),n(20,I=new Set),n(22,F=null),n(23,T=null),n(24,z=null);const He=await Ze(`../api/analytics/url-detail?url=${encodeURIComponent(ye)}`);n(0,k=await He.json()),n(17,C=!1),!x&&o.length>0&&n(18,x=o[0].lang)}function be(){n(16,v=null),n(0,k=null)}function ve(ye){const He=new Set(I);He.has(ye)?He.delete(ye):He.add(ye),n(20,I=He)}function Ne(ye){const He=new Set(I);ye.target.checked?r.forEach(Je=>He.add(Je.id)):r.forEach(Je=>He.delete(Je.id)),n(20,I=He)}async function le(ye,He){if(!(!x||!ye||ye.length===0)){n(21,P=!0),n(22,F=null);try{const Je=await Ze("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:ye,lang:x})});if(Je.ok)n(22,F={ok:!0,text:`${He} queued for ${x}`}),n(20,I=new Set);else{const at=await Je.json().catch(()=>({}));n(22,F={ok:!1,text:at.message||`Error ${Je.status}`})}}catch(Je){n(22,F={ok:!1,text:Je.message})}finally{n(21,P=!1)}}}async function me(ye){if((T==null?void 0:T.id)===ye.id){n(23,T=null),n(24,z=null);return}n(23,T=ye),n(24,z=null),n(25,w=!0);try{const He=await Ze(`../api/analytics/phrase-detail?id=${ye.id}`);n(24,z=await He.json())}finally{n(25,w=!1)}}function ae(){ne(),Ae(),A(),re(),X()}function ne(){if(!V||!l)return;en(V).selectAll("*").remove();const ye=[{label:"Pending",value:l.pendingPhrases,color:"#F59E0B"},{label:"Approved",value:l.approvedPhrases,color:"#10B981"},{label:"Trash",value:l.trashPhrases,color:"#EF4444"}].filter(Re=>Re.value>0),He=160,Je=He/2,at=Je*.6,_t=en(V).append("svg").attr("width",He).attr("height",He).append("g").attr("transform",`translate(${Je},${Je})`),ut=k_().value(Re=>Re.value).sort(null),mt=Mu().innerRadius(at).outerRadius(Je-3),nt=Mu().innerRadius(at).outerRadius(Je),We=en(V).append("div").attr("class","chart-tip").style("display","none");_t.selectAll("path").data(ut(ye)).join("path").attr("d",mt).attr("fill",Re=>Re.data.color).attr("stroke","#111827").attr("stroke-width",2).style("cursor","pointer").on("mouseover",function(Re,Xe){en(this).transition().duration(120).attr("d",nt),We.style("display","block").html(`<b>${Xe.data.label}</b>: ${dt(Xe.data.value)}`)}).on("mousemove",Re=>We.style("left",Re.offsetX+10+"px").style("top",Re.offsetY-8+"px")).on("mouseout",function(){en(this).transition().duration(120).attr("d",mt),We.style("display","none")}),_t.append("text").attr("text-anchor","middle").attr("dy","-0.25em").attr("fill","#f9fafb").attr("font-size",16).attr("font-weight","bold").text(un(l.totalPhrases)),_t.append("text").attr("text-anchor","middle").attr("dy","1.1em").attr("fill","#6b7280").attr("font-size",10).text("phrases")}function Ae(){if(!$||!o.length)return;en($).selectAll("*").remove();const ye={top:8,right:60,bottom:8,left:68},He=26,Je=4,at=$.clientWidth||400,kt=o.length*(He+Je)+ye.top+ye.bottom,_t=at-ye.left-ye.right,mt=en($).append("svg").attr("width",at).attr("height",kt).append("g").attr("transform",`translate(${ye.left},${ye.top})`),nt=bl(o,Xe=>Xe.translated)||1,We=Yr().domain([0,nt]).range([0,_t]),Re=Mf(u_).domain([0,o.length-1]);o.forEach((Xe,At)=>{const it=At*(He+Je);mt.append("text").attr("x",-6).attr("y",it+He/2+1).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","#a5b4fc").attr("font-size",11).attr("font-family","monospace").text(Xe.lang),mt.append("rect").attr("x",0).attr("y",it).attr("width",_t).attr("height",He).attr("fill","#1f2937").attr("rx",4),mt.append("rect").attr("x",0).attr("y",it).attr("width",We(Xe.translated)).attr("height",He).attr("fill",Re(At)).attr("rx",4),mt.append("text").attr("x",_t+6).attr("y",it+He/2+1).attr("dominant-baseline","middle").attr("fill","#9ca3af").attr("font-size",10).text(`${un(Xe.translated)} (${Xe.coverage}%)`)})}function A(){if(!se||!c.length)return;en(se).selectAll("*").remove();const ye={top:10,right:16,bottom:28,left:48},He=se.clientWidth||500,Je=130,at=He-ye.left-ye.right,kt=Je-ye.top-ye.bottom,_t=Af("%Y-%m-%d"),ut=c.map(it=>({day:_t(it.day),count:it.count})),nt=en(se).append("svg").attr("width",He).attr("height",Je).append("g").attr("transform",`translate(${ye.left},${ye.top})`),We=o_().domain(O0(ut,it=>it.day)).range([0,at]),Re=Yr().domain([0,bl(ut,it=>it.count)]).nice().range([kt,0]),Xe=b_().x(it=>We(it.day)).y0(kt).y1(it=>Re(it.count)).curve(zu);nt.append("path").datum(ut).attr("fill","#6366f133").attr("d",Xe);const At=If().x(it=>We(it.day)).y(it=>Re(it.count)).curve(zu);nt.append("path").datum(ut).attr("fill","none").attr("stroke","#6366f1").attr("stroke-width",2).attr("d",At),nt.selectAll("circle").data(ut).join("circle").attr("cx",it=>We(it.day)).attr("cy",it=>Re(it.count)).attr("r",3).attr("fill","#818cf8").attr("stroke","#1f2937").attr("stroke-width",1.5),nt.append("g").attr("transform",`translate(0,${kt})`).call(Ha(We).ticks(6).tickFormat(no("%b %d"))).call(it=>it.select(".domain").attr("stroke","#374151")).call(it=>it.selectAll("text").attr("fill","#6b7280").attr("font-size",10)),nt.append("g").call(Wa(Re).ticks(4).tickFormat(Vl(",d"))).call(it=>it.select(".domain").attr("stroke","#374151")).call(it=>it.selectAll("text").attr("fill","#6b7280").attr("font-size",10))}function re(){if(!B||!i.length)return;en(B).selectAll("*").remove();const ye={chart:"#6366f1",admin:"#f59e0b",layout:"#10b981",func:"#3b82f6",other:"#8b5cf6"},He={top:10,right:16,bottom:32,left:48},Je=B.clientWidth||400,at=180,kt=Je-He.left-He.right,_t=at-He.top-He.bottom,mt=en(B).append("svg").attr("width",Je).attr("height",at).append("g").attr("transform",`translate(${He.left},${He.top})`),nt=_f().domain(i.map(Re=>Re.section)).range([0,kt]).padding(.3),We=Yr().domain([0,bl(i,Re=>Re.phrases)]).nice().range([_t,0]);mt.append("g").call(Wa(We).ticks(4).tickFormat(Vl(",d"))).call(Re=>Re.select(".domain").attr("stroke","#374151")).call(Re=>Re.selectAll("text").attr("fill","#9ca3af").attr("font-size",10)),mt.selectAll(".bar").data(i).join("rect").attr("x",Re=>nt(Re.section)).attr("y",Re=>We(Re.phrases)).attr("width",nt.bandwidth()).attr("height",Re=>_t-We(Re.phrases)).attr("fill",Re=>ye[Re.section]||"#6b7280").attr("rx",3).style("cursor","pointer").on("click",(Re,Xe)=>{n(14,m=m===Xe.section?"":Xe.section),n(13,_=0),n(27,Z="pages"),te()}),mt.selectAll(".bar-label").data(i).join("text").attr("x",Re=>nt(Re.section)+nt.bandwidth()/2).attr("y",Re=>We(Re.phrases)-4).attr("text-anchor","middle").attr("fill","#d1d5db").attr("font-size",9).text(Re=>un(Re.phrases)),mt.append("g").attr("transform",`translate(0,${_t})`).call(Ha(nt)).call(Re=>Re.select(".domain").attr("stroke","#374151")).call(Re=>Re.selectAll("text").attr("fill","#9ca3af").attr("font-size",11))}function X(){if(!W||!s.length)return;en(W).selectAll("*").remove();const ye=s.filter(Xe=>Xe.phrases>=100);if(!ye.length)return;const He={top:8,right:56,bottom:8,left:76},Je=22,at=4,kt=W.clientWidth||400,_t=ye.length*(Je+at)+He.top+He.bottom,ut=kt-He.left-He.right,nt=en(W).append("svg").attr("width",kt).attr("height",_t).append("g").attr("transform",`translate(${He.left},${He.top})`),We=bl(ye,Xe=>Xe.phrases)||1,Re=Yr().domain([0,We]).range([0,ut]);ye.forEach((Xe,At)=>{const it=At*(Je+at);nt.append("text").attr("x",-6).attr("y",it+Je/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","#93c5fd").attr("font-size",10).attr("font-family","monospace").text(Xe.instance),nt.append("rect").attr("x",0).attr("y",it).attr("width",ut).attr("height",Je).attr("fill","#1f2937").attr("rx",3),nt.append("rect").attr("x",0).attr("y",it).attr("width",Re(Xe.phrases)).attr("height",Je).attr("fill","#3b82f655").attr("rx",3),nt.append("rect").attr("x",0).attr("y",it).attr("width",Re(Xe.approved)).attr("height",Je).attr("fill","#10b981").attr("rx",3).style("cursor","pointer").on("click",()=>{n(15,y=y===Xe.instance?"":Xe.instance),n(12,g=y),n(13,_=0),n(27,Z="pages"),te()}),nt.append("text").attr("x",ut+6).attr("y",it+Je/2).attr("dominant-baseline","middle").attr("fill","#9ca3af").attr("font-size",9).text(`${un(Xe.phrases)} phrases`)})}let H;function U(){n(14,m=""),n(15,y=""),clearTimeout(H),H=setTimeout(()=>{n(13,_=0),te()},300)}function Y(ye){n(14,m=m===ye?"":ye),n(12,g=""),n(15,y=""),n(13,_=0),te()}function ie(ye){n(15,y=y===ye?"":ye),n(12,g=y),n(14,m=""),n(13,_=0),te()}function ue(){n(13,_=Math.max(0,_-Vn)),te()}function G(){n(13,_+=Vn),te()}function ce(ye){n(27,Z=ye),ye==="pages"&&f.length===0&&te(),ye==="overview"&&xr().then(ae)}Nr(()=>{const ye=new ResizeObserver(()=>{h||ae()});return K().then(()=>{[$,se,B,W].filter(Boolean).forEach(He=>ye.observe(He))}),()=>ye.disconnect()});function ke(ye){wr.call(this,e,ye)}const he=ye=>ce(ye);function xe(ye){Hn[ye?"unshift":"push"](()=>{V=ye,n(29,V)})}function Te(ye){Hn[ye?"unshift":"push"](()=>{se=ye,n(30,se)})}function ge(ye){Hn[ye?"unshift":"push"](()=>{B=ye,n(31,B)})}const je=ye=>Y(ye.section);function Fe(ye){Hn[ye?"unshift":"push"](()=>{W=ye,n(32,W)})}function oe(){g=this.value,n(12,g)}const ze=ye=>Y(ye.section),Le=ye=>ie(ye.instance),Pe=ye=>v===ye.url?be():q(ye.url);function Ye(){x=tn(this),n(18,x),n(5,o)}const et=()=>le(k.pendingKeyIds,"All pending"),$e=()=>le([...I],"Selected");function we(){S=this.value,n(1,S)}const Ue=()=>{n(23,T=null),n(24,z=null)},_e=()=>{n(2,M=!M),n(23,T=null),n(24,z=null)};function Me(){L=tn(this),n(3,L)}const Ce=()=>{n(23,T=null),n(24,z=null)},Ve=ye=>I.has(ye.id),pe=ye=>ve(ye.id),qe=ye=>me(ye),Ke=ye=>le([ye.id],`"${ye.key}"`);function bt(ye){Hn[ye?"unshift":"push"](()=>{$=ye,n(28,$)})}const jt=()=>{n(23,T=null),n(24,z=null)};function Et(){x=tn(this),n(18,x),n(5,o)}const Rt=()=>le([z.id],`"${z.key}"`),Bt=(ye,He)=>!ye.has(He.lang),Dt=()=>{n(23,T=null),n(24,z=null)};return e.$$.update=()=>{e.$$.dirty[0]&15&&n(33,r=(()=>{const ye=(k==null?void 0:k.topPhrases)||[];if(!S)return ye.filter(Je=>!L||Je.status===L);if(M){let Je;try{Je=new RegExp(S,"i"),n(19,N=!1)}catch{return n(19,N=!0),[]}return ye.filter(at=>(!L||at.status===L)&&(Je.test(at.key)||Je.test(at.context||"")))}const He=S.toLowerCase();return ye.filter(Je=>(!L||Je.status===L)&&(Je.key.toLowerCase().includes(He)||(Je.context||"").toLowerCase().includes(He)))})())},n(19,N=!1),[k,S,M,L,l,o,i,s,f,d,h,p,g,_,m,y,v,C,x,N,I,P,F,T,z,w,D,Z,$,V,se,B,W,r,J,q,be,ve,Ne,le,me,U,Y,ie,ue,G,ce,ke,he,xe,Te,ge,je,Fe,oe,ze,Le,Pe,Ye,et,$e,we,Ue,_e,Me,Ce,Ve,pe,qe,Ke,bt,jt,Et,Rt,Bt,Dt]}class G_ extends sn{constructor(t){super(),on(this,t,J_,Y_,$t,{},null,[-1,-1,-1,-1])}}function gc(e,t,n){const r=e.slice();return r[23]=t[n],r}function mc(e,t,n){const r=e.slice();return r[26]=t[n],r}function _c(e){let t,n,r,l;function o(){return e[16](e[26])}return{c(){t=b("button"),a(t,"class",n="w-6 h-6 rounded-full border-2 transition-transform hover:scale-110 "+(e[2]===e[26]?"border-gray-800 scale-110":"border-transparent")),gt(t,"background-color",e[26]),a(t,"title",e[26])},m(i,s){R(i,t,s),r||(l=Q(t,"click",o),r=!0)},p(i,s){e=i,s&4&&n!==(n="w-6 h-6 rounded-full border-2 transition-transform hover:scale-110 "+(e[2]===e[26]?"border-gray-800 scale-110":"border-transparent"))&&a(t,"class",n)},d(i){i&&j(t),r=!1,l()}}}function bc(e){let t,n;return{c(){t=b("p"),n=O(e[6]),a(t,"class","text-sm text-red-600 mb-4")},m(r,l){R(r,t,l),u(t,n)},p(r,l){l&64&&ee(n,r[6])},d(r){r&&j(t)}}}function K_(e){let t,n=[],r=new Map,l=Oe(e[0]);const o=i=>i[23].id;for(let i=0;i<l.length;i+=1){let s=gc(e,l,i),c=o(s);r.set(c,n[i]=yc(c,s))}return{c(){t=b("div");for(let i=0;i<n.length;i+=1)n[i].c();a(t,"class","space-y-2")},m(i,s){R(i,t,s);for(let c=0;c<n.length;c+=1)n[c]&&n[c].m(t,null)},p(i,s){s&7737&&(l=Oe(i[0]),n=tl(n,s,o,1,i,l,r,t,ji,yc,null,gc))},d(i){i&&j(t);for(let s=0;s<n.length;s+=1)n[s].d()}}}function X_(e){let t;return{c(){t=b("div"),t.innerHTML='<p>No labels created yet.</p> <p class="text-sm mt-1">Create your first label above to start organizing phrases.</p>',a(t,"class","text-center py-8 text-gray-400")},m(n,r){R(n,t,r)},p:Be,d(n){n&&j(t)}}}function Q_(e){let t,n,r,l=e[23].name+"",o,i,s,c=e[23].count+"",f,d,h=e[23].count!==1?"s":"",p,g,_,m,y,v,k;function C(){return e[20](e[23])}function x(){return e[21](e[23])}return{c(){t=b("span"),n=E(),r=b("span"),o=O(l),i=E(),s=b("span"),f=O(c),d=O(" phrase"),p=O(h),g=E(),_=b("button"),_.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 20 20" fill="currentColor"><path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"></path></svg>',m=E(),y=b("button"),y.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg>',a(t,"class","inline-block w-4 h-4 rounded-full shrink-0"),gt(t,"background-color",e[23].color),a(r,"class","flex-1 text-sm font-medium text-gray-700"),a(s,"class","text-xs text-gray-400"),a(_,"class","p-1 text-gray-400 hover:text-indigo-600 transition-colors"),a(_,"title","Edit"),a(y,"class","p-1 text-gray-400 hover:text-red-600 transition-colors"),a(y,"title","Delete")},m(S,M){R(S,t,M),R(S,n,M),R(S,r,M),u(r,o),R(S,i,M),R(S,s,M),u(s,f),u(s,d),u(s,p),R(S,g,M),R(S,_,M),R(S,m,M),R(S,y,M),v||(k=[Q(_,"click",C),Q(y,"click",x)],v=!0)},p(S,M){e=S,M&1&&gt(t,"background-color",e[23].color),M&1&&l!==(l=e[23].name+"")&&ee(o,l),M&1&&c!==(c=e[23].count+"")&&ee(f,c),M&1&&h!==(h=e[23].count!==1?"s":"")&&ee(p,h)},d(S){S&&(j(t),j(n),j(r),j(i),j(s),j(g),j(_),j(m),j(y)),v=!1,lt(k)}}}function $_(e){let t,n,r,l,o,i,s,c,f;return{c(){t=b("input"),n=E(),r=b("input"),l=E(),o=b("button"),o.textContent="Save",i=E(),s=b("button"),s.textContent="Cancel",a(t,"type","color"),a(t,"class","w-7 h-7 rounded border border-gray-300 cursor-pointer"),a(r,"type","text"),a(r,"maxlength","50"),a(r,"class","flex-1 px-2 py-1 border border-gray-300 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(o,"class","px-3 py-1 bg-indigo-600 text-white text-xs rounded hover:bg-indigo-700"),a(s,"class","px-3 py-1 border border-gray-300 text-xs rounded hover:bg-gray-100")},m(d,h){R(d,t,h),Ie(t,e[5]),R(d,n,h),R(d,r,h),Ie(r,e[4]),R(d,l,h),R(d,o,h),R(d,i,h),R(d,s,h),c||(f=[Q(t,"input",e[17]),Q(r,"input",e[18]),Q(r,"keydown",e[19]),Q(o,"click",e[10]),Q(s,"click",e[11])],c=!0)},p(d,h){h&32&&Ie(t,d[5]),h&16&&r.value!==d[4]&&Ie(r,d[4])},d(d){d&&(j(t),j(n),j(r),j(l),j(o),j(i),j(s)),c=!1,lt(f)}}}function yc(e,t){let n,r;function l(s,c){return s[3]===s[23].id?$_:Q_}let o=l(t),i=o(t);return{key:e,first:null,c(){n=b("div"),i.c(),r=E(),a(n,"class","flex items-center gap-3 p-3 rounded-lg border border-gray-200 hover:bg-gray-50 transition-colors"),this.first=n},m(s,c){R(s,n,c),i.m(n,null),u(n,r)},p(s,c){t=s,o===(o=l(t))&&i?i.p(t,c):(i.d(1),i=o(t),i&&(i.c(),i.m(n,r)))},d(s){s&&j(n),i.d()}}}function e2(e){let t,n,r,l,o,i,s,c,f,d,h,p,g,_,m,y,v,k,C,x,S,M=Oe(e[7]),N=[];for(let T=0;T<M.length;T+=1)N[T]=_c(mc(e,M,T));let L=e[6]&&bc(e);function I(T,z){return T[0].length===0?X_:K_}let P=I(e),F=P(e);return{c(){t=b("section"),n=b("h2"),n.textContent="Labels",r=E(),l=b("p"),l.textContent="Create labels to organize and categorize your phrases. Labels work like GitHub labels — assign them to phrases and filter by them.",o=E(),i=b("div"),s=b("div"),c=b("input"),f=E(),d=b("div"),h=b("input"),p=E(),g=b("button"),_=O("Create"),y=E(),v=b("div");for(let T=0;T<N.length;T+=1)N[T].c();k=E(),L&&L.c(),C=E(),F.c(),a(n,"class","text-lg font-semibold text-gray-800 mb-4"),a(l,"class","text-sm text-gray-500 mb-6"),a(c,"type","text"),a(c,"placeholder","Label name"),a(c,"maxlength","50"),a(c,"class","flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),a(h,"type","color"),a(h,"class","w-9 h-9 rounded-md border border-gray-300 cursor-pointer"),a(h,"title","Pick color"),a(d,"class","relative"),a(s,"class","flex items-center gap-2 flex-1"),a(g,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),g.disabled=m=!e[1].trim(),a(i,"class","flex items-center gap-3 mb-6 p-4 bg-gray-50 rounded-lg border border-gray-200"),a(v,"class","flex flex-wrap gap-1.5 mb-6"),a(t,"class","max-w-2xl")},m(T,z){R(T,t,z),u(t,n),u(t,r),u(t,l),u(t,o),u(t,i),u(i,s),u(s,c),Ie(c,e[1]),u(s,f),u(s,d),u(d,h),Ie(h,e[2]),u(i,p),u(i,g),u(g,_),u(t,y),u(t,v);for(let w=0;w<N.length;w+=1)N[w]&&N[w].m(v,null);u(t,k),L&&L.m(t,null),u(t,C),F.m(t,null),x||(S=[Q(c,"input",e[13]),Q(c,"keydown",e[14]),Q(h,"input",e[15]),Q(g,"click",e[8])],x=!0)},p(T,[z]){if(z&2&&c.value!==T[1]&&Ie(c,T[1]),z&4&&Ie(h,T[2]),z&2&&m!==(m=!T[1].trim())&&(g.disabled=m),z&132){M=Oe(T[7]);let w;for(w=0;w<M.length;w+=1){const D=mc(T,M,w);N[w]?N[w].p(D,z):(N[w]=_c(D),N[w].c(),N[w].m(v,null))}for(;w<N.length;w+=1)N[w].d(1);N.length=M.length}T[6]?L?L.p(T,z):(L=bc(T),L.c(),L.m(t,C)):L&&(L.d(1),L=null),P===(P=I(T))&&F?F.p(T,z):(F.d(1),F=P(T),F&&(F.c(),F.m(t,null)))},i:Be,o:Be,d(T){T&&j(t),ft(N,T),L&&L.d(),F.d(),x=!1,lt(S)}}}function t2(e,t,n){let r=[],l="",o="#6366f1",i=null,s="",c="",f="";const d=["#ef4444","#f97316","#f59e0b","#84cc16","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#64748b"];Nr(h);async function h(){const P=await Ze("../api/labels");P.ok&&n(0,r=await P.json())}async function p(){if(!l.trim())return;n(6,f="");const P=await Ze("../api/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.trim(),color:o})});if(P.ok)n(1,l=""),n(2,o="#6366f1"),await h();else{const F=await P.json().catch(()=>({}));n(6,f=F.error||"Failed to create label")}}function g(P){n(3,i=P.id),n(4,s=P.name),n(5,c=P.color)}async function _(){if(!s.trim())return;(await Ze(`../api/labels/${i}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.trim(),color:c})})).ok&&(n(3,i=null),await h())}function m(){n(3,i=null)}async function y(P){confirm("Delete this label? It will be removed from all phrases.")&&(await Ze(`../api/labels/${P}`,{method:"DELETE"}),await h())}function v(){l=this.value,n(1,l)}const k=P=>P.key==="Enter"&&p();function C(){o=this.value,n(2,o)}const x=P=>n(2,o=P);function S(){c=this.value,n(5,c)}function M(){s=this.value,n(4,s)}return[r,l,o,i,s,c,f,d,p,g,_,m,y,v,k,C,x,S,M,P=>{P.key==="Enter"&&_(),P.key==="Escape"&&m()},P=>g(P),P=>y(P.id)]}class n2 extends sn{constructor(t){super(),on(this,t,t2,e2,$t,{})}}function vc(e){if(!e)throw Error("Parameter args is required");if(!e.component==!e.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(e.component&&(e.asyncComponent=()=>Promise.resolve(e.component)),typeof e.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(e.conditions){Array.isArray(e.conditions)||(e.conditions=[e.conditions]);for(let n=0;n<e.conditions.length;n++)if(!e.conditions[n]||typeof e.conditions[n]!="function")throw Error("Invalid parameter conditions["+n+"]")}return e.loadingComponent&&(e.asyncComponent.loading=e.loadingComponent,e.asyncComponent.loadingParams=e.loadingParams||void 0),{component:e.asyncComponent,userData:e.userData,conditions:e.conditions&&e.conditions.length?e.conditions:void 0,props:e.props&&Object.keys(e.props).length?e.props:{},_sveltesparouter:!0}}function r2(e){let t,n;return t=new Xf({props:{routes:e[4]}}),t.$on("conditionsFailed",e[6]),t.$on("routeLoaded",e[7]),{c(){rn(t.$$.fragment)},m(r,l){Xt(t,r,l),n=!0},p:Be,i(r){n||(st(t.$$.fragment,r),n=!0)},o(r){ct(t.$$.fragment,r),n=!1},d(r){Qt(t,r)}}}function l2(e){let t;return{c(){t=b("div"),t.innerHTML='<div class="flex flex-col items-center gap-3"><svg width="60" height="60" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><defs><style>@keyframes lspin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes lpulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:0.7;transform:scale(0.92)}}#lr{animation:lspin 1.2s linear infinite;transform-origin:40px 40px}#lp{animation:lpulse 2s ease-in-out infinite;transform-origin:40px 40px}</style></defs><g id="lr"><circle cx="40" cy="40" r="34" fill="none" stroke="#2a3040" stroke-width="4"></circle><path d="M40 6 A34 34 0 0 1 74 40" fill="none" stroke="#2ECC88" stroke-width="4" stroke-linecap="round"></path><path d="M74 40 A34 34 0 0 1 56 70" fill="none" stroke="#3A8FE0" stroke-width="4" stroke-linecap="round"></path><path d="M56 70 A34 34 0 0 1 24 70" fill="none" stroke="#FFB833" stroke-width="4" stroke-linecap="round"></path></g><g id="lp"><circle cx="40" cy="40" r="16" fill="#1a1f2e"></circle><circle cx="40" cy="38" r="10" fill="#2ECC88"></circle><circle cx="37" cy="37" r="2.5" fill="white"></circle><circle cx="37.5" cy="37.5" r="1.5" fill="#2C2C2A"></circle><circle cx="43" cy="37" r="2.5" fill="white"></circle><circle cx="42.5" cy="37.5" r="1.5" fill="#2C2C2A"></circle><path d="M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z" fill="#E8A020"></path><line x1="38" y1="30" x2="36" y2="26" stroke="#FFB833" stroke-width="1.5" stroke-linecap="round"></line><line x1="40" y1="29" x2="40" y2="24" stroke="#7BC74A" stroke-width="1.5" stroke-linecap="round"></line><line x1="42" y1="30" x2="44" y2="26" stroke="#F07040" stroke-width="1.5" stroke-linecap="round"></line><circle cx="36" cy="25.5" r="1.5" fill="#FFB833"></circle><circle cx="40" cy="23.5" r="1.5" fill="#7BC74A"></circle><circle cx="44" cy="25.5" r="1.5" fill="#F07040"></circle></g></svg> <p class="text-gray-400 text-sm">Loading…</p></div>',a(t,"class","flex items-center justify-center h-full")},m(n,r){R(n,t,r)},p:Be,i:Be,o:Be,d(n){n&&j(t)}}}function i2(e){let t,n,r,l,o,i,s,c,f,d,h;n=new ed({props:{currentView:e[2]}}),n.$on("navigate",e[5]),i=new sd({props:{projects:e[1],currentProject:e[3]}}),i.$on("switch",e[8]),i.$on("created",e[9]),i.$on("deleted",e[10]),i.$on("renamed",e[11]);const p=[l2,r2],g=[];function _(m,y){return m[0]?1:0}return f=_(e),d=g[f]=p[f](e),{c(){t=b("div"),rn(n.$$.fragment),r=E(),l=b("div"),o=b("header"),rn(i.$$.fragment),s=E(),c=b("main"),d.c(),a(o,"class","bg-white border-b border-gray-200 px-6 py-2 flex items-center justify-end gap-3 shrink-0"),a(c,"class","flex-1 p-6 overflow-auto"),a(l,"class","flex-1 flex flex-col overflow-hidden"),a(t,"class","flex min-h-screen bg-gray-100")},m(m,y){R(m,t,y),Xt(n,t,null),u(t,r),u(t,l),u(l,o),Xt(i,o,null),u(l,s),u(l,c),g[f].m(c,null),h=!0},p(m,[y]){const v={};y&4&&(v.currentView=m[2]),n.$set(v);const k={};y&2&&(k.projects=m[1]),y&8&&(k.currentProject=m[3]),i.$set(k);let C=f;f=_(m),f===C?g[f].p(m,y):(Gt(),ct(g[C],1,1,()=>{g[C]=null}),Kt(),d=g[f],d?d.p(m,y):(d=g[f]=p[f](m),d.c()),st(d,1),d.m(c,null))},i(m){h||(st(n.$$.fragment,m),st(i.$$.fragment,m),st(d),h=!0)},o(m){ct(n.$$.fragment,m),ct(i.$$.fragment,m),ct(d),h=!1},d(m){m&&j(t),Qt(n),Qt(i),g[f].d()}}}function o2(e,t,n){let r,l,o,i;Gr(e,an,k=>n(3,o=k)),Gr(e,Jf,k=>n(13,i=k));let s=!1,c=[];const f={"/translations/:tab":vc({component:Js,conditions:[k=>{var C;return["pending","approved","trash"].includes((C=k.params)==null?void 0:C.tab)}]}),"/ai-translate":m0,"/analytics":G_,"/labels":n2,"/settings":N0,"*":vc({component:Js})};function d(k){const C=k.detail;if(C==="translations"){if(i.startsWith("/translations/"))return;mr("/translations/pending")}else mr(`/${C}`)}function h(){mr("/translations/pending")}function p(k){k.detail.route==="*"&&mr("/translations/pending")}Nr(async()=>{(!window.location.hash||window.location.hash==="#"||window.location.hash==="#/")&&mr("/translations/pending");const k=await fetch("../api/projects");n(1,c=await k.json());const C=localStorage.getItem("loco_project_id");let x=c.find(S=>String(S.id)===C)||c[0];if(!x){n(0,s=!0);return}await g(x),n(0,s=!0)});async function g(k){Lc(k.api_key),localStorage.setItem("loco_project_id",String(k.id)),an.set(k)}async function _(k){n(0,s=!1),await g(k.detail),n(0,s=!0)}async function m(k){n(1,c=[...c,k.detail]),n(0,s=!1),await g(k.detail),n(0,s=!0)}async function y(k){const C=k.detail;n(1,c=c.filter(x=>x.id!==C.id)),(o==null?void 0:o.id)===C.id&&(n(0,s=!1),await g(c[0]),n(0,s=!0))}async function v(k){const C=k.detail;n(1,c=c.map(x=>x.id===C.id?{...x,name:C.name}:x)),(o==null?void 0:o.id)===C.id&&an.update(x=>({...x,name:C.name}))}return e.$$.update=()=>{e.$$.dirty&8192&&n(12,r=(i||"").split("/")[1]||"translations"),e.$$.dirty&4096&&n(2,l=r==="ai-translate"?"ai-translate":r==="settings"?"settings":r==="analytics"?"analytics":r==="labels"?"labels":"translations")},[s,c,l,o,f,d,h,p,_,m,y,v,r,i]}class s2 extends sn{constructor(t){super(),on(this,t,o2,i2,$t,{})}}new s2({target:document.getElementById("app")});