vskill 1.2.0 → 1.2.2

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.
Files changed (106) hide show
  1. package/agents.json +1 -1
  2. package/dist/api/client.js +7 -6
  3. package/dist/api/client.js.map +1 -1
  4. package/dist/blocklist/blocklist.d.ts +12 -0
  5. package/dist/blocklist/blocklist.js +19 -0
  6. package/dist/blocklist/blocklist.js.map +1 -1
  7. package/dist/commands/add.js +71 -43
  8. package/dist/commands/add.js.map +1 -1
  9. package/dist/commands/auth.js +32 -1
  10. package/dist/commands/auth.js.map +1 -1
  11. package/dist/commands/diff.js +8 -0
  12. package/dist/commands/diff.js.map +1 -1
  13. package/dist/commands/eval/run.js +5 -0
  14. package/dist/commands/eval/run.js.map +1 -1
  15. package/dist/commands/info.js +7 -0
  16. package/dist/commands/info.js.map +1 -1
  17. package/dist/commands/outdated.js +24 -7
  18. package/dist/commands/outdated.js.map +1 -1
  19. package/dist/commands/pin.js +7 -2
  20. package/dist/commands/pin.js.map +1 -1
  21. package/dist/commands/submit.js +8 -0
  22. package/dist/commands/submit.js.map +1 -1
  23. package/dist/commands/update.js +14 -5
  24. package/dist/commands/update.js.map +1 -1
  25. package/dist/commands/versions.js +11 -0
  26. package/dist/commands/versions.js.map +1 -1
  27. package/dist/discovery/github-tree.js +14 -2
  28. package/dist/discovery/github-tree.js.map +1 -1
  29. package/dist/eval/anthropic-catalog.d.ts +7 -1
  30. package/dist/eval/anthropic-catalog.js +81 -8
  31. package/dist/eval/anthropic-catalog.js.map +1 -1
  32. package/dist/eval/credential-resolver.js +5 -3
  33. package/dist/eval/credential-resolver.js.map +1 -1
  34. package/dist/eval/integration-runner.js +4 -4
  35. package/dist/eval/integration-runner.js.map +1 -1
  36. package/dist/eval/llm.d.ts +2 -0
  37. package/dist/eval/llm.js +39 -8
  38. package/dist/eval/llm.js.map +1 -1
  39. package/dist/eval/model-catalog.d.ts +27 -0
  40. package/dist/eval/model-catalog.js +101 -0
  41. package/dist/eval/model-catalog.js.map +1 -0
  42. package/dist/eval/pricing.d.ts +5 -0
  43. package/dist/eval/pricing.js +16 -2
  44. package/dist/eval/pricing.js.map +1 -1
  45. package/dist/eval/test-case-parser.js +35 -16
  46. package/dist/eval/test-case-parser.js.map +1 -1
  47. package/dist/eval-server/api-routes.d.ts +2 -10
  48. package/dist/eval-server/api-routes.js +35 -85
  49. package/dist/eval-server/api-routes.js.map +1 -1
  50. package/dist/eval-server/install-skill-routes.d.ts +2 -0
  51. package/dist/eval-server/install-skill-routes.js +7 -0
  52. package/dist/eval-server/install-skill-routes.js.map +1 -1
  53. package/dist/eval-server/model-compare-routes.js +4 -2
  54. package/dist/eval-server/model-compare-routes.js.map +1 -1
  55. package/dist/eval-server/oauth-github-routes.js +32 -2
  56. package/dist/eval-server/oauth-github-routes.js.map +1 -1
  57. package/dist/eval-server/origin-resolver.d.ts +6 -0
  58. package/dist/eval-server/origin-resolver.js +35 -5
  59. package/dist/eval-server/origin-resolver.js.map +1 -1
  60. package/dist/eval-server/platform-proxy.d.ts +3 -3
  61. package/dist/eval-server/platform-proxy.js +10 -25
  62. package/dist/eval-server/platform-proxy.js.map +1 -1
  63. package/dist/eval-server/skill-create-routes.d.ts +1 -1
  64. package/dist/eval-server/skill-create-routes.js +1 -71
  65. package/dist/eval-server/skill-create-routes.js.map +1 -1
  66. package/dist/eval-server/skill-md-emitter.d.ts +17 -0
  67. package/dist/eval-server/skill-md-emitter.js +70 -0
  68. package/dist/eval-server/skill-md-emitter.js.map +1 -0
  69. package/dist/eval-server/studio-privacy.d.ts +26 -0
  70. package/dist/eval-server/studio-privacy.js +129 -0
  71. package/dist/eval-server/studio-privacy.js.map +1 -0
  72. package/dist/eval-ui/assets/{AdvancedTab-DOgbx7u0.js → AdvancedTab-CSWhj_MZ.js} +1 -1
  73. package/dist/eval-ui/assets/{CreateSkillPage-ENMve2K8.js → CreateSkillPage-BJzNKgad.js} +1 -1
  74. package/dist/eval-ui/assets/{FindSkillsPalette-BMVKCk6E.js → FindSkillsPalette-XckIggJi.js} +2 -2
  75. package/dist/eval-ui/assets/{GeneralTab-AwK9sIkP.js → GeneralTab-Gbc-K6UI.js} +1 -1
  76. package/dist/eval-ui/assets/{PrivacyTab-BtNrxpVV.js → PrivacyTab-BXCIX8cQ.js} +1 -1
  77. package/dist/eval-ui/assets/SearchPaletteCore-CTZ8CI14.js +14 -0
  78. package/dist/eval-ui/assets/SkillDetailPanel-NPnDnA3H.js +1 -0
  79. package/dist/eval-ui/assets/{UpdateDropdown-C4BH7W_M.js → UpdateDropdown-CPP1t9LD.js} +1 -1
  80. package/dist/eval-ui/assets/{UpdatesTab-DTmo-vVb.js → UpdatesTab-BFGUaUtu.js} +1 -1
  81. package/dist/eval-ui/assets/{main-tzMA8J07.js → main-jiMosYzo.js} +40 -41
  82. package/dist/eval-ui/assets/{preferences-DCdw0Kvu.js → preferences-D2BPT0OT.js} +2 -2
  83. package/dist/eval-ui/assets/useDesktopBridge-BKz-gcRg.js +2 -0
  84. package/dist/eval-ui/index.html +2 -2
  85. package/dist/eval-ui/preferences.html +2 -2
  86. package/dist/lib/frontmatter.d.ts +2 -5
  87. package/dist/lib/frontmatter.js +15 -40
  88. package/dist/lib/frontmatter.js.map +1 -1
  89. package/dist/lib/github-fetch.d.ts +2 -0
  90. package/dist/lib/github-fetch.js +27 -1
  91. package/dist/lib/github-fetch.js.map +1 -1
  92. package/dist/lib/keychain.js +8 -1
  93. package/dist/lib/keychain.js.map +1 -1
  94. package/dist/lib/private-source.d.ts +77 -0
  95. package/dist/lib/private-source.js +392 -0
  96. package/dist/lib/private-source.js.map +1 -0
  97. package/dist/lib/repo-visibility.d.ts +16 -0
  98. package/dist/lib/repo-visibility.js +43 -3
  99. package/dist/lib/repo-visibility.js.map +1 -1
  100. package/dist/utils/version.d.ts +5 -10
  101. package/dist/utils/version.js +82 -40
  102. package/dist/utils/version.js.map +1 -1
  103. package/package.json +1 -1
  104. package/dist/eval-ui/assets/SearchPaletteCore-C9G-ySXc.js +0 -14
  105. package/dist/eval-ui/assets/SkillDetailPanel-BCJj8p79.js +0 -1
  106. package/dist/eval-ui/assets/useDesktopBridge-9oZFQsrw.js +0 -2
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GeneralTab-AwK9sIkP.js","assets/globals-hm1COkXX.js","assets/globals-Dpf9KmYH.css","assets/useDesktopBridge-9oZFQsrw.js","assets/fonts-i7Lkz2zN.css","assets/UpdatesTab-DTmo-vVb.js","assets/PrivacyTab-BtNrxpVV.js","assets/AdvancedTab-DOgbx7u0.js"])))=>i.map(i=>d[i]);
2
- var Ee=Object.defineProperty;var $e=(n,e,t)=>e in n?Ee(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ie=(n,e,t)=>$e(n,typeof e!="symbol"?e+"":e,t);import{r as S,j as m,c as je}from"./globals-hm1COkXX.js";/* empty css */import{_ as Y,u as Ie,a as Te,l as Ae}from"./useDesktopBridge-9oZFQsrw.js";function Fe(){if(console&&console.warn){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];$(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}const re={};function X(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];$(e[0])&&re[e[0]]||($(e[0])&&(re[e[0]]=new Date),Fe(...e))}const ve=(n,e)=>()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}},ae=(n,e,t)=>{n.loadNamespaces(e,ve(n,t))},oe=(n,e,t,s)=>{$(t)&&(t=[t]),t.forEach(i=>{n.options.ns.indexOf(i)<0&&n.options.ns.push(i)}),n.loadLanguages(e,ve(n,s))},De=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=e.languages[0],i=e.options?e.options.fallbackLng:!1,r=e.languages[e.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,u)=>{const c=e.services.backendConnector.state[`${o}|${u}`];return c===-1||c===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!a(e.isLanguageChangingTo,n)?!1:!!(e.hasResourceBundle(s,n)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||a(s,n)&&(!i||a(r,n)))},Ue=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(X("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(n,{lng:t.lng,precheck:(i,r)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,n))return!1}}):De(n,e,t)},$=n=>typeof n=="string",Ve=n=>typeof n=="object"&&n!==null,Ke=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Me={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},ze=n=>Me[n],He=n=>n.replace(Ke,ze);let _={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:He};const Be=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_={..._,...n}},Je=()=>_;let we;const We=n=>{we=n},Ge=()=>we,Ye={type:"3rdParty",init(n){Be(n.options.react),We(n)}},Le=S.createContext();class Qe{constructor(){ie(this,"getUsedNamespaces",()=>Object.keys(this.usedNamespaces));this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}}const qe=(n,e)=>{const t=S.useRef();return S.useEffect(()=>{t.current=n},[n,e]),t.current},Ne=(n,e,t,s)=>n.getFixedT(e,t,s),Ze=(n,e,t,s)=>S.useCallback(Ne(n,e,t,s),[n,e,t,s]),Xe=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:t}=e,{i18n:s,defaultNS:i}=S.useContext(Le)||{},r=t||s||Ge();if(r&&!r.reportNamespaces&&(r.reportNamespaces=new Qe),!r){X("You will need to pass in an i18next instance by using initReactI18next");const b=(N,v)=>$(v)?v:Ve(v)&&$(v.defaultValue)?v.defaultValue:Array.isArray(N)?N[N.length-1]:N,L=[b,{},!1];return L.t=b,L.i18n={},L.ready=!1,L}r.options.react&&r.options.react.wait!==void 0&&X("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Je(),...r.options.react,...e},{useSuspense:o,keyPrefix:u}=a;let c=n;c=$(c)?[c]:c||["translation"],r.reportNamespaces.addUsedNamespaces&&r.reportNamespaces.addUsedNamespaces(c);const d=(r.isInitialized||r.initializedStoreOnce)&&c.every(b=>Ue(b,r,a)),h=Ze(r,e.lng||null,a.nsMode==="fallback"?c:c[0],u),l=()=>h,f=()=>Ne(r,e.lng||null,a.nsMode==="fallback"?c:c[0],u),[p,x]=S.useState(l);let y=c.join();e.lng&&(y=`${e.lng}${y}`);const C=qe(y),w=S.useRef(!0);S.useEffect(()=>{const{bindI18n:b,bindI18nStore:L}=a;w.current=!0,!d&&!o&&(e.lng?oe(r,e.lng,c,()=>{w.current&&x(f)}):ae(r,c,()=>{w.current&&x(f)})),d&&C&&C!==y&&w.current&&x(f);const N=()=>{w.current&&x(f)};return b&&r&&r.on(b,N),L&&r&&r.store.on(L,N),()=>{w.current=!1,b&&r&&b.split(" ").forEach(v=>r.off(v,N)),L&&r&&L.split(" ").forEach(v=>r.store.off(v,N))}},[r,y]),S.useEffect(()=>{w.current&&d&&x(l)},[r,u,d]);const R=[p,r,d];if(R.t=p,R.i18n=r,R.ready=d,d||!d&&!o)return R;throw new Promise(b=>{e.lng?oe(r,e.lng,c,()=>b()):ae(r,c,()=>b())})};function _e(n){let{i18n:e,defaultNS:t,children:s}=n;const i=S.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return S.createElement(Le.Provider,{value:i},s)}const g=n=>typeof n=="string",U=()=>{let n,e;const t=new Promise((s,i)=>{n=s,e=i});return t.resolve=n,t.reject=e,t},le=n=>n==null?"":""+n,et=(n,e,t)=>{n.forEach(s=>{e[s]&&(t[s]=e[s])})},tt=/###/g,ue=n=>n&&n.indexOf("###")>-1?n.replace(tt,"."):n,ce=n=>!n||g(n),V=(n,e,t)=>{const s=g(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(ce(n))return{};const r=ue(s[i]);!n[r]&&t&&(n[r]=new t),Object.prototype.hasOwnProperty.call(n,r)?n=n[r]:n={},++i}return ce(n)?{}:{obj:n,k:ue(s[i])}},de=(n,e,t)=>{const{obj:s,k:i}=V(n,e,Object);if(s!==void 0||e.length===1){s[i]=t;return}let r=e[e.length-1],a=e.slice(0,e.length-1),o=V(n,a,Object);for(;o.obj===void 0&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),o=V(n,a,Object),o&&o.obj&&typeof o.obj[`${o.k}.${r}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${r}`]=t},st=(n,e,t,s)=>{const{obj:i,k:r}=V(n,e,Object);i[r]=i[r]||[],i[r].push(t)},B=(n,e)=>{const{obj:t,k:s}=V(n,e);if(t)return t[s]},nt=(n,e,t)=>{const s=B(n,t);return s!==void 0?s:B(e,t)},Ce=(n,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in n?g(n[s])||n[s]instanceof String||g(e[s])||e[s]instanceof String?t&&(n[s]=e[s]):Ce(n[s],e[s],t):n[s]=e[s]);return n},j=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var it={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const rt=n=>g(n)?n.replace(/[&<>"'\/]/g,e=>it[e]):n;class at{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const ot=[" ",",","?","!",";"],lt=new at(20),ut=(n,e,t)=>{e=e||"",t=t||"";const s=ot.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(s.length===0)return!0;const i=lt.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let r=!i.test(n);if(!r){const a=n.indexOf(t);a>0&&!i.test(n.substring(0,a))&&(r=!0)}return r},ee=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!n)return;if(n[e])return n[e];const s=e.split(t);let i=n;for(let r=0;r<s.length;){if(!i||typeof i!="object")return;let a,o="";for(let u=r;u<s.length;++u)if(u!==r&&(o+=t),o+=s[u],a=i[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&u<s.length-1)continue;r+=u-r+1;break}i=a}return i},J=n=>n&&n.replace("_","-"),ct={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){console&&console[n]&&console[n].apply(console,e)}};class W{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||ct,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,i){return i&&!this.debug?null:(g(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new W(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new W(this.logger,e)}}var P=new W;class Q{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(t)||0;this.observers[s].set(t,i+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[o,u]=a;for(let c=0;c<u;c++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[o,u]=a;for(let c=0;c<u;c++)o.apply(o,[e,...s])})}}class fe extends Q{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],s&&(Array.isArray(s)?o.push(...s):g(s)&&r?o.push(...s.split(r)):o.push(s)));const u=B(this.data,o);return!u&&!t&&!s&&e.indexOf(".")>-1&&(e=o[0],t=o[1],s=o.slice(2).join(".")),u||!a||!g(s)?u:ee(this.data&&this.data[e]&&this.data[e][t],s,r)}addResource(e,t,s,i){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=[e,t];s&&(o=o.concat(a?s.split(a):s)),e.indexOf(".")>-1&&(o=e.split("."),i=t,t=o[1]),this.addNamespaces(t),de(this.data,o,i),r.silent||this.emit("added",e,t,s,i)}addResources(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in s)(g(s[r])||Array.isArray(s[r]))&&this.addResource(e,t,r,s[r],{silent:!0});i.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,i,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),i=s,s=t,t=o[1]),this.addNamespaces(t);let u=B(this.data,o)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?Ce(u,s,r):u={...u,...s},de(this.data,o,u),a.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}}var ke={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,e,t,s,i){return n.forEach(r=>{this.processors[r]&&(e=this.processors[r].process(e,t,s,i))}),e}};const he={};class G extends Q{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),et(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=P.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const s=this.resolve(e,t);return s&&s.res!==void 0}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const a=s&&e.indexOf(s)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!ut(e,s,i);if(a&&!o){const u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:g(r)?[r]:r};const c=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(c[0])>-1)&&(r=c.shift()),e=c.join(i)}return{key:e,namespaces:g(r)?[r]:r}}translate(e,t,s){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,r=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],t),u=o[o.length-1],c=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(d){const b=t.nsSeparator||this.options.nsSeparator;return i?{res:`${u}${b}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:`${u}${b}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:a}const h=this.resolve(e,t);let l=h&&h.res;const f=h&&h.usedKey||a,p=h&&h.exactUsedKey||a,x=Object.prototype.toString.apply(l),y=["[object Number]","[object Function]","[object RegExp]"],C=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,R=!g(l)&&typeof l!="boolean"&&typeof l!="number";if(w&&l&&R&&y.indexOf(x)<0&&!(g(C)&&Array.isArray(l))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,l,{...t,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=b,h.usedParams=this.getUsedParamsDetails(t),h):b}if(r){const b=Array.isArray(l),L=b?[]:{},N=b?p:f;for(const v in l)if(Object.prototype.hasOwnProperty.call(l,v)){const M=`${N}${r}${v}`;L[v]=this.translate(M,{...t,joinArrays:!1,ns:o}),L[v]===M&&(L[v]=l[v])}l=L}}else if(w&&g(C)&&Array.isArray(l))l=l.join(C),l&&(l=this.extendTranslation(l,e,t,s));else{let b=!1,L=!1;const N=t.count!==void 0&&!g(t.count),v=G.hasDefaultValue(t),M=N?this.pluralResolver.getSuffix(c,t.count,t):"",Re=t.ordinal&&N?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",te=N&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),T=te&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${M}`]||t[`defaultValue${Re}`]||t.defaultValue;!this.isValidLookup(l)&&v&&(b=!0,l=T),this.isValidLookup(l)||(L=!0,l=a);const Pe=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:l,A=v&&T!==l&&this.options.updateMissing;if(L||b||A){if(this.logger.log(A?"updateKey":"missingKey",c,u,a,A?T:l),r){const O=this.resolve(a,{...t,keySeparator:!1});O&&O.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let F=[];const z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&z&&z[0])for(let O=0;O<z.length;O++)F.push(z[O]);else this.options.saveMissingTo==="all"?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);const se=(O,E,D)=>{const ne=v&&D!==l?D:Pe;this.options.missingKeyHandler?this.options.missingKeyHandler(O,u,E,ne,A,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(O,u,E,ne,A,t),this.emit("missingKey",O,u,E,l)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?F.forEach(O=>{const E=this.pluralResolver.getSuffixes(O,t);te&&t[`defaultValue${this.options.pluralSeparator}zero`]&&E.indexOf(`${this.options.pluralSeparator}zero`)<0&&E.push(`${this.options.pluralSeparator}zero`),E.forEach(D=>{se([O],a+D,t[`defaultValue${D}`]||T)})}):se(F,a,T))}l=this.extendTranslation(l,e,t,h,s),L&&l===a&&this.options.appendNamespaceToMissingKey&&(l=`${u}:${a}`),(L||b)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?l=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,b?l:void 0):l=this.options.parseMissingKeyHandler(l))}return i?(h.res=l,h.usedParams=this.getUsedParamsDetails(t),h):l}extendTranslation(e,t,s,i,r){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const c=g(e)&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const l=e.match(this.interpolator.nestingRegexp);d=l&&l.length}let h=s.replace&&!g(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,s.lng||this.language||i.usedLng,s),c){const l=e.match(this.interpolator.nestingRegexp),f=l&&l.length;d<f&&(s.nest=!1)}!s.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var l=arguments.length,f=new Array(l),p=0;p<l;p++)f[p]=arguments[p];return r&&r[0]===f[0]&&!s.context?(a.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${t[0]}`),null):a.translate(...f,t)},s)),s.interpolation&&this.interpolator.reset()}const o=s.postProcess||this.options.postProcess,u=g(o)?[o]:o;return e!=null&&u&&u.length&&s.applyPostProcessor!==!1&&(e=ke.handle(u,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,i,r,a,o;return g(e)&&(e=[e]),e.forEach(u=>{if(this.isValidLookup(s))return;const c=this.extractFromKey(u,t),d=c.key;i=d;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const l=t.count!==void 0&&!g(t.count),f=l&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),p=t.context!==void 0&&(g(t.context)||typeof t.context=="number")&&t.context!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);h.forEach(y=>{this.isValidLookup(s)||(o=y,!he[`${x[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(he[`${x[0]}-${y}`]=!0,this.logger.warn(`key "${i}" for languages "${x.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(C=>{if(this.isValidLookup(s))return;a=C;const w=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,C,y,t);else{let b;l&&(b=this.pluralResolver.getSuffix(C,t.count,t));const L=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(l&&(w.push(d+b),t.ordinal&&b.indexOf(N)===0&&w.push(d+b.replace(N,this.options.pluralSeparator)),f&&w.push(d+L)),p){const v=`${d}${this.options.contextSeparator}${t.context}`;w.push(v),l&&(w.push(v+b),t.ordinal&&b.indexOf(N)===0&&w.push(v+b.replace(N,this.options.pluralSeparator)),f&&w.push(v+L))}}let R;for(;R=w.pop();)this.isValidLookup(s)||(r=R,s=this.getResource(C,y,R,t))}))})}),{res:s,usedKey:i,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!g(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const r of t)delete i[r]}return i}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&e[s]!==void 0)return!0;return!1}}const q=n=>n.charAt(0).toUpperCase()+n.slice(1);class ge{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P.create("languageUtils")}getScriptPartFromCode(e){if(e=J(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=J(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(g(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(e)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let s=e.split("-");return this.options.lowerCaseLng?s=s.map(i=>i.toLowerCase()):s.length===2?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=q(s[1].toLowerCase()))):s.length===3&&(s[0]=s[0].toLowerCase(),s[1].length===2&&(s[1]=s[1].toUpperCase()),s[0]!=="sgn"&&s[2].length===2&&(s[2]=s[2].toUpperCase()),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=q(s[1].toLowerCase())),t.indexOf(s[2].toLowerCase())>-1&&(s[2]=q(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const i=this.getLanguagePartFromCode(s);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(r=>{if(r===i)return r;if(!(r.indexOf("-")<0&&i.indexOf("-")<0)&&(r.indexOf("-")>0&&i.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===i||r.indexOf(i)===0&&i.length>1))return r})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),g(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],r=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return g(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):g(e)&&r(this.formatLanguageCode(e)),s.forEach(a=>{i.indexOf(a)<0&&r(this.formatLanguageCode(a))}),i}}let dt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ft={1:n=>+(n>1),2:n=>+(n!=1),3:n=>0,4:n=>n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2,5:n=>n==0?0:n==1?1:n==2?2:n%100>=3&&n%100<=10?3:n%100>=11?4:5,6:n=>n==1?0:n>=2&&n<=4?1:2,7:n=>n==1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2,8:n=>n==1?0:n==2?1:n!=8&&n!=11?2:3,9:n=>+(n>=2),10:n=>n==1?0:n==2?1:n<7?2:n<11?3:4,11:n=>n==1||n==11?0:n==2||n==12?1:n>2&&n<20?2:3,12:n=>+(n%10!=1||n%100==11),13:n=>+(n!==0),14:n=>n==1?0:n==2?1:n==3?2:3,15:n=>n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2,16:n=>n%10==1&&n%100!=11?0:n!==0?1:2,17:n=>n==1||n%10==1&&n%100!=11?0:1,18:n=>n==0?0:n==1?1:2,19:n=>n==1?0:n==0||n%100>1&&n%100<11?1:n%100>10&&n%100<20?2:3,20:n=>n==1?0:n==0||n%100>0&&n%100<20?1:2,21:n=>n%100==1?1:n%100==2?2:n%100==3||n%100==4?3:0,22:n=>n==1?0:n==2?1:(n<0||n>10)&&n%10==0?2:3};const ht=["v1","v2","v3"],gt=["v4"],pe={zero:0,one:1,two:2,few:3,many:4,other:5},pt=()=>{const n={};return dt.forEach(e=>{e.lngs.forEach(t=>{n[t]={numbers:e.nr,plurals:ft[e.fc]}})}),n};class mt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=P.create("pluralResolver"),(!this.options.compatibilityJSON||gt.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=pt(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const s=J(e==="dev"?"en":e),i=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:i});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let a;try{a=new Intl.PluralRules(s,{type:i})}catch{if(!e.match(/-|_/))return;const u=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(u,t)}return this.pluralRulesCache[r]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,s).map(i=>`${t}${i}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort((i,r)=>pe[i]-pe[r]).map(i=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${i}`):s.numbers.map(i=>this.getSuffix(e,i,t)):[]}getSuffix(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,s);return i?this.shouldUseIntlApi()?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:this.getSuffixRetroCompatible(i,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const s=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let i=e.numbers[s];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const r=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?r():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}shouldUseIntlApi(){return!ht.includes(this.options.compatibilityJSON)}}const me=function(n,e,t){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=nt(n,e,t);return!r&&i&&g(t)&&(r=ee(n,t,s),r===void 0&&(r=ee(e,t,s))),r},Z=n=>n.replace(/\$/g,"$$$$");class bt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(t=>t),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:r,prefixEscaped:a,suffix:o,suffixEscaped:u,formatSeparator:c,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:l,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:x,nestingOptionsSeparator:y,maxReplaces:C,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:rt,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=r?j(r):a||"{{",this.suffix=o?j(o):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=l?j(l):f||j("$t("),this.nestingSuffix=p?j(p):x||j(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=C||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>t&&t.source===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,s,i){let r,a,o;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const C=me(t,u,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,s,{...i,...t,interpolationkey:f}):C}const p=f.split(this.formatSeparator),x=p.shift().trim(),y=p.join(this.formatSeparator).trim();return this.format(me(t,u,x,this.options.keySeparator,this.options.ignoreJSONStructure),y,s,{...i,...t,interpolationkey:x})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>Z(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?Z(this.escape(f)):Z(f)}].forEach(f=>{for(o=0;r=f.regex.exec(e);){const p=r[1].trim();if(a=c(p),a===void 0)if(typeof d=="function"){const y=d(e,r,i);a=g(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))a="";else if(h){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),a="";else!g(a)&&!this.useRawValueToEscape&&(a=le(a));const x=f.safeValue(a);if(e=e.replace(r[0],x),h?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=r[0].length):f.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,r,a;const o=(u,c)=>{const d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;const h=u.split(new RegExp(`${d}[ ]*{`));let l=`{${h[1]}`;u=h[0],l=this.interpolate(l,a);const f=l.match(/'/g),p=l.match(/"/g);(f&&f.length%2===0&&!p||p.length%2!==0)&&(l=l.replace(/'/g,'"'));try{a=JSON.parse(l),c&&(a={...c,...a})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,x),`${u}${d}${l}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;i=this.nestingRegexp.exec(e);){let u=[];a={...s},a=a.replace&&!g(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(h=>h.trim());i[1]=d.shift(),u=d,c=!0}if(r=t(o.call(this,i[1].trim(),a),a),r&&i[0]===e&&!g(r))return r;g(r)||(r=le(r)),r||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),r=""),c&&(r=u.reduce((d,h)=>this.format(d,h,s.lng,{...s,interpolationkey:i[1].trim()}),r.trim())),e=e.replace(i[0],r),this.regexp.lastIndex=0}return e}}const yt=n=>{let e=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const s=n.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);e==="currency"&&i.indexOf(":")<0?t.currency||(t.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?t.range||(t.range=i.trim()):i.split(";").forEach(a=>{if(a){const[o,...u]=a.split(":"),c=u.join(":").trim().replace(/^'+|'+$/g,""),d=o.trim();t[d]||(t[d]=c),c==="false"&&(t[d]=!1),c==="true"&&(t[d]=!0),isNaN(c)||(t[d]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},I=n=>{const e={};return(t,s,i)=>{let r=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(r={...r,[i.interpolationkey]:void 0});const a=s+JSON.stringify(r);let o=e[a];return o||(o=n(J(s),i),e[a]=o),o(t)}};class xt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P.create("formatter"),this.options=e,this.formats={number:I((t,s)=>{const i=new Intl.NumberFormat(t,{...s});return r=>i.format(r)}),currency:I((t,s)=>{const i=new Intl.NumberFormat(t,{...s,style:"currency"});return r=>i.format(r)}),datetime:I((t,s)=>{const i=new Intl.DateTimeFormat(t,{...s});return r=>i.format(r)}),relativetime:I((t,s)=>{const i=new Intl.RelativeTimeFormat(t,{...s});return r=>i.format(r,s.range||"day")}),list:I((t,s)=>{const i=new Intl.ListFormat(t,{...s});return r=>i.format(r)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=I(t)}format(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(o=>o.indexOf(")")>-1)){const o=r.findIndex(u=>u.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,o)].join(this.formatSeparator)}return r.reduce((o,u)=>{const{formatName:c,formatOptions:d}=yt(u);if(this.formats[c]){let h=o;try{const l=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},f=l.locale||l.lng||i.locale||i.lng||s;h=this.formats[c](o,f,{...d,...i,...l})}catch(l){this.logger.warn(l)}return h}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const St=(n,e)=>{n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)};class vt extends Q{constructor(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=P.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,i.backend,i)}queueLoad(e,t,s,i){const r={},a={},o={},u={};return e.forEach(c=>{let d=!0;t.forEach(h=>{const l=`${c}|${h}`;!s.reload&&this.store.hasResourceBundle(c,h)?this.state[l]=2:this.state[l]<0||(this.state[l]===1?a[l]===void 0&&(a[l]=!0):(this.state[l]=1,d=!1,a[l]===void 0&&(a[l]=!0),r[l]===void 0&&(r[l]=!0),u[h]===void 0&&(u[h]=!0)))}),d||(o[c]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(u)}}loaded(e,t,s){const i=e.split("|"),r=i[0],a=i[1];t&&this.emit("failedLoading",r,a,t),!t&&s&&this.store.addResourceBundle(r,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const o={};this.queue.forEach(u=>{st(u.loaded,[r],a),St(u,e),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(c=>{o[c]||(o[c]={});const d=u.loaded[c];d.length&&d.forEach(h=>{o[c][h]===void 0&&(o[c][h]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(u=>!u.done)}read(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:r,callback:a});return}this.readingCalls++;const o=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,s,i+1,r*2,a)},r);return}a(c,d)},u=this.backend[s].bind(this.backend);if(u.length===2){try{const c=u(e,t);c&&typeof c.then=="function"?c.then(d=>o(null,d)).catch(o):o(null,c)}catch(c){o(c)}return}return u(e,t,o)}prepareLoading(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();g(e)&&(e=this.languageUtils.toResolveHierarchy(e)),g(t)&&(t=[t]);const r=this.queueLoad(e,t,s,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const s=e.split("|"),i=s[0],r=s[1];this.read(i,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${i}`,o),this.loaded(e,a,o)})}saveMissing(e,t,s,i,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){const u={...a,isUpdate:r},c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(e,t,s,i,u):d=c(e,t,s,i),d&&typeof d.then=="function"?d.then(h=>o(null,h)).catch(o):o(null,d)}catch(d){o(d)}else c(e,t,s,i,o,u)}!e||!e[0]||this.store.addResource(e[0],t,s,i)}}}const be=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let e={};if(typeof n[1]=="object"&&(e=n[1]),g(n[1])&&(e.defaultValue=n[1]),g(n[2])&&(e.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),ye=n=>(g(n.ns)&&(n.ns=[n.ns]),g(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),g(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs&&n.supportedLngs.indexOf("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),n),H=()=>{},wt=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})};class K extends Q{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=ye(e),this.services={},this.logger=P,this.modules={external:[]},wt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(s=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(g(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=be();this.options={...i,...this.options,...ye(t)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const r=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?P.init(r(this.modules.logger),this.options):P.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=xt);const h=new ge(this.options);this.store=new fe(this.options.resources,this.options);const l=this.services;l.logger=P,l.resourceStore=this.store,l.languageUtils=h,l.pluralResolver=new mt(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(l.formatter=r(d),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new bt(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new vt(r(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(f){for(var p=arguments.length,x=new Array(p>1?p-1:0),y=1;y<p;y++)x[y-1]=arguments[y];e.emit(f,...x)}),this.modules.languageDetector&&(l.languageDetector=r(this.modules.languageDetector),l.languageDetector.init&&l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=r(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new G(this.services,this.options),this.translator.on("*",function(f){for(var p=arguments.length,x=new Array(p>1?p-1:0),y=1;y<p;y++)x[y-1]=arguments[y];e.emit(f,...x)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,s||(s=H),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const u=U(),c=()=>{const d=(h,l)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(l),s(h,l)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),u}loadResources(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H;const i=g(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(c=>{c!=="cimode"&&r.indexOf(c)<0&&r.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(o)})}else s(null)}reloadResources(e,t,s){const i=U();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=H),this.services.backendConnector.reload(e,t,r=>{i.resolve(),s(r)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&ke.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}changeLanguage(e,t){var s=this;this.isLanguageChangingTo=e;const i=U();this.emit("languageChanging",e);const r=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},a=(u,c)=>{c?(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return s.t(...arguments)}),t&&t(u,function(){return s.t(...arguments)})},o=u=>{!e&&!u&&this.services.languageDetector&&(u=[]);const c=g(u)?u:this.services.languageUtils.getBestMatchFromCodes(u);c&&(this.language||r(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,d=>{a(d,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),i}getFixedT(e,t,s){var i=this;const r=function(a,o){let u;if(typeof o!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),h=2;h<c;h++)d[h-2]=arguments[h];u=i.options.overloadTranslationOptionHandler([a,o].concat(d))}else u={...o};u.lng=u.lng||r.lng,u.lngs=u.lngs||r.lngs,u.ns=u.ns||r.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||s||r.keyPrefix);const l=i.options.keySeparator||".";let f;return u.keyPrefix&&Array.isArray(a)?f=a.map(p=>`${u.keyPrefix}${l}${p}`):f=u.keyPrefix?`${u.keyPrefix}${l}${a}`:a,i.t(f,u)};return g(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=s,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=t.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,u)=>{const c=this.services.backendConnector.state[`${o}|${u}`];return c===-1||c===0||c===2};if(t.precheck){const o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!i||a(r,e)))}loadNamespaces(e,t){const s=U();return this.options.ns?(g(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),t&&t(i)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=U();g(e)&&(e=[e]);const i=this.options.preload||[],r=e.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return r.length?(this.options.preload=i.concat(r),this.loadResources(a=>{s.resolve(),t&&t(a)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new ge(be());return t.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new K(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H;const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},r=new K(i);return(e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s&&(r.store=new fe(this.store.data,i),r.services.resourceStore=r.store),r.translator=new G(r.services,i),r.translator.on("*",function(o){for(var u=arguments.length,c=new Array(u>1?u-1:0),d=1;d<u;d++)c[d-1]=arguments[d];r.emit(o,...c)}),r.init(i,t),r.translator.options=i,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const k=K.createInstance();k.createInstance=K.createInstance;k.createInstance;k.dir;k.init;k.loadResources;k.reloadResources;k.use;k.changeLanguage;k.getFixedT;k.t;k.exists;k.setDefaultNamespace;k.hasLoadedNamespace;k.loadNamespaces;k.loadLanguages;const Lt={title:"Skill Studio — Preferences",brand:"Skill Studio",browserCallout:"Some preferences require the Skill Studio desktop app.",downloadLink:"Download for Mac, Windows, or Linux",downloadUrl:"https://verified-skill.com/download"},Nt={general:"General",updates:"Updates",privacy:"Privacy",advanced:"Advanced"},Ct={heading:"General",subheading:"Appearance and project defaults.",theme:{label:"Appearance",system:"System",light:"Light",dark:"Dark",help:"Match the system or pick a fixed theme."},launchAtLogin:{label:"Launch Skill Studio at login",help:"Open Skill Studio automatically when you sign in.",browserDisabled:"Available in the desktop app.",errorAdmin:"Couldn't change launch at login. Your administrator may have disabled this.",openSettings:"Open System Settings"},defaultProject:{label:"Default project folder",help:"New projects start here unless you choose another location.",notSet:"(not set)",choose:"Choose folder…"},language:{label:"Language",help:"Currently English only. More languages will arrive in a future release.",english:"English"}},kt={heading:"Updates",subheading:"Stay current with the latest Skill Studio.",currentVersion:"Current version",channel:{label:"Update channel",stable:"Stable",beta:"Beta",betaUnavailable:"No beta release yet — we'll check back later.",help:"Stable releases are recommended. Beta delivers previews of upcoming features."},autoCheck:{label:"Check for updates automatically",help:"Skill Studio will check daily and notify you when an update is ready."},checkNow:"Check for updates",checking:"Checking…",upToDate:"Skill Studio is up to date.",updateAvailable:"Update available: {{version}}",lastChecked:"Last checked",lastCheckedNever:"Never",lastCheckedAgo:"{{relative}}",errors:{network:"Couldn't reach the update server. Check your connection and try again.",signature:"Update signature invalid — refusing to install.",diskSpace:"Not enough disk space to install the update.",tryAgain:"Try again",viewLogs:"View logs"},dialog:{title:"Update available",version:"Version {{version}}",releaseNotes:"Release notes",noReleaseNotes:"Release notes not provided.",installNow:"Install now",later:"Later",skipVersion:"Skip this version",downloading:"Downloading update…",preparing:"Preparing update…",restartRequired:"Restart required to finish installing.",restartNow:"Restart now",onQuit:"Install on quit",cancel:"Cancel"},browserCallout:"Updates are managed by the desktop app. Run npm i -g vskill@latest to update the CLI.",about:{heading:"About",build:"Build",commit:"Commit",links:{openSource:"Open source licenses",website:"Visit verified-skill.com",acknowledgements:"Acknowledgements"}}},Ot={heading:"Privacy",subheading:"Decide what Skill Studio shares with us.",telemetry:{label:"Send anonymous usage telemetry",help:"Helps us improve Skill Studio. Disabled by default. No personal data is collected."},crash:{label:"Send anonymized crash reports",help:"Sends a small report when Skill Studio crashes so we can fix it."},openLogs:{label:"Open logs folder",help:"Inspect log files to audit what Skill Studio records on your machine.",browserHidden:"Logs are stored on the desktop app only."},disclosure:"Skill Studio v1 does not currently emit telemetry. These switches reserve your preference for when telemetry ships."},Rt={heading:"Advanced",subheading:"Diagnostics and reset.",logLevel:{label:"Log level",help:"Higher levels emit more diagnostic detail. Defaults to Info.",error:"Error",warn:"Warning",info:"Info",debug:"Debug",trace:"Trace"},settingsPath:{label:"Settings file",help:"Where your preferences live on disk.",reveal:"Reveal in Finder",copy:"Copy path",copied:"Copied",browserValue:"Stored in this browser's local storage"},factoryReset:{label:"Factory reset",help:"Reset all preferences to their defaults. Recent projects and your keychain are preserved.",button:"Reset all preferences…",confirmTitle:"Reset all preferences?",confirmBody:"This will return every Skill Studio preference to its default value. Recent projects and API keys stored in your system keychain are not affected.",confirm:"Reset",cancel:"Cancel",done:"Preferences reset to defaults."}},Pt={save:"Save",cancel:"Cancel",close:"Close",loading:"Loading…",browserMode:"Browser mode",desktopOnly:"Desktop only"},Et={app:Lt,tabs:Nt,general:Ct,updates:kt,privacy:Ot,advanced:Rt,common:Pt},Oe=k.createInstance();Oe.use(Ye).init({lng:"en",fallbackLng:"en",ns:["preferences"],defaultNS:"preferences",resources:{en:{preferences:Et}},interpolation:{escapeValue:!1},returnNull:!1});function zt({checked:n,onChange:e,disabled:t,ariaLabel:s,id:i}){return m.jsx("button",{id:i,type:"button",role:"switch","aria-checked":n,"aria-label":s,"aria-disabled":t||void 0,className:"pref-toggle",onClick:()=>!t&&e(!n),disabled:t})}function Ht({options:n,value:e,onChange:t,disabled:s,ariaLabel:i}){return m.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":s||void 0,className:"pref-segmented",children:n.map(r=>m.jsx("button",{type:"button",role:"radio","aria-checked":e===r.value,disabled:s,onClick:()=>!s&&t(r.value),children:r.label},r.value))})}function Bt({label:n,help:e,control:t,stacked:s}){return m.jsxs("div",{className:`pref-row${s?" pref-row--stacked":""}`,children:[m.jsxs("div",{className:"pref-row__label",children:[m.jsx("span",{className:"pref-row__label-text",children:n}),e?m.jsx("span",{className:"pref-row__help",children:e}):null]}),m.jsx("div",{children:t})]})}function Jt({title:n,children:e,style:t}){return m.jsxs("section",{className:"pref-section",style:t,children:[n?m.jsx("h2",{className:"pref-section__title",children:n}):null,e]})}function Wt({variant:n="info",children:e}){return m.jsx("div",{role:"note",className:`pref-callout${n==="info"?" pref-callout--info":""}`,children:e})}function Gt({open:n,onDismiss:e,ariaLabel:t,children:s}){const i=S.useRef(null);return S.useEffect(()=>{var a;if(!n)return;const r=o=>{o.key==="Escape"&&e&&e()};return document.addEventListener("keydown",r),(a=i.current)==null||a.focus(),()=>document.removeEventListener("keydown",r)},[n,e]),n?m.jsx("div",{className:"pref-dialog-overlay",onClick:r=>{r.target===r.currentTarget&&e&&e()},children:m.jsx("div",{ref:i,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,className:"pref-dialog",children:s})}):null}function $t({toasts:n,onDismiss:e}){return S.useEffect(()=>{if(n.length===0)return;const t=n.map(s=>window.setTimeout(()=>e(s.id),s.variant==="error"?8e3:4e3));return()=>t.forEach(s=>window.clearTimeout(s))},[n,e]),m.jsx("div",{className:"pref-toast-stack",role:"status","aria-live":"polite",children:n.map(t=>m.jsxs("div",{className:`pref-toast${t.variant==="error"?" pref-toast--error":""}`,children:[m.jsx("span",{children:t.message}),t.actions&&t.actions.length>0?m.jsx("div",{className:"pref-toast__actions",children:t.actions.map(s=>m.jsx("button",{type:"button",className:"pref-button",onClick:()=>{s.onClick(),e(t.id)},children:s.label},s.label))}):null]},t.id))})}const jt=S.lazy(()=>Y(()=>import("./GeneralTab-AwK9sIkP.js"),__vite__mapDeps([0,1,2,3,4])).then(n=>({default:n.GeneralTab}))),It=S.lazy(()=>Y(()=>import("./UpdatesTab-DTmo-vVb.js"),__vite__mapDeps([5,1,2,3,4])).then(n=>({default:n.UpdatesTab}))),Tt=S.lazy(()=>Y(()=>import("./PrivacyTab-BtNrxpVV.js"),__vite__mapDeps([6,1,2,3,4])).then(n=>({default:n.PrivacyTab}))),At=S.lazy(()=>Y(()=>import("./AdvancedTab-DOgbx7u0.js"),__vite__mapDeps([7,1,2,3,4])).then(n=>({default:n.AdvancedTab}))),xe=[{key:"general",iconChar:"⚙",shortcut:"1"},{key:"updates",iconChar:"↻",shortcut:"2"},{key:"privacy",iconChar:"⚓",shortcut:"3"},{key:"advanced",iconChar:"⁂",shortcut:"4"}];function Se(){const n=typeof window<"u"&&window.location.hash.slice(1)||"general";return n==="general"||n==="updates"||n==="privacy"||n==="advanced"?n:"general"}function Ft(){const{t:n}=Xe("preferences"),e=Ie(),{snapshot:t,refresh:s}=Te(e),[i,r]=S.useState(()=>Se()),[a,o]=S.useState(0),[u,c]=S.useState([]),d=S.useCallback(l=>{c(f=>[...f,{...l,id:`t-${Date.now()}-${Math.random()}`}])},[]),h=S.useCallback(l=>{c(f=>f.filter(p=>p.id!==l))},[]);return S.useEffect(()=>{const l=()=>r(Se());return window.addEventListener("hashchange",l),()=>window.removeEventListener("hashchange",l)},[]),S.useEffect(()=>{if(!e.available)return;let l=null;return Ae("preferences-trigger-check",()=>{r("updates"),o(f=>f+1)}).then(f=>{l=f}),()=>{l==null||l()}},[e.available]),S.useEffect(()=>{window.location.hash.slice(1)!==i&&window.history.replaceState(null,"",`#${i}`)},[i]),S.useEffect(()=>{const l=f=>{if(!(f.metaKey||f.ctrlKey))return;const x=parseInt(f.key,10);if(Number.isNaN(x))return;const y=xe[x-1];y&&(f.preventDefault(),r(y.key))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]),S.useEffect(()=>{if(!t)return;const l=t.general.theme;if(l==="system"){const f=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>{document.documentElement.dataset.theme=f.matches?"dark":"light",document.documentElement.dataset.themeMode="auto"};return p(),f.addEventListener("change",p),()=>f.removeEventListener("change",p)}document.documentElement.dataset.theme=l,document.documentElement.dataset.themeMode=l},[t]),m.jsxs("div",{className:"preferences-window",children:[m.jsxs("nav",{className:"preferences-sidebar","aria-label":n("app.title"),children:[m.jsx("div",{className:"preferences-sidebar__brand",children:n("app.brand")}),xe.map(l=>m.jsxs("button",{type:"button",className:"preferences-nav-item","aria-current":i===l.key?"page":void 0,onClick:()=>r(l.key),children:[m.jsx("span",{"aria-hidden":"true",className:"preferences-nav-item__icon",children:l.iconChar}),m.jsx("span",{children:n(`tabs.${l.key}`)}),m.jsxs("span",{className:"preferences-nav-item__shortcut","aria-hidden":"true",children:[/^Mac/i.test(navigator.platform)?"⌘":"Ctrl+",l.shortcut]})]},l.key))]}),m.jsx("main",{className:"preferences-content","data-active-tab":i,children:m.jsxs(S.Suspense,{fallback:m.jsx("div",{className:"pref-status-row",children:n("common.loading")}),children:[i==="general"?m.jsx(jt,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null,i==="updates"?m.jsx(It,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d,triggerCheckNonce:a}):null,i==="privacy"?m.jsx(Tt,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null,i==="advanced"?m.jsx(At,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null]})}),m.jsx($t,{toasts:u,onDismiss:h})]})}je.createRoot(document.getElementById("root")).render(m.jsx(S.StrictMode,{children:m.jsx(_e,{i18n:Oe,children:m.jsx(Ft,{})})}));export{Wt as C,Gt as D,Bt as F,Jt as S,zt as T,Ht as a,Xe as u};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GeneralTab-Gbc-K6UI.js","assets/globals-hm1COkXX.js","assets/globals-Dpf9KmYH.css","assets/useDesktopBridge-BKz-gcRg.js","assets/fonts-i7Lkz2zN.css","assets/UpdatesTab-BFGUaUtu.js","assets/PrivacyTab-BXCIX8cQ.js","assets/AdvancedTab-CSWhj_MZ.js"])))=>i.map(i=>d[i]);
2
+ var Ee=Object.defineProperty;var $e=(n,e,t)=>e in n?Ee(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ie=(n,e,t)=>$e(n,typeof e!="symbol"?e+"":e,t);import{r as v,j as m,c as je}from"./globals-hm1COkXX.js";/* empty css */import{_ as Y,u as Ie,a as Te,l as Ae}from"./useDesktopBridge-BKz-gcRg.js";function Fe(){if(console&&console.warn){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];$(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}const re={};function X(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];$(e[0])&&re[e[0]]||($(e[0])&&(re[e[0]]=new Date),Fe(...e))}const Se=(n,e)=>()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}},ae=(n,e,t)=>{n.loadNamespaces(e,Se(n,t))},oe=(n,e,t,s)=>{$(t)&&(t=[t]),t.forEach(i=>{n.options.ns.indexOf(i)<0&&n.options.ns.push(i)}),n.loadLanguages(e,Se(n,s))},De=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=e.languages[0],i=e.options?e.options.fallbackLng:!1,r=e.languages[e.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,u)=>{const c=e.services.backendConnector.state[`${o}|${u}`];return c===-1||c===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!a(e.isLanguageChangingTo,n)?!1:!!(e.hasResourceBundle(s,n)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||a(s,n)&&(!i||a(r,n)))},Ue=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(X("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(n,{lng:t.lng,precheck:(i,r)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,n))return!1}}):De(n,e,t)},$=n=>typeof n=="string",Ve=n=>typeof n=="object"&&n!==null,Ke=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Me={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},ze=n=>Me[n],He=n=>n.replace(Ke,ze);let _={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:He};const Be=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_={..._,...n}},Je=()=>_;let we;const We=n=>{we=n},Ge=()=>we,Ye={type:"3rdParty",init(n){Be(n.options.react),We(n)}},Le=v.createContext();class qe{constructor(){ie(this,"getUsedNamespaces",()=>Object.keys(this.usedNamespaces));this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}}const Qe=(n,e)=>{const t=v.useRef();return v.useEffect(()=>{t.current=n},[n,e]),t.current},Ne=(n,e,t,s)=>n.getFixedT(e,t,s),Ze=(n,e,t,s)=>v.useCallback(Ne(n,e,t,s),[n,e,t,s]),Xe=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:t}=e,{i18n:s,defaultNS:i}=v.useContext(Le)||{},r=t||s||Ge();if(r&&!r.reportNamespaces&&(r.reportNamespaces=new qe),!r){X("You will need to pass in an i18next instance by using initReactI18next");const b=(N,S)=>$(S)?S:Ve(S)&&$(S.defaultValue)?S.defaultValue:Array.isArray(N)?N[N.length-1]:N,L=[b,{},!1];return L.t=b,L.i18n={},L.ready=!1,L}r.options.react&&r.options.react.wait!==void 0&&X("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Je(),...r.options.react,...e},{useSuspense:o,keyPrefix:u}=a;let c=n;c=$(c)?[c]:c||["translation"],r.reportNamespaces.addUsedNamespaces&&r.reportNamespaces.addUsedNamespaces(c);const d=(r.isInitialized||r.initializedStoreOnce)&&c.every(b=>Ue(b,r,a)),h=Ze(r,e.lng||null,a.nsMode==="fallback"?c:c[0],u),l=()=>h,f=()=>Ne(r,e.lng||null,a.nsMode==="fallback"?c:c[0],u),[p,x]=v.useState(l);let y=c.join();e.lng&&(y=`${e.lng}${y}`);const C=Qe(y),w=v.useRef(!0);v.useEffect(()=>{const{bindI18n:b,bindI18nStore:L}=a;w.current=!0,!d&&!o&&(e.lng?oe(r,e.lng,c,()=>{w.current&&x(f)}):ae(r,c,()=>{w.current&&x(f)})),d&&C&&C!==y&&w.current&&x(f);const N=()=>{w.current&&x(f)};return b&&r&&r.on(b,N),L&&r&&r.store.on(L,N),()=>{w.current=!1,b&&r&&b.split(" ").forEach(S=>r.off(S,N)),L&&r&&L.split(" ").forEach(S=>r.store.off(S,N))}},[r,y]),v.useEffect(()=>{w.current&&d&&x(l)},[r,u,d]);const R=[p,r,d];if(R.t=p,R.i18n=r,R.ready=d,d||!d&&!o)return R;throw new Promise(b=>{e.lng?oe(r,e.lng,c,()=>b()):ae(r,c,()=>b())})};function _e(n){let{i18n:e,defaultNS:t,children:s}=n;const i=v.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return v.createElement(Le.Provider,{value:i},s)}const g=n=>typeof n=="string",U=()=>{let n,e;const t=new Promise((s,i)=>{n=s,e=i});return t.resolve=n,t.reject=e,t},le=n=>n==null?"":""+n,et=(n,e,t)=>{n.forEach(s=>{e[s]&&(t[s]=e[s])})},tt=/###/g,ue=n=>n&&n.indexOf("###")>-1?n.replace(tt,"."):n,ce=n=>!n||g(n),V=(n,e,t)=>{const s=g(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(ce(n))return{};const r=ue(s[i]);!n[r]&&t&&(n[r]=new t),Object.prototype.hasOwnProperty.call(n,r)?n=n[r]:n={},++i}return ce(n)?{}:{obj:n,k:ue(s[i])}},de=(n,e,t)=>{const{obj:s,k:i}=V(n,e,Object);if(s!==void 0||e.length===1){s[i]=t;return}let r=e[e.length-1],a=e.slice(0,e.length-1),o=V(n,a,Object);for(;o.obj===void 0&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),o=V(n,a,Object),o&&o.obj&&typeof o.obj[`${o.k}.${r}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${r}`]=t},st=(n,e,t,s)=>{const{obj:i,k:r}=V(n,e,Object);i[r]=i[r]||[],i[r].push(t)},B=(n,e)=>{const{obj:t,k:s}=V(n,e);if(t)return t[s]},nt=(n,e,t)=>{const s=B(n,t);return s!==void 0?s:B(e,t)},Ce=(n,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in n?g(n[s])||n[s]instanceof String||g(e[s])||e[s]instanceof String?t&&(n[s]=e[s]):Ce(n[s],e[s],t):n[s]=e[s]);return n},j=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var it={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const rt=n=>g(n)?n.replace(/[&<>"'\/]/g,e=>it[e]):n;class at{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const ot=[" ",",","?","!",";"],lt=new at(20),ut=(n,e,t)=>{e=e||"",t=t||"";const s=ot.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(s.length===0)return!0;const i=lt.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let r=!i.test(n);if(!r){const a=n.indexOf(t);a>0&&!i.test(n.substring(0,a))&&(r=!0)}return r},ee=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!n)return;if(n[e])return n[e];const s=e.split(t);let i=n;for(let r=0;r<s.length;){if(!i||typeof i!="object")return;let a,o="";for(let u=r;u<s.length;++u)if(u!==r&&(o+=t),o+=s[u],a=i[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&u<s.length-1)continue;r+=u-r+1;break}i=a}return i},J=n=>n&&n.replace("_","-"),ct={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){console&&console[n]&&console[n].apply(console,e)}};class W{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||ct,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,i){return i&&!this.debug?null:(g(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new W(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new W(this.logger,e)}}var P=new W;class q{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(t)||0;this.observers[s].set(t,i+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[o,u]=a;for(let c=0;c<u;c++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[o,u]=a;for(let c=0;c<u;c++)o.apply(o,[e,...s])})}}class fe extends q{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],s&&(Array.isArray(s)?o.push(...s):g(s)&&r?o.push(...s.split(r)):o.push(s)));const u=B(this.data,o);return!u&&!t&&!s&&e.indexOf(".")>-1&&(e=o[0],t=o[1],s=o.slice(2).join(".")),u||!a||!g(s)?u:ee(this.data&&this.data[e]&&this.data[e][t],s,r)}addResource(e,t,s,i){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=[e,t];s&&(o=o.concat(a?s.split(a):s)),e.indexOf(".")>-1&&(o=e.split("."),i=t,t=o[1]),this.addNamespaces(t),de(this.data,o,i),r.silent||this.emit("added",e,t,s,i)}addResources(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in s)(g(s[r])||Array.isArray(s[r]))&&this.addResource(e,t,r,s[r],{silent:!0});i.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,i,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),i=s,s=t,t=o[1]),this.addNamespaces(t);let u=B(this.data,o)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?Ce(u,s,r):u={...u,...s},de(this.data,o,u),a.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}}var ke={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,e,t,s,i){return n.forEach(r=>{this.processors[r]&&(e=this.processors[r].process(e,t,s,i))}),e}};const he={};class G extends q{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),et(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=P.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const s=this.resolve(e,t);return s&&s.res!==void 0}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const a=s&&e.indexOf(s)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!ut(e,s,i);if(a&&!o){const u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:g(r)?[r]:r};const c=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(c[0])>-1)&&(r=c.shift()),e=c.join(i)}return{key:e,namespaces:g(r)?[r]:r}}translate(e,t,s){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,r=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],t),u=o[o.length-1],c=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(d){const b=t.nsSeparator||this.options.nsSeparator;return i?{res:`${u}${b}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:`${u}${b}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:a}const h=this.resolve(e,t);let l=h&&h.res;const f=h&&h.usedKey||a,p=h&&h.exactUsedKey||a,x=Object.prototype.toString.apply(l),y=["[object Number]","[object Function]","[object RegExp]"],C=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,R=!g(l)&&typeof l!="boolean"&&typeof l!="number";if(w&&l&&R&&y.indexOf(x)<0&&!(g(C)&&Array.isArray(l))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,l,{...t,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=b,h.usedParams=this.getUsedParamsDetails(t),h):b}if(r){const b=Array.isArray(l),L=b?[]:{},N=b?p:f;for(const S in l)if(Object.prototype.hasOwnProperty.call(l,S)){const M=`${N}${r}${S}`;L[S]=this.translate(M,{...t,joinArrays:!1,ns:o}),L[S]===M&&(L[S]=l[S])}l=L}}else if(w&&g(C)&&Array.isArray(l))l=l.join(C),l&&(l=this.extendTranslation(l,e,t,s));else{let b=!1,L=!1;const N=t.count!==void 0&&!g(t.count),S=G.hasDefaultValue(t),M=N?this.pluralResolver.getSuffix(c,t.count,t):"",Re=t.ordinal&&N?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",te=N&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),T=te&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${M}`]||t[`defaultValue${Re}`]||t.defaultValue;!this.isValidLookup(l)&&S&&(b=!0,l=T),this.isValidLookup(l)||(L=!0,l=a);const Pe=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:l,A=S&&T!==l&&this.options.updateMissing;if(L||b||A){if(this.logger.log(A?"updateKey":"missingKey",c,u,a,A?T:l),r){const O=this.resolve(a,{...t,keySeparator:!1});O&&O.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let F=[];const z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&z&&z[0])for(let O=0;O<z.length;O++)F.push(z[O]);else this.options.saveMissingTo==="all"?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);const se=(O,E,D)=>{const ne=S&&D!==l?D:Pe;this.options.missingKeyHandler?this.options.missingKeyHandler(O,u,E,ne,A,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(O,u,E,ne,A,t),this.emit("missingKey",O,u,E,l)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?F.forEach(O=>{const E=this.pluralResolver.getSuffixes(O,t);te&&t[`defaultValue${this.options.pluralSeparator}zero`]&&E.indexOf(`${this.options.pluralSeparator}zero`)<0&&E.push(`${this.options.pluralSeparator}zero`),E.forEach(D=>{se([O],a+D,t[`defaultValue${D}`]||T)})}):se(F,a,T))}l=this.extendTranslation(l,e,t,h,s),L&&l===a&&this.options.appendNamespaceToMissingKey&&(l=`${u}:${a}`),(L||b)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?l=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,b?l:void 0):l=this.options.parseMissingKeyHandler(l))}return i?(h.res=l,h.usedParams=this.getUsedParamsDetails(t),h):l}extendTranslation(e,t,s,i,r){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const c=g(e)&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const l=e.match(this.interpolator.nestingRegexp);d=l&&l.length}let h=s.replace&&!g(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,s.lng||this.language||i.usedLng,s),c){const l=e.match(this.interpolator.nestingRegexp),f=l&&l.length;d<f&&(s.nest=!1)}!s.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var l=arguments.length,f=new Array(l),p=0;p<l;p++)f[p]=arguments[p];return r&&r[0]===f[0]&&!s.context?(a.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${t[0]}`),null):a.translate(...f,t)},s)),s.interpolation&&this.interpolator.reset()}const o=s.postProcess||this.options.postProcess,u=g(o)?[o]:o;return e!=null&&u&&u.length&&s.applyPostProcessor!==!1&&(e=ke.handle(u,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,i,r,a,o;return g(e)&&(e=[e]),e.forEach(u=>{if(this.isValidLookup(s))return;const c=this.extractFromKey(u,t),d=c.key;i=d;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const l=t.count!==void 0&&!g(t.count),f=l&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),p=t.context!==void 0&&(g(t.context)||typeof t.context=="number")&&t.context!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);h.forEach(y=>{this.isValidLookup(s)||(o=y,!he[`${x[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(he[`${x[0]}-${y}`]=!0,this.logger.warn(`key "${i}" for languages "${x.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(C=>{if(this.isValidLookup(s))return;a=C;const w=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,C,y,t);else{let b;l&&(b=this.pluralResolver.getSuffix(C,t.count,t));const L=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(l&&(w.push(d+b),t.ordinal&&b.indexOf(N)===0&&w.push(d+b.replace(N,this.options.pluralSeparator)),f&&w.push(d+L)),p){const S=`${d}${this.options.contextSeparator}${t.context}`;w.push(S),l&&(w.push(S+b),t.ordinal&&b.indexOf(N)===0&&w.push(S+b.replace(N,this.options.pluralSeparator)),f&&w.push(S+L))}}let R;for(;R=w.pop();)this.isValidLookup(s)||(r=R,s=this.getResource(C,y,R,t))}))})}),{res:s,usedKey:i,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!g(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const r of t)delete i[r]}return i}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&e[s]!==void 0)return!0;return!1}}const Q=n=>n.charAt(0).toUpperCase()+n.slice(1);class ge{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P.create("languageUtils")}getScriptPartFromCode(e){if(e=J(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=J(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(g(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(e)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let s=e.split("-");return this.options.lowerCaseLng?s=s.map(i=>i.toLowerCase()):s.length===2?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=Q(s[1].toLowerCase()))):s.length===3&&(s[0]=s[0].toLowerCase(),s[1].length===2&&(s[1]=s[1].toUpperCase()),s[0]!=="sgn"&&s[2].length===2&&(s[2]=s[2].toUpperCase()),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=Q(s[1].toLowerCase())),t.indexOf(s[2].toLowerCase())>-1&&(s[2]=Q(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const i=this.getLanguagePartFromCode(s);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(r=>{if(r===i)return r;if(!(r.indexOf("-")<0&&i.indexOf("-")<0)&&(r.indexOf("-")>0&&i.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===i||r.indexOf(i)===0&&i.length>1))return r})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),g(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],r=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return g(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):g(e)&&r(this.formatLanguageCode(e)),s.forEach(a=>{i.indexOf(a)<0&&r(this.formatLanguageCode(a))}),i}}let dt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ft={1:n=>+(n>1),2:n=>+(n!=1),3:n=>0,4:n=>n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2,5:n=>n==0?0:n==1?1:n==2?2:n%100>=3&&n%100<=10?3:n%100>=11?4:5,6:n=>n==1?0:n>=2&&n<=4?1:2,7:n=>n==1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2,8:n=>n==1?0:n==2?1:n!=8&&n!=11?2:3,9:n=>+(n>=2),10:n=>n==1?0:n==2?1:n<7?2:n<11?3:4,11:n=>n==1||n==11?0:n==2||n==12?1:n>2&&n<20?2:3,12:n=>+(n%10!=1||n%100==11),13:n=>+(n!==0),14:n=>n==1?0:n==2?1:n==3?2:3,15:n=>n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2,16:n=>n%10==1&&n%100!=11?0:n!==0?1:2,17:n=>n==1||n%10==1&&n%100!=11?0:1,18:n=>n==0?0:n==1?1:2,19:n=>n==1?0:n==0||n%100>1&&n%100<11?1:n%100>10&&n%100<20?2:3,20:n=>n==1?0:n==0||n%100>0&&n%100<20?1:2,21:n=>n%100==1?1:n%100==2?2:n%100==3||n%100==4?3:0,22:n=>n==1?0:n==2?1:(n<0||n>10)&&n%10==0?2:3};const ht=["v1","v2","v3"],gt=["v4"],pe={zero:0,one:1,two:2,few:3,many:4,other:5},pt=()=>{const n={};return dt.forEach(e=>{e.lngs.forEach(t=>{n[t]={numbers:e.nr,plurals:ft[e.fc]}})}),n};class mt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=P.create("pluralResolver"),(!this.options.compatibilityJSON||gt.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=pt(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const s=J(e==="dev"?"en":e),i=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:i});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let a;try{a=new Intl.PluralRules(s,{type:i})}catch{if(!e.match(/-|_/))return;const u=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(u,t)}return this.pluralRulesCache[r]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,s).map(i=>`${t}${i}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort((i,r)=>pe[i]-pe[r]).map(i=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${i}`):s.numbers.map(i=>this.getSuffix(e,i,t)):[]}getSuffix(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,s);return i?this.shouldUseIntlApi()?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:this.getSuffixRetroCompatible(i,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const s=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let i=e.numbers[s];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const r=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?r():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}shouldUseIntlApi(){return!ht.includes(this.options.compatibilityJSON)}}const me=function(n,e,t){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=nt(n,e,t);return!r&&i&&g(t)&&(r=ee(n,t,s),r===void 0&&(r=ee(e,t,s))),r},Z=n=>n.replace(/\$/g,"$$$$");class bt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(t=>t),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:r,prefixEscaped:a,suffix:o,suffixEscaped:u,formatSeparator:c,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:l,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:x,nestingOptionsSeparator:y,maxReplaces:C,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:rt,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=r?j(r):a||"{{",this.suffix=o?j(o):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=l?j(l):f||j("$t("),this.nestingSuffix=p?j(p):x||j(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=C||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>t&&t.source===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,s,i){let r,a,o;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const C=me(t,u,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,s,{...i,...t,interpolationkey:f}):C}const p=f.split(this.formatSeparator),x=p.shift().trim(),y=p.join(this.formatSeparator).trim();return this.format(me(t,u,x,this.options.keySeparator,this.options.ignoreJSONStructure),y,s,{...i,...t,interpolationkey:x})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>Z(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?Z(this.escape(f)):Z(f)}].forEach(f=>{for(o=0;r=f.regex.exec(e);){const p=r[1].trim();if(a=c(p),a===void 0)if(typeof d=="function"){const y=d(e,r,i);a=g(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))a="";else if(h){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),a="";else!g(a)&&!this.useRawValueToEscape&&(a=le(a));const x=f.safeValue(a);if(e=e.replace(r[0],x),h?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=r[0].length):f.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,r,a;const o=(u,c)=>{const d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;const h=u.split(new RegExp(`${d}[ ]*{`));let l=`{${h[1]}`;u=h[0],l=this.interpolate(l,a);const f=l.match(/'/g),p=l.match(/"/g);(f&&f.length%2===0&&!p||p.length%2!==0)&&(l=l.replace(/'/g,'"'));try{a=JSON.parse(l),c&&(a={...c,...a})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,x),`${u}${d}${l}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;i=this.nestingRegexp.exec(e);){let u=[];a={...s},a=a.replace&&!g(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(h=>h.trim());i[1]=d.shift(),u=d,c=!0}if(r=t(o.call(this,i[1].trim(),a),a),r&&i[0]===e&&!g(r))return r;g(r)||(r=le(r)),r||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),r=""),c&&(r=u.reduce((d,h)=>this.format(d,h,s.lng,{...s,interpolationkey:i[1].trim()}),r.trim())),e=e.replace(i[0],r),this.regexp.lastIndex=0}return e}}const yt=n=>{let e=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const s=n.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);e==="currency"&&i.indexOf(":")<0?t.currency||(t.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?t.range||(t.range=i.trim()):i.split(";").forEach(a=>{if(a){const[o,...u]=a.split(":"),c=u.join(":").trim().replace(/^'+|'+$/g,""),d=o.trim();t[d]||(t[d]=c),c==="false"&&(t[d]=!1),c==="true"&&(t[d]=!0),isNaN(c)||(t[d]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},I=n=>{const e={};return(t,s,i)=>{let r=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(r={...r,[i.interpolationkey]:void 0});const a=s+JSON.stringify(r);let o=e[a];return o||(o=n(J(s),i),e[a]=o),o(t)}};class xt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P.create("formatter"),this.options=e,this.formats={number:I((t,s)=>{const i=new Intl.NumberFormat(t,{...s});return r=>i.format(r)}),currency:I((t,s)=>{const i=new Intl.NumberFormat(t,{...s,style:"currency"});return r=>i.format(r)}),datetime:I((t,s)=>{const i=new Intl.DateTimeFormat(t,{...s});return r=>i.format(r)}),relativetime:I((t,s)=>{const i=new Intl.RelativeTimeFormat(t,{...s});return r=>i.format(r,s.range||"day")}),list:I((t,s)=>{const i=new Intl.ListFormat(t,{...s});return r=>i.format(r)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=I(t)}format(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(o=>o.indexOf(")")>-1)){const o=r.findIndex(u=>u.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,o)].join(this.formatSeparator)}return r.reduce((o,u)=>{const{formatName:c,formatOptions:d}=yt(u);if(this.formats[c]){let h=o;try{const l=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},f=l.locale||l.lng||i.locale||i.lng||s;h=this.formats[c](o,f,{...d,...i,...l})}catch(l){this.logger.warn(l)}return h}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const vt=(n,e)=>{n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)};class St extends q{constructor(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=P.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,i.backend,i)}queueLoad(e,t,s,i){const r={},a={},o={},u={};return e.forEach(c=>{let d=!0;t.forEach(h=>{const l=`${c}|${h}`;!s.reload&&this.store.hasResourceBundle(c,h)?this.state[l]=2:this.state[l]<0||(this.state[l]===1?a[l]===void 0&&(a[l]=!0):(this.state[l]=1,d=!1,a[l]===void 0&&(a[l]=!0),r[l]===void 0&&(r[l]=!0),u[h]===void 0&&(u[h]=!0)))}),d||(o[c]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(u)}}loaded(e,t,s){const i=e.split("|"),r=i[0],a=i[1];t&&this.emit("failedLoading",r,a,t),!t&&s&&this.store.addResourceBundle(r,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const o={};this.queue.forEach(u=>{st(u.loaded,[r],a),vt(u,e),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(c=>{o[c]||(o[c]={});const d=u.loaded[c];d.length&&d.forEach(h=>{o[c][h]===void 0&&(o[c][h]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(u=>!u.done)}read(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:r,callback:a});return}this.readingCalls++;const o=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,s,i+1,r*2,a)},r);return}a(c,d)},u=this.backend[s].bind(this.backend);if(u.length===2){try{const c=u(e,t);c&&typeof c.then=="function"?c.then(d=>o(null,d)).catch(o):o(null,c)}catch(c){o(c)}return}return u(e,t,o)}prepareLoading(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();g(e)&&(e=this.languageUtils.toResolveHierarchy(e)),g(t)&&(t=[t]);const r=this.queueLoad(e,t,s,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const s=e.split("|"),i=s[0],r=s[1];this.read(i,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${i}`,o),this.loaded(e,a,o)})}saveMissing(e,t,s,i,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){const u={...a,isUpdate:r},c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(e,t,s,i,u):d=c(e,t,s,i),d&&typeof d.then=="function"?d.then(h=>o(null,h)).catch(o):o(null,d)}catch(d){o(d)}else c(e,t,s,i,o,u)}!e||!e[0]||this.store.addResource(e[0],t,s,i)}}}const be=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let e={};if(typeof n[1]=="object"&&(e=n[1]),g(n[1])&&(e.defaultValue=n[1]),g(n[2])&&(e.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),ye=n=>(g(n.ns)&&(n.ns=[n.ns]),g(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),g(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs&&n.supportedLngs.indexOf("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),n),H=()=>{},wt=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})};class K extends q{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=ye(e),this.services={},this.logger=P,this.modules={external:[]},wt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(s=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(g(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=be();this.options={...i,...this.options,...ye(t)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const r=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?P.init(r(this.modules.logger),this.options):P.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=xt);const h=new ge(this.options);this.store=new fe(this.options.resources,this.options);const l=this.services;l.logger=P,l.resourceStore=this.store,l.languageUtils=h,l.pluralResolver=new mt(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(l.formatter=r(d),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new bt(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new St(r(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(f){for(var p=arguments.length,x=new Array(p>1?p-1:0),y=1;y<p;y++)x[y-1]=arguments[y];e.emit(f,...x)}),this.modules.languageDetector&&(l.languageDetector=r(this.modules.languageDetector),l.languageDetector.init&&l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=r(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new G(this.services,this.options),this.translator.on("*",function(f){for(var p=arguments.length,x=new Array(p>1?p-1:0),y=1;y<p;y++)x[y-1]=arguments[y];e.emit(f,...x)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,s||(s=H),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const u=U(),c=()=>{const d=(h,l)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(l),s(h,l)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),u}loadResources(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H;const i=g(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(c=>{c!=="cimode"&&r.indexOf(c)<0&&r.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(o)})}else s(null)}reloadResources(e,t,s){const i=U();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=H),this.services.backendConnector.reload(e,t,r=>{i.resolve(),s(r)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&ke.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}changeLanguage(e,t){var s=this;this.isLanguageChangingTo=e;const i=U();this.emit("languageChanging",e);const r=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},a=(u,c)=>{c?(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return s.t(...arguments)}),t&&t(u,function(){return s.t(...arguments)})},o=u=>{!e&&!u&&this.services.languageDetector&&(u=[]);const c=g(u)?u:this.services.languageUtils.getBestMatchFromCodes(u);c&&(this.language||r(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,d=>{a(d,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),i}getFixedT(e,t,s){var i=this;const r=function(a,o){let u;if(typeof o!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),h=2;h<c;h++)d[h-2]=arguments[h];u=i.options.overloadTranslationOptionHandler([a,o].concat(d))}else u={...o};u.lng=u.lng||r.lng,u.lngs=u.lngs||r.lngs,u.ns=u.ns||r.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||s||r.keyPrefix);const l=i.options.keySeparator||".";let f;return u.keyPrefix&&Array.isArray(a)?f=a.map(p=>`${u.keyPrefix}${l}${p}`):f=u.keyPrefix?`${u.keyPrefix}${l}${a}`:a,i.t(f,u)};return g(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=s,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=t.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,u)=>{const c=this.services.backendConnector.state[`${o}|${u}`];return c===-1||c===0||c===2};if(t.precheck){const o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!i||a(r,e)))}loadNamespaces(e,t){const s=U();return this.options.ns?(g(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),t&&t(i)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=U();g(e)&&(e=[e]);const i=this.options.preload||[],r=e.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return r.length?(this.options.preload=i.concat(r),this.loadResources(a=>{s.resolve(),t&&t(a)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new ge(be());return t.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new K(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H;const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},r=new K(i);return(e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s&&(r.store=new fe(this.store.data,i),r.services.resourceStore=r.store),r.translator=new G(r.services,i),r.translator.on("*",function(o){for(var u=arguments.length,c=new Array(u>1?u-1:0),d=1;d<u;d++)c[d-1]=arguments[d];r.emit(o,...c)}),r.init(i,t),r.translator.options=i,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const k=K.createInstance();k.createInstance=K.createInstance;k.createInstance;k.dir;k.init;k.loadResources;k.reloadResources;k.use;k.changeLanguage;k.getFixedT;k.t;k.exists;k.setDefaultNamespace;k.hasLoadedNamespace;k.loadNamespaces;k.loadLanguages;const Lt={title:"Skill Studio — Preferences",brand:"Skill Studio",browserCallout:"Some preferences require the Skill Studio desktop app.",downloadLink:"Download for Mac, Windows, or Linux",downloadUrl:"https://verified-skill.com/download"},Nt={general:"General",updates:"Updates",privacy:"Privacy",advanced:"Advanced"},Ct={heading:"General",subheading:"Appearance and project defaults.",theme:{label:"Appearance",system:"System",light:"Light",dark:"Dark",help:"Match the system or pick a fixed theme."},launchAtLogin:{label:"Launch Skill Studio at login",help:"Open Skill Studio automatically when you sign in.",browserDisabled:"Available in the desktop app.",errorAdmin:"Couldn't change launch at login. Your administrator may have disabled this.",openSettings:"Open System Settings"},defaultProject:{label:"Default project folder",help:"New projects start here unless you choose another location.",notSet:"(not set)",choose:"Choose folder…"},language:{label:"Language",help:"Currently English only. More languages will arrive in a future release.",english:"English"}},kt={heading:"Updates",subheading:"Stay current with the latest Skill Studio.",currentVersion:"Current version",channel:{label:"Update channel",stable:"Stable",beta:"Beta",betaUnavailable:"No beta release yet — we'll check back later.",help:"Stable releases are recommended. Beta delivers previews of upcoming features."},autoCheck:{label:"Check for updates automatically",help:"Skill Studio will check daily and notify you when an update is ready."},checkNow:"Check for updates",checking:"Checking…",upToDate:"Skill Studio is up to date.",updateAvailable:"Update available: {{version}}",lastChecked:"Last checked",lastCheckedNever:"Never",lastCheckedAgo:"{{relative}}",errors:{network:"Couldn't reach the update server. Check your connection and try again.",signature:"Update signature invalid — refusing to install.",diskSpace:"Not enough disk space to install the update.",tryAgain:"Try again",viewLogs:"View logs"},dialog:{title:"Update available",version:"Version {{version}}",releaseNotes:"Release notes",noReleaseNotes:"Release notes not provided.",installNow:"Install now",later:"Later",skipVersion:"Skip this version",downloading:"Downloading update…",preparing:"Preparing update…",restartRequired:"Restart required to finish installing.",restartNow:"Restart now",onQuit:"Install on quit",cancel:"Cancel"},browserCallout:"Updates are managed by the desktop app. Run npm i -g vskill@latest to update the CLI.",about:{heading:"About",build:"Build",commit:"Commit",links:{openSource:"Open source licenses",website:"Visit verified-skill.com",acknowledgements:"Acknowledgements"}}},Ot={heading:"Privacy",subheading:"Decide what Skill Studio shares with us.",telemetry:{label:"Send optional usage telemetry",help:"Disabled by default. Shares selected public skill identifiers, connection events and local skill counts. Search text, skill contents and credentials are excluded."},crash:{label:"Send anonymized crash reports",help:"Reserved preference. Crash reporting is not available yet."},openLogs:{label:"Open logs folder",help:"Inspect log files to audit what Skill Studio records on your machine.",browserHidden:"Logs are stored on the desktop app only."},disclosure:"Optional usage telemetry is sent only when enabled. Signing in, public catalog searches and updates still contact their services to perform the requested action. Crash reporting is not implemented yet."},Rt={heading:"Advanced",subheading:"Diagnostics and reset.",logLevel:{label:"Log level",help:"Higher levels emit more diagnostic detail. Defaults to Info.",error:"Error",warn:"Warning",info:"Info",debug:"Debug",trace:"Trace"},settingsPath:{label:"Settings file",help:"Where your preferences live on disk.",reveal:"Reveal in Finder",copy:"Copy path",copied:"Copied",browserValue:"Stored in this browser's local storage"},factoryReset:{label:"Factory reset",help:"Reset all preferences to their defaults. Recent projects and your keychain are preserved.",button:"Reset all preferences…",confirmTitle:"Reset all preferences?",confirmBody:"This will return every Skill Studio preference to its default value. Recent projects and API keys stored in your system keychain are not affected.",confirm:"Reset",cancel:"Cancel",done:"Preferences reset to defaults."}},Pt={save:"Save",cancel:"Cancel",close:"Close",loading:"Loading…",browserMode:"Browser mode",desktopOnly:"Desktop only"},Et={app:Lt,tabs:Nt,general:Ct,updates:kt,privacy:Ot,advanced:Rt,common:Pt},Oe=k.createInstance();Oe.use(Ye).init({lng:"en",fallbackLng:"en",ns:["preferences"],defaultNS:"preferences",resources:{en:{preferences:Et}},interpolation:{escapeValue:!1},returnNull:!1});function zt({checked:n,onChange:e,disabled:t,ariaLabel:s,id:i}){return m.jsx("button",{id:i,type:"button",role:"switch","aria-checked":n,"aria-label":s,"aria-disabled":t||void 0,className:"pref-toggle",onClick:()=>!t&&e(!n),disabled:t})}function Ht({options:n,value:e,onChange:t,disabled:s,ariaLabel:i}){return m.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":s||void 0,className:"pref-segmented",children:n.map(r=>m.jsx("button",{type:"button",role:"radio","aria-checked":e===r.value,disabled:s,onClick:()=>!s&&t(r.value),children:r.label},r.value))})}function Bt({label:n,help:e,control:t,stacked:s}){return m.jsxs("div",{className:`pref-row${s?" pref-row--stacked":""}`,children:[m.jsxs("div",{className:"pref-row__label",children:[m.jsx("span",{className:"pref-row__label-text",children:n}),e?m.jsx("span",{className:"pref-row__help",children:e}):null]}),m.jsx("div",{children:t})]})}function Jt({title:n,children:e,style:t}){return m.jsxs("section",{className:"pref-section",style:t,children:[n?m.jsx("h2",{className:"pref-section__title",children:n}):null,e]})}function Wt({variant:n="info",children:e}){return m.jsx("div",{role:"note",className:`pref-callout${n==="info"?" pref-callout--info":""}`,children:e})}function Gt({open:n,onDismiss:e,ariaLabel:t,children:s}){const i=v.useRef(null);return v.useEffect(()=>{var a;if(!n)return;const r=o=>{o.key==="Escape"&&e&&e()};return document.addEventListener("keydown",r),(a=i.current)==null||a.focus(),()=>document.removeEventListener("keydown",r)},[n,e]),n?m.jsx("div",{className:"pref-dialog-overlay",onClick:r=>{r.target===r.currentTarget&&e&&e()},children:m.jsx("div",{ref:i,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,className:"pref-dialog",children:s})}):null}function $t({toasts:n,onDismiss:e}){return v.useEffect(()=>{if(n.length===0)return;const t=n.map(s=>window.setTimeout(()=>e(s.id),s.variant==="error"?8e3:4e3));return()=>t.forEach(s=>window.clearTimeout(s))},[n,e]),m.jsx("div",{className:"pref-toast-stack",role:"status","aria-live":"polite",children:n.map(t=>m.jsxs("div",{className:`pref-toast${t.variant==="error"?" pref-toast--error":""}`,children:[m.jsx("span",{children:t.message}),t.actions&&t.actions.length>0?m.jsx("div",{className:"pref-toast__actions",children:t.actions.map(s=>m.jsx("button",{type:"button",className:"pref-button",onClick:()=>{s.onClick(),e(t.id)},children:s.label},s.label))}):null]},t.id))})}const jt=v.lazy(()=>Y(()=>import("./GeneralTab-Gbc-K6UI.js"),__vite__mapDeps([0,1,2,3,4])).then(n=>({default:n.GeneralTab}))),It=v.lazy(()=>Y(()=>import("./UpdatesTab-BFGUaUtu.js"),__vite__mapDeps([5,1,2,3,4])).then(n=>({default:n.UpdatesTab}))),Tt=v.lazy(()=>Y(()=>import("./PrivacyTab-BXCIX8cQ.js"),__vite__mapDeps([6,1,2,3,4])).then(n=>({default:n.PrivacyTab}))),At=v.lazy(()=>Y(()=>import("./AdvancedTab-CSWhj_MZ.js"),__vite__mapDeps([7,1,2,3,4])).then(n=>({default:n.AdvancedTab}))),xe=[{key:"general",iconChar:"⚙",shortcut:"1"},{key:"updates",iconChar:"↻",shortcut:"2"},{key:"privacy",iconChar:"⚓",shortcut:"3"},{key:"advanced",iconChar:"⁂",shortcut:"4"}];function ve(){const n=typeof window<"u"&&window.location.hash.slice(1)||"general";return n==="general"||n==="updates"||n==="privacy"||n==="advanced"?n:"general"}function Ft(){const{t:n}=Xe("preferences"),e=Ie(),{snapshot:t,refresh:s}=Te(e),[i,r]=v.useState(()=>ve()),[a,o]=v.useState(0),[u,c]=v.useState([]),d=v.useCallback(l=>{c(f=>[...f,{...l,id:`t-${Date.now()}-${Math.random()}`}])},[]),h=v.useCallback(l=>{c(f=>f.filter(p=>p.id!==l))},[]);return v.useEffect(()=>{const l=()=>r(ve());return window.addEventListener("hashchange",l),()=>window.removeEventListener("hashchange",l)},[]),v.useEffect(()=>{if(!e.available)return;let l=null;return Ae("preferences-trigger-check",()=>{r("updates"),o(f=>f+1)}).then(f=>{l=f}),()=>{l==null||l()}},[e.available]),v.useEffect(()=>{window.location.hash.slice(1)!==i&&window.history.replaceState(null,"",`#${i}`)},[i]),v.useEffect(()=>{const l=f=>{if(!(f.metaKey||f.ctrlKey))return;const x=parseInt(f.key,10);if(Number.isNaN(x))return;const y=xe[x-1];y&&(f.preventDefault(),r(y.key))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]),v.useEffect(()=>{if(!t)return;const l=t.general.theme;if(l==="system"){const f=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>{document.documentElement.dataset.theme=f.matches?"dark":"light",document.documentElement.dataset.themeMode="auto"};return p(),f.addEventListener("change",p),()=>f.removeEventListener("change",p)}document.documentElement.dataset.theme=l,document.documentElement.dataset.themeMode=l},[t]),m.jsxs("div",{className:"preferences-window",children:[m.jsxs("nav",{className:"preferences-sidebar","aria-label":n("app.title"),children:[m.jsx("div",{className:"preferences-sidebar__brand",children:n("app.brand")}),xe.map(l=>m.jsxs("button",{type:"button",className:"preferences-nav-item","aria-current":i===l.key?"page":void 0,onClick:()=>r(l.key),children:[m.jsx("span",{"aria-hidden":"true",className:"preferences-nav-item__icon",children:l.iconChar}),m.jsx("span",{children:n(`tabs.${l.key}`)}),m.jsxs("span",{className:"preferences-nav-item__shortcut","aria-hidden":"true",children:[/^Mac/i.test(navigator.platform)?"⌘":"Ctrl+",l.shortcut]})]},l.key))]}),m.jsx("main",{className:"preferences-content","data-active-tab":i,children:m.jsxs(v.Suspense,{fallback:m.jsx("div",{className:"pref-status-row",children:n("common.loading")}),children:[i==="general"?m.jsx(jt,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null,i==="updates"?m.jsx(It,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d,triggerCheckNonce:a}):null,i==="privacy"?m.jsx(Tt,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null,i==="advanced"?m.jsx(At,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null]})}),m.jsx($t,{toasts:u,onDismiss:h})]})}je.createRoot(document.getElementById("root")).render(m.jsx(v.StrictMode,{children:m.jsx(_e,{i18n:Oe,children:m.jsx(Ft,{})})}));export{Wt as C,Gt as D,Bt as F,Jt as S,zt as T,Ht as a,Xe as u};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CUEYzTVL.js","assets/core-DZjBCfjp.js","assets/event-QtOCMXAv.js"])))=>i.map(i=>d[i]);
2
+ import{r as v}from"./globals-hm1COkXX.js";const $="modulepreload",z=function(e){return"/"+e},A={},L=function(a,t,c){let s=Promise.resolve();if(t&&t.length>0){let r=function(d){return Promise.all(d.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=r(t.map(d=>{if(d=z(d),d in A)return;A[d]=!0;const y=d.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${g}`))return;const w=document.createElement("link");if(w.rel=y?"stylesheet":$,y||(w.as="script"),w.crossOrigin="",w.href=d,l&&w.setAttribute("nonce",l),document.head.appendChild(w),y)return new Promise((E,S)=>{w.addEventListener("load",E),w.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${d}`)))})}))}function f(r){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=r,window.dispatchEvent(i),!i.defaultPrevented)throw r}return s.then(r=>{for(const i of r||[])i.status==="rejected"&&f(i.reason);return a().catch(f)})},M={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};class _ extends Error{constructor(a){super(`${a} is not available in browser mode — install the Skill Studio desktop app.`),this.name="BrowserModeError"}}function R(){return typeof window>"u"?"browser":"__TAURI_INTERNALS__"in window?"desktop":"browser"}const h={version:1,general:{theme:"system",language:"auto",defaultProjectFolder:null,launchAtLogin:!1},updates:{channel:"stable",autoCheck:!0,lastCheckedAt:null,lastKnownVersion:null,skippedVersion:null,snoozedUntil:null},privacy:{telemetryEnabled:!1,crashReportingEnabled:!1},advanced:{logLevel:"info"},studio:{lifecycleDefault:"ask"}},T="vskill:preferences:browser-shadow";function I(e){const a=(e==null?void 0:e.general)??{},t=(e==null?void 0:e.updates)??{},c=(e==null?void 0:e.privacy)??{},s=(e==null?void 0:e.advanced)??{},f=(e==null?void 0:e.studio)??{};return{version:(e==null?void 0:e.version)??h.version,general:{theme:a.theme??h.general.theme,language:a.language??h.general.language,defaultProjectFolder:a.defaultProjectFolder??a.default_project_folder??null,launchAtLogin:a.launchAtLogin??a.launch_at_login??h.general.launchAtLogin},updates:{channel:t.channel??h.updates.channel,autoCheck:t.autoCheck??t.auto_check??h.updates.autoCheck,lastCheckedAt:t.lastCheckedAt??t.last_checked_at??null,lastKnownVersion:t.lastKnownVersion??t.last_known_version??null,skippedVersion:t.skippedVersion??t.skipped_version??null,snoozedUntil:t.snoozedUntil??t.snoozed_until??null},privacy:{telemetryEnabled:c.telemetryEnabled??c.telemetry_enabled??h.privacy.telemetryEnabled,crashReportingEnabled:c.crashReportingEnabled??c.crash_reporting_enabled??h.privacy.crashReportingEnabled},advanced:{logLevel:s.logLevel??s.log_level??h.advanced.logLevel},studio:{lifecycleDefault:f.lifecycleDefault??f.lifecycle_default??h.studio.lifecycleDefault}}}function G(e,a){return{available:e.available===!0,currentVersion:e.currentVersion??a,latestVersion:e.latestVersion??e.version??void 0,releaseNotes:e.releaseNotes??e.notes??void 0,releaseDate:e.releaseDate??e.pub_date??void 0}}function b(e){if(!e||typeof e.login!="string"||e.login.trim()==="")return null;const a=e.login.trim(),t=e.avatar_url??e.avatarUrl??`https://github.com/${encodeURIComponent(a)}.png?size=40`;return{login:a,avatar_url:t,email:e.email??null,cached_at:e.cached_at??null}}async function K(e){var c,s,f;if(typeof window>"u")return;const a=window,t=(c=a.__TAURI_INTERNALS__)==null?void 0:c.invoke;if(t)try{await t("open_external_url",{url:e});return}catch(r){console.warn("open_external_url command failed; falling back to shell open:",r)}try{const r=await fetch("/api/desktop/open-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})});if(r.ok)return;console.warn(`sidecar open-url failed: HTTP ${r.status}`)}catch(r){console.warn("sidecar open-url failed; falling back to shell open:",r)}try{const r=(f=(s=a.__TAURI__)==null?void 0:s.shell)==null?void 0:f.open;if(typeof r=="function"){await r(e);return}const{open:i}=await L(async()=>{const{open:l}=await import("./index-CUEYzTVL.js");return{open:l}},__vite__mapDeps([0,1]));await i(e);return}catch(r){console.warn("tauri shell open failed; falling back to window.open:",r)}window.open(e,"_blank","noopener,noreferrer")}async function H(e,a){if(typeof window>"u"||!("__TAURI_INTERNALS__"in window))return null;try{return await(await L(()=>import("./event-QtOCMXAv.js"),__vite__mapDeps([2,1]))).listen(e,a)}catch{return null}}function U(){try{const e=localStorage.getItem(T);return e?I(JSON.parse(e)):structuredClone(h)}catch{return structuredClone(h)}}function J(e){try{localStorage.setItem(T,JSON.stringify(e))}catch{}}function W(e,a,t){const c=a.split(".");let s=e;for(let f=0;f<c.length-1;f++){const r=c[f];(typeof s[r]!="object"||s[r]===null)&&(s[r]={}),s=s[r]}s[c[c.length-1]]=t}async function u(e,a){var s;const c=(s=window.__TAURI_INTERNALS__)==null?void 0:s.invoke;if(!c)throw new _(e);return c(e,a)}async function C(){return R()!=="desktop"?U():I(await u("get_settings"))}async function Y(){try{if(typeof window>"u")return!1;const e=M;return e.VITE_VSKILL_DISABLE_TELEMETRY==="1"||e.VITE_VSKILL_DISABLE_TELEMETRY==="true"||new URLSearchParams(window.location.search).get("disableTelemetry")==="1"?!1:(await C()).privacy.telemetryEnabled===!0}catch{return!1}}function oe(){const[e]=v.useState(()=>R());return v.useMemo(()=>{const t=e==="desktop",c=async()=>C(),s=async(n,o)=>{if(!t){const p=U();W(p,n,o),J(p),window.dispatchEvent(new CustomEvent("preferences-shadow-updated",{detail:{path:n,value:o}}));return}await u("set_setting",{key:n,value:o})},f=async()=>{if(!t){try{localStorage.removeItem(T)}catch{}window.dispatchEvent(new CustomEvent("preferences-shadow-reset"));return}await u("reset_settings")},r=async()=>{if(!t)throw new _("checkForUpdates");const[n,o]=await Promise.all([u("check_for_updates"),g().catch(()=>({version:"unknown",build:"n/a",commit:"n/a",target:"unknown",arch:"unknown"}))]);return G(n,o.version)},i=async n=>{if(!t)throw new _("downloadAndInstallUpdate");const o=n?await H("updater://progress",p=>{const m=p.payload??{},B=m.downloadedBytes??m.bytes??m.chunkBytes??0,N=m.totalBytes??m.total??null;n(B,N)}):null;try{await u("download_and_install_update")}finally{await(o==null?void 0:o())}},l=async()=>{if(!t)throw new _("cancelUpdate");await u("cancel_update")},d=async()=>{if(!t)throw new _("restartApp");await u("restart_app")},y=async n=>{if(!t){n&&(window.location.hash=`#${n}`);return}await u("open_preferences",{tab:n??null})},g=async()=>t?u("get_app_metadata"):{version:"browser",build:"n/a",commit:"n/a",target:navigator.platform||"browser",arch:"n/a"},w=async n=>{if(!t)throw new _("setAutostart");await u("set_autostart",{enabled:n})},E=async()=>{if(!t)throw new _("pickFolder");const n=await u("pick_default_project_folder");return(n==null?void 0:n.path)??null},S=async()=>{if(!t)throw new _("openLogsFolder");await u("open_logs_folder")},P=async()=>{if(!t)throw new _("revealSettingsFile");await u("reveal_settings_file")},O=async n=>{try{await navigator.clipboard.writeText(n)}catch{}},D=async()=>{const n=await fetch("/api/oauth/github/start",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!n.ok){const p=await n.text().catch(()=>"");throw new Error(`OAuth start failed: HTTP ${n.status}: ${p.slice(0,200)}`)}const o=await n.json();return{userCode:o.state,verificationUri:o.authUrl,interval:2,expiresIn:Math.max(60,Math.floor((o.expiresAt-Date.now())/1e3))}},F=async()=>{const n=window.__vskillOauthState;if(!n)return{status:"error",message:"no OAuth flow in progress"};try{const o=await fetch(`/api/oauth/github/status?state=${encodeURIComponent(n)}`);if(!o.ok)return{status:"error",message:`HTTP ${o.status}`};const p=await o.json(),m=b(p.user);return p.status==="ready"&&m?{status:"granted",user:m}:p.status==="pending"?{status:"pending"}:p.status==="expired"?{status:"expired"}:p.status==="error"?{status:"error",message:p.error??"unknown"}:{status:"pending"}}catch(o){return{status:"error",message:o instanceof Error?o.message:String(o)}}},x=async()=>{try{const n=await fetch("/api/auth/me");if(!n.ok)return null;const o=await n.json();return o.signedIn?b(o.user):null}catch{return null}},V=async()=>{await fetch("/api/auth/sign-out",{method:"POST"})},j=async()=>{if(!t)throw new _("pickProjectFolder");return await u("pick_default_project_folder")??null},q=async n=>t?u("get_repo_info",{folder:n}):{name:null,branch:null,is_private:null,sync_state:{kind:"no_remote"}},k={cache:null,localSkillCount:0,isFresh:!1,daysRemaining:0};return{mode:e,available:t,getSettings:c,setSetting:s,resetSettings:f,checkForUpdates:r,downloadAndInstallUpdate:i,cancelUpdate:l,restartApp:d,openPreferences:y,getAppMetadata:g,setAutostart:w,pickFolder:E,openLogsFolder:S,revealSettingsFile:P,copyToClipboard:O,startGithubDeviceFlow:D,pollGithubDeviceFlow:F,getSignedInUser:x,signOut:V,pickProjectFolder:j,getRepoInfo:q,quotaGet:async n=>t?await u("quota_get",{projectRoots:n}):{...k},quotaForceSync:async(n,o)=>t?await u("quota_force_sync",{projectRoots:n,fresh:o}):{...k},quotaCanCreateSkill:async n=>t?u("quota_can_create_skill",{projectRoots:n}):{blocked:!1,reason:"browser-mode",snapshot:{...k}},quotaReportCount:async n=>{if(t)try{if(!await Y())return;await u("quota_report_count",{skillCount:n})}catch(o){console.warn("quotaReportCount failed:",o)}},openExternalUrl:async n=>{if(!t){typeof window<"u"&&window.open(n,"_blank","noopener,noreferrer");return}await K(n)},refreshUserIdentity:async()=>{if(!t)return null;const n=await u("refresh_user_identity");return b(n)}}},[e])}function ae(e){const[a,t]=v.useState(null),[c,s]=v.useState(null),[f,r]=v.useState(!0),i=v.useCallback(async()=>{r(!0),s(null);try{const l=await e.getSettings();t(l)}catch(l){s(l instanceof Error?l.message:String(l))}finally{r(!1)}},[e]);return v.useEffect(()=>{let l=!1;return(async()=>{try{const d=await e.getSettings();l||(t(d),r(!1))}catch(d){l||(s(d instanceof Error?d.message:String(d)),r(!1))}})(),()=>{l=!0}},[e]),v.useEffect(()=>{const l=()=>i();return window.addEventListener("preferences-shadow-updated",l),window.addEventListener("preferences-shadow-reset",l),()=>{window.removeEventListener("preferences-shadow-updated",l),window.removeEventListener("preferences-shadow-reset",l)}},[i]),{snapshot:a,error:c,loading:f,refresh:i}}export{L as _,ae as a,Y as h,H as l,G as n,K as o,oe as u};
@@ -47,9 +47,9 @@
47
47
  }
48
48
  })();
