@fugood/bricks-cli 2.23.0-beta.25 → 2.23.0-beta.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fugood/bricks-cli",
3
- "version": "2.23.0-beta.25",
3
+ "version": "2.23.0-beta.26",
4
4
  "description": "BRICKS CLI - Command-line interface for BRICKS Workspace API",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,10 +12,10 @@
12
12
  "bin"
13
13
  ],
14
14
  "scripts": {
15
- "start": "node bin/bricks.js",
16
- "dev": "node --watch bin/bricks.js",
15
+ "start": "bun bin/bricks.js",
16
+ "dev": "bun --watch bin/bricks.js",
17
17
  "build": "webpack --config webpack.config.js",
18
- "prepack": "npm run build"
18
+ "prepack": "bun run build"
19
19
  },
20
20
  "dependencies": {
21
21
  "conf": "^13.0.1",
@@ -47,5 +47,5 @@
47
47
  "graphql"
48
48
  ],
49
49
  "license": "UNLICENSED",
50
- "gitHead": "89d05d356e4deae1c06afd6db781e2b83c547991"
50
+ "gitHead": "a3c7e7c4b3775d92d4f152e4d7dd032b526b05d1"
51
51
  }
package/lib/676.index.js DELETED
@@ -1 +0,0 @@
1
- export const __webpack_esm_id__=676;export const __webpack_esm_ids__=[676];export const __webpack_esm_modules__={6417:(e,l,t)=>{const n=Object.assign({},t(8024)),i=Object.keys(n);Object.defineProperty(n,"random",{get(){const e=Math.floor(Math.random()*i.length),l=i[e];return n[l]}}),e.exports=n},6787:(e,l,t)=>{t.d(l,{Ay:()=>m});var n=t(1649),i=t(8498),r=t(1708);const o={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},a={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},s={...o,...a},_={...o,tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},f=function(){const{env:e}=r,{TERM:l,TERM_PROGRAM:t}=e;return"win32"!==r.platform?"linux"!==l:Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===t||"vscode"===t||"xterm-256color"===l||"alacritty"===l||"rxvt-unicode"===l||"rxvt-unicode-256color"===l||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}(),c=f?s:_;Object.entries(a);const d=function({isSelected:e=!1}){return n.default.createElement(i.Box,{marginRight:1},e?n.default.createElement(i.Text,{color:"blue"},c.pointer):n.default.createElement(i.Text,null," "))};const h=function({isSelected:e=!1,label:l}){return n.createElement(i.Text,{color:e?"blue":void 0},l)};var u=t(7975);function g(e,l){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);if(!Number.isSafeInteger(l))throw new TypeError(`The \`steps\` parameter must be an integer, got ${l}.`);const{length:t}=e;if(0===t)return[...e];const n=(l%t+t)%t;return 0===n?[...e]:[...e.slice(-n),...e.slice(0,-n)]}const m=function({items:e=[],isFocused:l=!0,initialIndex:t=0,indicatorComponent:r=d,itemComponent:o=h,limit:a,onSelect:s,onHighlight:_}){const f="number"==typeof a&&e.length>a,c=f?Math.min(a,e.length):e.length,m=c-1,[D,p]=(0,n.useState)(t>m?m-t:0),[v,B]=(0,n.useState)(t?t>m?m:t:0),w=(0,n.useRef)(e);(0,n.useEffect)((()=>{(0,u.isDeepStrictEqual)(w.current.map((e=>e.value)),e.map((e=>e.value)))||(p(0),B(0)),w.current=e}),[e]),(0,i.useInput)((0,n.useCallback)(((l,t)=>{if("k"===l||t.upArrow){const l=(f?c:e.length)-1,t=0===v,n=t?D+1:D,i=t?f?v:l:v-1;p(n),B(i);const r=f?g(e,n).slice(0,c):e;"function"==typeof _&&_(r[i])}if("j"===l||t.downArrow){const l=v===(f?c:e.length)-1,t=l?D-1:D,n=l?f?v:0:v+1;p(t),B(n);const i=f?g(e,t).slice(0,c):e;"function"==typeof _&&_(i[n])}if(/^[1-9]$/.test(l)){const t=Number.parseInt(l,10)-1,n=f?g(e,D).slice(0,c):e;if(t>=0&&t<n.length){const e=n[t];e&&s?.(e)}}if(t.return){const l=f?g(e,D).slice(0,c):e;"function"==typeof s&&s(l[v])}}),[f,c,D,v,e,s,_]),{isActive:l});const b=f?g(e,D).slice(0,c):e;return n.default.createElement(i.Box,{flexDirection:"column"},b.map(((e,l)=>{const t=l===v;return n.default.createElement(i.Box,{key:e.key??e.value},n.default.createElement(r,{isSelected:t}),n.default.createElement(o,{...e,isSelected:t}))})))}},7882:(e,l,t)=>{t.d(l,{A:()=>o});var n=t(1649),i=t(8498),r=t(6417);const o=function({type:e="dots"}){const[l,t]=(0,n.useState)(0),o=r[e];return(0,n.useEffect)((()=>{const e=setInterval((()=>{t((e=>e===o.frames.length-1?0:e+1))}),o.interval);return()=>{clearInterval(e)}}),[o]),n.default.createElement(i.Text,null,o.frames[l])}},8024:e=>{e.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots13":{"interval":80,"frames":["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"sand":{"interval":80,"frames":["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"binary":{"interval":80,"frames":["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","❤️ "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},"dwarfFortress":{"interval":80,"frames":[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]}}')},9253:(e,l,t)=>{t.d(l,{A:()=>a});var n=t(1649),i=t(8498),r=t(1897);function o({value:e,placeholder:l="",focus:t=!0,mask:o,highlightPastedText:a=!1,showCursor:s=!0,onChange:_,onSubmit:f}){const[c,d]=(0,n.useState)({cursorOffset:(e||"").length,cursorWidth:0}),{cursorOffset:h,cursorWidth:u}=c;(0,n.useEffect)((()=>{d((l=>{if(!t||!s)return l;const n=e||"";return l.cursorOffset>n.length-1?{cursorOffset:n.length,cursorWidth:0}:l}))}),[e,t,s]);const g=a?u:0,m=o?o.repeat(e.length):e;let D=m,p=l?r.Ay.grey(l):void 0;if(s&&t){p=l.length>0?r.Ay.inverse(l[0])+r.Ay.grey(l.slice(1)):r.Ay.inverse(" "),D=m.length>0?"":r.Ay.inverse(" ");let e=0;for(const l of m)D+=e>=h-g&&e<=h?r.Ay.inverse(l):l,e++;m.length>0&&h===m.length&&(D+=r.Ay.inverse(" "))}return(0,i.useInput)(((l,t)=>{if(t.upArrow||t.downArrow||t.ctrl&&"c"===l||t.tab||t.shift&&t.tab)return;if(t.return)return void(f&&f(e));let n=h,i=e,r=0;t.leftArrow?s&&n--:t.rightArrow?s&&n++:t.backspace||t.delete?h>0&&(i=e.slice(0,h-1)+e.slice(h,e.length),n--):(i=e.slice(0,h)+l+e.slice(h,e.length),n+=l.length,l.length>1&&(r=l.length)),h<0&&(n=0),h>e.length&&(n=e.length),d({cursorOffset:n,cursorWidth:r}),i!==e&&_(i)}),{isActive:t}),n.default.createElement(i.Text,null,l?m.length>0?D:p:D)}const a=o}};
package/lib/803.index.js DELETED
@@ -1 +0,0 @@
1
- export const __webpack_esm_id__=803;export const __webpack_esm_ids__=[803];export const __webpack_esm_modules__={2803:(e,l,n)=>{n.d(l,{App:()=>H,AppDetail:()=>k,AppList:()=>I,CONTROL_ACTIONS:()=>x,DeviceControl:()=>A,DeviceDetail:()=>E,DeviceList:()=>S,DeviceScreenshot:()=>B,DeviceStatus:()=>p,Footer:()=>T,GroupDetail:()=>R,GroupList:()=>C,Header:()=>j,Loading:()=>_,MainMenu:()=>D,MediaBoxDetail:()=>P,MediaBoxList:()=>O,MediaFileDetail:()=>U,MediaFileList:()=>N,ModuleDetail:()=>L,ModuleList:()=>w,ONLINE_THRESHOLD_MS:()=>h,ShortEditEditor:()=>G,VIEWS:()=>u,runInteractiveMode:()=>X}),n.r(l);var r=n(1649),o=n(8498),t=n(9557),i=n(9436),c=n(8832),a=n(5009),s=n(6895),d=n(997),u={MAIN:"main",DEVICES:"devices",DEVICE_DETAIL:"device_detail",DEVICE_CONTROL:"device_control",DEVICE_SCREENSHOT:"device_screenshot",APPS:"apps",APP_DETAIL:"app_detail",APP_SHORT_EDIT:"app_short_edit",MODULES:"modules",MODULE_DETAIL:"module_detail",MODULE_SHORT_EDIT:"module_short_edit",GROUPS:"groups",GROUP_DETAIL:"group_detail",MEDIA_BOXES:"media_boxes",MEDIA_BOX_DETAIL:"media_box_detail",MEDIA_FILES:"media_files",MEDIA_FILE_DETAIL:"media_file_detail"},x=[{label:"Refresh Application",value:"refresh"},{label:"Clear Cache",value:"clear-cache"},{label:"Take Screenshot",value:"take-screenshot"},{label:"Open System Menu",value:"system-menu-open"},{label:"Close System Menu",value:"system-menu-close"},{label:"Open Debug Panel",value:"debug-panel-open"},{label:"Close Debug Panel",value:"debug-panel-close"},{label:"Enable Logging",value:"logging-on"},{label:"Disable Logging",value:"logging-off"},{label:"← Back",value:"back"}],h=3e5,f=n(7882),g=n(1178),m=function(e){var l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=Math.floor(60),o=(0,r.useState)(n),t=c(o,2),i=t[0],a=t[1],s=(0,r.useState)(null),d=c(s,2),u=d[0],x=d[1],h=(0,r.useRef)(e);(0,r.useEffect)((function(){h.current=e}),[e]);var f=(0,r.useCallback)((function(){a(n),x(Date.now())}),[n]);return(0,r.useEffect)((function(){if(l){var e=setInterval((function(){a((function(e){return e<=1?(null==h.current||h.current(),x(Date.now()),n):e-1}))}),1e3);return function(){return clearInterval(e)}}}),[l,n]),(0,r.useEffect)((function(){l&&(a(n),x(Date.now()))}),[l,n]),{countdown:i,lastRefreshTime:u,resetCountdown:f}},v=function(e){var l=e.countdown,n=e.lastRefreshTime;return(0,g.jsx)(o.Box,{children:(0,g.jsxs)(o.Text,{color:"gray",children:["Next refresh in ",(0,g.jsxs)(o.Text,{color:"cyan",children:[l,"s"]}),n&&(0,g.jsxs)(o.Text,{color:"gray",children:[" (last: ",n?new Date(n).toLocaleTimeString():null,")"]})]})})},j=function(e){var l=e.workspace,n=e.view;return(0,g.jsxs)(o.Box,{flexDirection:"column",marginBottom:1,children:[(0,g.jsxs)(o.Box,{children:[(0,g.jsx)(o.Text,{bold:!0,color:"cyan",children:"BRICKS CLI"}),(0,g.jsx)(o.Text,{color:"gray",children:" - Interactive Mode"})]}),(0,g.jsxs)(o.Box,{children:[(0,g.jsx)(o.Text,{color:"gray",children:"Workspace: "}),(0,g.jsx)(o.Text,{color:"green",children:(null==l?void 0:l.name)||"Not connected"}),(0,g.jsx)(o.Text,{color:"gray",children:" | View: "}),(0,g.jsx)(o.Text,{color:"yellow",children:n})]}),(0,g.jsx)(o.Text,{color:"gray",children:"─".repeat(60)})]})},T=function(){return(0,g.jsxs)(o.Box,{marginTop:1,flexDirection:"column",children:[(0,g.jsx)(o.Text,{color:"gray",children:"─".repeat(60)}),(0,g.jsxs)(o.Text,{color:"gray",children:["Press ",(0,g.jsx)(o.Text,{color:"cyan",children:"q"})," to quit, ",(0,g.jsx)(o.Text,{color:"cyan",children:"Esc"})," to go back"]})]})},_=function(e){var l=e.text;return(0,g.jsxs)(o.Box,{children:[(0,g.jsx)(o.Text,{color:"green",children:(0,g.jsx)(f.A,{type:"dots"})}),(0,g.jsxs)(o.Text,{children:[" ",l||"Loading..."]})]})},p=function(e){var l=e.lastAliveTime;if(!l)return(0,g.jsx)(o.Text,{color:"gray",children:"○ Unknown"});var n=Date.now()-new Date(l).getTime();if(n<=h)return(0,g.jsx)(o.Text,{color:"green",children:"● Online"});var r=Math.floor(n/6e4);if(r<60)return(0,g.jsxs)(o.Text,{color:"yellow",children:["○ Offline (",r,"m ago)"]});var t=Math.floor(r/60);if(t<24)return(0,g.jsxs)(o.Text,{color:"red",children:["○ Offline (",t,"h ago)"]});var i=Math.floor(t/24);return(0,g.jsxs)(o.Text,{color:"red",children:["○ Offline (",i,"d ago)"]})},b=n(147),y=n(6787),D=function(e){var l=e.onSelect,n=e.mediaEnabled,r=[{label:"Devices",value:u.DEVICES},{label:"Applications",value:u.APPS},{label:"Modules",value:u.MODULES},{label:"Device Groups",value:u.GROUPS}].concat(b(n?[{label:"Media Flow",value:u.MEDIA_BOXES}]:[]),[{label:"Exit",value:"exit"}]);return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Text,{bold:!0,marginBottom:1,children:"Main Menu"}),(0,g.jsx)(y.Ay,{items:r,onSelect:l})]})},S=function(e){var l=e.devices,n=e.loading,r=e.onSelect,t=e.countdown,i=e.lastRefreshTime;if(n)return(0,g.jsx)(_,{text:"Loading devices..."});if(null==l||!l.length)return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Text,{color:"yellow",children:"No devices found"}),(0,g.jsx)(v,{countdown:t,lastRefreshTime:i})]});var c=[].concat(b(l.map((function(e){var l;return{label:`${function(e){if(!e)return"○ Unknown";var l=Date.now()-new Date(e).getTime();if(l<=h)return"● Online";var n=Math.floor(l/6e4);if(n<60)return`○ ${n}m ago`;var r=Math.floor(n/60);return r<24?`○ ${r}h ago`:`○ ${Math.floor(r/24)}d ago`}(null==(l=e.entry_detail)||null==(l=l.watch_dog_timer)?void 0:l.last_alive_time)} - ${e.name||e.device_name}`,value:e._id,device:e}}))),[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}]);return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Box,{marginBottom:1,children:[(0,g.jsxs)(o.Text,{bold:!0,children:["Devices (",l.length,")"]}),(0,g.jsx)(o.Text,{color:"gray",children:" - "}),(0,g.jsx)(v,{countdown:t,lastRefreshTime:i})]}),(0,g.jsx)(y.Ay,{items:c,onSelect:r})]})},E=function(e){var l,n,r,t,i,c=e.device,a=e.loading,s=e.error,d=e.onSelect,u=e.mediaEnabled,x=e.countdown,h=e.lastRefreshTime;if(a)return(0,g.jsx)(_,{text:"Loading device..."});if(s)return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"red",children:["Error: ",s]}),(0,g.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:d})]});if(!c)return(0,g.jsx)(o.Text,{color:"red",children:"Device not found"});var f=[{label:"Control Device",value:"control"}].concat(b(u?[{label:"View Screenshot",value:"screenshot"}]:[]),[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}]),m=c.entry_detail,j=null==m?void 0:m.screen,T=null==m?void 0:m.update,D=null==m?void 0:m.local_sync;return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Box,{children:[(0,g.jsx)(o.Text,{bold:!0,color:"cyan",children:c.name||c.device_name}),(0,g.jsx)(o.Text,{color:"gray",children:" - "}),(0,g.jsx)(v,{countdown:x,lastRefreshTime:h})]}),c.description&&(0,g.jsx)(o.Text,{color:"gray",children:c.description}),(0,g.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,g.jsxs)(o.Box,{children:[(0,g.jsx)(o.Text,{color:"gray",children:"Status: "}),(0,g.jsx)(p,{lastAliveTime:null==m||null==(l=m.watch_dog_timer)?void 0:l.last_alive_time})]}),(0,g.jsxs)(o.Text,{color:"gray",children:["ID: ",c._id]}),(null==(n=c.tags)?void 0:n.length)>0&&(0,g.jsxs)(o.Text,{color:"gray",children:["Tags: ",c.tags.join(", ")]}),(null==m?void 0:m.application)&&(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Application"}),(0,g.jsxs)(o.Text,{color:"gray",children:[" Name: ",m.application.name]}),(0,g.jsxs)(o.Text,{color:"gray",children:[" Mode: ",m.operation_mode||"N/A"]})]}),j&&(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Screen"}),j.resolution&&(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Resolution: ",j.resolution.width,"x",j.resolution.height,j.resolution.scale&&` @${j.resolution.scale}x`]}),j.orientation&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Orientation: ",j.orientation]}),j.touch&&(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Touch:"," ",j.touch.available?`Yes (${j.touch.touch_point} points)`:"No"]})]}),((null==m?void 0:m.memory_usage)||(null==m?void 0:m.disk_usage))&&(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"System"}),m.memory_usage&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Memory: ",Math.round(100*m.memory_usage),"%"]}),m.disk_usage&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Disk: ",Math.round(100*m.disk_usage),"%"]})]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Capabilities"}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Sound: ",null!=m&&null!=(r=m.sound)&&r.available?"✓":"✗"," | ","Camera: ",null!=m&&null!=(t=m.camera)&&t.available?"✓":"✗"," | ","Audio In: ",null!=m&&null!=(i=m.audio_in)&&i.available?"✓":"✗"]})]}),D&&(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Local Sync"}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Role: ",D.is_main?"Main":"Peer",D.peer_count>0&&` | Peers: ${D.peer_count}`,D.mean_latency&&` | Latency: ${D.mean_latency}ms`]})]}),T&&(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Update"}),(0,g.jsxs)(o.Text,{color:T.need_update?"yellow":"gray",children:[" ","Status: ",T.need_update?"⚠ Update available":"✓ Up to date"]}),T.current_version&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Version: ",T.current_version]})]})]}),(0,g.jsx)(y.Ay,{items:f,onSelect:d})]})},A=function(e){var l=e.device,n=e.onSelect,r=e.controlling,t=e.controlResult;return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{bold:!0,color:"cyan",children:["Control: ",(null==l?void 0:l.name)||(null==l?void 0:l.device_name)]}),r&&(0,g.jsx)(_,{text:"Sending command..."}),t&&(0,g.jsx)(o.Text,{color:t.success?"green":"red",children:t.message}),(0,g.jsx)(o.Box,{marginTop:1,children:(0,g.jsx)(y.Ay,{items:x,onSelect:n})})]})},B=function(e){var l,n,r=e.device,i=e.screenshot,c=e.loading,a=e.error,s=e.onSelect,d=null==i||null==(l=i.file)?void 0:l.meta,u=null!=(null==d?void 0:d.originalWidth)&&null!=(null==d?void 0:d.originalHeight),x=null!=(null==d?void 0:d.originalFileSize);return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{bold:!0,color:"cyan",children:["Screenshot: ",(null==r?void 0:r.name)||(null==r?void 0:r.device_name)||"Unknown"]}),c&&(0,g.jsx)(_,{text:"Loading screenshot..."}),a&&(0,g.jsx)(o.Box,{marginY:1,children:(0,g.jsx)(o.Text,{color:"red",children:String(a)})}),!c&&!a&&i&&(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Box,{height:30,children:(0,g.jsx)(t.default,{src:i.path,width:80,alt:"Device screenshot"})}),(0,g.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Screenshot Details"}),(0,g.jsxs)(o.Box,{marginY:1,children:[(0,g.jsx)(o.Text,{color:"green",children:"Screenshot saved to: "}),(0,g.jsx)(o.Text,{color:"cyan",children:String(i.path||"")})]}),u&&(0,g.jsxs)(o.Text,{color:"gray",children:["Size: ",String(d.originalWidth),"x",String(d.originalHeight)]}),x&&(0,g.jsxs)(o.Text,{color:"gray",children:["File: ",(Number(d.originalFileSize)/1024).toFixed(1)," KB"]}),(null==(n=i.file)?void 0:n.updatedAt)&&(0,g.jsxs)(o.Text,{color:"gray",children:["Updated: ",new Date(i.file.updatedAt).toLocaleString()]})]})]}),!c&&!a&&!i&&(0,g.jsx)(o.Box,{marginY:1,children:(0,g.jsx)(o.Text,{color:"yellow",children:"No screenshot available. Try taking a new one."})}),(0,g.jsx)(o.Box,{marginTop:1,children:(0,g.jsx)(y.Ay,{items:[{label:"Take New Screenshot",value:"take"},{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:s})})]})},I=function(e){var l=e.apps,n=e.loading,r=e.onSelect;if(n)return(0,g.jsx)(_,{text:"Loading applications..."});if(null==l||!l.length)return(0,g.jsx)(o.Text,{color:"yellow",children:"No applications found"});var t=[].concat(b(l.map((function(e){return{label:`${e.has_unreleased_changes?"●":"○"} ${e.name}`,value:e._id,app:e}}))),[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}]);return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{bold:!0,marginBottom:1,children:["Applications (",l.length,")"]}),(0,g.jsx)(y.Ay,{items:t,onSelect:r})]})},k=function(e){var l,n,r,t,i,c,a,s,d,u=e.app,x=e.loading,h=e.error,f=e.onSelect;if(x)return(0,g.jsx)(_,{text:"Loading application..."});if(h)return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"red",children:["Error: ",h]}),(0,g.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:f})]});if(!u)return(0,g.jsx)(o.Text,{color:"red",children:"Application not found"});var m=(null==(l=u.short_edit)?void 0:l.enabled)&&u.short_edit.ref_map,v=[].concat(b(m?[{label:"Short Edit",value:"short_edit"}]:[]),[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}]),j=(null==(n=u.devices)?void 0:n.length)||0,T=(null==(r=u.devices)||null==(r=r.filter((function(e){return"online"===e.status})))?void 0:r.length)||0;return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Text,{bold:!0,color:"cyan",children:u.name}),u.description&&(0,g.jsx)(o.Text,{color:"gray",children:u.description}),(0,g.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"gray",children:["ID: ",u._id]}),(null==(t=u.tags)?void 0:t.length)>0&&(0,g.jsxs)(o.Text,{color:"gray",children:["Tags: ",u.tags.join(", ")]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Version"}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Current: ",u.current_version?`v${u.current_version}`:"N/A"]}),(0,g.jsxs)(o.Text,{color:u.has_unreleased_changes?"yellow":"gray",children:[" ","Changes:"," ",u.has_unreleased_changes?"● Unreleased changes":"○ No pending changes"]}),u.current_version_details&&(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Released: v",u.current_version_details.version||"N/A"]})]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Devices"}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Total: ",j,j>0&&` (${T} online)`]})]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Features"}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Short Edit: ",null!=(i=u.short_edit)&&i.enabled?"✓ Enabled":"✗ Disabled"]}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Canvas Control: ",null!=(c=u.canvas_control)&&c.enabled?"✓ Enabled":"✗ Disabled"]}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Device Control: ",null!=(a=u.device_control)&&a.enabled?"✓ Enabled":"✗ Disabled"]}),(0,g.jsxs)(o.Text,{color:null!=(s=u.lock)&&s.enabled?"yellow":"gray",children:[" ","Lock: ",null!=(d=u.lock)&&d.enabled?"🔒 Locked":"🔓 Unlocked"]})]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Timestamps"}),u.create_datetime&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Created: ",new Date(u.create_datetime).toLocaleString()]}),u.last_modify_datetime&&(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Modified: ",new Date(u.last_modify_datetime).toLocaleString()]})]})]}),(0,g.jsx)(y.Ay,{items:v,onSelect:f})]})},w=function(e){var l=e.modules,n=e.loading,r=e.onSelect;if(n)return(0,g.jsx)(_,{text:"Loading modules..."});var t=(l||[]).map((function(e){return{label:`${e.current_version?"●":"○"} ${e.name}`,value:e._id,module:e}})),i=[].concat(b(t),[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}]);return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{bold:!0,marginBottom:1,children:["Modules (",(null==l?void 0:l.length)||0,")"]}),!(null!=l&&l.length)&&(0,g.jsx)(o.Text,{color:"yellow",children:"No modules found"}),(0,g.jsx)(y.Ay,{items:i,onSelect:r})]})},L=function(e){var l,n,r,t,i,c=e.module,a=e.loading,s=e.error,d=e.onSelect;if(a)return(0,g.jsx)(_,{text:"Loading module..."});if(s)return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"red",children:["Error: ",s]}),(0,g.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:d})]});if(!c)return(0,g.jsx)(o.Text,{color:"red",children:"Module not found"});var u=(null==(l=c.short_edit)?void 0:l.enabled)&&c.short_edit.ref_map,x=[].concat(b(u?[{label:"Short Edit",value:"short_edit"}]:[]),[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}]);return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Text,{bold:!0,color:"cyan",children:c.name}),c.description&&(0,g.jsx)(o.Text,{color:"gray",children:c.description}),(0,g.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"gray",children:["ID: ",c._id]}),(null==(n=c.tags)?void 0:n.length)>0&&(0,g.jsxs)(o.Text,{color:"gray",children:["Tags: ",c.tags.join(", ")]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Version"}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Current: ",c.current_version?`v${c.current_version}`:"N/A"]}),(0,g.jsxs)(o.Text,{color:c.has_unreleased_changes?"yellow":"gray",children:[" ","Changes:"," ",c.has_unreleased_changes?"● Unreleased changes":"○ No pending changes"]})]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Usage"}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Used in: ",(null==(r=c.use_count)?void 0:r.total_count)||0," application(s)"]})]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Settings"}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Public: ",c.is_public?"✓ Yes":"✗ No"]}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Modifiable: ",c.is_allow_modify?"✓ Yes":"✗ No"]}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Short Edit: ",null!=(t=c.short_edit)&&t.enabled?"✓ Enabled":"✗ Disabled"]})]}),(null==(i=c.expose_properties)?void 0:i.length)>0&&(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Exposed Properties"}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ",c.expose_properties.length," properties exposed"]})]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Timestamps"}),c.create_datetime&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Created: ",new Date(c.create_datetime).toLocaleString()]}),c.last_modify_datetime&&(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Modified: ",new Date(c.last_modify_datetime).toLocaleString()]})]})]}),(0,g.jsx)(y.Ay,{items:x,onSelect:d})]})},C=function(e){var l=e.groups,n=e.loading,r=e.onSelect,t=e.countdown,i=e.lastRefreshTime;if(n)return(0,g.jsx)(_,{text:"Loading device groups..."});var c=(l||[]).map((function(e){var l;return{label:`📁 ${e.name} (${(null==(l=e.devices)?void 0:l.length)||0} devices)`,value:e._id,group:e}})),a=[].concat(b(c),[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}]);return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Box,{marginBottom:1,children:[(0,g.jsxs)(o.Text,{bold:!0,children:["Device Groups (",(null==l?void 0:l.length)||0,")"]}),(0,g.jsx)(o.Text,{color:"gray",children:" - "}),(0,g.jsx)(v,{countdown:t,lastRefreshTime:i})]}),!(null!=l&&l.length)&&(0,g.jsx)(o.Text,{color:"yellow",children:"No device groups found"}),(0,g.jsx)(y.Ay,{items:a,onSelect:r})]})},M=function(e){var l=e.loading,n=e.groupDevices;return l?(0,g.jsx)(_,{text:"Loading devices..."}):null!=n&&n.length?(0,g.jsxs)(g.Fragment,{children:[n.slice(0,10).map((function(e){var l;return(0,g.jsxs)(o.Box,{children:[(0,g.jsx)(o.Text,{color:"gray",children:" "}),(0,g.jsx)(p,{lastAliveTime:null==(l=e.entry_detail)||null==(l=l.watch_dog_timer)?void 0:l.last_alive_time}),(0,g.jsxs)(o.Text,{color:"gray",children:[" ",e.name||e.device_name]}),e.device_target_name&&(0,g.jsxs)(o.Text,{color:"gray",dimColor:!0,children:[" ","(",e.device_target_name,")"]})]},e._id)})),n.length>10&&(0,g.jsxs)(o.Text,{color:"gray",dimColor:!0,children:[" ","... and ",n.length-10," more"]})]}):(0,g.jsx)(o.Text,{color:"gray",children:" No devices in this group"})},R=function(e){var l,n,r=e.group,t=e.groupDevices,i=e.loading,c=e.error,a=e.onSelect,s=e.countdown,d=e.lastRefreshTime;if(i&&!r)return(0,g.jsx)(_,{text:"Loading device group..."});if(c)return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"red",children:["Error: ",c]}),(0,g.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:a})]});if(!r)return(0,g.jsx)(o.Text,{color:"red",children:"Device group not found"});return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Box,{children:[(0,g.jsx)(o.Text,{bold:!0,color:"cyan",children:r.name}),(0,g.jsx)(o.Text,{color:"gray",children:" - "}),(0,g.jsx)(v,{countdown:s,lastRefreshTime:d})]}),r.description&&(0,g.jsx)(o.Text,{color:"gray",children:r.description}),(0,g.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"gray",children:["ID: ",r._id]}),(null==(l=r.tags)?void 0:l.length)>0&&(0,g.jsxs)(o.Text,{color:"gray",children:["Tags: ",r.tags.join(", ")]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsxs)(o.Text,{bold:!0,color:"white",children:["Devices (",(null==(n=r.devices)?void 0:n.length)||0,")"]}),(0,g.jsx)(M,{loading:i,groupDevices:t})]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Timestamps"}),r.create_datetime&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Created: ",new Date(r.create_datetime).toLocaleString()]}),r.last_modify_datetime&&(0,g.jsxs)(o.Text,{color:"gray",children:[" ","Modified: ",new Date(r.last_modify_datetime).toLocaleString()]})]})]}),(0,g.jsx)(y.Ay,{items:[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:a})]})},O=function(e){var l=e.boxes,n=e.loading,r=e.onSelect;if(n)return(0,g.jsx)(_,{text:"Loading media boxes..."});if(null==l||!l.length)return(0,g.jsx)(o.Text,{color:"yellow",children:"No media boxes found"});var t=[].concat(b(l.map((function(e){return{label:`📦 ${e.name||"Unnamed"}`,value:e.id,box:e}}))),[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}]);return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{bold:!0,marginBottom:1,children:["Media Boxes (",l.length,")"]}),(0,g.jsx)(y.Ay,{items:t,onSelect:r})]})},P=function(e){var l,n,r=e.box,t=e.loading,i=e.error,c=e.onSelect;if(t&&!r)return(0,g.jsx)(_,{text:"Loading media box..."});if(i)return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"red",children:["Error: ",i]}),(0,g.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:c})]});if(!r)return(0,g.jsx)(o.Text,{color:"red",children:"Media box not found"});return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Text,{bold:!0,color:"cyan",children:r.name||"Unnamed"}),r.description&&(0,g.jsx)(o.Text,{color:"gray",children:r.description}),(0,g.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"gray",children:["ID: ",r.id]}),(null==(l=r.tags)?void 0:l.length)>0&&(0,g.jsxs)(o.Text,{color:"gray",children:["Tags: ",r.tags.join(", ")]}),null!=r.size&&(0,g.jsxs)(o.Text,{color:"gray",children:["Size: ",r.size]}),(null==(n=r.passcodes)?void 0:n.length)>0&&(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsxs)(o.Text,{bold:!0,color:"white",children:["Passcodes (",r.passcodes.length,")"]}),r.passcodes.slice(0,5).map((function(e){return(0,g.jsxs)(o.Text,{color:"gray",children:[" ",e.name||"Passcode",": ",e.code]},e.id)})),r.passcodes.length>5&&(0,g.jsxs)(o.Text,{color:"gray",dimColor:!0,children:[" ","... and ",r.passcodes.length-5," more"]})]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Timestamps"}),r.createdAt&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Created: ",new Date(r.createdAt).toLocaleString()]}),r.updatedAt&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Modified: ",new Date(r.updatedAt).toLocaleString()]})]})]}),(0,g.jsx)(y.Ay,{items:[{label:"List Files",value:"files"},{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:c})]})},N=function(e){var l=e.files,n=e.loading,r=e.onSelect,t=e.box;if(n)return(0,g.jsx)(_,{text:"Loading media files..."});if(null==l||!l.length)return(0,g.jsx)(o.Text,{color:"yellow",children:"No media files found"});var i=[].concat(b(l.map((function(e){return{label:`${l=e.fileType,"Image"===l?"🖼":"Video"===l?"🎞":"Audio"===l?"🎵":"📄"} ${e.name||"Unnamed"}`,value:e.id,file:e};var l}))),[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}]);return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{bold:!0,marginBottom:1,children:["Media Files (",l.length,")",null!=t&&t.name?` - ${t.name}`:""]}),(0,g.jsx)(y.Ay,{items:i,onSelect:r})]})},U=function(e){var l,n=e.file,r=e.loading,t=e.error,i=e.onSelect;if(r&&!n)return(0,g.jsx)(_,{text:"Loading media file..."});if(t)return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"red",children:["Error: ",t]}),(0,g.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]});if(!n)return(0,g.jsx)(o.Text,{color:"red",children:"Media file not found"});var c=n.meta,a=(0,d.Gu)(n),s=(0,d.Gu)(n,{preferThumbnail:!0}),u=Boolean(s&&s!==a);return(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Text,{bold:!0,color:"cyan",children:n.name||"Unnamed"}),n.description&&(0,g.jsx)(o.Text,{color:"gray",children:n.description}),(0,g.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"gray",children:["ID: ",n.id]}),(0,g.jsxs)(o.Text,{color:"gray",children:["Box ID: ",n.boxId]}),(0,g.jsxs)(o.Text,{color:"gray",children:["Type: ",n.fileType]}),(null==(l=n.userTags)?void 0:l.length)>0&&(0,g.jsxs)(o.Text,{color:"gray",children:["Tags: ",n.userTags.join(", ")]}),null!=(null==c?void 0:c.originalWidth)&&null!=(null==c?void 0:c.originalHeight)&&(0,g.jsxs)(o.Text,{color:"gray",children:["Size: ",c.originalWidth,"x",c.originalHeight]}),null!=(null==c?void 0:c.originalFileSize)&&(0,g.jsxs)(o.Text,{color:"gray",children:["File: ",(Number(c.originalFileSize)/1024).toFixed(1)," KB"]}),a&&(0,g.jsxs)(o.Text,{color:"gray",children:["Original URL: ",a]}),u&&(0,g.jsxs)(o.Text,{color:"gray",children:["Thumbnail URL: ",s]}),(0,g.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,g.jsx)(o.Text,{bold:!0,color:"white",children:"Timestamps"}),n.createdAt&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Created: ",new Date(n.createdAt).toLocaleString()]}),n.updatedAt&&(0,g.jsxs)(o.Text,{color:"gray",children:[" Modified: ",new Date(n.updatedAt).toLocaleString()]})]})]}),(0,g.jsx)(y.Ay,{items:[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:i})]})},V=n(9253),F=n(4595),$=["B","C","G","D"],G=function(e){var l,n,t=e.instanceType,a=e.instance,s=e.client,d=e.onDone,u=e.onCancel,x=(0,o.useApp)().exit,h=(0,r.useState)("select_ref"),f=c(h,2),m=f[0],v=f[1],j=(0,r.useState)(""),T=c(j,2),p=T[0],D=T[1],S=(0,r.useState)("search"),E=c(S,2),A=E[0],B=E[1],I=(0,r.useState)(null),k=c(I,2),w=k[0],L=k[1],C=(0,r.useState)(null),M=c(C,2),R=M[0],O=M[1],P=(0,r.useState)(""),N=c(P,2),U=N[0],G=N[1],H=(0,r.useState)(""),X=c(H,2),Y=X[0],z=X[1],W=(0,r.useState)(null),q=c(W,2),K=q[0],J=q[1],Q=(null==a||null==(l=a.short_edit)?void 0:l.ref_map)||{},Z=Object.entries(Q).filter((function(e){var l=c(e,2)[1];return l&&!l.hide})),ee=(0,F.V)(Q,{keyword:p,types:$}),le=ee.flatMap((function(e){return[{label:e.label,value:`__header_${e.prefix}__`,isHeader:!0}].concat(b(e.refs.map((function(e){var l=e.shortId,n=e.ref;return{label:`${n.title||l} (${l})`,value:l,ref:n}}))))})),ne=[].concat(b(p?[{label:"↻ Clear Search",value:"__clear_search__"}]:[]),[{label:"← Back",value:"__back__"}]),re=le.length>0?[].concat(b(le),b(ne)):ne,oe=re.findIndex((function(e){var l;return!(e.isHeader||null!=(l=e.value)&&l.startsWith("__"))}));(0,o.useInput)((function(e,l){l.tab&&"select_ref"===m?B((function(e){return"search"===e?"list":"search"})):(l.escape&&("select_ref"===m&&u(),"input_path"===m&&v("select_ref"),"input_content"===m&&v("input_path"),"confirm"===m&&v("input_content"),"done"===m&&u()),"q"!==e||("input_path"===m||"input_content"===m)||"select_ref"===m&&"search"===A||x())}),{isActive:!0});var te,ie=function(e){var l=e.trim();if(""===l)return null;try{return JSON.parse(l)}catch(e){return l}},ce=(te=i((function*(){if(s&&null!=a&&a._id&&w){v("submitting"),J(null);try{var e,l={shortId:w,path:U.trim(),content:ie(Y),forwardDataLink:!0};null!=R&&null!=(e=R.inner_ref)&&e.pid&&(l.innerRefParentShortId=R.inner_ref.pid),"application"===t?yield s.shortEditApplication({id:a._id,list:[l]}):yield s.shortEditModule({id:a._id,list:[l]}),yield d(),v("done")}catch(e){J(e.message),v("confirm")}}})),function(){return te.apply(this,arguments)});return null!=a&&null!=(n=a.short_edit)&&n.enabled?0===Z.length?(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Text,{color:"yellow",children:"No Short Edit references found."}),(0,g.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:u})]}):"select_ref"===m?(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Text,{bold:!0,children:"Short Edit References"}),(0,g.jsx)(o.Text,{color:"gray",dimColor:!0,children:"Showing: Brick, Canvas, Generator, Data"}),(0,g.jsxs)(o.Box,{marginTop:1,flexDirection:"column",children:[(0,g.jsx)(o.Text,{color:"gray",children:"Search (title or shortId)"}),(0,g.jsx)(V.A,{value:p,placeholder:"type to filter, Enter to focus list",onChange:function(e){return D(e)},onSubmit:function(){return B("list")},focus:"search"===A}),(0,g.jsx)(o.Text,{color:"gray",dimColor:!0,children:"Press Tab to switch focus"})]}),(0,g.jsxs)(o.Box,{marginTop:1,children:[0===ee.length&&(0,g.jsx)(o.Text,{color:"yellow",children:"No references match your search."}),(0,g.jsx)(y.Ay,{items:re,isFocused:"list"===A,initialIndex:oe>-1?oe:0,indicatorComponent:function(){return null},itemComponent:function(e){var l=e.label,n=e.isSelected;return e.isHeader?(0,g.jsx)(o.Box,{marginTop:1,children:(0,g.jsx)(o.Text,{bold:!0,color:"white",children:l})}):(0,g.jsxs)(o.Text,{color:n?"blue":void 0,children:[n?"❯":" "," ",l]})},onSelect:function(e){if("__back__"!==e.value)return"__clear_search__"===e.value?(D(""),void B("search")):void(e.isHeader||(L(e.value),O(e.ref),v("input_path")));u()}})]})]}):"input_path"===m?(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{children:["Reference:"," ",(0,g.jsxs)(o.Text,{color:"cyan",children:[(null==R?void 0:R.title)||w," (",w,")"]})]}),(0,g.jsx)(o.Text,{marginTop:1,children:"Enter property path (e.g. title, property.backgroundColor)"}),K&&(0,g.jsxs)(o.Text,{color:"red",children:["Error: ",K]}),(0,g.jsx)(V.A,{value:U,placeholder:"path",onChange:function(e){G(e),K&&J(null)},onSubmit:function(e){var l=e.trim();l?(G(l),v("input_content")):J("Path is required")},focus:!0})]}):"input_content"===m?(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{children:["Path: ",(0,g.jsx)(o.Text,{color:"cyan",children:U})]}),(0,g.jsx)(o.Text,{marginTop:1,children:"Enter new content (JSON or plain text). Empty to clear."}),K&&(0,g.jsxs)(o.Text,{color:"red",children:["Error: ",K]}),(0,g.jsx)(V.A,{value:Y,placeholder:"content",onChange:function(e){z(e),K&&J(null)},onSubmit:function(){return v("confirm")},focus:!0})]}):"submitting"===m?(0,g.jsx)(_,{text:"Applying short edit..."}):"done"===m?(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Text,{color:"green",children:"Short edit applied successfully."}),(0,g.jsx)(y.Ay,{items:[{label:"Edit another property",value:"again"},{label:"← Back",value:"back"}],onSelect:function(e){"again"===e.value?(v("select_ref"),L(null),O(null),G(""),z(""),J(null)):u()}})]}):(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(o.Text,{bold:!0,marginBottom:1,children:"Confirm Short Edit"}),(0,g.jsxs)(o.Text,{children:["Reference:"," ",(0,g.jsxs)(o.Text,{color:"cyan",children:[(null==R?void 0:R.title)||w," (",w,")"]})]}),(0,g.jsxs)(o.Text,{children:["Path: ",(0,g.jsx)(o.Text,{color:"cyan",children:U})]}),(0,g.jsxs)(o.Text,{children:["Content: ",(0,g.jsx)(o.Text,{color:"cyan",children:Y||"<empty>"})]}),K&&(0,g.jsxs)(o.Text,{color:"red",children:["Error: ",K]}),(0,g.jsx)(y.Ay,{items:[{label:"Apply",value:"apply"},{label:"Edit Path",value:"edit_path"},{label:"Edit Content",value:"edit_content"},{label:"← Back",value:"back"}],onSelect:function(e){"apply"===e.value&&ce(),"edit_path"===e.value&&v("input_path"),"edit_content"===e.value&&v("input_content"),"back"===e.value&&u()}})]}):(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsxs)(o.Text,{color:"yellow",children:["Short Edit is not enabled for this ",t,"."]}),(0,g.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:u})]})};const H=function(){var e=(0,o.useApp)().exit,l=(0,r.useState)(u.MAIN),n=c(l,2),t=n[0],x=n[1],h=(0,r.useState)(null),f=c(h,2),v=f[0],p=f[1],b=(0,r.useState)(null),y=c(b,2),M=y[0],V=y[1],F=(0,r.useState)(!0),$=c(F,2),H=$[0],X=$[1],Y=(0,r.useState)(null),z=c(Y,2),W=z[0],q=z[1],K=(0,r.useState)([]),J=c(K,2),Q=J[0],Z=J[1],ee=(0,r.useState)(null),le=c(ee,2),ne=le[0],re=le[1],oe=(0,r.useState)([]),te=c(oe,2),ie=te[0],ce=te[1],ae=(0,r.useState)(null),se=c(ae,2),de=se[0],ue=se[1],xe=(0,r.useState)([]),he=c(xe,2),fe=he[0],ge=he[1],me=(0,r.useState)(null),ve=c(me,2),je=ve[0],Te=ve[1],_e=(0,r.useState)([]),pe=c(_e,2),be=pe[0],ye=pe[1],De=(0,r.useState)(null),Se=c(De,2),Ee=Se[0],Ae=Se[1],Be=(0,r.useState)([]),Ie=c(Be,2),ke=Ie[0],we=Ie[1],Le=(0,r.useState)(!1),Ce=c(Le,2),Me=Ce[0],Re=Ce[1],Oe=(0,r.useState)(null),Pe=c(Oe,2),Ne=Pe[0],Ue=Pe[1],Ve=(0,r.useState)(null),Fe=c(Ve,2),$e=Fe[0],Ge=Fe[1],He=(0,r.useState)(null),Xe=c(He,2),Ye=Xe[0],ze=Xe[1],We=(0,r.useState)(null),qe=c(We,2),Ke=qe[0],Je=qe[1],Qe=(0,r.useState)([]),Ze=c(Qe,2),el=Ze[0],ll=Ze[1],nl=(0,r.useState)(null),rl=c(nl,2),ol=rl[0],tl=rl[1],il=(0,r.useState)([]),cl=c(il,2),al=cl[0],sl=cl[1],dl=(0,r.useState)(null),ul=c(dl,2),xl=ul[0],hl=ul[1],fl=t===u.DEVICES,gl=t===u.DEVICE_DETAIL,ml=t===u.GROUPS,vl=t===u.GROUP_DETAIL;(0,r.useEffect)((function(){var e=(0,s.getCurrentProfile)(),l=(0,s.getToken)(e);if(!l)return q("Not logged in. Run `bricks auth login` first."),void X(!1);var n=(0,a.createClient)((0,s.getBaseUrl)(),l);p(n),n.workspace().then((function(e){V(e),X(!1)})).catch((function(e){q(e.message),X(!1)}))}),[]),(0,o.useInput)((function(l,n){"q"===l&&e(),n.escape&&(t===u.DEVICE_CONTROL?(x(u.DEVICE_DETAIL),Ue(null)):t===u.DEVICE_SCREENSHOT?(x(u.DEVICE_DETAIL),ze(null),Je(null)):t===u.DEVICE_DETAIL?(x(u.DEVICES),re(null)):t===u.APP_DETAIL?(x(u.APPS),ue(null)):t===u.MODULE_DETAIL?(x(u.MODULES),Te(null)):t===u.GROUP_DETAIL?(x(u.GROUPS),Ae(null),we([])):t===u.MEDIA_FILE_DETAIL?(x(u.MEDIA_FILES),hl(null)):t===u.MEDIA_FILES?(x(u.MEDIA_BOX_DETAIL),hl(null)):t===u.MEDIA_BOX_DETAIL?(x(u.MEDIA_BOXES),tl(null),sl([])):(t===u.MEDIA_BOXES||t!==u.MAIN)&&x(u.MAIN))}),{isActive:t!==u.APP_SHORT_EDIT&&t!==u.MODULE_SHORT_EDIT});var jl,Tl,_l,pl,bl,yl,Dl,Sl,El=(0,r.useCallback)(i((function*(){if(v){X(!0);try{var e=yield v.devices({});Z(e||[])}catch(e){q(e.message)}X(!1)}})),[v]),Al=(0,r.useCallback)((jl=i((function*(e){if(v){X(!0),Ge(null);try{var l=yield v.device({id:e});re(l)}catch(e){Ge(e.message)}X(!1)}})),function(e){return jl.apply(this,arguments)}),[v]),Bl=(0,r.useCallback)(i((function*(){if(v){X(!0);try{var e=yield v.applications({});ce(e||[])}catch(e){q(e.message)}X(!1)}})),[v]),Il=(0,r.useCallback)((Tl=i((function*(e){if(v){X(!0),Ge(null);try{var l=yield v.application({id:e});ue(l)}catch(e){Ge(e.message)}X(!1)}})),function(e){return Tl.apply(this,arguments)}),[v]),kl=(0,r.useCallback)(i((function*(){if(v){X(!0);try{var e=yield v.modules({});ge(e||[])}catch(e){q(e.message)}X(!1)}})),[v]),wl=(0,r.useCallback)((_l=i((function*(e){if(v){X(!0),Ge(null);try{var l=yield v.module({id:e});Te(l)}catch(e){Ge(e.message)}X(!1)}})),function(e){return _l.apply(this,arguments)}),[v]),Ll=(0,r.useCallback)(i((function*(){if(v){X(!0);try{var e=yield v.deviceGroups({});ye(e||[])}catch(e){q(e.message)}X(!1)}})),[v]),Cl=(0,r.useCallback)((pl=i((function*(e){if(v){X(!0),Ge(null);try{var l=yield Promise.all([v.deviceGroup({id:e}),v.devicesByGroup({id:e})]),n=c(l,2),r=n[0],o=n[1];Ae(r),we(o||[])}catch(e){Ge(e.message)}X(!1)}})),function(e){return pl.apply(this,arguments)}),[v]),Ml=(0,r.useCallback)(i((function*(){if(v){X(!0);try{var e=yield v.mediaBoxes();ll(e||[])}catch(e){q(e.message)}X(!1)}})),[v]),Rl=(0,r.useCallback)((bl=i((function*(e){if(v){X(!0),Ge(null);try{var l=yield v.mediaBox({id:e});tl(l)}catch(e){Ge(e.message)}X(!1)}})),function(e){return bl.apply(this,arguments)}),[v]),Ol=(0,r.useCallback)((yl=i((function*(e){if(v){X(!0);try{var l=yield v.mediaFiles({boxId:e});sl(l||[])}catch(e){q(e.message)}X(!1)}})),function(e){return yl.apply(this,arguments)}),[v]),Pl=(0,r.useCallback)((Dl=i((function*(e){if(v){X(!0),Ge(null);try{var l=yield v.mediaFile({id:e});hl(l)}catch(e){Ge(e.message)}X(!1)}})),function(e){return Dl.apply(this,arguments)}),[v]),Nl=(0,r.useCallback)((Sl=i((function*(e){if(v&&ne){Re(!0),Ue(null);try{yield v.controlDevice({id:ne._id,type:e}),Ue({success:!0,message:`Command sent: ${e}`})}catch(e){Ue({success:!1,message:e.message})}Re(!1)}})),function(e){return Sl.apply(this,arguments)}),[v,ne]),Ul=(0,r.useCallback)(i((function*(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(v&&ne&&M){X(!0),Je(null),ze(null);try{e&&(yield v.controlDevice({id:ne._id,type:"take-screenshot"}),yield new Promise((function(e){return setTimeout(e,3e3)})));var l=yield(0,d.he)(v,M,ne._id,null,{preferThumbnail:!0});l.error?Je(l.error):ze(l)}catch(e){Je(e.message)}X(!1)}})),[v,ne,M]),Vl=m((0,r.useCallback)((function(){v&&El()}),[v,El]),fl),Fl=m((0,r.useCallback)((function(){v&&ne&&Al(ne._id)}),[v,ne,Al]),gl),$l=m((0,r.useCallback)((function(){v&&Ll()}),[v,Ll]),ml),Gl=m((0,r.useCallback)((function(){v&&Ee&&Cl(Ee._id)}),[v,Ee,Cl]),vl);return H&&!M?(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(j,{workspace:M,view:t}),(0,g.jsx)(_,{text:"Connecting to workspace..."})]}):W&&!M?(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(j,{workspace:M,view:t}),(0,g.jsxs)(o.Text,{color:"red",children:["Error: ",W]}),(0,g.jsx)(T,{})]}):(0,g.jsxs)(o.Box,{flexDirection:"column",children:[(0,g.jsx)(j,{workspace:M,view:t}),t===u.MAIN&&(0,g.jsx)(D,{onSelect:function(l){"exit"!==l.value?(x(l.value),l.value===u.DEVICES?El():l.value===u.APPS?Bl():l.value===u.MODULES?kl():l.value===u.GROUPS?Ll():l.value===u.MEDIA_BOXES&&Ml()):e()},mediaEnabled:(0,d.wR)(M)}),t===u.DEVICES&&(0,g.jsx)(S,{devices:Q,loading:H,onSelect:function(e){if("back"!==e.value){if("refresh"===e.value)return El(),void Vl.resetCountdown();re(null),X(!0),x(u.DEVICE_DETAIL),Al(e.value)}else x(u.MAIN)},countdown:Vl.countdown,lastRefreshTime:Vl.lastRefreshTime}),t===u.DEVICE_DETAIL&&(0,g.jsx)(E,{device:ne,loading:H,error:$e,onSelect:function(e){return"back"===e.value?(x(u.DEVICES),void re(null)):"refresh"===e.value?(Al(ne._id),void Fl.resetCountdown()):("control"===e.value&&(x(u.DEVICE_CONTROL),Ue(null)),void("screenshot"===e.value&&(x(u.DEVICE_SCREENSHOT),ze(null),Je(null),Ul(!1))))},mediaEnabled:(0,d.wR)(M),countdown:Fl.countdown,lastRefreshTime:Fl.lastRefreshTime}),t===u.DEVICE_CONTROL&&(0,g.jsx)(A,{device:ne,onSelect:function(e){if("back"===e.value)return x(u.DEVICE_DETAIL),void Ue(null);Nl(e.value)},controlling:Me,controlResult:Ne}),t===u.DEVICE_SCREENSHOT&&(0,g.jsx)(B,{device:ne,screenshot:Ye,loading:H,error:Ke,onSelect:function(e){if("back"===e.value)return x(u.DEVICE_DETAIL),ze(null),void Je(null);"refresh"!==e.value?"take"===e.value&&Ul(!0):Ul(!1)}}),t===u.APPS&&(0,g.jsx)(I,{apps:ie,loading:H,onSelect:function(e){"back"!==e.value?"refresh"!==e.value?(ue(null),X(!0),x(u.APP_DETAIL),Il(e.value)):Bl():x(u.MAIN)}}),t===u.APP_DETAIL&&(0,g.jsx)(k,{app:de,loading:H,error:$e,onSelect:function(e){if("back"===e.value)return x(u.APPS),void ue(null);"refresh"!==e.value?"short_edit"===e.value&&(x(u.APP_SHORT_EDIT),Ge(null)):Il(de._id)}}),t===u.APP_SHORT_EDIT&&(0,g.jsx)(G,{instanceType:"application",instance:de,client:v,onDone:i((function*(){return Il(de._id)})),onCancel:function(){return x(u.APP_DETAIL)}}),t===u.MODULES&&(0,g.jsx)(w,{modules:fe,loading:H,onSelect:function(e){"back"!==e.value?"refresh"!==e.value?(Te(null),X(!0),x(u.MODULE_DETAIL),wl(e.value)):kl():x(u.MAIN)}}),t===u.MODULE_DETAIL&&(0,g.jsx)(L,{module:je,loading:H,error:$e,onSelect:function(e){if("back"===e.value)return x(u.MODULES),void Te(null);"refresh"!==e.value?"short_edit"===e.value&&(x(u.MODULE_SHORT_EDIT),Ge(null)):wl(je._id)}}),t===u.MODULE_SHORT_EDIT&&(0,g.jsx)(G,{instanceType:"module",instance:je,client:v,onDone:i((function*(){return wl(je._id)})),onCancel:function(){return x(u.MODULE_DETAIL)}}),t===u.GROUPS&&(0,g.jsx)(C,{groups:be,loading:H,onSelect:function(e){if("back"!==e.value){if("refresh"===e.value)return Ll(),void $l.resetCountdown();Ae(null),we([]),X(!0),x(u.GROUP_DETAIL),Cl(e.value)}else x(u.MAIN)},countdown:$l.countdown,lastRefreshTime:$l.lastRefreshTime}),t===u.GROUP_DETAIL&&(0,g.jsx)(R,{group:Ee,groupDevices:ke,loading:H,error:$e,onSelect:function(e){if("back"===e.value)return x(u.GROUPS),Ae(null),void we([]);"refresh"===e.value&&(Cl(Ee._id),Gl.resetCountdown())},countdown:Gl.countdown,lastRefreshTime:Gl.lastRefreshTime}),t===u.MEDIA_BOXES&&(0,g.jsx)(O,{boxes:el,loading:H,onSelect:function(e){"back"!==e.value?"refresh"!==e.value?(tl(null),sl([]),X(!0),x(u.MEDIA_BOX_DETAIL),Rl(e.value)):Ml():x(u.MAIN)}}),t===u.MEDIA_BOX_DETAIL&&(0,g.jsx)(P,{box:ol,loading:H,error:$e,onSelect:function(e){if("back"===e.value)return x(u.MEDIA_BOXES),tl(null),void sl([]);"refresh"!==e.value?"files"===e.value&&(sl([]),hl(null),x(u.MEDIA_FILES),Ol(ol.id)):Rl(ol.id)}}),t===u.MEDIA_FILES&&(0,g.jsx)(N,{files:al,box:ol,loading:H,onSelect:function(e){if("back"===e.value)return x(u.MEDIA_BOX_DETAIL),void hl(null);"refresh"!==e.value?(hl(null),X(!0),x(u.MEDIA_FILE_DETAIL),Pl(e.value)):Ol(ol.id)}}),t===u.MEDIA_FILE_DETAIL&&(0,g.jsx)(U,{file:xl,loading:H,error:$e,onSelect:function(e){if("back"===e.value)return x(u.MEDIA_FILES),void hl(null);"refresh"===e.value&&Pl(xl.id)}}),(0,g.jsx)(T,{})]})};var X=function(){(0,o.render)((0,g.jsx)(t.TerminalInfoProvider,{children:(0,g.jsx)(H,{})}))}}};