@nextclaw/ui 0.22.2 → 0.22.3
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.
- package/CHANGELOG.md +7 -0
- package/dist/assets/{appearance-settings-page-BLaxNij2.js → appearance-settings-page-Bh_65RFw.js} +1 -1
- package/dist/assets/{channels-list-page-eUVEhukh.js → channels-list-page-Bd3_YlyV.js} +1 -1
- package/dist/assets/{desktop-capabilities-page-FV7xowDx.js → desktop-capabilities-page-CQxp8NvQ.js} +1 -1
- package/dist/assets/{desktop-update-config-BWP2Pr4u.js → desktop-update-config-DsyKUJbp.js} +1 -1
- package/dist/assets/{extensions-Mc3juAVp.js → extensions-C_FUBhUf.js} +1 -1
- package/dist/assets/{index-DIkMNtbu.js → index-C83VUh83.js} +2 -2
- package/dist/assets/{index-CBmwJjwE.css → index-CwCTiMM9.css} +1 -1
- package/dist/assets/{model-config-page-DAseq1vr.js → model-config-page-B_w0J2p1.js} +1 -1
- package/dist/assets/{privacy-settings-page-COFa7LrK.js → privacy-settings-page-D3RzjGyz.js} +1 -1
- package/dist/assets/{providers-config-page-zP-J1Asx.js → providers-config-page-ONfW4tjw.js} +1 -1
- package/dist/assets/remote-DRh0aAHG.js +1 -0
- package/dist/assets/{runtime-config-page-D5KbQ3ue.js → runtime-config-page-CdwKIwZc.js} +1 -1
- package/dist/assets/{search-config-page-Bi9J2kYR.js → search-config-page-C0YgfpcA.js} +1 -1
- package/dist/assets/{secrets-config-page-0MP2MSvq.js → secrets-config-page-Bb28CTv4.js} +1 -1
- package/dist/index.html +10 -2
- package/dist/themes/island/island-atmosphere-7a037243.webp +0 -0
- package/index.html +8 -0
- package/package.json +4 -4
- package/public/themes/island/island-atmosphere-7a037243.webp +0 -0
- package/src/app/styles/island-theme.css +2 -2
- package/dist/assets/remote-EeKMCoyb.js +0 -1
- package/dist/themes/island/island-atmosphere.webp +0 -0
- package/public/themes/island/island-atmosphere.webp +0 -0
package/CHANGELOG.md
CHANGED
package/dist/assets/{appearance-settings-page-BLaxNij2.js → appearance-settings-page-Bh_65RFw.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{B as t,H as n,L as r,a as i,o as a}from"./react-BwGMzqXA.js";import{Ht as o,an as s,in as c,on as l,sn as u}from"./api-DU3C4HfX.js";import{x as d}from"./mcp-marketplace-page-CEr3FgVp.js";import{a as f,i as p,n as m,r as h,t as g,w as _}from"./select-DvuHOwPH.js";import{H as v,f as y,n as b,u as x}from"./index-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{B as t,H as n,L as r,a as i,o as a}from"./react-BwGMzqXA.js";import{Ht as o,an as s,in as c,on as l,sn as u}from"./api-DU3C4HfX.js";import{x as d}from"./mcp-marketplace-page-CEr3FgVp.js";import{a as f,i as p,n as m,r as h,t as g,w as _}from"./select-DvuHOwPH.js";import{H as v,f as y,n as b,u as x}from"./index-C83VUh83.js";var S=e(n(),1);function C(){let{language:e,setLanguage:t}=d();return{currentLanguage:e,currentLanguageLabel:a.find(t=>t.value===e)?.label??e,languageOptions:a,selectLanguage:(0,S.useCallback)(n=>{e!==n&&(t(n),window.location.reload())},[e,t])}}var w=t(),T=[{value:`card`,labelKey:`chatMessageLayoutCard`,descriptionKey:`chatMessageLayoutCardDescription`},{value:`flat`,labelKey:`chatMessageLayoutFlat`,descriptionKey:`chatMessageLayoutFlatDescription`}];function E(){let{theme:e,setTheme:t}=x(),{currentLanguage:n,languageOptions:a,selectLanguage:d}=C(),S=v(e=>e.layout),E=v(e=>e.setLayout),D=b(e=>e.isVisible),O=b(e=>e.setVisible);return(0,w.jsx)(u,{title:i(`appearance`),children:(0,w.jsx)(l,{children:(0,w.jsxs)(s,{children:[(0,w.jsx)(c,{title:i(`theme`),control:(0,w.jsxs)(g,{value:e,onValueChange:e=>t(e),children:[(0,w.jsx)(p,{"aria-label":i(`theme`),className:`w-36 sm:w-44`,children:(0,w.jsx)(f,{})}),(0,w.jsx)(m,{children:y.map(e=>(0,w.jsx)(h,{value:e.value,children:i(e.labelKey)},e.value))})]})}),(0,w.jsx)(c,{title:i(`language`),control:(0,w.jsxs)(g,{value:n,onValueChange:e=>d(e),children:[(0,w.jsx)(p,{"aria-label":i(`language`),className:`w-36 sm:w-44`,children:(0,w.jsx)(f,{})}),(0,w.jsx)(m,{children:a.map(e=>(0,w.jsx)(h,{value:e.value,children:e.label},e.value))})]})}),(0,w.jsx)(c,{title:i(`chatMessageLayoutTitle`),description:i(`chatMessageLayoutDescription`),layout:`stacked`,children:(0,w.jsx)(`div`,{role:`radiogroup`,"aria-label":i(`chatMessageLayoutTitle`),className:`grid gap-1 rounded-xl bg-background/65 p-1 sm:grid-cols-2`,children:T.map(e=>{let t=e.value===S;return(0,w.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>E(e.value),className:r(`flex min-w-0 items-start gap-3 rounded-lg px-3 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,t?`bg-card text-foreground shadow-sm`:`text-muted-foreground hover:bg-card/60 hover:text-foreground`),children:[(0,w.jsx)(`span`,{className:r(`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full ring-1`,t?`bg-primary text-primary-foreground ring-primary`:`bg-background ring-border`),children:t?(0,w.jsx)(_,{className:`h-2.5 w-2.5`,strokeWidth:3}):null}),(0,w.jsxs)(`span`,{className:`min-w-0`,children:[(0,w.jsx)(`span`,{className:`block text-sm font-medium`,children:i(e.labelKey)}),(0,w.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-muted-foreground`,children:i(e.descriptionKey)})]})]},e.value)})})}),(0,w.jsx)(c,{title:i(`sideDockVisibilityTitle`),description:i(`sideDockVisibilityDescription`),control:(0,w.jsx)(o,{id:`appearance-side-dock-visible`,"aria-label":i(`sideDockVisibilityTitle`),checked:D,onCheckedChange:O})})]})})})}export{E as AppearanceSettingsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./chunk-DseTPa7n.js";import{B as n,F as r,H as i,L as a,a as o,r as s,s as c}from"./react-BwGMzqXA.js";import{n as l,t as u}from"./navigation-link-DI0mOIVl.js";import{An as d,At as f,Ht as p,It as m,Mt as h,_n as g,dn as _,fn as v,jt as y,sn as b,un as x,vn as S,yn as C}from"./api-DU3C4HfX.js";import{C as w,a as T,i as E,n as D,r as O,t as k}from"./select-DvuHOwPH.js";import{t as A}from"./createLucideIcon-CLfqNlvk.js";import{t as ee}from"./search-BVeIVVGT.js";import{t as te}from"./book-open-DMnwJfVM.js";import{t as ne}from"./loader-circle-DXH2fVRq.js";import{t as re}from"./x-27QFIvUt.js";import{t as ie}from"./tag-chip-BI9NffVf.js";import{G as ae,J as j,K as M,St as oe,U as se,W as N,_t as ce,b as le,g as P,h as F,k as ue,m as I,mt as de,p as fe,q as pe,wt as me,xt as he}from"./index-DIkMNtbu.js";import{t as ge}from"./form-actions-DJlfyLEH.js";import{t as L}from"./config-hints-nV5HPOvq.js";import{a as _e,c as ve,i as ye,l as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./config-split-page-DON62DcK.js";var Ee=A(`Hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),De=A(`Mail`,[[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}]]),R=A(`MessageCircleMore`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]),z=A(`QrCode`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),Oe=A(`ToggleLeft`,[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`6`,ry:`6`,key:`f2vt7d`}],[`circle`,{cx:`8`,cy:`12`,r:`2`,key:`1nvbw3`}]]),B=e(i(),1),V=n();function ke({value:e,onChange:t,className:n,placeholder:r=``}){let[i,s]=(0,B.useState)(``),c=n=>{n.key===`Enter`&&i.trim()?(n.preventDefault(),t([...e,i.trim()]),s(``)):n.key===`Backspace`&&!i&&e.length>0&&t(e.slice(0,-1))},l=n=>{t(e.filter((e,t)=>t!==n))};return(0,V.jsxs)(`div`,{className:a(`flex min-h-[42px] flex-wrap gap-2 rounded-xl border border-gray-200/80 bg-white p-2`,n),children:[e.map((e,t)=>(0,V.jsxs)(ie,{tone:`info`,className:`gap-1 px-2 py-1 text-sm`,children:[e,(0,V.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`transition-colors hover:text-rose-200`,children:(0,V.jsx)(re,{className:`h-3 w-3`})})]},t)),(0,V.jsx)(`input`,{type:`text`,value:i,onChange:e=>s(e.target.value),onKeyDown:c,className:`flex-1 outline-none min-w-[100px] bg-transparent text-sm`,placeholder:r||o(`enterTag`)})]})}function Ae(e){return e.includes(`token`)||e.includes(`secret`)||e.includes(`password`)?(0,V.jsx)(oe,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`url`)||e.includes(`host`)?(0,V.jsx)(me,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`email`)||e.includes(`mail`)?(0,V.jsx)(De,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`id`)||e.includes(`from`)?(0,V.jsx)(Ee,{className:`h-3.5 w-3.5 text-gray-500`}):e===`enabled`||e===`consentGranted`?(0,V.jsx)(Oe,{className:`h-3.5 w-3.5 text-gray-500`}):(0,V.jsx)(ce,{className:`h-3.5 w-3.5 text-gray-500`})}function je({channelName:e,fields:t,formData:n,jsonDrafts:r,setJsonDrafts:i,updateField:a,uiHints:s}){return(0,V.jsx)(V.Fragment,{children:t.map(t=>{let c=L(`channels.${e}.${t.name}`,s),l=c?.label??t.label,u=c?.placeholder;return(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsxs)(x,{htmlFor:t.name,className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[Ae(t.name),l]}),t.type===`boolean`&&(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-gray-50 p-3`,children:[(0,V.jsx)(`span`,{className:`text-sm text-gray-500`,children:n[t.name]?o(`enabled`):o(`disabled`)}),(0,V.jsx)(p,{id:t.name,checked:n[t.name]||!1,onCheckedChange:e=>a(t.name,e),className:`data-[state=checked]:bg-emerald-500`})]}),(t.type===`text`||t.type===`email`)&&(0,V.jsx)(_,{id:t.name,type:t.type,value:n[t.name]||``,onChange:e=>a(t.name,e.target.value),placeholder:u,className:`rounded-xl`}),t.type===`password`&&(0,V.jsx)(_,{id:t.name,type:`password`,value:n[t.name]||``,onChange:e=>a(t.name,e.target.value),placeholder:u??o(`leaveBlankToKeepUnchanged`),className:`rounded-xl`}),t.type===`number`&&(0,V.jsx)(_,{id:t.name,type:`number`,value:n[t.name]||0,onChange:e=>a(t.name,parseInt(e.target.value,10)||0),placeholder:u,className:`rounded-xl`}),t.type===`tags`&&(0,V.jsx)(ke,{value:n[t.name]||[],onChange:e=>a(t.name,e)}),t.type===`select`&&(0,V.jsxs)(k,{value:n[t.name]||``,onValueChange:e=>a(t.name,e),children:[(0,V.jsx)(E,{className:`rounded-xl`,children:(0,V.jsx)(T,{})}),(0,V.jsx)(D,{children:(t.options??[]).map(e=>(0,V.jsx)(O,{value:e.value,children:e.label},e.value))})]}),t.type===`json`&&(0,V.jsx)(`textarea`,{id:t.name,value:r[t.name]??`{}`,onChange:e=>i(n=>({...n,[t.name]:e.target.value})),className:`min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`})]},t.name)})})}var Me=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),H=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),U=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),Ne=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Pe=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),Fe=t((e=>{var t=H().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),Ie=t((e=>{var t=H().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),Le=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),W=t((e=>{var t=U(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),Re=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),ze=t((e=>{var t=Re();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),Be=t(((e,t)=>{var n=ze();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),G=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),K=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
|
|
1
|
+
import{i as e,t}from"./chunk-DseTPa7n.js";import{B as n,F as r,H as i,L as a,a as o,r as s,s as c}from"./react-BwGMzqXA.js";import{n as l,t as u}from"./navigation-link-DI0mOIVl.js";import{An as d,At as f,Ht as p,It as m,Mt as h,_n as g,dn as _,fn as v,jt as y,sn as b,un as x,vn as S,yn as C}from"./api-DU3C4HfX.js";import{C as w,a as T,i as E,n as D,r as O,t as k}from"./select-DvuHOwPH.js";import{t as A}from"./createLucideIcon-CLfqNlvk.js";import{t as ee}from"./search-BVeIVVGT.js";import{t as te}from"./book-open-DMnwJfVM.js";import{t as ne}from"./loader-circle-DXH2fVRq.js";import{t as re}from"./x-27QFIvUt.js";import{t as ie}from"./tag-chip-BI9NffVf.js";import{G as ae,J as j,K as M,St as oe,U as se,W as N,_t as ce,b as le,g as P,h as F,k as ue,m as I,mt as de,p as fe,q as pe,wt as me,xt as he}from"./index-C83VUh83.js";import{t as ge}from"./form-actions-DJlfyLEH.js";import{t as L}from"./config-hints-nV5HPOvq.js";import{a as _e,c as ve,i as ye,l as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./config-split-page-DON62DcK.js";var Ee=A(`Hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),De=A(`Mail`,[[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}]]),R=A(`MessageCircleMore`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]),z=A(`QrCode`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),Oe=A(`ToggleLeft`,[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`6`,ry:`6`,key:`f2vt7d`}],[`circle`,{cx:`8`,cy:`12`,r:`2`,key:`1nvbw3`}]]),B=e(i(),1),V=n();function ke({value:e,onChange:t,className:n,placeholder:r=``}){let[i,s]=(0,B.useState)(``),c=n=>{n.key===`Enter`&&i.trim()?(n.preventDefault(),t([...e,i.trim()]),s(``)):n.key===`Backspace`&&!i&&e.length>0&&t(e.slice(0,-1))},l=n=>{t(e.filter((e,t)=>t!==n))};return(0,V.jsxs)(`div`,{className:a(`flex min-h-[42px] flex-wrap gap-2 rounded-xl border border-gray-200/80 bg-white p-2`,n),children:[e.map((e,t)=>(0,V.jsxs)(ie,{tone:`info`,className:`gap-1 px-2 py-1 text-sm`,children:[e,(0,V.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`transition-colors hover:text-rose-200`,children:(0,V.jsx)(re,{className:`h-3 w-3`})})]},t)),(0,V.jsx)(`input`,{type:`text`,value:i,onChange:e=>s(e.target.value),onKeyDown:c,className:`flex-1 outline-none min-w-[100px] bg-transparent text-sm`,placeholder:r||o(`enterTag`)})]})}function Ae(e){return e.includes(`token`)||e.includes(`secret`)||e.includes(`password`)?(0,V.jsx)(oe,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`url`)||e.includes(`host`)?(0,V.jsx)(me,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`email`)||e.includes(`mail`)?(0,V.jsx)(De,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`id`)||e.includes(`from`)?(0,V.jsx)(Ee,{className:`h-3.5 w-3.5 text-gray-500`}):e===`enabled`||e===`consentGranted`?(0,V.jsx)(Oe,{className:`h-3.5 w-3.5 text-gray-500`}):(0,V.jsx)(ce,{className:`h-3.5 w-3.5 text-gray-500`})}function je({channelName:e,fields:t,formData:n,jsonDrafts:r,setJsonDrafts:i,updateField:a,uiHints:s}){return(0,V.jsx)(V.Fragment,{children:t.map(t=>{let c=L(`channels.${e}.${t.name}`,s),l=c?.label??t.label,u=c?.placeholder;return(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsxs)(x,{htmlFor:t.name,className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[Ae(t.name),l]}),t.type===`boolean`&&(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-gray-50 p-3`,children:[(0,V.jsx)(`span`,{className:`text-sm text-gray-500`,children:n[t.name]?o(`enabled`):o(`disabled`)}),(0,V.jsx)(p,{id:t.name,checked:n[t.name]||!1,onCheckedChange:e=>a(t.name,e),className:`data-[state=checked]:bg-emerald-500`})]}),(t.type===`text`||t.type===`email`)&&(0,V.jsx)(_,{id:t.name,type:t.type,value:n[t.name]||``,onChange:e=>a(t.name,e.target.value),placeholder:u,className:`rounded-xl`}),t.type===`password`&&(0,V.jsx)(_,{id:t.name,type:`password`,value:n[t.name]||``,onChange:e=>a(t.name,e.target.value),placeholder:u??o(`leaveBlankToKeepUnchanged`),className:`rounded-xl`}),t.type===`number`&&(0,V.jsx)(_,{id:t.name,type:`number`,value:n[t.name]||0,onChange:e=>a(t.name,parseInt(e.target.value,10)||0),placeholder:u,className:`rounded-xl`}),t.type===`tags`&&(0,V.jsx)(ke,{value:n[t.name]||[],onChange:e=>a(t.name,e)}),t.type===`select`&&(0,V.jsxs)(k,{value:n[t.name]||``,onValueChange:e=>a(t.name,e),children:[(0,V.jsx)(E,{className:`rounded-xl`,children:(0,V.jsx)(T,{})}),(0,V.jsx)(D,{children:(t.options??[]).map(e=>(0,V.jsx)(O,{value:e.value,children:e.label},e.value))})]}),t.type===`json`&&(0,V.jsx)(`textarea`,{id:t.name,value:r[t.name]??`{}`,onChange:e=>i(n=>({...n,[t.name]:e.target.value})),className:`min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`})]},t.name)})})}var Me=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),H=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),U=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),Ne=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Pe=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),Fe=t((e=>{var t=H().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),Ie=t((e=>{var t=H().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),Le=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),W=t((e=>{var t=U(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),Re=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),ze=t((e=>{var t=Re();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),Be=t(((e,t)=>{var n=ze();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),G=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),K=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
|
|
2
2
|
]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),q=t((e=>{var t=G(),n=K();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),Ve=t((e=>{var t=H(),n=W(),r=U(),i=q(),a=G(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),He=t((e=>{var t=H(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),Ue=t(((e,t)=>{var n=q();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),We=t(((e,t)=>{var n=q(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),Ge=t(((e,t)=>{var n=q();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),Ke=t(((e,t)=>{var n=q(),r=H();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
|
|
3
3
|
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),qe=t(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),Je=t((e=>{var t=q(),n=Ue(),r=We(),i=Ge(),a=Ke(),o=K(),s=H(),c=qe();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
|
|
4
4
|
Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),Ye=t((e=>{var t=H(),n=U(),r=Ne(),i=Pe(),a=Fe(),o=Ie(),s=Le(),c=W(),l=Be(),u=Ve(),d=He(),f=q(),p=Je();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
|
package/dist/assets/{desktop-capabilities-page-FV7xowDx.js → desktop-capabilities-page-CQxp8NvQ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,a as t}from"./react-BwGMzqXA.js";import{an as n,fn as r,in as i,on as a,sn as o}from"./api-DU3C4HfX.js";import{a as s,i as c,o as l,r as u,s as d}from"./index-
|
|
1
|
+
import{B as e,a as t}from"./react-BwGMzqXA.js";import{an as n,fn as r,in as i,on as a,sn as o}from"./api-DU3C4HfX.js";import{a as s,i as c,o as l,r as u,s as d}from"./index-C83VUh83.js";var f=e();function p(){let e=c(),p=u(),h=l(),v=s(),y=d(),b=e.data,x=h.isPending||v.isPending;return(0,f.jsxs)(o,{title:t(`desktopCapabilitiesPageTitle`),description:t(`desktopCapabilitiesPageDescription`),children:[(0,f.jsx)(a,{title:t(`desktopCapabilitiesSystemTitle`),description:t(`desktopCapabilitiesSystemDescription`),children:(0,f.jsxs)(n,{children:[(0,f.jsx)(i,{title:t(`desktopCapabilitiesHostStatus`),description:e.isLoading?t(`loading`):b?.online?t(`desktopCapabilitiesHostOnline`):t(`desktopCapabilitiesHostOffline`),control:(0,f.jsx)(r,{type:`button`,variant:`outline`,size:`sm`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:t(`desktopCapabilitiesRecheck`)})}),(0,f.jsx)(i,{title:t(`desktopCapabilitiesAccessibility`),description:g(b?.permissions.accessibility),control:(0,f.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,f.jsx)(r,{type:`button`,variant:`outline`,size:`sm`,disabled:x,onClick:()=>v.mutate(),children:t(`desktopCapabilitiesOpenSettings`)}),(0,f.jsx)(r,{type:`button`,size:`sm`,disabled:x,onClick:()=>h.mutate(),children:t(`desktopCapabilitiesRequestPermission`)})]})})]})}),(0,f.jsx)(a,{title:t(`desktopCapabilitiesGrantsTitle`),description:t(`desktopCapabilitiesGrantsDescription`),children:(0,f.jsx)(n,{children:p.isLoading?(0,f.jsx)(i,{title:t(`loading`)}):p.data?.length?p.data.map(e=>(0,f.jsx)(m,{grant:e,disabled:y.isPending,onRevoke:()=>y.mutate(e)},_(e))):(0,f.jsx)(i,{title:t(`desktopCapabilitiesNoGrants`),description:t(`desktopCapabilitiesNoGrantsDescription`)})})})]})}function m({disabled:e,grant:n,onRevoke:a}){let o=h(n.resource.target);return(0,f.jsx)(i,{title:n.subject.type===`agent`?`${t(`desktopCapabilitiesAgent`)} · ${n.subject.id}`:`${t(`desktopCapabilitiesExtension`)} · ${n.subject.id}`,description:`${o} · ${n.access.join(`, `)}`,control:(0,f.jsx)(r,{type:`button`,variant:`destructive`,size:`sm`,disabled:e,onClick:a,children:t(`desktopCapabilitiesRevoke`)})})}function h(e){if(!e||typeof e!=`object`||Array.isArray(e))return t(`desktopCapabilitiesUnknownApplication`);let{applicationId:n}=e;return typeof n==`string`&&n.trim()?n.trim():t(`desktopCapabilitiesUnknownApplication`)}function g(e){switch(e){case`granted`:return t(`desktopCapabilitiesPermissionGranted`);case`not_granted`:return t(`desktopCapabilitiesPermissionNotGranted`);case`not_supported`:return t(`desktopCapabilitiesPermissionNotSupported`);default:return t(`desktopCapabilitiesPermissionUnknown`)}}function _(e){return`${e.subject.type}:${e.subject.id}:${JSON.stringify(e.resource.target)}:${e.access.join(`,`)}`}export{p as DesktopCapabilitiesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,L as t,a as n,r,s as i}from"./react-BwGMzqXA.js";import{t as a}from"./navigation-link-DI0mOIVl.js";import{Gt as o,Jt as s,Kt as c,Wt as l,Yt as u,an as d,fn as f,in as p,on as m,sn as h,yn as g}from"./api-DU3C4HfX.js";import{a as _,i as v,n as y,r as b,t as x}from"./select-DvuHOwPH.js";import{t as S}from"./refresh-cw-DmR6-f9A.js";import{t as C}from"./rotate-cw-BUWqEgob.js";import{$ as w,Q as T,et as E,nt as D,tt as O}from"./index-
|
|
1
|
+
import{B as e,L as t,a as n,r,s as i}from"./react-BwGMzqXA.js";import{t as a}from"./navigation-link-DI0mOIVl.js";import{Gt as o,Jt as s,Kt as c,Wt as l,Yt as u,an as d,fn as f,in as p,on as m,sn as h,yn as g}from"./api-DU3C4HfX.js";import{a as _,i as v,n as y,r as b,t as x}from"./select-DvuHOwPH.js";import{t as S}from"./refresh-cw-DmR6-f9A.js";import{t as C}from"./rotate-cw-BUWqEgob.js";import{$ as w,Q as T,et as E,nt as D,tt as O}from"./index-C83VUh83.js";var k=e(),A={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,applying:`desktopUpdatesStatusApplying`,"restart-required":`desktopUpdatesStatusRestartRequired`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`},j={feature:`desktopUpdatesReleaseNotesFeature`,enhancement:`desktopUpdatesReleaseNotesEnhancement`,fix:`desktopUpdatesReleaseNotesFix`,compatibility:`desktopUpdatesReleaseNotesCompatibility`};function M({snapshot:e}){return(0,k.jsx)(`span`,{className:t(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,V(e.status)),children:B(e)})}function N({label:e,value:t}){return(0,k.jsxs)(`div`,{className:`rounded-lg bg-background/70 p-3`,children:[(0,k.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,k.jsx)(`p`,{className:`mt-1 text-sm font-semibold text-foreground`,children:t})]})}function P({snapshot:e}){if(e.status!==`downloading`)return null;let t=e.progress?.percent,r=t==null?n(`desktopUpdatesDownloadProgressUnknown`):n(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(t)),i=L(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,k.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:r}),(0,k.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:i})]}),(0,k.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,k.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${t??0}%`}})})]})}function F(e){return e?.trim()||`-`}function I(e){return e?r(e):`-`}function L(e,t){let n=R(e);return t&&t>0?`${n} / ${R(t)}`:n}function R(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function z(e){return n(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function B(e){return e.status===`failed`&&e.failureStage?n(`desktopUpdatesFailureStage.${e.failureStage}`):n(A[e.status]??`desktopUpdatesStatusIdle`)}function V(e){return e===`downloaded`||e===`restart-required`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function H(){return i()===`zh`?`zh-CN`:`en-US`}function U(e,t){return o(e.title,t)??n(j[e.kind]??`desktopUpdatesReleaseNotesEnhancement`)}function W({snapshot:e}){let t=c(e),r=H(),i=g({queryKey:[`runtime-release-notes`,t],queryFn:async()=>await l(t??``),enabled:!!t,retry:!1,staleTime:300*1e3}),s=i.data,u=o(s?.title,r)??n(`desktopUpdatesReleaseNotesPreviewTitle`),d=o(s?.summary,r)??n(`desktopUpdatesReleaseNotesPreviewDescription`);return e.releaseNotesUrl?(0,k.jsxs)(T,{children:[(0,k.jsx)(O,{children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(D,{children:u}),(0,k.jsx)(E,{children:d})]}),(0,k.jsx)(a,{href:e.releaseNotesUrl,external:!0,children:n(`desktopUpdatesReleaseNotes`)})]})}),(0,k.jsxs)(w,{className:`space-y-4`,children:[i.isLoading?(0,k.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`desktopUpdatesReleaseNotesPreviewLoading`)}):null,!t||i.isError?(0,k.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`desktopUpdatesReleaseNotesPreviewUnavailable`)}):null,s?(0,k.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:s.sections.map(e=>(0,k.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:U(e,r)}),(0,k.jsx)(`ul`,{className:`mt-3 space-y-3`,children:e.items.map((t,n)=>{let i=o(t.title,r),a=o(t.body,r);return(0,k.jsxs)(`li`,{className:`space-y-1`,children:[i?(0,k.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:i}):null,a?(0,k.jsx)(`p`,{className:`text-sm leading-5 text-gray-600`,children:a}):null]},`${i??e.kind}-${n}`)})})]},e.kind))}):null]})]}):null}function G(){return(0,k.jsx)(h,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),children:(0,k.jsx)(m,{title:n(`runtimeUpdatesUnavailableTitle`),description:n(`runtimeUpdatesUnavailableDescription`),children:(0,k.jsx)(d,{children:(0,k.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:n(`runtimeUpdatesUnavailableHint`)})})})})}function K(){let{supported:e,initialized:r,busyAction:i,snapshot:a}=u();if(!r)return(0,k.jsx)(h,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),children:(0,k.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:n(`loading`)})});if(!e||!a)return(0,k.jsx)(G,{});let o=i===`checking`,c=i===`downloading`,l=i===`applying`,g=i===`updating`,w=i===`switching-channel`,T=(a.status===`update-available`||a.status===`downloaded`)&&!c&&!l&&!g,E=[[n(`runtimeUpdatesHostVersion`),F(a.hostVersion)],[n(`desktopUpdatesCurrentBundleVersion`),F(a.currentVersion)],[n(`desktopUpdatesAvailableVersion`),F(a.availableVersion)],[n(`desktopUpdatesLastCheckedAt`),I(a.lastCheckedAt)],[n(`desktopUpdatesCurrentChannel`),z(a.channel)]];return(0,k.jsxs)(h,{title:n(`runtimeUpdatesPageTitle`),description:n(`runtimeUpdatesPageDescription`),actions:(0,k.jsxs)(f,{variant:`outline`,onClick:()=>void s.checkForUpdates(),disabled:o||c||l||g,children:[(0,k.jsx)(S,{className:t(`mr-2 h-4 w-4`,o&&`animate-spin`)}),n(`desktopUpdatesCheckNow`)]}),children:[(0,k.jsx)(m,{title:n(`desktopUpdatesOverviewTitle`),description:n(`desktopUpdatesOverviewDescription`),children:(0,k.jsx)(d,{children:(0,k.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n(`desktopUpdatesStatusLabel`)}),(0,k.jsx)(M,{snapshot:a})]}),(0,k.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:E.map(([e,t])=>(0,k.jsx)(N,{label:e,value:t},e))}),a.channel===`beta`?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:n(`desktopUpdatesBetaBadgeTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:n(`desktopUpdatesBetaBadgeDescription`)})]}):null,a.downloadedVersion?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:n(`desktopUpdatesDownloadedBannerTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:n(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,a.downloadedVersion)})]}):null,(0,k.jsx)(P,{snapshot:a}),a.status===`blocked`?(0,k.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:n(`desktopUpdatesBlockedTitle`)}),(0,k.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:a.errorMessage??n(`desktopUpdatesBlockedDescription`)}),a.recoveryCommand?(0,k.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:a.recoveryCommand}):null]}):null,a.errorMessage&&a.status!==`blocked`?(0,k.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:a.errorMessage}):null]})})}),(0,k.jsx)(W,{snapshot:a}),(0,k.jsx)(m,{title:n(`desktopUpdatesChannelSettingsTitle`),description:n(`desktopUpdatesChannelSettingsDescription`),children:(0,k.jsx)(d,{children:(0,k.jsx)(p,{title:n(`desktopUpdatesReleaseChannel`),description:n(`desktopUpdatesReleaseChannelHelp`),layout:`stacked`,children:(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsxs)(x,{value:a.channel,disabled:w||o||c||l||g,onValueChange:e=>void s.updateChannel(e),children:[(0,k.jsx)(v,{className:`w-full max-w-sm`,children:(0,k.jsx)(_,{placeholder:n(`desktopUpdatesReleaseChannel`)})}),(0,k.jsxs)(y,{children:[(0,k.jsx)(b,{value:`stable`,children:n(`desktopUpdatesChannelStable`)}),(0,k.jsx)(b,{value:`beta`,children:n(`desktopUpdatesChannelBeta`)})]})]}),(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`desktopUpdatesReleaseChannelDowngradeHint`)})]})})})}),(0,k.jsx)(m,{title:n(`desktopUpdatesActionsTitle`),description:n(`runtimeUpdatesActionsDescription`),children:(0,k.jsx)(d,{children:(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,k.jsxs)(f,{variant:`outline`,onClick:()=>void s.checkForUpdates(),disabled:o||c||l||g,children:[(0,k.jsx)(S,{className:t(`mr-2 h-4 w-4`,o&&`animate-spin`)}),n(`desktopUpdatesCheckNow`)]}),(0,k.jsxs)(f,{onClick:()=>void s.updateNow(),disabled:!T,children:[(0,k.jsx)(C,{className:t(`mr-2 h-4 w-4`,g&&`animate-spin`)}),n(`runtimeUpdatesApplyNow`)]})]})})})]})}export{K as DesktopUpdateConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,L as t,a as n}from"./react-BwGMzqXA.js";import{f as r,fn as i,sn as a,yn as o}from"./api-DU3C4HfX.js";import{t as s}from"./refresh-cw-DmR6-f9A.js";import{Ct as c,Ot as l,Tt as u,yt as d}from"./index-
|
|
1
|
+
import{B as e,L as t,a as n}from"./react-BwGMzqXA.js";import{f as r,fn as i,sn as a,yn as o}from"./api-DU3C4HfX.js";import{t as s}from"./refresh-cw-DmR6-f9A.js";import{Ct as c,Ot as l,Tt as u,yt as d}from"./index-C83VUh83.js";function f(){return o({queryKey:[`extension-catalog`],queryFn:r,staleTime:5e3,refetchOnWindowFocus:!0})}var p=e(),m={running:`bg-emerald-50 text-emerald-700`,starting:`bg-amber-50 text-amber-700`,stopping:`bg-amber-50 text-amber-700`,stopped:`bg-muted text-muted-foreground`,failed:`bg-rose-50 text-rose-700`};function h({state:e}){return(0,p.jsx)(`span`,{className:t(`rounded-full px-2 py-1 text-xs font-medium`,m[e]),children:n(`extensionsState${e[0].toUpperCase()}${e.slice(1)}`)})}function g({label:e,value:t}){return(0,p.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card px-4 py-3`,children:[(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,p.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tabular-nums text-foreground`,children:t})]})}function _({extension:e}){return(0,p.jsxs)(`article`,{className:`rounded-xl border border-border/70 bg-card p-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,p.jsx)(`span`,{className:`inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,p.jsx)(d,{className:`h-5 w-5`})}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,p.jsx)(`h2`,{className:`truncate font-semibold text-foreground`,children:e.name}),(0,p.jsx)(h,{state:e.state})]}),(0,p.jsxs)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:[e.id,e.version?` · v${e.version}`:``]})]})]}),(0,p.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:[(0,p.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,p.jsx)(u,{className:`h-3.5 w-3.5`}),n(`extensionsObservationCapabilities`)]}),(0,p.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.observations.context?n(`extensionsContextCapability`):null,e.observations.context&&e.observations.events?` · `:null,e.observations.events?n(`extensionsEventsCapability`):null,!e.observations.context&&!e.observations.events?n(`extensionsNone`):null]})]}),(0,p.jsxs)(`div`,{className:`rounded-lg bg-muted/40 px-3 py-2`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,p.jsx)(c,{className:`h-3.5 w-3.5`}),n(`extensionsChannelCapabilities`)]}),(0,p.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.channels.length>0?e.channels.map(e=>e.name||e.id).join(` · `):n(`extensionsNone`)})]})]}),(0,p.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,p.jsxs)(`span`,{children:[n(`extensionsLeaseCount`),`: `,e.leaseCount]}),e.pid?(0,p.jsxs)(`span`,{children:[n(`extensionsProcess`),`: `,e.pid]}):null,e.startedAt?(0,p.jsxs)(`span`,{children:[n(`extensionsStartedAt`),`: `,new Date(e.startedAt).toLocaleString()]}):null]})]})}function v(){let e=f(),r=e.data;return(0,p.jsxs)(a,{title:n(`extensionsPageTitle`),description:n(`extensionsPageDescription`),actions:(0,p.jsxs)(i,{type:`button`,variant:`outline`,size:`sm`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:[(0,p.jsx)(s,{className:t(`mr-2 h-4 w-4`,e.isFetching&&`animate-spin`)}),n(`extensionsRefresh`)]}),children:[(0,p.jsx)(`div`,{className:`rounded-xl border border-primary/20 bg-primary/5 px-4 py-3 text-sm text-muted-foreground`,children:(0,p.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,p.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-primary`}),(0,p.jsx)(`p`,{children:n(`extensionsLifecycleDescription`)})]})}),e.isPending?(0,p.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:n(`extensionsLoading`)}):e.isError?(0,p.jsxs)(`div`,{className:`rounded-xl border border-rose-200 bg-rose-50 px-4 py-5 text-sm text-rose-700`,children:[(0,p.jsx)(`p`,{children:n(`extensionsLoadFailed`)}),(0,p.jsx)(i,{className:`mt-3`,type:`button`,variant:`outline`,size:`sm`,onClick:()=>void e.refetch(),children:n(`extensionsRetry`)})]}):r?.extensions.length?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 lg:grid-cols-4`,children:[(0,p.jsx)(g,{label:n(`extensionsTotal`),value:r.counts.total}),(0,p.jsx)(g,{label:n(`extensionsRunning`),value:r.counts.running}),(0,p.jsx)(g,{label:n(`extensionsWithObservations`),value:r.counts.withObservations}),(0,p.jsx)(g,{label:n(`extensionsWithChannels`),value:r.counts.withChannels})]}),(0,p.jsx)(`div`,{className:`space-y-3`,children:r.extensions.map(e=>(0,p.jsx)(_,{extension:e},e.id))})]}):(0,p.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border px-4 py-8 text-center text-sm text-muted-foreground`,children:[(0,p.jsx)(d,{className:`mx-auto h-5 w-5 text-muted-foreground/50`}),(0,p.jsx)(`p`,{className:`mt-2 font-medium text-foreground`,children:n(`extensionsEmpty`)}),(0,p.jsx)(`p`,{className:`mt-1`,children:n(`extensionsEmptyDescription`)})]})]})}export{v as ExtensionsConfigPage};
|