49
49
  </script>
50
- <script type="module" crossorigin src="/assets/main-tzMA8J07.js"></script>
50
+ <script type="module" crossorigin src="/assets/main-jiMosYzo.js"></script>
51
51
  <link rel="modulepreload" crossorigin href="/assets/globals-hm1COkXX.js">
52
- <link rel="modulepreload" crossorigin href="/assets/useDesktopBridge-9oZFQsrw.js">
52
+ <link rel="modulepreload" crossorigin href="/assets/useDesktopBridge-BKz-gcRg.js">
53
53
  <link rel="stylesheet" crossorigin href="/assets/globals-Dpf9KmYH.css">
54
54
  <link rel="stylesheet" crossorigin href="/assets/fonts-i7Lkz2zN.css">
55
55
  </head>
@@ -21,9 +21,9 @@
21
21
  }
22
22
  })();
23
23
  </script>
24
- <script type="module" crossorigin src="/assets/preferences-DCdw0Kvu.js"></script>
24
+ <script type="module" crossorigin src="/assets/preferences-D2BPT0OT.js"></script>
25
25
  <link rel="modulepreload" crossorigin href="/assets/globals-hm1COkXX.js">
26
- <link rel="modulepreload" crossorigin href="/assets/useDesktopBridge-9oZFQsrw.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/useDesktopBridge-BKz-gcRg.js">
27
27
  <link rel="stylesheet" crossorigin href="/assets/globals-Dpf9KmYH.css">
28
28
  <link rel="stylesheet" crossorigin href="/assets/preferences-BHZXB5dL.css">
29
29
  <link rel="stylesheet" crossorigin href="/assets/fonts-i7Lkz2zN.css">
@@ -11,16 +11,13 @@
11
11
  * Increment 0794 — US-002b / T-004.
12
12
  */
13
13
  /**
14
- * Insert or replace the top-level `version:` field in YAML frontmatter.
14
+ * Update the published version, preserving legacy root quoting where present.
15
15
  *
16
16
  * Behaviour:
17
17
  * - If `version:` exists at column 1: replace its value (preserves
18
18
  * surrounding lines and quoting style of the source whenever possible).
19
- * - Else if `description:` exists at column 1: insert immediately after
20
- * the description block (skipping indented continuation lines).
21
- * - Else: append the version line at the end of the frontmatter.
19
+ * - New fields and existing metadata.version use the portable metadata shape.
22
20
  * - If the file has no frontmatter block at all: synthesise a minimal one.
23
- * - Indented `metadata.version` is never touched.
24
21
  *
25
22
  * Returns the full file content with the change applied. Pure function.
26
23
  */
@@ -10,62 +10,37 @@
10
10
  *
11
11
  * Increment 0794 — US-002b / T-004.
12
12
  */
13
+ import { setFrontmatterVersion } from "../utils/version.js";
13
14
  const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n/;
14
15
  const TOP_VERSION_RE = /^version\s*:\s*[^\n]*\r?\n?/m;
15
- const HAS_DESCRIPTION_RE = /^description\s*:/m;
16
16
  /**
17
- * Insert or replace the top-level `version:` field in YAML frontmatter.
17
+ * Update the published version, preserving legacy root quoting where present.
18
18
  *
19
19
  * Behaviour:
20
20
  * - If `version:` exists at column 1: replace its value (preserves
21
21
  * surrounding lines and quoting style of the source whenever possible).
22
- * - Else if `description:` exists at column 1: insert immediately after
23
- * the description block (skipping indented continuation lines).
24
- * - Else: append the version line at the end of the frontmatter.
22
+ * - New fields and existing metadata.version use the portable metadata shape.
25
23
  * - If the file has no frontmatter block at all: synthesise a minimal one.
26
- * - Indented `metadata.version` is never touched.
27
24
  *
28
25
  * Returns the full file content with the change applied. Pure function.
29
26
  */
30
27
  export function upsertFrontmatterVersion(content, newVersion) {
31
28
  const match = content.match(FRONTMATTER_RE);
32
- if (!match) {
33
- return `---\nversion: ${newVersion}\n---\n${content}`;
29
+ if (!match || !TOP_VERSION_RE.test(match[1])) {
30
+ return setFrontmatterVersion(content, newVersion);
34
31
  }
35
32
  const fmBody = match[1];
36
33
  // Replace existing top-level `version:`
37
- if (TOP_VERSION_RE.test(fmBody)) {
38
- const newFm = fmBody.replace(TOP_VERSION_RE, (line) => {
39
- // Preserve quoting style if present
40
- const quotedMatch = line.match(/^version\s*:\s*("|')/);
41
- if (quotedMatch) {
42
- const quote = quotedMatch[1];
43
- return `version: ${quote}${newVersion}${quote}\n`;
44
- }
45
- return `version: ${newVersion}\n`;
46
- });
47
- return content.replace(FRONTMATTER_RE, `---\n${newFm}\n---\n`);
48
- }
49
- // Insert after `description:` if present
50
- const lines = fmBody.split(/\r?\n/);
51
- const descIdx = lines.findIndex((line) => HAS_DESCRIPTION_RE.test(line));
52
- let updatedLines;
53
- if (descIdx >= 0) {
54
- let insertAt = descIdx + 1;
55
- // Skip continuation lines (indented under description)
56
- while (insertAt < lines.length && /^\s+\S/.test(lines[insertAt]))
57
- insertAt++;
58
- updatedLines = [
59
- ...lines.slice(0, insertAt),
60
- `version: ${newVersion}`,
61
- ...lines.slice(insertAt),
62
- ];
63
- }
64
- else {
65
- updatedLines = [...lines, `version: ${newVersion}`];
66
- }
67
- const newFm = updatedLines.join("\n");
68
- return content.replace(FRONTMATTER_RE, `---\n${newFm}\n---\n`);
34
+ const newFm = fmBody.replace(TOP_VERSION_RE, (line) => {
35
+ // Preserve quoting style if present
36
+ const quotedMatch = line.match(/^version\s*:\s*("|')/);
37
+ if (quotedMatch) {
38
+ const quote = quotedMatch[1];
39
+ return `version: ${quote}${newVersion}${quote}\n`;
40
+ }
41
+ return `version: ${newVersion}\n`;
42
+ });
43
+ return content.replace(FRONTMATTER_RE, () => `---\n${newFm}\n---\n`);
69
44
  }
70
45
  /**
71
46
  * Lightweight validation: round-trip the result through the frontmatter regex
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/lib/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,cAAc,GAAG,kCAAkC,CAAC;AAC1D,MAAM,cAAc,GAAG,8BAA8B,CAAC;AACtD,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe,EAAE,UAAkB;IAC1E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,iBAAiB,UAAU,UAAU,OAAO,EAAE,CAAC;IACxD,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAExB,wCAAwC;IACxC,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAChC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;YACpD,oCAAoC;YACpC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;YACvD,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;gBAC7B,OAAO,YAAY,KAAK,GAAG,UAAU,GAAG,KAAK,IAAI,CAAC;YACpD,CAAC;YACD,OAAO,YAAY,UAAU,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC;IACjE,CAAC;IAED,yCAAyC;IACzC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACzE,IAAI,YAAsB,CAAC;IAC3B,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;QACjB,IAAI,QAAQ,GAAG,OAAO,GAAG,CAAC,CAAC;QAC3B,uDAAuD;QACvD,OAAO,QAAQ,GAAG,KAAK,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAAE,QAAQ,EAAE,CAAC;QAC7E,YAAY,GAAG;YACb,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC;YAC3B,YAAY,UAAU,EAAE;YACxB,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;SACzB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,YAAY,GAAG,CAAC,GAAG,KAAK,EAAE,YAAY,UAAU,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC;AACjE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAe;IACxD,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACxC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,yCAAyC;IACzC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClB,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/lib/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,cAAc,GAAG,kCAAkC,CAAC;AAC1D,MAAM,cAAc,GAAG,8BAA8B,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe,EAAE,UAAkB;IAC1E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,OAAO,qBAAqB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAExB,wCAAwC;IACxC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;QACpD,oCAAoC;QACpC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACvD,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAC7B,OAAO,YAAY,KAAK,GAAG,UAAU,GAAG,KAAK,IAAI,CAAC;QACpD,CAAC;QACD,OAAO,YAAY,UAAU,IAAI,CAAC;IACpC,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,EAAE,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;AACvE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAe;IACxD,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACxC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,yCAAyC;IACzC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClB,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -46,6 +46,8 @@ export declare function privateRepoHint(tokenProvider?: () => string | null): st
46
46
  */
47
47
  export declare function rawToContentsApiUrl(url: string): string | null;
48
48
  export declare function createGitHubFetch(opts?: GitHubFetchOptions): GitHubFetch;
49
+ /** @internal test-only */
50
+ export declare function _resetRejectedTokenWarningForTests(): void;
49
51
  export declare function githubFetch(url: string, init?: RequestInit): Promise<Response>;
50
52
  /** Test-only reset hook. */
51
53
  export declare function _resetDefaultGitHubFetchForTests(): void;
@@ -210,6 +210,7 @@ export function createGitHubFetch(opts = {}) {
210
210
  if (!(err instanceof GitHubFetchError && err.status === 401))
211
211
  throw err;
212
212
  // Stale or revoked token: public content still reads anonymously.
213
+ warnRejectedTokenOnce();
213
214
  const anonHeaders = { ...headers };
214
215
  delete anonHeaders.Authorization;
215
216
  delete anonHeaders.authorization;
@@ -219,7 +220,20 @@ export function createGitHubFetch(opts = {}) {
219
220
  throw err;
220
221
  }
221
222
  }
222
- return send(url, { ...init, headers }, Boolean(token));
223
+ try {
224
+ return await send(url, { ...init, headers }, Boolean(token));
225
+ }
226
+ catch (err) {
227
+ if (!(token && err instanceof GitHubFetchError && err.status === 401))
228
+ throw err;
229
+ // Expired or revoked token: public repos still answer anonymously, so
230
+ // visibility checks and public updates keep working. Say so once.
231
+ warnRejectedTokenOnce();
232
+ const anonHeaders = { ...headers };
233
+ delete anonHeaders.Authorization;
234
+ delete anonHeaders.authorization;
235
+ return send(url, { ...init, headers: anonHeaders }, false);
236
+ }
223
237
  };
224
238
  async function send(url, req, hadToken) {
225
239
  let attempt = 0;
@@ -250,6 +264,18 @@ export function createGitHubFetch(opts = {}) {
250
264
  return lastResponse;
251
265
  }
252
266
  }
267
+ let rejectedTokenWarned = false;
268
+ function warnRejectedTokenOnce() {
269
+ if (rejectedTokenWarned)
270
+ return;
271
+ rejectedTokenWarned = true;
272
+ process.stderr.write("vskill: GitHub rejected your token (expired or revoked); continuing without it for public repos. " +
273
+ "Run `vskill auth login` (add --repos for private repos) to refresh it.\n");
274
+ }
275
+ /** @internal test-only */
276
+ export function _resetRejectedTokenWarningForTests() {
277
+ rejectedTokenWarned = false;
278
+ }
253
279
  function safeHost(url) {
254
280
  try {
255
281
  return new URL(url).hostname || "<invalid>";