@fugood/bricks-cli 2.25.0-beta.6 → 2.25.0-beta.61

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/lib/917.js ADDED
@@ -0,0 +1 @@
1
+ export const __rspack_esm_id=917;export const __rspack_esm_ids=[917];export const __webpack_modules__={96554(u,e,t){!function(){"use strict";function u(u){return G.Statement.hasOwnProperty(u.type)}i=t(4704),s=t(71562),n=i.Syntax;var n,r,o,i,s,a,D,l,c,p,A,C,F,h,f,E,g,m,B,d,y,v,x,S={"??":(r={Sequence:0,Yield:1,Assignment:1,Conditional:2,ArrowFunction:2,Coalesce:3,LogicalOR:4,LogicalAND:5,BitwiseOR:6,BitwiseXOR:7,BitwiseAND:8,Equality:9,Relational:10,BitwiseSHIFT:11,Additive:12,Multiplicative:13,Exponentiation:14,Await:15,Unary:15,Postfix:16,OptionalChaining:17,Call:18,New:19,TaggedTemplate:20,Member:21,Primary:22}).Coalesce,"||":r.LogicalOR,"&&":r.LogicalAND,"|":r.BitwiseOR,"^":r.BitwiseXOR,"&":r.BitwiseAND,"==":r.Equality,"!=":r.Equality,"===":r.Equality,"!==":r.Equality,is:r.Equality,isnt:r.Equality,"<":r.Relational,">":r.Relational,"<=":r.Relational,">=":r.Relational,in:r.Relational,instanceof:r.Relational,"<<":r.BitwiseSHIFT,">>":r.BitwiseSHIFT,">>>":r.BitwiseSHIFT,"+":r.Additive,"-":r.Additive,"*":r.Multiplicative,"%":r.Multiplicative,"/":r.Multiplicative,"**":r.Exponentiation};function b(){return{indent:null,base:null,parse:null,comment:!1,format:{indent:{style:" ",base:0,adjustMultilineComment:!1},newline:"\n",space:" ",json:!1,renumber:!1,hexadecimal:!1,quotes:"single",escapeless:!1,compact:!1,parentheses:!0,semicolons:!0,safeConcatenation:!1,preserveBlankLines:!1},moz:{comprehensionExpressionStartsWithAssignment:!1,starlessGenerator:!1},sourceMap:null,sourceMapRoot:null,sourceMapWithCode:!1,directive:!1,raw:!0,verbatim:null,sourceCode:null}}function _(u,e){var t="";for(e|=0;e>0;e>>>=1,u+=u)1&e&&(t+=u);return t}function w(u){var e=u.length;return e&&s.code.isLineTerminator(u.charCodeAt(e-1))}function O(u,e){var t;for(t in e)e.hasOwnProperty(t)&&(u[t]=e[t]);return u}function j(u,e){var t,n;function r(u){return"object"==typeof u&&u instanceof Object&&!(u instanceof RegExp)}for(t in e)e.hasOwnProperty(t)&&(r(n=e[t])?r(u[t])?j(u[t],n):u[t]=j({},n):u[t]=n);return u}function L(u,e){return(-2&u)==8232?(e?"u":"\\u")+(8232===u?"2028":"2029"):10===u||13===u?(e?"":"\\")+(10===u?"n":"r"):String.fromCharCode(u)}function P(u,e){if(!y)if(Array.isArray(u))return function u(e){var t,n,r,o="";for(t=0,n=e.length;t<n;++t)o+=Array.isArray(r=e[t])?u(r):r;return o}(u);else return u;if(null==e)if(u instanceof o)return u;else e={};return null==e.loc?new o(null,null,y,u,e.name||null):new o(e.loc.start.line,e.loc.start.column,!0===y?e.loc.source||null:y,u,e.name||null)}function k(){return h||" "}function M(u,e){var t,n,r,o;return 0===(t=P(u).toString()).length?[e]:0===(n=P(e).toString()).length?[u]:(r=t.charCodeAt(t.length-1),o=n.charCodeAt(0),(43===r||45===r)&&r===o||s.code.isIdentifierPartES5(r)&&s.code.isIdentifierPartES5(o)||47===r&&105===o)?[u,k(),e]:s.code.isWhiteSpace(r)||s.code.isLineTerminator(r)||s.code.isWhiteSpace(o)||s.code.isLineTerminator(o)?[u,e]:[u,h,e]}function I(u){return[a,u]}function R(u){var e;e=a,u(a+=D),a=e}function q(u,e){if("Line"===u.type)if(w(u.value))return"//"+u.value;else{var t="//"+u.value;return x||(t+="\n"),t}return B.format.indent.adjustMultilineComment&&/[\n\r]/.test(u.value)?function(u,e){var t,n,r,o,i,D,l,c;for(n=1,t=u.split(/\r\n|[\r\n]/),D=Number.MAX_VALUE,r=t.length;n<r;++n){for(o=t[n],i=0;i<o.length&&s.code.isWhiteSpace(o.charCodeAt(i));)++i;D>i&&(D=i)}for(void 0!==e?(l=a,"*"===t[1][D]&&(e+=" "),a=e):(1&D&&--D,l=a),n=1,r=t.length;n<r;++n)c=P(I(t[n].slice(D))),t[n]=y?c.join(""):c;return a=l,t.join("\n")}("/*"+u.value+"*/",e):"/*"+u.value+"*/"}function T(u,e){var t,r,o,i,l,c,p,A,C,F,h,f;if(u.leadingComments&&u.leadingComments.length>0){if(i=e,x){for(o=u.leadingComments[0],e=[],A=o.extendedRange,C=o.range,(f=((h=v.substring(A[0],C[0])).match(/\n/g)||[]).length)>0?(e.push(_("\n",f)),e.push(I(q(o)))):(e.push(h),e.push(q(o))),F=C,t=1,r=u.leadingComments.length;t<r;t++)C=(o=u.leadingComments[t]).range,f=(v.substring(F[1],C[0]).match(/\n/g)||[]).length,e.push(_("\n",f)),e.push(I(q(o))),F=C;f=(v.substring(C[1],A[1]).match(/\n/g)||[]).length,e.push(_("\n",f))}else for(o=u.leadingComments[0],e=[],g&&u.type===n.Program&&0===u.body.length&&e.push("\n"),e.push(q(o)),w(P(e).toString())||e.push("\n"),t=1,r=u.leadingComments.length;t<r;++t)w(P(p=[q(o=u.leadingComments[t])]).toString())||p.push("\n"),e.push(I(p));e.push(I(i))}if(u.trailingComments)if(x)A=(o=u.trailingComments[0]).extendedRange,C=o.range,(f=((h=v.substring(A[0],C[0])).match(/\n/g)||[]).length)>0?(e.push(_("\n",f)),e.push(I(q(o)))):(e.push(h),e.push(q(o)));else for(t=0,l=!w(P(e).toString()),c=_(" ",function(u){var e;for(e=u.length-1;e>=0&&!s.code.isLineTerminator(u.charCodeAt(e));--e);return u.length-1-e}(P([a,e,D]).toString())),r=u.trailingComments.length;t<r;++t)o=u.trailingComments[t],l?(e=0===t?[e,D]:[e,c]).push(q(o,c)):e=[e,I(q(o))],t===r-1||w(P(e).toString())||(e=[e,"\n"]);return e}function N(u,e,t){var n,r=0;for(n=u;n<e;n++)"\n"===v[n]&&r++;for(n=1;n<r;n++)t.push(F)}function U(u,e,t){return e<t?["(",u,")"]:u}function W(u){var e,t,n;for(e=1,t=(n=u.split(/\r\n|\n/)).length;e<t;e++)n[e]=F+a+n[e];return n}function G(){}function z(u){return P(u.name,u)}function V(u,e){return u.async?"async"+(e?k():h):""}function $(u){return u.generator&&!B.moz.starlessGenerator?"*"+h:""}function K(u){var e=u.value,t="";return e.async&&(t+=V(e,!u.computed)),e.generator&&(t+=$(e)?"*":""),t}G.prototype.maybeBlock=function(u,e){var t,r,o=this;return(r=!B.comment||!u.leadingComments,u.type===n.BlockStatement&&r)?[h,this.generateStatement(u,e)]:u.type===n.EmptyStatement&&r?";":(R(function(){t=[F,I(o.generateStatement(u,e))]}),t)},G.prototype.maybeBlockSuffix=function(u,e){var t=w(P(e).toString());return u.type!==n.BlockStatement||B.comment&&u.leadingComments||t?t?[e,a]:[e,F,a]:[e,h]},G.prototype.generatePattern=function(u,e,t){return u.type===n.Identifier?z(u):this.generateExpression(u,e,t)},G.prototype.generateFunctionParams=function(u){var e,t,o,i;if(i=!1,u.type!==n.ArrowFunctionExpression||u.rest||u.defaults&&0!==u.defaults.length||1!==u.params.length||u.params[0].type!==n.Identifier){for((o=u.type===n.ArrowFunctionExpression?[V(u,!1)]:[]).push("("),u.defaults&&(i=!0),e=0,t=u.params.length;e<t;++e)i&&u.defaults[e]?o.push(this.generateAssignment(u.params[e],u.defaults[e],"=",r.Assignment,7)):o.push(this.generatePattern(u.params[e],r.Assignment,7)),e+1<t&&o.push(","+h);u.rest&&(u.params.length&&o.push(","+h),o.push("..."),o.push(z(u.rest))),o.push(")")}else o=[V(u,!0),z(u.params[0])];return o},G.prototype.generateFunctionBody=function(u){var e,t;return e=this.generateFunctionParams(u),u.type===n.ArrowFunctionExpression&&(e.push(h),e.push("=>")),u.expression?(e.push(h),"{"===(t=this.generateExpression(u.body,r.Assignment,7)).toString().charAt(0)&&(t=["(",t,")"]),e.push(t)):e.push(this.maybeBlock(u.body,9)),e},G.prototype.generateIterationForStatement=function(u,e,t){var o=["for"+(e.await?k()+"await":"")+h+"("],i=this;return R(function(){e.left.type===n.VariableDeclaration?R(function(){o.push(e.left.kind+k()),o.push(i.generateStatement(e.left.declarations[0],0))}):o.push(i.generateExpression(e.left,r.Call,7)),o=M(o,u),o=[M(o,i.generateExpression(e.right,r.Assignment,7)),")"]}),o.push(this.maybeBlock(e.body,t)),o},G.prototype.generatePropertyKey=function(u,e){var t=[];return e&&t.push("["),t.push(this.generateExpression(u,r.Assignment,7)),e&&t.push("]"),t},G.prototype.generateAssignment=function(u,e,t,n,o){return r.Assignment<n&&(o|=1),U([this.generateExpression(u,r.Call,o),h+t+h,this.generateExpression(e,r.Assignment,o)],r.Assignment,n)},G.prototype.semicolon=function(u){return!E&&32&u?"":";"},G.Statement={BlockStatement:function(u,e){var t,n,r=["{",F],o=this;return R(function(){var i,s,a,D;for(0===u.body.length&&x&&(t=u.range)[1]-t[0]>2&&("\n"===(n=v.substring(t[0]+1,t[1]-1))[0]&&(r=["{"]),r.push(n)),D=1,8&e&&(D|=16),i=0,s=u.body.length;i<s;++i)x&&(0===i&&(u.body[0].leadingComments&&(t=u.body[0].leadingComments[0].extendedRange,"\n"===(n=v.substring(t[0],t[1]))[0]&&(r=["{"])),u.body[0].leadingComments||N(u.range[0],u.body[0].range[0],r)),!(i>0)||u.body[i-1].trailingComments||u.body[i].leadingComments||N(u.body[i-1].range[1],u.body[i].range[0],r)),i===s-1&&(D|=32),a=u.body[i].leadingComments&&x?o.generateStatement(u.body[i],D):I(o.generateStatement(u.body[i],D)),r.push(a),!w(P(a).toString())&&(x&&i<s-1&&u.body[i+1].leadingComments||r.push(F)),x&&i===s-1&&!u.body[i].trailingComments&&N(u.body[i].range[1],u.range[1],r)}),r.push(I("}")),r},BreakStatement:function(u,e){return u.label?"break "+u.label.name+this.semicolon(e):"break"+this.semicolon(e)},ContinueStatement:function(u,e){return u.label?"continue "+u.label.name+this.semicolon(e):"continue"+this.semicolon(e)},ClassBody:function(u,e){var t=["{",F],n=this;return R(function(e){var o,i;for(o=0,i=u.body.length;o<i;++o)t.push(e),t.push(n.generateExpression(u.body[o],r.Sequence,7)),o+1<i&&t.push(F)}),w(P(t).toString())||t.push(F),t.push(a),t.push("}"),t},ClassDeclaration:function(u,e){var t,n;return t=["class"],u.id&&(t=M(t,this.generateExpression(u.id,r.Sequence,7))),u.superClass&&(n=M("extends",this.generateExpression(u.superClass,r.Unary,7)),t=M(t,n)),t.push(h),t.push(this.generateStatement(u.body,33)),t},DirectiveStatement:function(u,e){return B.raw&&u.raw?u.raw+this.semicolon(e):function(u){var e,t,n,r;for(e=0,r="double"===A?'"':"'",t=u.length;e<t;++e){if(39===(n=u.charCodeAt(e))){r='"';break}if(34===n){r="'";break}92===n&&++e}return r+u+r}(u.directive)+this.semicolon(e)},DoWhileStatement:function(u,e){var t=M("do",this.maybeBlock(u.body,1));return M(t=this.maybeBlockSuffix(u.body,t),["while"+h+"(",this.generateExpression(u.test,r.Sequence,7),")"+this.semicolon(e)])},CatchClause:function(u,e){var t,n=this;return R(function(){var e;u.param?(t=["catch"+h+"(",n.generateExpression(u.param,r.Sequence,7),")"],u.guard&&(e=n.generateExpression(u.guard,r.Sequence,7),t.splice(2,0," if ",e))):t=["catch"]}),t.push(this.maybeBlock(u.body,1)),t},DebuggerStatement:function(u,e){return"debugger"+this.semicolon(e)},EmptyStatement:function(u,e){return";"},ExportDefaultDeclaration:function(e,t){var n=["export"];return n=M(n,"default"),n=u(e.declaration)?M(n,this.generateStatement(e.declaration,32&t?33:1)):M(n,this.generateExpression(e.declaration,r.Assignment,7)+this.semicolon(t))},ExportNamedDeclaration:function(u,e){var t,o=["export"],i=this;return(t=32&e?33:1,u.declaration)?M(o,this.generateStatement(u.declaration,t)):(u.specifiers&&(0===u.specifiers.length?o=M(o,"{"+h+"}"):u.specifiers[0].type===n.ExportBatchSpecifier?o=M(o,this.generateExpression(u.specifiers[0],r.Sequence,7)):(o=M(o,"{"),R(function(e){var t,n;for(o.push(F),t=0,n=u.specifiers.length;t<n;++t)o.push(e),o.push(i.generateExpression(u.specifiers[t],r.Sequence,7)),t+1<n&&o.push(","+F)}),w(P(o).toString())||o.push(F),o.push(a+"}")),u.source?o=M(o,["from"+h,this.generateExpression(u.source,r.Sequence,7),this.semicolon(e)]):o.push(this.semicolon(e))),o)},ExportAllDeclaration:function(u,e){return["export"+h,"*"+h,"from"+h,this.generateExpression(u.source,r.Sequence,7),this.semicolon(e)]},ExpressionStatement:function(u,e){var t,o,i,a;return 123===(o=P(t=[this.generateExpression(u.expression,r.Sequence,7)]).toString()).charCodeAt(0)||"class"===o.slice(0,5)&&(123===(i=o.charCodeAt(5))||s.code.isWhiteSpace(i)||s.code.isLineTerminator(i))||"function"===o.slice(0,8)&&(40===(a=o.charCodeAt(8))||s.code.isWhiteSpace(a)||42===a||s.code.isLineTerminator(a))||function(u){var e,t,n;if("async"!==u.slice(0,5)||!s.code.isWhiteSpace(u.charCodeAt(5)))return!1;for(t=6,n=u.length;t<n&&s.code.isWhiteSpace(u.charCodeAt(t));++t);return t!==n&&"function"===u.slice(t,t+8)&&(40===(e=u.charCodeAt(t+8))||s.code.isWhiteSpace(e)||42===e||s.code.isLineTerminator(e))}(o)||m&&16&e&&u.expression.type===n.Literal&&"string"==typeof u.expression.value?t=["(",t,")"+this.semicolon(e)]:t.push(this.semicolon(e)),t},ImportDeclaration:function(u,e){var t,o,i=this;return 0===u.specifiers.length?["import",h,this.generateExpression(u.source,r.Sequence,7),this.semicolon(e)]:(t=["import"],o=0,u.specifiers[o].type===n.ImportDefaultSpecifier&&(t=M(t,[this.generateExpression(u.specifiers[o],r.Sequence,7)]),++o),u.specifiers[o]&&(0!==o&&t.push(","),u.specifiers[o].type===n.ImportNamespaceSpecifier?t=M(t,[h,this.generateExpression(u.specifiers[o],r.Sequence,7)]):(t.push(h+"{"),u.specifiers.length-o==1?(t.push(h),t.push(this.generateExpression(u.specifiers[o],r.Sequence,7)),t.push(h+"}"+h)):(R(function(e){var n,s;for(t.push(F),n=o,s=u.specifiers.length;n<s;++n)t.push(e),t.push(i.generateExpression(u.specifiers[n],r.Sequence,7)),n+1<s&&t.push(","+F)}),w(P(t).toString())||t.push(F),t.push(a+"}"+h)))),t=M(t,["from"+h,this.generateExpression(u.source,r.Sequence,7),this.semicolon(e)]))},VariableDeclarator:function(u,e){var t=1&e?7:6;return u.init?[this.generateExpression(u.id,r.Assignment,t),h,"=",h,this.generateExpression(u.init,r.Assignment,t)]:this.generatePattern(u.id,r.Assignment,t)},VariableDeclaration:function(u,e){var t,n,r,o,i,s=this;function a(){for(o=u.declarations[0],B.comment&&o.leadingComments?(t.push("\n"),t.push(I(s.generateStatement(o,i)))):(t.push(k()),t.push(s.generateStatement(o,i))),n=1,r=u.declarations.length;n<r;++n)o=u.declarations[n],B.comment&&o.leadingComments?(t.push(","+F),t.push(I(s.generateStatement(o,i)))):(t.push(","+h),t.push(s.generateStatement(o,i)))}return t=[u.kind],i=1&e?1:0,u.declarations.length>1?R(a):a(),t.push(this.semicolon(e)),t},ThrowStatement:function(u,e){return[M("throw",this.generateExpression(u.argument,r.Sequence,7)),this.semicolon(e)]},TryStatement:function(u,e){var t,n,r,o;if(t=["try",this.maybeBlock(u.block,1)],t=this.maybeBlockSuffix(u.block,t),u.handlers)for(n=0,r=u.handlers.length;n<r;++n)t=M(t,this.generateStatement(u.handlers[n],1)),(u.finalizer||n+1!==r)&&(t=this.maybeBlockSuffix(u.handlers[n].body,t));else{for(n=0,r=(o=u.guardedHandlers||[]).length;n<r;++n)t=M(t,this.generateStatement(o[n],1)),(u.finalizer||n+1!==r)&&(t=this.maybeBlockSuffix(o[n].body,t));if(u.handler)if(Array.isArray(u.handler))for(n=0,r=u.handler.length;n<r;++n)t=M(t,this.generateStatement(u.handler[n],1)),(u.finalizer||n+1!==r)&&(t=this.maybeBlockSuffix(u.handler[n].body,t));else t=M(t,this.generateStatement(u.handler,1)),u.finalizer&&(t=this.maybeBlockSuffix(u.handler.body,t))}return u.finalizer&&(t=M(t,["finally",this.maybeBlock(u.finalizer,1)])),t},SwitchStatement:function(u,e){var t,n,o,i,s,a=this;if(R(function(){t=["switch"+h+"(",a.generateExpression(u.discriminant,r.Sequence,7),")"+h+"{"+F]}),u.cases)for(o=0,s=1,i=u.cases.length;o<i;++o)o===i-1&&(s|=32),n=I(this.generateStatement(u.cases[o],s)),t.push(n),w(P(n).toString())||t.push(F);return t.push(I("}")),t},SwitchCase:function(u,e){var t,o,i,s,a,D=this;return R(function(){for(t=u.test?[M("case",D.generateExpression(u.test,r.Sequence,7)),":"]:["default:"],i=0,(s=u.consequent.length)&&u.consequent[0].type===n.BlockStatement&&(o=D.maybeBlock(u.consequent[0],1),t.push(o),i=1),i===s||w(P(t).toString())||t.push(F),a=1;i<s;++i)i===s-1&&32&e&&(a|=32),o=I(D.generateStatement(u.consequent[i],a)),t.push(o),i+1===s||w(P(o).toString())||t.push(F)}),t},IfStatement:function(u,e){var t,o,i=this;return R(function(){t=["if"+h+"(",i.generateExpression(u.test,r.Sequence,7),")"]}),o=1,32&e&&(o|=32),u.alternate?(t.push(this.maybeBlock(u.consequent,1)),t=this.maybeBlockSuffix(u.consequent,t),t=u.alternate.type===n.IfStatement?M(t,["else ",this.generateStatement(u.alternate,o)]):M(t,M("else",this.maybeBlock(u.alternate,o)))):t.push(this.maybeBlock(u.consequent,o)),t},ForStatement:function(u,e){var t,o=this;return R(function(){t=["for"+h+"("],u.init?u.init.type===n.VariableDeclaration?t.push(o.generateStatement(u.init,0)):(t.push(o.generateExpression(u.init,r.Sequence,6)),t.push(";")):t.push(";"),u.test&&(t.push(h),t.push(o.generateExpression(u.test,r.Sequence,7))),t.push(";"),u.update&&(t.push(h),t.push(o.generateExpression(u.update,r.Sequence,7))),t.push(")")}),t.push(this.maybeBlock(u.body,32&e?33:1)),t},ForInStatement:function(u,e){return this.generateIterationForStatement("in",u,32&e?33:1)},ForOfStatement:function(u,e){return this.generateIterationForStatement("of",u,32&e?33:1)},LabeledStatement:function(u,e){return[u.label.name+":",this.maybeBlock(u.body,32&e?33:1)]},Program:function(u,e){var t,n,r,o,i;for(r=0,o=u.body.length,t=[g&&o>0?"\n":""],i=17;r<o;++r)g||r!==o-1||(i|=32),x&&(0!==r||u.body[0].leadingComments||N(u.range[0],u.body[r].range[0],t),!(r>0)||u.body[r-1].trailingComments||u.body[r].leadingComments||N(u.body[r-1].range[1],u.body[r].range[0],t)),n=I(this.generateStatement(u.body[r],i)),t.push(n),r+1<o&&!w(P(n).toString())&&(x&&u.body[r+1].leadingComments||t.push(F)),x&&r===o-1&&!u.body[r].trailingComments&&N(u.body[r].range[1],u.range[1],t);return t},FunctionDeclaration:function(u,e){return[V(u,!0),"function",$(u)||k(),u.id?z(u.id):"",this.generateFunctionBody(u)]},ReturnStatement:function(u,e){return u.argument?[M("return",this.generateExpression(u.argument,r.Sequence,7)),this.semicolon(e)]:["return"+this.semicolon(e)]},WhileStatement:function(u,e){var t,n=this;return R(function(){t=["while"+h+"(",n.generateExpression(u.test,r.Sequence,7),")"]}),t.push(this.maybeBlock(u.body,32&e?33:1)),t},WithStatement:function(u,e){var t,n=this;return R(function(){t=["with"+h+"(",n.generateExpression(u.object,r.Sequence,7),")"]}),t.push(this.maybeBlock(u.body,32&e?33:1)),t}},O(G.prototype,G.Statement),G.Expression={SequenceExpression:function(u,e,t){var n,o,i;for(r.Sequence<e&&(t|=1),n=[],o=0,i=u.expressions.length;o<i;++o)n.push(this.generateExpression(u.expressions[o],r.Assignment,t)),o+1<i&&n.push(","+h);return U(n,r.Sequence,e)},AssignmentExpression:function(u,e,t){return this.generateAssignment(u.left,u.right,u.operator,e,t)},ArrowFunctionExpression:function(u,e,t){return U(this.generateFunctionBody(u),r.ArrowFunction,e)},ConditionalExpression:function(u,e,t){return r.Conditional<e&&(t|=1),U([this.generateExpression(u.test,r.Coalesce,t),h+"?"+h,this.generateExpression(u.consequent,r.Assignment,t),h+":"+h,this.generateExpression(u.alternate,r.Assignment,t)],r.Conditional,e)},LogicalExpression:function(u,e,t){return"??"===u.operator&&(t|=64),this.BinaryExpression(u,e,t)},BinaryExpression:function(u,e,t){var n,o,i,a,D,l;return(a=S[u.operator],o="**"===u.operator?r.Postfix:a,i="**"===u.operator?a:a+1,a<e&&(t|=1),n=47===(l=(D=this.generateExpression(u.left,o,t)).toString()).charCodeAt(l.length-1)&&s.code.isIdentifierPartES5(u.operator.charCodeAt(0))?[D,k(),u.operator]:M(D,u.operator),D=this.generateExpression(u.right,i,t),"/"===u.operator&&"/"===D.toString().charAt(0)||"<"===u.operator.slice(-1)&&"!--"===D.toString().slice(0,3)?(n.push(k()),n.push(D)):n=M(n,D),"in"===u.operator&&!(1&t)||("||"===u.operator||"&&"===u.operator)&&64&t)?["(",n,")"]:U(n,a,e)},CallExpression:function(u,e,t){var n,o,i;for(n=[this.generateExpression(u.callee,r.Call,3)],u.optional&&n.push("?."),n.push("("),o=0,i=u.arguments.length;o<i;++o)n.push(this.generateExpression(u.arguments[o],r.Assignment,7)),o+1<i&&n.push(","+h);return(n.push(")"),2&t)?U(n,r.Call,e):["(",n,")"]},ChainExpression:function(u,e,t){return r.OptionalChaining<e&&(t|=2),U(this.generateExpression(u.expression,r.OptionalChaining,t),r.OptionalChaining,e)},NewExpression:function(u,e,t){var n,o,i,s;if(o=u.arguments.length,s=4&t&&!f&&0===o?5:1,n=M("new",this.generateExpression(u.callee,r.New,s)),!(4&t)||f||o>0){for(n.push("("),i=0;i<o;++i)n.push(this.generateExpression(u.arguments[i],r.Assignment,7)),i+1<o&&n.push(","+h);n.push(")")}return U(n,r.New,e)},MemberExpression:function(u,e,t){var o,i;return o=[this.generateExpression(u.object,r.Call,2&t?3:1)],u.computed?(u.optional&&o.push("?."),o.push("["),o.push(this.generateExpression(u.property,r.Sequence,2&t?7:5)),o.push("]")):(!u.optional&&u.object.type===n.Literal&&"number"==typeof u.object.value&&0>(i=P(o).toString()).indexOf(".")&&!/[eExX]/.test(i)&&s.code.isDecimalDigit(i.charCodeAt(i.length-1))&&!(i.length>=2&&48===i.charCodeAt(0))&&o.push(" "),o.push(u.optional?"?.":"."),o.push(z(u.property))),U(o,r.Member,e)},MetaProperty:function(u,e,t){var n;return(n=[]).push("string"==typeof u.meta?u.meta:z(u.meta)),n.push("."),n.push("string"==typeof u.property?u.property:z(u.property)),U(n,r.Member,e)},UnaryExpression:function(u,e,t){var n,o,i,a,D;return o=this.generateExpression(u.argument,r.Unary,7),""===h?n=M(u.operator,o):(n=[u.operator],u.operator.length>2?n=M(n,o):(D=(a=P(n).toString()).charCodeAt(a.length-1),i=o.toString().charCodeAt(0),((43===D||45===D)&&D===i||s.code.isIdentifierPartES5(D)&&s.code.isIdentifierPartES5(i))&&n.push(k()),n.push(o))),U(n,r.Unary,e)},YieldExpression:function(u,e,t){var n;return n=u.delegate?"yield*":"yield",u.argument&&(n=M(n,this.generateExpression(u.argument,r.Yield,7))),U(n,r.Yield,e)},AwaitExpression:function(u,e,t){return U(M(u.all?"await*":"await",this.generateExpression(u.argument,r.Await,7)),r.Await,e)},UpdateExpression:function(u,e,t){return u.prefix?U([u.operator,this.generateExpression(u.argument,r.Unary,7)],r.Unary,e):U([this.generateExpression(u.argument,r.Postfix,7),u.operator],r.Postfix,e)},FunctionExpression:function(u,e,t){var n=[V(u,!0),"function"];return u.id?(n.push($(u)||k()),n.push(z(u.id))):n.push($(u)||h),n.push(this.generateFunctionBody(u)),n},ArrayPattern:function(u,e,t){return this.ArrayExpression(u,e,t,!0)},ArrayExpression:function(u,e,t,n){var o,i,s=this;return u.elements.length?(o=["[",(i=!n&&u.elements.length>1)?F:""],R(function(e){var t,n;for(t=0,n=u.elements.length;t<n;++t)u.elements[t]?(o.push(i?e:""),o.push(s.generateExpression(u.elements[t],r.Assignment,7))):(i&&o.push(e),t+1===n&&o.push(",")),t+1<n&&o.push(","+(i?F:h))}),i&&!w(P(o).toString())&&o.push(F),o.push(i?a:""),o.push("]"),o):"[]"},RestElement:function(u,e,t){return"..."+this.generatePattern(u.argument)},ClassExpression:function(u,e,t){var n,o;return n=["class"],u.id&&(n=M(n,this.generateExpression(u.id,r.Sequence,7))),u.superClass&&(o=M("extends",this.generateExpression(u.superClass,r.Unary,7)),n=M(n,o)),n.push(h),n.push(this.generateStatement(u.body,33)),n},MethodDefinition:function(u,e,t){var n,r;return n=u.static?["static"+h]:[],r="get"===u.kind||"set"===u.kind?[M(u.kind,this.generatePropertyKey(u.key,u.computed)),this.generateFunctionBody(u.value)]:[K(u),this.generatePropertyKey(u.key,u.computed),this.generateFunctionBody(u.value)],M(n,r)},Property:function(u,e,t){return"get"===u.kind||"set"===u.kind?[u.kind,k(),this.generatePropertyKey(u.key,u.computed),this.generateFunctionBody(u.value)]:u.shorthand?"AssignmentPattern"===u.value.type?this.AssignmentPattern(u.value,r.Sequence,7):this.generatePropertyKey(u.key,u.computed):u.method?[K(u),this.generatePropertyKey(u.key,u.computed),this.generateFunctionBody(u.value)]:[this.generatePropertyKey(u.key,u.computed),":"+h,this.generateExpression(u.value,r.Assignment,7)]},ObjectExpression:function(u,e,t){var n,o,i,s,D=this;return u.properties.length?(o=u.properties.length>1,R(function(){s=D.generateExpression(u.properties[0],r.Sequence,7)}),o||(n=P(s).toString(),/[\r\n]/g.test(n)))?(R(function(e){var t,n;if(i=["{",F,e,s],o)for(i.push(","+F),t=1,n=u.properties.length;t<n;++t)i.push(e),i.push(D.generateExpression(u.properties[t],r.Sequence,7)),t+1<n&&i.push(","+F)}),w(P(i).toString())||i.push(F),i.push(a),i.push("}"),i):["{",h,s,h,"}"]:"{}"},AssignmentPattern:function(u,e,t){return this.generateAssignment(u.left,u.right,"=",e,t)},ObjectPattern:function(u,e,t){var o,i,s,D,l,c=this;if(!u.properties.length)return"{}";if(D=!1,1===u.properties.length)(l=u.properties[0]).type===n.Property&&l.value.type!==n.Identifier&&(D=!0);else for(i=0,s=u.properties.length;i<s;++i)if((l=u.properties[i]).type===n.Property&&!l.shorthand){D=!0;break}return o=["{",D?F:""],R(function(e){var t,n;for(t=0,n=u.properties.length;t<n;++t)o.push(D?e:""),o.push(c.generateExpression(u.properties[t],r.Sequence,7)),t+1<n&&o.push(","+(D?F:h))}),D&&!w(P(o).toString())&&o.push(F),o.push(D?a:""),o.push("}"),o},ThisExpression:function(u,e,t){return"this"},Super:function(u,e,t){return"super"},Identifier:function(u,e,t){return z(u)},ImportDefaultSpecifier:function(u,e,t){return z(u.id||u.local)},ImportNamespaceSpecifier:function(u,e,t){var n=["*"],r=u.id||u.local;return r&&n.push(h+"as"+k()+z(r)),n},ImportSpecifier:function(u,e,t){var n=u.imported,r=[n.name],o=u.local;return o&&o.name!==n.name&&r.push(k()+"as"+k()+z(o)),r},ExportSpecifier:function(u,e,t){var n=u.local,r=[n.name],o=u.exported;return o&&o.name!==n.name&&r.push(k()+"as"+k()+z(o)),r},Literal:function(u,e,t){var r;if(u.hasOwnProperty("raw")&&d&&B.raw)try{if((r=d(u.raw).body[0].expression).type===n.Literal&&r.value===u.value)return u.raw}catch(u){}return u.regex?"/"+u.regex.pattern+"/"+u.regex.flags:"bigint"==typeof u.value?u.value.toString()+"n":u.bigint?u.bigint+"n":null===u.value?"null":"string"==typeof u.value?function(u){var e,t,n,r,o,i="",a=0,D=0;for(e=0,t=u.length;e<t;++e){if(39===(n=u.charCodeAt(e)))++a;else if(34===n)++D;else if(47===n&&l)i+="\\";else if(s.code.isLineTerminator(n)||92===n){i+=function(u){if(92===u)return"\\\\";if(10===u)return"\\n";if(13===u)return"\\r";if(8232===u)return"\\u2028";if(8233===u)return"\\u2029";throw Error("Incorrectly classified character")}(n);continue}else if(!s.code.isIdentifierPartES5(n)&&(l&&n<32||!l&&!C&&(n<32||n>126))){i+=function(u,e){var t;return 8===u?"\\b":12===u?"\\f":9===u?"\\t":(t=u.toString(16).toUpperCase(),l||u>255)?"\\u"+"0000".slice(t.length)+t:0!==u||s.code.isDecimalDigit(e)?11===u?"\\x0B":"\\x"+"00".slice(t.length)+t:"\\0"}(n,u.charCodeAt(e+1));continue}i+=String.fromCharCode(n)}if(o=(r=!("double"===A||"auto"===A&&D<a))?"'":'"',!(r?a:D))return o+i+o;for(e=0,u=i,i=o,t=u.length;e<t;++e)(39===(n=u.charCodeAt(e))&&r||34===n&&!r)&&(i+="\\"),i+=String.fromCharCode(n);return i+o}(u.value):"number"==typeof u.value?function(u){var e,t,n,r,o;if(u!=u)throw Error("Numeric literal whose value is NaN");if(u<0||0===u&&1/u<0)throw Error("Numeric literal whose value is negative");if(u===1/0)return l?"null":c?"1e400":"1e+400";if(e=""+u,!c||e.length<3)return e;for(t=e.indexOf("."),l||48!==e.charCodeAt(0)||1!==t||(t=0,e=e.slice(1)),n=e,e=e.replace("e+","e"),r=0,(o=n.indexOf("e"))>0&&(r=+n.slice(o+1),n=n.slice(0,o)),t>=0&&(r-=n.length-t-1,n=+(n.slice(0,t)+n.slice(t+1))+""),o=0;48===n.charCodeAt(n.length+o-1);)--o;return 0!==o&&(r-=o,n=n.slice(0,o)),0!==r&&(n+="e"+r),(n.length<e.length||p&&u>1e12&&Math.floor(u)===u&&(n="0x"+u.toString(16)).length<e.length)&&+n===u&&(e=n),e}(u.value):"boolean"==typeof u.value?u.value?"true":"false":function(u){var e,t,n,r,o,i,s,a;if(t=u.toString(),u.source){if(!(e=t.match(/\/([^/]*)$/)))return t;for(r=0,n=e[1],t="",s=!1,a=!1,o=u.source.length;r<o;++r)i=u.source.charCodeAt(r),a?(t+=L(i,a),a=!1):(s?93===i&&(s=!1):47===i?t+="\\":91===i&&(s=!0),t+=L(i,a),a=92===i);return"/"+t+"/"+n}return t}(u.value)},GeneratorExpression:function(u,e,t){return this.ComprehensionExpression(u,e,t)},ComprehensionExpression:function(u,e,t){var o,i,s,a,D=this;return o=u.type===n.GeneratorExpression?["("]:["["],B.moz.comprehensionExpressionStartsWithAssignment&&(a=this.generateExpression(u.body,r.Assignment,7),o.push(a)),u.blocks&&R(function(){for(i=0,s=u.blocks.length;i<s;++i)a=D.generateExpression(u.blocks[i],r.Sequence,7),i>0||B.moz.comprehensionExpressionStartsWithAssignment?o=M(o,a):o.push(a)}),u.filter&&(o=M(o,"if"+h),a=this.generateExpression(u.filter,r.Sequence,7),o=M(o,["(",a,")"])),B.moz.comprehensionExpressionStartsWithAssignment||(a=this.generateExpression(u.body,r.Assignment,7),o=M(o,a)),o.push(u.type===n.GeneratorExpression?")":"]"),o},ComprehensionBlock:function(u,e,t){var o;return o=M(o=u.left.type===n.VariableDeclaration?[u.left.kind,k(),this.generateStatement(u.left.declarations[0],0)]:this.generateExpression(u.left,r.Call,7),u.of?"of":"in"),o=M(o,this.generateExpression(u.right,r.Sequence,7)),["for"+h+"(",o,")"]},SpreadElement:function(u,e,t){return["...",this.generateExpression(u.argument,r.Assignment,7)]},TaggedTemplateExpression:function(u,e,t){var n=3;return 2&t||(n=1),U([this.generateExpression(u.tag,r.Call,n),this.generateExpression(u.quasi,r.Primary,4)],r.TaggedTemplate,e)},TemplateElement:function(u,e,t){return u.value.raw},TemplateLiteral:function(u,e,t){var n,o,i;for(o=0,n=["`"],i=u.quasis.length;o<i;++o)n.push(this.generateExpression(u.quasis[o],r.Primary,7)),o+1<i&&(n.push("${"+h),n.push(this.generateExpression(u.expressions[o],r.Sequence,7)),n.push(h+"}"));return n.push("`"),n},ModuleSpecifier:function(u,e,t){return this.Literal(u,e,t)},ImportExpression:function(u,e,t){return U(["import(",this.generateExpression(u.source,r.Assignment,7),")"],r.Call,e)}},O(G.prototype,G.Expression),G.prototype.generateExpression=function(u,e,t){var o,i,s,a;return(i=u.type||n.Property,B.verbatim&&u.hasOwnProperty(B.verbatim))?P(a="string"==typeof(s=u[B.verbatim])?U(W(s),r.Sequence,e):U(a=W(s.content),null!=s.precedence?s.precedence:r.Sequence,e),u):(o=this[i](u,e,t),B.comment&&(o=T(u,o)),P(o,u))},G.prototype.generateStatement=function(u,e){var t,r;return t=this[u.type](u,e),B.comment&&(t=T(u,t)),r=P(t).toString(),u.type!==n.Program||g||""!==F||"\n"!==r.charAt(r.length-1)||(t=y?P(t).replaceRight(/\s+$/,""):r.replace(/\s+$/,"")),P(t,u)},b().format,e.cM=function(n,i){var s,S,w=b();return(null!=i?("string"==typeof i.indent&&(w.format.indent.style=i.indent),"number"==typeof i.base&&(w.format.indent.base=i.base),D=(i=j(w,i)).format.indent.style,a="string"==typeof i.base?i.base:_(D,i.format.indent.base)):a=_(D=(i=w).format.indent.style,i.format.indent.base),l=i.format.json,c=i.format.renumber,p=!l&&i.format.hexadecimal,A=l?"double":i.format.quotes,C=i.format.escapeless,F=i.format.newline,h=i.format.space,i.format.compact&&(F=h=D=a=""),f=i.format.parentheses,E=i.format.semicolons,g=i.format.safeConcatenation,m=i.directive,d=l?null:i.parse,y=i.sourceMap,v=i.sourceCode,x=i.format.preserveBlankLines&&null!==v,B=i,y&&(o=e.T?global.sourceMap.SourceNode:t(62096).ee),s=function(e){var t;if(t=new G,u(e))return t.generateStatement(e,1);if(G.Expression.hasOwnProperty(e.type))return t.generateExpression(e,r.Sequence,7);throw Error("Unknown node type: "+e.type)}(n),y)?(S=s.toStringWithSourceMap({file:i.file,sourceRoot:i.sourceMapRoot}),i.sourceContent&&S.map.setSourceContent(i.sourceMap,i.sourceContent),i.sourceMapWithCode)?S:S.map.toString():(S={code:s.toString(),map:null},i.sourceMapWithCode?S:S.code)},i.attachComments,j({},r),e.T=!1}()},4704(u,e){!function u(e){"use strict";var t,n,r,o,i,s;function a(u){var e,t,n={};for(e in u)u.hasOwnProperty(e)&&("object"==typeof(t=u[e])&&null!==t?n[e]=a(t):n[e]=t);return n}function D(u,e){this.parent=u,this.key=e}function l(u,e,t,n){this.node=u,this.path=e,this.wrap=t,this.ref=n}function c(){}function p(u){return null!=u&&"object"==typeof u&&"string"==typeof u.type}function A(u,e){return(u===t.ObjectExpression||u===t.ObjectPattern)&&"properties"===e}function C(u,e){for(var t=u.length-1;t>=0;--t)if(u[t].node===e)return!0;return!1}function F(u,e){return new c().traverse(u,e)}return t={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},r={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:o={},Skip:i={},Remove:s={}},D.prototype.replace=function(u){this.parent[this.key]=u},D.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},c.prototype.path=function(){var u,e,t,n,r;function o(u,e){if(Array.isArray(e))for(t=0,n=e.length;t<n;++t)u.push(e[t]);else u.push(e)}if(!this.__current.path)return null;for(u=2,r=[],e=this.__leavelist.length;u<e;++u)o(r,this.__leavelist[u].path);return o(r,this.__current.path),r},c.prototype.type=function(){return this.current().type||this.__current.wrap},c.prototype.parents=function(){var u,e,t;for(u=1,t=[],e=this.__leavelist.length;u<e;++u)t.push(this.__leavelist[u].node);return t},c.prototype.current=function(){return this.__current.node},c.prototype.__execute=function(u,e){var t,n;return n=void 0,t=this.__current,this.__current=e,this.__state=null,u&&(n=u.call(this,e.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=t,n},c.prototype.notify=function(u){this.__state=u},c.prototype.skip=function(){this.notify(i)},c.prototype.break=function(){this.notify(o)},c.prototype.remove=function(){this.notify(s)},c.prototype.__initialize=function(u,e){this.visitor=e,this.root=u,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,"iteration"===e.fallback?this.__fallback=Object.keys:"function"==typeof e.fallback&&(this.__fallback=e.fallback),this.__keys=r,e.keys&&(this.__keys=Object.assign(Object.create(this.__keys),e.keys))},c.prototype.traverse=function(u,e){var t,n,r,s,a,D,c,F,h,f,E,g;for(this.__initialize(u,e),g={},t=this.__worklist,n=this.__leavelist,t.push(new l(u,null,null,null)),n.push(new l(null,null,null,null));t.length;){if((r=t.pop())===g){if(r=n.pop(),D=this.__execute(e.leave,r),this.__state===o||D===o)return;continue}if(r.node){if(D=this.__execute(e.enter,r),this.__state===o||D===o)return;if(t.push(g),n.push(r),this.__state===i||D===i)continue;if(a=(s=r.node).type||r.wrap,!(f=this.__keys[a]))if(this.__fallback)f=this.__fallback(s);else throw Error("Unknown node type "+a+".");for(F=f.length;(F-=1)>=0;)if(E=s[c=f[F]]){if(Array.isArray(E)){for(h=E.length;(h-=1)>=0;)if(!(!E[h]||C(n,E[h]))){if(A(a,f[F]))r=new l(E[h],[c,h],"Property",null);else{if(!p(E[h]))continue;r=new l(E[h],[c,h],null,null)}t.push(r)}}else if(p(E)){if(C(n,E))continue;t.push(new l(E,c,null,null))}}}}},c.prototype.replace=function(u,e){var t,n,r,a,c,C,F,h,f,E,g,m,B;function d(u){var e,n,r,o;if(u.ref.remove()){for(n=u.ref.key,o=u.ref.parent,e=t.length;e--;)if((r=t[e]).ref&&r.ref.parent===o){if(r.ref.key<n)break;--r.ref.key}}}for(this.__initialize(u,e),g={},t=this.__worklist,n=this.__leavelist,m={root:u},C=new l(u,null,null,new D(m,"root")),t.push(C),n.push(C);t.length;){if((C=t.pop())===g){if(C=n.pop(),void 0!==(c=this.__execute(e.leave,C))&&c!==o&&c!==i&&c!==s&&C.ref.replace(c),(this.__state===s||c===s)&&d(C),this.__state===o||c===o)return m.root;continue}if(void 0!==(c=this.__execute(e.enter,C))&&c!==o&&c!==i&&c!==s&&(C.ref.replace(c),C.node=c),(this.__state===s||c===s)&&(d(C),C.node=null),this.__state===o||c===o)break;if(r=C.node){if(t.push(g),n.push(C),this.__state!==i&&c!==i){if(a=r.type||C.wrap,!(f=this.__keys[a]))if(this.__fallback)f=this.__fallback(r);else throw Error("Unknown node type "+a+".");for(F=f.length;(F-=1)>=0;)if(E=r[B=f[F]])if(Array.isArray(E)){for(h=E.length;(h-=1)>=0;)if(E[h]){if(A(a,f[F]))C=new l(E[h],[B,h],"Property",new D(E,h));else{if(!p(E[h]))continue;C=new l(E[h],[B,h],null,new D(E,h))}t.push(C)}}else p(E)&&t.push(new l(E,B,null,new D(r,B)))}}}return m.root},e.Syntax=t,e.traverse=F,e.replace=function(u,e){return new c().replace(u,e)},e.attachComments=function(u,e,t){var r,o,i,s,D=[];if(!u.range)throw Error("attachComments needs range information");if(!t.length){if(e.length){for(i=0,o=e.length;i<o;i+=1)(r=a(e[i])).extendedRange=[0,u.range[0]],D.push(r);u.leadingComments=D}return u}for(i=0,o=e.length;i<o;i+=1)D.push(function(u,e){var t;return t=function(u,e){var t,n,r,o;for(n=u.length,r=0;n;)e(u[o=r+(t=n>>>1)])?n=t:(r=o+1,n-=t+1);return r}(e,function(e){return e.range[0]>u.range[0]}),u.extendedRange=[u.range[0],u.range[1]],t!==e.length&&(u.extendedRange[1]=e[t].range[0]),(t-=1)>=0&&(u.extendedRange[0]=e[t].range[1]),u}(a(e[i]),t));return s=0,F(u,{enter:function(u){for(var e;s<D.length&&!((e=D[s]).extendedRange[1]>u.range[0]);)e.extendedRange[1]===u.range[0]?(u.leadingComments||(u.leadingComments=[]),u.leadingComments.push(e),D.splice(s,1)):s+=1;return s===D.length?n.Break:D[s].extendedRange[0]>u.range[1]?n.Skip:void 0}}),s=0,F(u,{leave:function(u){for(var e;s<D.length&&(e=D[s],!(u.range[1]<e.extendedRange[0]));)u.range[1]===e.extendedRange[0]?(u.trailingComments||(u.trailingComments=[]),u.trailingComments.push(e),D.splice(s,1)):s+=1;return s===D.length?n.Break:D[s].extendedRange[0]>u.range[1]?n.Skip:void 0}}),u},e.VisitorKeys=r,e.VisitorOption=n,e.Controller=c,e.cloneEnvironment=function(){return u({})},e}(e)},46543(u){!function(){"use strict";function e(u){if(null==u)return!1;switch(u.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return!0}return!1}function t(u){switch(u.type){case"IfStatement":if(null!=u.alternate)return u.alternate;return u.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return u.body}return null}u.exports={isExpression:function(u){if(null==u)return!1;switch(u.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return!0}return!1},isStatement:e,isIterationStatement:function(u){if(null==u)return!1;switch(u.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return!0}return!1},isSourceElement:function(u){return e(u)||null!=u&&"FunctionDeclaration"===u.type},isProblematicIfStatement:function(u){var e;if("IfStatement"!==u.type||null==u.alternate)return!1;e=u.consequent;do{if("IfStatement"===e.type&&null==e.alternate)return!0;e=t(e)}while(e);return!1},trailingStatement:t}}()},14562(u){!function(){"use strict";var e,t,n,r,o,i;function s(u){return u<=65535?String.fromCharCode(u):String.fromCharCode(Math.floor((u-65536)/1024)+55296)+String.fromCharCode((u-65536)%1024+56320)}for(t={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},e={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},n=[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],i=0,r=Array(128);i<128;++i)r[i]=i>=97&&i<=122||i>=65&&i<=90||36===i||95===i;for(i=0,o=Array(128);i<128;++i)o[i]=i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57||36===i||95===i;u.exports={isDecimalDigit:function(u){return 48<=u&&u<=57},isHexDigit:function(u){return 48<=u&&u<=57||97<=u&&u<=102||65<=u&&u<=70},isOctalDigit:function(u){return u>=48&&u<=55},isWhiteSpace:function(u){return 32===u||9===u||11===u||12===u||160===u||u>=5760&&n.indexOf(u)>=0},isLineTerminator:function(u){return 10===u||13===u||8232===u||8233===u},isIdentifierStartES5:function(u){return u<128?r[u]:t.NonAsciiIdentifierStart.test(s(u))},isIdentifierPartES5:function(u){return u<128?o[u]:t.NonAsciiIdentifierPart.test(s(u))},isIdentifierStartES6:function(u){return u<128?r[u]:e.NonAsciiIdentifierStart.test(s(u))},isIdentifierPartES6:function(u){return u<128?o[u]:e.NonAsciiIdentifierPart.test(s(u))}}}()},21204(u,e,t){!function(){"use strict";var e=t(14562);function n(u,e){return(!!e||"yield"!==u)&&r(u,e)}function r(u,e){if(e&&function(u){switch(u){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}(u))return!0;switch(u.length){case 2:return"if"===u||"in"===u||"do"===u;case 3:return"var"===u||"for"===u||"new"===u||"try"===u;case 4:return"this"===u||"else"===u||"case"===u||"void"===u||"with"===u||"enum"===u;case 5:return"while"===u||"break"===u||"catch"===u||"throw"===u||"const"===u||"yield"===u||"class"===u||"super"===u;case 6:return"return"===u||"typeof"===u||"delete"===u||"switch"===u||"export"===u||"import"===u;case 7:return"default"===u||"finally"===u||"extends"===u;case 8:return"function"===u||"continue"===u||"debugger"===u;case 10:return"instanceof"===u;default:return!1}}function o(u,e){return"null"===u||"true"===u||"false"===u||n(u,e)}function i(u,e){return"null"===u||"true"===u||"false"===u||r(u,e)}function s(u){var t,n,r;if(0===u.length||(r=u.charCodeAt(0),!e.isIdentifierStartES5(r)))return!1;for(t=1,n=u.length;t<n;++t)if(r=u.charCodeAt(t),!e.isIdentifierPartES5(r))return!1;return!0}function a(u){var t,n,r,o,i;if(0===u.length)return!1;for(t=0,i=e.isIdentifierStartES6,n=u.length;t<n;++t){if(55296<=(r=u.charCodeAt(t))&&r<=56319){if(++t>=n||!(56320<=(o=u.charCodeAt(t))&&o<=57343))return!1;r=(r-55296)*1024+(o-56320)+65536}if(!i(r))return!1;i=e.isIdentifierPartES6}return!0}u.exports={isKeywordES5:n,isKeywordES6:r,isReservedWordES5:o,isReservedWordES6:i,isRestrictedWord:function(u){return"eval"===u||"arguments"===u},isIdentifierNameES5:s,isIdentifierNameES6:a,isIdentifierES5:function(u,e){return s(u)&&!o(u,e)},isIdentifierES6:function(u,e){return a(u)&&!i(u,e)}}}()},71562(u,e,t){!function(){"use strict";e.ast=t(46543),e.code=t(14562),e.keyword=t(21204)}()},33103(u,e,t){u.exports=t(94715)(t(78942),"DataView")},89413(u,e,t){u.exports=t(94715)(t(78942),"Promise")},64512(u,e,t){u.exports=t(94715)(t(78942),"Set")},51340(u,e,t){var n=t(1386),r=t(64103),o=t(21779),i=t(34162),s=t(7462),a=t(96638);function D(u){var e=this.__data__=new n(u);this.size=e.size}D.prototype.clear=r,D.prototype.delete=o,D.prototype.get=i,D.prototype.has=s,D.prototype.set=a,u.exports=D},31623(u,e,t){u.exports=t(78942).Uint8Array},19270(u,e,t){u.exports=t(94715)(t(78942),"WeakMap")},86912(u){u.exports=function(u,e,t){switch(t.length){case 0:return u.call(e);case 1:return u.call(e,t[0]);case 2:return u.call(e,t[0],t[1]);case 3:return u.call(e,t[0],t[1],t[2])}return u.apply(e,t)}},79968(u){u.exports=function(u,e){for(var t=-1,n=null==u?0:u.length;++t<n&&!1!==e(u[t],t,u););return u}},79847(u){u.exports=function(u,e){for(var t=-1,n=null==u?0:u.length,r=0,o=[];++t<n;){var i=u[t];e(i,t,u)&&(o[r++]=i)}return o}},10358(u,e,t){var n=t(26137),r=t(3283),o=t(53142),i=t(75853),s=t(69632),a=t(8666),D=Object.prototype.hasOwnProperty;u.exports=function(u,e){var t=o(u),l=!t&&r(u),c=!t&&!l&&i(u),p=!t&&!l&&!c&&a(u),A=t||l||c||p,C=A?n(u.length,String):[],F=C.length;for(var h in u)(e||D.call(u,h))&&!(A&&("length"==h||c&&("offset"==h||"parent"==h)||p&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||s(h,F)))&&C.push(h);return C}},11129(u){u.exports=function(u,e){for(var t=-1,n=e.length,r=u.length;++t<n;)u[r+t]=e[t];return u}},3422(u,e,t){var n=t(57073),r=t(46285),o=Object.prototype.hasOwnProperty;u.exports=function(u,e,t){var i=u[e];o.call(u,e)&&r(i,t)&&(void 0!==t||e in u)||n(u,e,t)}},37930(u,e,t){var n=t(39032),r=t(81211);u.exports=function(u,e){return u&&n(e,r(e),u)}},30125(u,e,t){var n=t(39032),r=t(25288);u.exports=function(u,e){return u&&n(e,r(e),u)}},57073(u,e,t){var n=t(72532);u.exports=function(u,e,t){"__proto__"==e&&n?n(u,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):u[e]=t}},69334(u,e,t){var n=t(51340),r=t(79968),o=t(3422),i=t(37930),s=t(30125),a=t(17099),D=t(84354),l=t(83546),c=t(24733),p=t(80393),A=t(93650),C=t(28486),F=t(97350),h=t(50424),f=t(75964),E=t(53142),g=t(75853),m=t(37681),B=t(41580),d=t(83943),y=t(81211),v=t(25288),x="[object Arguments]",S="[object Function]",b="[object Object]",_={};_[x]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_[b]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_[S]=_["[object WeakMap]"]=!1,u.exports=function u(e,t,w,O,j,L){var P,k=1&t,M=2&t,I=4&t;if(w&&(P=j?w(e,O,j,L):w(e)),void 0!==P)return P;if(!B(e))return e;var R=E(e);if(R){if(P=F(e),!k)return D(e,P)}else{var q=C(e),T=q==S||"[object GeneratorFunction]"==q;if(g(e))return a(e,k);if(q==b||q==x||T&&!j){if(P=M||T?{}:f(e),!k)return M?c(e,s(P,e)):l(e,i(P,e))}else{if(!_[q])return j?e:{};P=h(e,q,k)}}L||(L=new n);var N=L.get(e);if(N)return N;L.set(e,P),d(e)?e.forEach(function(n){P.add(u(n,t,w,n,e,L))}):m(e)&&e.forEach(function(n,r){P.set(r,u(n,t,w,r,e,L))});var U=I?M?A:p:M?v:y,W=R?void 0:U(e);return r(W||e,function(n,r){W&&(n=e[r=n]),o(P,r,u(n,t,w,r,e,L))}),P}},39747(u,e,t){var n=t(41580),r=Object.create;u.exports=function(){function u(){}return function(e){if(!n(e))return{};if(r)return r(e);u.prototype=e;var t=new u;return u.prototype=void 0,t}}()},90313(u,e,t){var n=t(11129),r=t(20714);u.exports=function u(e,t,o,i,s){var a=-1,D=e.length;for(o||(o=r),s||(s=[]);++a<D;){var l=e[a];t>0&&o(l)?t>1?u(l,t-1,o,i,s):n(s,l):i||(s[s.length]=l)}return s}},48244(u,e,t){var n=t(11129),r=t(53142);u.exports=function(u,e,t){var o=e(u);return r(u)?o:n(o,t(u))}},56027(u,e,t){var n=t(87379),r=t(80547);u.exports=function(u){return r(u)&&"[object Arguments]"==n(u)}},80777(u,e,t){var n=t(28486),r=t(80547);u.exports=function(u){return r(u)&&"[object Map]"==n(u)}},81935(u,e,t){var n=t(28486),r=t(80547);u.exports=function(u){return r(u)&&"[object Set]"==n(u)}},70674(u,e,t){var n=t(87379),r=t(65387),o=t(80547),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,u.exports=function(u){return o(u)&&r(u.length)&&!!i[n(u)]}},195(u,e,t){var n=t(84882),r=t(98121),o=Object.prototype.hasOwnProperty;u.exports=function(u){if(!n(u))return r(u);var e=[];for(var t in Object(u))o.call(u,t)&&"constructor"!=t&&e.push(t);return e}},57200(u,e,t){var n=t(41580),r=t(84882),o=t(38546),i=Object.prototype.hasOwnProperty;u.exports=function(u){if(!n(u))return o(u);var e=r(u),t=[];for(var s in u)"constructor"==s&&(e||!i.call(u,s))||t.push(s);return t}},47403(u,e,t){var n=t(82619),r=t(72532),o=t(22053);u.exports=r?function(u,e){return r(u,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:o},26137(u){u.exports=function(u,e){for(var t=-1,n=Array(u);++t<u;)n[t]=e(t);return n}},49460(u){u.exports=function(u){return function(e){return u(e)}}},81586(u,e,t){var n=t(93526),r=t(98087),o=t(13398),i=t(66040);u.exports=function(u,e){return e=n(e,u),null==(u=o(u,e))||delete u[i(r(e))]}},58898(u,e,t){var n=t(31623);u.exports=function(u){var e=new u.constructor(u.byteLength);return new n(e).set(new n(u)),e}},17099(u,e,t){u=t.nmd(u);var n=t(78942),r=e&&!e.nodeType&&e,o=r&&u&&!u.nodeType&&u,i=o&&o.exports===r?n.Buffer:void 0,s=i?i.allocUnsafe:void 0;u.exports=function(u,e){if(e)return u.slice();var t=u.length,n=s?s(t):new u.constructor(t);return u.copy(n),n}},92480(u,e,t){var n=t(58898);u.exports=function(u,e){var t=e?n(u.buffer):u.buffer;return new u.constructor(t,u.byteOffset,u.byteLength)}},78340(u){var e=/\w*$/;u.exports=function(u){var t=new u.constructor(u.source,e.exec(u));return t.lastIndex=u.lastIndex,t}},18069(u,e,t){var n=t(65650),r=n?n.prototype:void 0,o=r?r.valueOf:void 0;u.exports=function(u){return o?Object(o.call(u)):{}}},92264(u,e,t){var n=t(58898);u.exports=function(u,e){var t=e?n(u.buffer):u.buffer;return new u.constructor(t,u.byteOffset,u.length)}},84354(u){u.exports=function(u,e){var t=-1,n=u.length;for(e||(e=Array(n));++t<n;)e[t]=u[t];return e}},39032(u,e,t){var n=t(3422),r=t(57073);u.exports=function(u,e,t,o){var i=!t;t||(t={});for(var s=-1,a=e.length;++s<a;){var D=e[s],l=o?o(t[D],u[D],D,t,u):void 0;void 0===l&&(l=u[D]),i?r(t,D,l):n(t,D,l)}return t}},83546(u,e,t){var n=t(39032),r=t(77979);u.exports=function(u,e){return n(u,r(u),e)}},24733(u,e,t){var n=t(39032),r=t(85832);u.exports=function(u,e){return n(u,r(u),e)}},29259(u,e,t){var n=t(48360);u.exports=function(u){return n(u)?void 0:u}},72532(u,e,t){var n=t(94715);u.exports=function(){try{var u=n(Object,"defineProperty");return u({},"",{}),u}catch(u){}}()},41439(u,e,t){var n=t(75857),r=t(75234),o=t(80796);u.exports=function(u){return o(r(u,void 0,n),u+"")}},80393(u,e,t){var n=t(48244),r=t(77979),o=t(81211);u.exports=function(u){return n(u,o,r)}},93650(u,e,t){var n=t(48244),r=t(85832),o=t(25288);u.exports=function(u){return n(u,o,r)}},74784(u,e,t){u.exports=t(3766)(Object.getPrototypeOf,Object)},77979(u,e,t){var n=t(79847),r=t(99306),o=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols;u.exports=i?function(u){return null==u?[]:n(i(u=Object(u)),function(e){return o.call(u,e)})}:r},85832(u,e,t){var n=t(11129),r=t(74784),o=t(77979),i=t(99306);u.exports=Object.getOwnPropertySymbols?function(u){for(var e=[];u;)n(e,o(u)),u=r(u);return e}:i},28486(u,e,t){var n=t(33103),r=t(19770),o=t(89413),i=t(64512),s=t(19270),a=t(87379),D=t(64066),l="[object Map]",c="[object Promise]",p="[object Set]",A="[object WeakMap]",C="[object DataView]",F=D(n),h=D(r),f=D(o),E=D(i),g=D(s),m=a;(n&&m(new n(new ArrayBuffer(1)))!=C||r&&m(new r)!=l||o&&m(o.resolve())!=c||i&&m(new i)!=p||s&&m(new s)!=A)&&(m=function(u){var e=a(u),t="[object Object]"==e?u.constructor:void 0,n=t?D(t):"";if(n)switch(n){case F:return C;case h:return l;case f:return c;case E:return p;case g:return A}return e}),u.exports=m},97350(u){var e=Object.prototype.hasOwnProperty;u.exports=function(u){var t=u.length,n=new u.constructor(t);return t&&"string"==typeof u[0]&&e.call(u,"index")&&(n.index=u.index,n.input=u.input),n}},50424(u,e,t){var n=t(58898),r=t(92480),o=t(78340),i=t(18069),s=t(92264);u.exports=function(u,e,t){var a=u.constructor;switch(e){case"[object ArrayBuffer]":return n(u);case"[object Boolean]":case"[object Date]":return new a(+u);case"[object DataView]":return r(u,t);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(u,t);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(u);case"[object RegExp]":return o(u);case"[object Symbol]":return i(u)}}},75964(u,e,t){var n=t(39747),r=t(74784),o=t(84882);u.exports=function(u){return"function"!=typeof u.constructor||o(u)?{}:n(r(u))}},20714(u,e,t){var n=t(65650),r=t(3283),o=t(53142),i=n?n.isConcatSpreadable:void 0;u.exports=function(u){return o(u)||r(u)||!!(i&&u&&u[i])}},69632(u){var e=/^(?:0|[1-9]\d*)$/;u.exports=function(u,t){var n=typeof u;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&e.test(u))&&u>-1&&u%1==0&&u<t}},84882(u){var e=Object.prototype;u.exports=function(u){var t=u&&u.constructor;return u===("function"==typeof t&&t.prototype||e)}},98121(u,e,t){u.exports=t(3766)(Object.keys,Object)},38546(u){u.exports=function(u){var e=[];if(null!=u)for(var t in Object(u))e.push(t);return e}},2306(u,e,t){u=t.nmd(u);var n=t(74967),r=e&&!e.nodeType&&e,o=r&&u&&!u.nodeType&&u,i=o&&o.exports===r&&n.process,s=function(){try{var u=o&&o.require&&o.require("util").types;if(u)return u;return i&&i.binding&&i.binding("util")}catch(u){}}();u.exports=s},3766(u){u.exports=function(u,e){return function(t){return u(e(t))}}},75234(u,e,t){var n=t(86912),r=Math.max;u.exports=function(u,e,t){return e=r(void 0===e?u.length-1:e,0),function(){for(var o=arguments,i=-1,s=r(o.length-e,0),a=Array(s);++i<s;)a[i]=o[e+i];i=-1;for(var D=Array(e+1);++i<e;)D[i]=o[i];return D[e]=t(a),n(u,this,D)}}},13398(u,e,t){var n=t(57923),r=t(73501);u.exports=function(u,e){return e.length<2?u:n(u,r(e,0,-1))}},80796(u,e,t){var n=t(47403);u.exports=t(3316)(n)},3316(u){var e=Date.now;u.exports=function(u){var t=0,n=0;return function(){var r=e(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return u.apply(void 0,arguments)}}},64103(u,e,t){var n=t(1386);u.exports=function(){this.__data__=new n,this.size=0}},21779(u){u.exports=function(u){var e=this.__data__,t=e.delete(u);return this.size=e.size,t}},34162(u){u.exports=function(u){return this.__data__.get(u)}},7462(u){u.exports=function(u){return this.__data__.has(u)}},96638(u,e,t){var n=t(1386),r=t(19770),o=t(68250);u.exports=function(u,e){var t=this.__data__;if(t instanceof n){var i=t.__data__;if(!r||i.length<199)return i.push([u,e]),this.size=++t.size,this;t=this.__data__=new o(i)}return t.set(u,e),this.size=t.size,this}},99677(u,e,t){var n=t(56005);u.exports=t(93640)(function(u,e,t){return e=e.toLowerCase(),u+(t?n(e):e)})},56005(u,e,t){var n=t(95243),r=t(5485);u.exports=function(u){return r(n(u).toLowerCase())}},82619(u){u.exports=function(u){return function(){return u}}},75857(u,e,t){var n=t(90313);u.exports=function(u){return(null==u?0:u.length)?n(u,1):[]}},22053(u){u.exports=function(u){return u}},3283(u,e,t){var n=t(56027),r=t(80547),o=Object.prototype,i=o.hasOwnProperty,s=o.propertyIsEnumerable;u.exports=n(function(){return arguments}())?n:function(u){return r(u)&&i.call(u,"callee")&&!s.call(u,"callee")}},36529(u,e,t){var n=t(93655),r=t(65387);u.exports=function(u){return null!=u&&r(u.length)&&!n(u)}},75853(u,e,t){u=t.nmd(u);var n=t(78942),r=t(34772),o=e&&!e.nodeType&&e,i=o&&u&&!u.nodeType&&u,s=i&&i.exports===o?n.Buffer:void 0,a=s?s.isBuffer:void 0;u.exports=a||r},65387(u){u.exports=function(u){return"number"==typeof u&&u>-1&&u%1==0&&u<=0x1fffffffffffff}},37681(u,e,t){var n=t(80777),r=t(49460),o=t(2306),i=o&&o.isMap;u.exports=i?r(i):n},48360(u,e,t){var n=t(87379),r=t(74784),o=t(80547),i=Object.prototype,s=Function.prototype.toString,a=i.hasOwnProperty,D=s.call(Object);u.exports=function(u){if(!o(u)||"[object Object]"!=n(u))return!1;var e=r(u);if(null===e)return!0;var t=a.call(e,"constructor")&&e.constructor;return"function"==typeof t&&t instanceof t&&s.call(t)==D}},83943(u,e,t){var n=t(81935),r=t(49460),o=t(2306),i=o&&o.isSet;u.exports=i?r(i):n},8666(u,e,t){var n=t(70674),r=t(49460),o=t(2306),i=o&&o.isTypedArray;u.exports=i?r(i):n},81211(u,e,t){var n=t(10358),r=t(195),o=t(36529);u.exports=function(u){return o(u)?n(u):r(u)}},25288(u,e,t){var n=t(10358),r=t(57200),o=t(36529);u.exports=function(u){return o(u)?n(u,!0):r(u)}},98087(u){u.exports=function(u){var e=null==u?0:u.length;return e?u[e-1]:void 0}},3326(u,e,t){var n=t(65111),r=t(69334),o=t(81586),i=t(93526),s=t(39032),a=t(29259),D=t(41439),l=t(93650);u.exports=D(function(u,e){var t={};if(null==u)return t;var D=!1;e=n(e,function(e){return e=i(e,u),D||(D=e.length>1),e}),s(u,l(u),t),D&&(t=r(t,7,a));for(var c=e.length;c--;)o(t,e[c]);return t})},79867(u,e,t){u.exports=t(93640)(function(u,e,t){return u+(t?"_":"")+e.toLowerCase()})},99306(u){u.exports=function(){return[]}},34772(u){u.exports=function(){return!1}},7604(u,e,t){var n=t(59002),r=Object.prototype.hasOwnProperty,o="u">typeof Map;function i(){this._array=[],this._set=o?new Map:Object.create(null)}i.fromArray=function(u,e){for(var t=new i,n=0,r=u.length;n<r;n++)t.add(u[n],e);return t},i.prototype.size=function(){return o?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(u,e){var t=o?u:n.toSetString(u),i=o?this.has(u):r.call(this._set,t),s=this._array.length;(!i||e)&&this._array.push(u),i||(o?this._set.set(u,s):this._set[t]=s)},i.prototype.has=function(u){if(o)return this._set.has(u);var e=n.toSetString(u);return r.call(this._set,e)},i.prototype.indexOf=function(u){if(o){var e=this._set.get(u);if(e>=0)return e}else{var t=n.toSetString(u);if(r.call(this._set,t))return this._set[t]}throw Error('"'+u+'" is not in the set.')},i.prototype.at=function(u){if(u>=0&&u<this._array.length)return this._array[u];throw Error("No element indexed by "+u)},i.prototype.toArray=function(){return this._array.slice()},e.C=i},17853(u,e,t){var n=t(53845);e.encode=function(u){var e,t="",r=u<0?(-u<<1)+1:(u<<1)+0;do e=31&r,(r>>>=5)>0&&(e|=32),t+=n.encode(e);while(r>0);return t},e.decode=function(u,e,t){var r,o,i,s,a=u.length,D=0,l=0;do{if(e>=a)throw Error("Expected more digits in base 64 VLQ value.");if(-1===(s=n.decode(u.charCodeAt(e++))))throw Error("Invalid base64 digit: "+u.charAt(e-1));i=!!(32&s),s&=31,D+=s<<l,l+=5}while(i);o=(r=D)>>1,t.value=(1&r)==1?-o:o,t.rest=e}},53845(u,e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(u){if(0<=u&&u<t.length)return t[u];throw TypeError("Must be between 0 and 63: "+u)},e.decode=function(u){return 65<=u&&u<=90?u-65:97<=u&&u<=122?u-97+26:48<=u&&u<=57?u-48+52:43==u?62:47==u?63:-1}},37120(u,e){e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2,e.search=function(u,t,n,r){if(0===t.length)return -1;var o=function u(t,n,r,o,i,s){var a=Math.floor((n-t)/2)+t,D=i(r,o[a],!0);return 0===D?a:D>0?n-a>1?u(a,n,r,o,i,s):s==e.LEAST_UPPER_BOUND?n<o.length?n:-1:a:a-t>1?u(t,a,r,o,i,s):s==e.LEAST_UPPER_BOUND?a:t<0?-1:t}(-1,t.length,u,t,n,r||e.GREATEST_LOWER_BOUND);if(o<0)return -1;for(;o-1>=0&&0===n(t[o],t[o-1],!0);)--o;return o}},7599(u,e,t){var n=t(59002);function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(u,e){this._array.forEach(u,e)},r.prototype.add=function(u){var e,t,r,o,i;(e=this._last,t=e.generatedLine,r=u.generatedLine,o=e.generatedColumn,i=u.generatedColumn,r>t||r==t&&i>=o||0>=n.compareByGeneratedPositionsInflated(e,u))?this._last=u:this._sorted=!1,this._array.push(u)},r.prototype.toArray=function(){return this._sorted||(this._array.sort(n.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.P=r},5776(u,e){function t(u,e,t){var n=u[e];u[e]=u[t],u[t]=n}e.g=function(u,e){!function u(e,n,r,o){if(r<o){var i=Math.round(r+Math.random()*(o-r)),s=r-1;t(e,i,o);for(var a=e[o],D=r;D<o;D++)0>=n(e[D],a)&&t(e,s+=1,D);t(e,s+1,D);var l=s+1;u(e,n,r,l-1),u(e,n,l+1,o)}}(u,e,0,u.length-1)}},73697(u,e,t){var n=t(59002),r=t(37120),o=t(7604).C,i=t(17853),s=t(5776).g;function a(u,e){var t=u;return"string"==typeof u&&(t=n.parseSourceMapInput(u)),null!=t.sections?new c(t,e):new D(t,e)}function D(u,e){var t=u;"string"==typeof u&&(t=n.parseSourceMapInput(u));var r=n.getArg(t,"version"),i=n.getArg(t,"sources"),s=n.getArg(t,"names",[]),a=n.getArg(t,"sourceRoot",null),D=n.getArg(t,"sourcesContent",null),l=n.getArg(t,"mappings"),c=n.getArg(t,"file",null);if(r!=this._version)throw Error("Unsupported version: "+r);a&&(a=n.normalize(a)),i=i.map(String).map(n.normalize).map(function(u){return a&&n.isAbsolute(a)&&n.isAbsolute(u)?n.relative(a,u):u}),this._names=o.fromArray(s.map(String),!0),this._sources=o.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(u){return n.computeSourceURL(a,u,e)}),this.sourceRoot=a,this.sourcesContent=D,this._mappings=l,this._sourceMapURL=e,this.file=c}function l(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function c(u,e){var t=u;"string"==typeof u&&(t=n.parseSourceMapInput(u));var r=n.getArg(t,"version"),i=n.getArg(t,"sections");if(r!=this._version)throw Error("Unsupported version: "+r);this._sources=new o,this._names=new o;var s={line:-1,column:0};this._sections=i.map(function(u){if(u.url)throw Error("Support for url field in sections not implemented.");var t=n.getArg(u,"offset"),r=n.getArg(t,"line"),o=n.getArg(t,"column");if(r<s.line||r===s.line&&o<s.column)throw Error("Section offsets must be ordered and non-overlapping.");return s=t,{generatedOffset:{generatedLine:r+1,generatedColumn:o+1},consumer:new a(n.getArg(u,"map"),e)}})}a.fromSourceMap=function(u,e){return D.fromSourceMap(u,e)},a.prototype._version=3,a.prototype.__generatedMappings=null,Object.defineProperty(a.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),a.prototype.__originalMappings=null,Object.defineProperty(a.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),a.prototype._charIsMappingSeparator=function(u,e){var t=u.charAt(e);return";"===t||","===t},a.prototype._parseMappings=function(u,e){throw Error("Subclasses must implement _parseMappings")},a.GENERATED_ORDER=1,a.ORIGINAL_ORDER=2,a.GREATEST_LOWER_BOUND=1,a.LEAST_UPPER_BOUND=2,a.prototype.eachMapping=function(u,e,t){switch(t||a.GENERATED_ORDER){case a.GENERATED_ORDER:r=this._generatedMappings;break;case a.ORIGINAL_ORDER:r=this._originalMappings;break;default:throw Error("Unknown order of iteration.")}var r,o=this.sourceRoot;r.map(function(u){var e=null===u.source?null:this._sources.at(u.source);return{source:e=n.computeSourceURL(o,e,this._sourceMapURL),generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:null===u.name?null:this._names.at(u.name)}},this).forEach(u,e||null)},a.prototype.allGeneratedPositionsFor=function(u){var e=n.getArg(u,"line"),t={source:n.getArg(u,"source"),originalLine:e,originalColumn:n.getArg(u,"column",0)};if(t.source=this._findSourceIndex(t.source),t.source<0)return[];var o=[],i=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,r.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(void 0===u.column)for(var a=s.originalLine;s&&s.originalLine===a;)o.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var D=s.originalColumn;s&&s.originalLine===e&&s.originalColumn==D;)o.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o},D.prototype=Object.create(a.prototype),D.prototype.consumer=a,D.prototype._findSourceIndex=function(u){var e,t=u;if(null!=this.sourceRoot&&(t=n.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);for(e=0;e<this._absoluteSources.length;++e)if(this._absoluteSources[e]==u)return e;return -1},D.fromSourceMap=function(u,e){var t=Object.create(D.prototype),r=t._names=o.fromArray(u._names.toArray(),!0),i=t._sources=o.fromArray(u._sources.toArray(),!0);t.sourceRoot=u._sourceRoot,t.sourcesContent=u._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=u._file,t._sourceMapURL=e,t._absoluteSources=t._sources.toArray().map(function(u){return n.computeSourceURL(t.sourceRoot,u,e)});for(var a=u._mappings.toArray().slice(),c=t.__generatedMappings=[],p=t.__originalMappings=[],A=0,C=a.length;A<C;A++){var F=a[A],h=new l;h.generatedLine=F.generatedLine,h.generatedColumn=F.generatedColumn,F.source&&(h.source=i.indexOf(F.source),h.originalLine=F.originalLine,h.originalColumn=F.originalColumn,F.name&&(h.name=r.indexOf(F.name)),p.push(h)),c.push(h)}return s(t.__originalMappings,n.compareByOriginalPositions),t},D.prototype._version=3,Object.defineProperty(D.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),D.prototype._parseMappings=function(u,e){for(var t,r,o,a,D,c=1,p=0,A=0,C=0,F=0,h=0,f=u.length,E=0,g={},m={},B=[],d=[];E<f;)if(";"===u.charAt(E))c++,E++,p=0;else if(","===u.charAt(E))E++;else{for((t=new l).generatedLine=c,a=E;a<f&&!this._charIsMappingSeparator(u,a);a++);if(o=g[r=u.slice(E,a)])E+=r.length;else{for(o=[];E<a;)i.decode(u,E,m),D=m.value,E=m.rest,o.push(D);if(2===o.length)throw Error("Found a source, but no line and column");if(3===o.length)throw Error("Found a source and line, but no column");g[r]=o}t.generatedColumn=p+o[0],p=t.generatedColumn,o.length>1&&(t.source=F+o[1],F+=o[1],t.originalLine=A+o[2],A=t.originalLine,t.originalLine+=1,t.originalColumn=C+o[3],C=t.originalColumn,o.length>4&&(t.name=h+o[4],h+=o[4])),d.push(t),"number"==typeof t.originalLine&&B.push(t)}s(d,n.compareByGeneratedPositionsDeflated),this.__generatedMappings=d,s(B,n.compareByOriginalPositions),this.__originalMappings=B},D.prototype._findMapping=function(u,e,t,n,o,i){if(u[t]<=0)throw TypeError("Line must be greater than or equal to 1, got "+u[t]);if(u[n]<0)throw TypeError("Column must be greater than or equal to 0, got "+u[n]);return r.search(u,e,o,i)},D.prototype.computeColumnSpans=function(){for(var u=0;u<this._generatedMappings.length;++u){var e=this._generatedMappings[u];if(u+1<this._generatedMappings.length){var t=this._generatedMappings[u+1];if(e.generatedLine===t.generatedLine){e.lastGeneratedColumn=t.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}},D.prototype.originalPositionFor=function(u){var e={generatedLine:n.getArg(u,"line"),generatedColumn:n.getArg(u,"column")},t=this._findMapping(e,this._generatedMappings,"generatedLine","generatedColumn",n.compareByGeneratedPositionsDeflated,n.getArg(u,"bias",a.GREATEST_LOWER_BOUND));if(t>=0){var r=this._generatedMappings[t];if(r.generatedLine===e.generatedLine){var o=n.getArg(r,"source",null);null!==o&&(o=this._sources.at(o),o=n.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var i=n.getArg(r,"name",null);return null!==i&&(i=this._names.at(i)),{source:o,line:n.getArg(r,"originalLine",null),column:n.getArg(r,"originalColumn",null),name:i}}}return{source:null,line:null,column:null,name:null}},D.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(u){return null==u})},D.prototype.sourceContentFor=function(u,e){if(!this.sourcesContent)return null;var t,r=this._findSourceIndex(u);if(r>=0)return this.sourcesContent[r];var o=u;if(null!=this.sourceRoot&&(o=n.relative(this.sourceRoot,o)),null!=this.sourceRoot&&(t=n.urlParse(this.sourceRoot))){var i=o.replace(/^file:\/\//,"");if("file"==t.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!t.path||"/"==t.path)&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(e)return null;throw Error('"'+o+'" is not in the SourceMap.')},D.prototype.generatedPositionFor=function(u){var e=n.getArg(u,"source");if((e=this._findSourceIndex(e))<0)return{line:null,column:null,lastColumn:null};var t={source:e,originalLine:n.getArg(u,"line"),originalColumn:n.getArg(u,"column")},r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,n.getArg(u,"bias",a.GREATEST_LOWER_BOUND));if(r>=0){var o=this._originalMappings[r];if(o.source===t.source)return{line:n.getArg(o,"generatedLine",null),column:n.getArg(o,"generatedColumn",null),lastColumn:n.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},c.prototype=Object.create(a.prototype),c.prototype.constructor=a,c.prototype._version=3,Object.defineProperty(c.prototype,"sources",{get:function(){for(var u=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)u.push(this._sections[e].consumer.sources[t]);return u}}),c.prototype.originalPositionFor=function(u){var e={generatedLine:n.getArg(u,"line"),generatedColumn:n.getArg(u,"column")},t=r.search(e,this._sections,function(u,e){var t=u.generatedLine-e.generatedOffset.generatedLine;return t||u.generatedColumn-e.generatedOffset.generatedColumn}),o=this._sections[t];return o?o.consumer.originalPositionFor({line:e.generatedLine-(o.generatedOffset.generatedLine-1),column:e.generatedColumn-(o.generatedOffset.generatedLine===e.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:u.bias}):{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(u){return u.consumer.hasContentsOfAllSources()})},c.prototype.sourceContentFor=function(u,e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t].consumer.sourceContentFor(u,!0);if(n)return n}if(e)return null;throw Error('"'+u+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(u){for(var e=0;e<this._sections.length;e++){var t=this._sections[e];if(-1!==t.consumer._findSourceIndex(n.getArg(u,"source"))){var r=t.consumer.generatedPositionFor(u);if(r)return{line:r.line+(t.generatedOffset.generatedLine-1),column:r.column+(t.generatedOffset.generatedLine===r.line?t.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},c.prototype._parseMappings=function(u,e){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var r=this._sections[t],o=r.consumer._generatedMappings,i=0;i<o.length;i++){var a=o[i],D=r.consumer._sources.at(a.source);D=n.computeSourceURL(r.consumer.sourceRoot,D,this._sourceMapURL),this._sources.add(D),D=this._sources.indexOf(D);var l=null;a.name&&(l=r.consumer._names.at(a.name),this._names.add(l),l=this._names.indexOf(l));var c={source:D,generatedLine:a.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(r.generatedOffset.generatedLine===a.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:l};this.__generatedMappings.push(c),"number"==typeof c.originalLine&&this.__originalMappings.push(c)}s(this.__generatedMappings,n.compareByGeneratedPositionsDeflated),s(this.__originalMappings,n.compareByOriginalPositions)}},32(u,e,t){var n=t(17853),r=t(59002),o=t(7604).C,i=t(7599).P;function s(u){u||(u={}),this._file=r.getArg(u,"file",null),this._sourceRoot=r.getArg(u,"sourceRoot",null),this._skipValidation=r.getArg(u,"skipValidation",!1),this._sources=new o,this._names=new o,this._mappings=new i,this._sourcesContents=null}s.prototype._version=3,s.fromSourceMap=function(u){var e=u.sourceRoot,t=new s({file:u.file,sourceRoot:e});return u.eachMapping(function(u){var n={generated:{line:u.generatedLine,column:u.generatedColumn}};null!=u.source&&(n.source=u.source,null!=e&&(n.source=r.relative(e,n.source)),n.original={line:u.originalLine,column:u.originalColumn},null!=u.name&&(n.name=u.name)),t.addMapping(n)}),u.sources.forEach(function(n){var o=n;null!==e&&(o=r.relative(e,n)),t._sources.has(o)||t._sources.add(o);var i=u.sourceContentFor(n);null!=i&&t.setSourceContent(n,i)}),t},s.prototype.addMapping=function(u){var e=r.getArg(u,"generated"),t=r.getArg(u,"original",null),n=r.getArg(u,"source",null),o=r.getArg(u,"name",null);this._skipValidation||this._validateMapping(e,t,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:null!=t&&t.line,originalColumn:null!=t&&t.column,source:n,name:o})},s.prototype.setSourceContent=function(u,e){var t=u;null!=this._sourceRoot&&(t=r.relative(this._sourceRoot,t)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[r.toSetString(t)]=e):this._sourcesContents&&(delete this._sourcesContents[r.toSetString(t)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},s.prototype.applySourceMap=function(u,e,t){var n=e;if(null==e){if(null==u.file)throw Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=u.file}var i=this._sourceRoot;null!=i&&(n=r.relative(i,n));var s=new o,a=new o;this._mappings.unsortedForEach(function(e){if(e.source===n&&null!=e.originalLine){var o=u.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=o.source&&(e.source=o.source,null!=t&&(e.source=r.join(t,e.source)),null!=i&&(e.source=r.relative(i,e.source)),e.originalLine=o.line,e.originalColumn=o.column,null!=o.name&&(e.name=o.name))}var D=e.source;null==D||s.has(D)||s.add(D);var l=e.name;null==l||a.has(l)||a.add(l)},this),this._sources=s,this._names=a,u.sources.forEach(function(e){var n=u.sourceContentFor(e);null!=n&&(null!=t&&(e=r.join(t,e)),null!=i&&(e=r.relative(i,e)),this.setSourceContent(e,n))},this)},s.prototype._validateMapping=function(u,e,t,n){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!u||!("line"in u)||!("column"in u)||!(u.line>0)||!(u.column>=0)||e||t||n){if(!u||!("line"in u)||!("column"in u)||!e||!("line"in e)||!("column"in e)||!(u.line>0)||!(u.column>=0)||!(e.line>0)||!(e.column>=0)||!t)throw Error("Invalid mapping: "+JSON.stringify({generated:u,source:t,original:e,name:n}))}},s.prototype._serializeMappings=function(){for(var u,e,t,o,i=0,s=1,a=0,D=0,l=0,c=0,p="",A=this._mappings.toArray(),C=0,F=A.length;C<F;C++){if(e=A[C],u="",e.generatedLine!==s)for(i=0;e.generatedLine!==s;)u+=";",s++;else if(C>0){if(!r.compareByGeneratedPositionsInflated(e,A[C-1]))continue;u+=","}u+=n.encode(e.generatedColumn-i),i=e.generatedColumn,null!=e.source&&(o=this._sources.indexOf(e.source),u+=n.encode(o-c),c=o,u+=n.encode(e.originalLine-1-D),D=e.originalLine-1,u+=n.encode(e.originalColumn-a),a=e.originalColumn,null!=e.name&&(t=this._names.indexOf(e.name),u+=n.encode(t-l),l=t)),p+=u}return p},s.prototype._generateSourcesContent=function(u,e){return u.map(function(u){if(!this._sourcesContents)return null;null!=e&&(u=r.relative(e,u));var t=r.toSetString(u);return Object.prototype.hasOwnProperty.call(this._sourcesContents,t)?this._sourcesContents[t]:null},this)},s.prototype.toJSON=function(){var u={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(u.file=this._file),null!=this._sourceRoot&&(u.sourceRoot=this._sourceRoot),this._sourcesContents&&(u.sourcesContent=this._generateSourcesContent(u.sources,u.sourceRoot)),u},s.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.x=s},25060(u,e,t){var n=t(32).x,r=t(59002),o=/(\r?\n)/,i="$$$isSourceNode$$$";function s(u,e,t,n,r){this.children=[],this.sourceContents={},this.line=null==u?null:u,this.column=null==e?null:e,this.source=null==t?null:t,this.name=null==r?null:r,this[i]=!0,null!=n&&this.add(n)}s.fromStringWithSourceMap=function(u,e,t){var n=new s,i=u.split(o),a=0,D=function(){return u()+(u()||"");function u(){return a<i.length?i[a++]:void 0}},l=1,c=0,p=null;return e.eachMapping(function(u){if(null!==p)if(l<u.generatedLine)A(p,D()),l++,c=0;else{var e=i[a]||"",t=e.substr(0,u.generatedColumn-c);i[a]=e.substr(u.generatedColumn-c),c=u.generatedColumn,A(p,t),p=u;return}for(;l<u.generatedLine;)n.add(D()),l++;if(c<u.generatedColumn){var e=i[a]||"";n.add(e.substr(0,u.generatedColumn)),i[a]=e.substr(u.generatedColumn),c=u.generatedColumn}p=u},this),a<i.length&&(p&&A(p,D()),n.add(i.splice(a).join(""))),e.sources.forEach(function(u){var o=e.sourceContentFor(u);null!=o&&(null!=t&&(u=r.join(t,u)),n.setSourceContent(u,o))}),n;function A(u,e){if(null===u||void 0===u.source)n.add(e);else{var o=t?r.join(t,u.source):u.source;n.add(new s(u.originalLine,u.originalColumn,o,e,u.name))}}},s.prototype.add=function(u){if(Array.isArray(u))u.forEach(function(u){this.add(u)},this);else if(u[i]||"string"==typeof u)u&&this.children.push(u);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+u);return this},s.prototype.prepend=function(u){if(Array.isArray(u))for(var e=u.length-1;e>=0;e--)this.prepend(u[e]);else if(u[i]||"string"==typeof u)this.children.unshift(u);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+u);return this},s.prototype.walk=function(u){for(var e,t=0,n=this.children.length;t<n;t++)(e=this.children[t])[i]?e.walk(u):""!==e&&u(e,{source:this.source,line:this.line,column:this.column,name:this.name})},s.prototype.join=function(u){var e,t,n=this.children.length;if(n>0){for(t=0,e=[];t<n-1;t++)e.push(this.children[t]),e.push(u);e.push(this.children[t]),this.children=e}return this},s.prototype.replaceRight=function(u,e){var t=this.children[this.children.length-1];return t[i]?t.replaceRight(u,e):"string"==typeof t?this.children[this.children.length-1]=t.replace(u,e):this.children.push("".replace(u,e)),this},s.prototype.setSourceContent=function(u,e){this.sourceContents[r.toSetString(u)]=e},s.prototype.walkSourceContents=function(u){for(var e=0,t=this.children.length;e<t;e++)this.children[e][i]&&this.children[e].walkSourceContents(u);for(var n=Object.keys(this.sourceContents),e=0,t=n.length;e<t;e++)u(r.fromSetString(n[e]),this.sourceContents[n[e]])},s.prototype.toString=function(){var u="";return this.walk(function(e){u+=e}),u},s.prototype.toStringWithSourceMap=function(u){var e={code:"",line:1,column:0},t=new n(u),r=!1,o=null,i=null,s=null,a=null;return this.walk(function(u,n){e.code+=u,null!==n.source&&null!==n.line&&null!==n.column?((o!==n.source||i!==n.line||s!==n.column||a!==n.name)&&t.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:e.line,column:e.column},name:n.name}),o=n.source,i=n.line,s=n.column,a=n.name,r=!0):r&&(t.addMapping({generated:{line:e.line,column:e.column}}),o=null,r=!1);for(var D=0,l=u.length;D<l;D++)10===u.charCodeAt(D)?(e.line++,e.column=0,D+1===l?(o=null,r=!1):r&&t.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:e.line,column:e.column},name:n.name})):e.column++}),this.walkSourceContents(function(u,e){t.setSourceContent(u,e)}),{code:e.code,map:t}},e.e=s},59002(u,e){e.getArg=function(u,e,t){if(e in u)return u[e];if(3==arguments.length)return t;throw Error('"'+e+'" is a required argument.')};var t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function r(u){var e=u.match(t);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}function o(u){var e="";return u.scheme&&(e+=u.scheme+":"),e+="//",u.auth&&(e+=u.auth+"@"),u.host&&(e+=u.host),u.port&&(e+=":"+u.port),u.path&&(e+=u.path),e}function i(u){var t=u,n=r(u);if(n){if(!n.path)return u;t=n.path}for(var i,s=e.isAbsolute(t),a=t.split(/\/+/),D=0,l=a.length-1;l>=0;l--)"."===(i=a[l])?a.splice(l,1):".."===i?D++:D>0&&(""===i?(a.splice(l+1,D),D=0):(a.splice(l,2),D--));return(""===(t=a.join("/"))&&(t=s?"/":"."),n)?(n.path=t,o(n)):t}function s(u,e){""===u&&(u="."),""===e&&(e=".");var t=r(e),s=r(u);if(s&&(u=s.path||"/"),t&&!t.scheme)return s&&(t.scheme=s.scheme),o(t);if(t||e.match(n))return e;if(s&&!s.host&&!s.path)return s.host=e,o(s);var a="/"===e.charAt(0)?e:i(u.replace(/\/+$/,"")+"/"+e);return s?(s.path=a,o(s)):a}e.urlParse=r,e.urlGenerate=o,e.normalize=i,e.join=s,e.isAbsolute=function(u){return"/"===u.charAt(0)||t.test(u)},e.relative=function(u,e){""===u&&(u="."),u=u.replace(/\/$/,"");for(var t=0;0!==e.indexOf(u+"/");){var n=u.lastIndexOf("/");if(n<0||(u=u.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return e;++t}return Array(t+1).join("../")+e.substr(u.length+1)};var a=!("__proto__"in Object.create(null));function D(u){return u}function l(u){if(!u)return!1;var e=u.length;if(e<9||95!==u.charCodeAt(e-1)||95!==u.charCodeAt(e-2)||111!==u.charCodeAt(e-3)||116!==u.charCodeAt(e-4)||111!==u.charCodeAt(e-5)||114!==u.charCodeAt(e-6)||112!==u.charCodeAt(e-7)||95!==u.charCodeAt(e-8)||95!==u.charCodeAt(e-9))return!1;for(var t=e-10;t>=0;t--)if(36!==u.charCodeAt(t))return!1;return!0}function c(u,e){return u===e?0:null===u?1:null===e?-1:u>e?1:-1}e.toSetString=a?D:function(u){return l(u)?"$"+u:u},e.fromSetString=a?D:function(u){return l(u)?u.slice(1):u},e.compareByOriginalPositions=function(u,e,t){var n=c(u.source,e.source);return 0!==n||0!=(n=u.originalLine-e.originalLine)||0!=(n=u.originalColumn-e.originalColumn)||t||0!=(n=u.generatedColumn-e.generatedColumn)||0!=(n=u.generatedLine-e.generatedLine)?n:c(u.name,e.name)},e.compareByGeneratedPositionsDeflated=function(u,e,t){var n=u.generatedLine-e.generatedLine;return 0!==n||0!=(n=u.generatedColumn-e.generatedColumn)||t||0!==(n=c(u.source,e.source))||0!=(n=u.originalLine-e.originalLine)||0!=(n=u.originalColumn-e.originalColumn)?n:c(u.name,e.name)},e.compareByGeneratedPositionsInflated=function(u,e){var t=u.generatedLine-e.generatedLine;return 0!==t||0!=(t=u.generatedColumn-e.generatedColumn)||0!==(t=c(u.source,e.source))||0!=(t=u.originalLine-e.originalLine)||0!=(t=u.originalColumn-e.originalColumn)?t:c(u.name,e.name)},e.parseSourceMapInput=function(u){return JSON.parse(u.replace(/^\)]}'[^\n]*\n/,""))},e.computeSourceURL=function(u,e,t){if(e=e||"",u&&("/"!==u[u.length-1]&&"/"!==e[0]&&(u+="/"),e=u+e),t){var n=r(t);if(!n)throw Error("sourceMapURL could not be parsed");if(n.path){var a=n.path.lastIndexOf("/");a>=0&&(n.path=n.path.substring(0,a+1))}e=s(o(n),e)}return i(e)}},62096(u,e,t){t(32).x,t(73697),e.ee=t(25060).e},67996(u,e,t){var n=t(51112);u.exports=function(u,e){if(null==u)return{};var t,r,o=n(u,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(u);for(r=0;r<i.length;r++)t=i[r],-1===e.indexOf(t)&&({}).propertyIsEnumerable.call(u,t)&&(o[t]=u[t])}return o},u.exports.__esModule=!0,u.exports.default=u.exports},51112(u){u.exports=function(u,e){if(null==u)return{};var t={};for(var n in u)if(({}).hasOwnProperty.call(u,n)){if(-1!==e.indexOf(n))continue;t[n]=u[n]}return t},u.exports.__esModule=!0,u.exports.default=u.exports}};
package/lib/940.js CHANGED
@@ -1 +1 @@
1
- import*as e from"ink";import*as l from"react";import{Fragment as r,jsx as t,jsxs as n}from"react/jsx-runtime";export const __rspack_esm_id=940;export const __rspack_esm_ids=[940];export const __webpack_modules__={8498(l){l.exports=e},51649(e){e.exports=l},92319(e,l,i){i.r(l),i.d(l,{AppList:()=>O,CONTROL_ACTIONS:()=>T,MainMenu:()=>I,Header:()=>y,ModuleDetail:()=>R,ONLINE_THRESHOLD_MS:()=>p,ShortEditEditor:()=>q,MediaFileList:()=>F,App:()=>es,DeviceDetail:()=>L,VIEWS:()=>m,runInteractiveMode:()=>ex,DeviceList:()=>C,MediaBoxList:()=>$,Loading:()=>D,DeviceControl:()=>k,ProjectInitView:()=>eu,GroupDetail:()=>G,ModuleList:()=>P,MediaBoxDetail:()=>V,GroupList:()=>N,Footer:()=>b,DeviceStatus:()=>E,AppDetail:()=>M,DeviceScreenshot:()=>w,MediaFileDetail:()=>j});var o,a,c=i(99436),d=i(51649),u=i(8498),s=i(68832),h=i(85382),x=i(23258),g=i(60450),m={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",APP_PROJECT_INIT:"app_project_init",MODULES:"modules",MODULE_DETAIL:"module_detail",MODULE_SHORT_EDIT:"module_short_edit",MODULE_PROJECT_INIT:"module_project_init",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",ACTIVITY_LOG:"activity_log"},T=[{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"}],p=3e5,f=i(47882),v=(e,l=!0)=>{var r=Math.floor(60),t=s((0,d.useState)(r),2),n=t[0],i=t[1],o=s((0,d.useState)(null),2),a=o[0],c=o[1],u=(0,d.useRef)(e);(0,d.useEffect)(()=>{u.current=e},[e]);var h=(0,d.useCallback)(()=>{i(r),c(Date.now())},[r]);return(0,d.useEffect)(()=>{if(l){var e=setInterval(()=>{i(e=>e<=1?(u.current?.(),c(Date.now()),r):e-1)},1e3);return()=>clearInterval(e)}},[l,r]),(0,d.useEffect)(()=>{l&&(i(r),c(Date.now()))},[l,r]),{countdown:n,lastRefreshTime:a,resetCountdown:h}},_=({countdown:e,lastRefreshTime:l})=>t(u.Box,{children:n(u.Text,{color:"gray",children:["Next refresh in ",n(u.Text,{color:"cyan",children:[e,"s"]}),l&&n(u.Text,{color:"gray",children:[" (last: ",l?new Date(l).toLocaleTimeString():null,")"]})]})}),y=({workspace:e,view:l})=>n(u.Box,{flexDirection:"column",marginBottom:1,children:[n(u.Box,{children:[t(u.Text,{bold:!0,color:"cyan",children:"BRICKS CLI"}),t(u.Text,{color:"gray",children:" - Interactive Mode"})]}),n(u.Box,{children:[t(u.Text,{color:"gray",children:"Workspace: "}),t(u.Text,{color:"green",children:e?.name||"Not connected"}),t(u.Text,{color:"gray",children:" | View: "}),t(u.Text,{color:"yellow",children:l})]}),t(u.Text,{color:"gray",children:"─".repeat(60)})]}),b=()=>n(u.Box,{marginTop:1,flexDirection:"column",children:[t(u.Text,{color:"gray",children:"─".repeat(60)}),n(u.Text,{color:"gray",children:["Press ",t(u.Text,{color:"cyan",children:"q"})," to quit, ",t(u.Text,{color:"cyan",children:"Esc"})," to go back"]})]}),D=({text:e})=>n(u.Box,{children:[t(u.Text,{color:"green",children:t(f.A,{type:"dots"})}),n(u.Text,{children:[" ",e||"Loading..."]})]}),E=({lastAliveTime:e})=>{if(!e)return t(u.Text,{color:"gray",children:"○ Unknown"});var l=Date.now()-new Date(e).getTime();if(l<=p)return t(u.Text,{color:"green",children:"● Online"});var r=Math.floor(l/6e4);if(r<60)return n(u.Text,{color:"yellow",children:["○ Offline (",r,"m ago)"]});var i=Math.floor(r/60);if(i<24)return n(u.Text,{color:"red",children:["○ Offline (",i,"h ago)"]});var o=Math.floor(i/24);return n(u.Text,{color:"red",children:["○ Offline (",o,"d ago)"]})},S=i(48724),I=({onSelect:e,mediaEnabled:l,activityLogEnabled:r})=>{var i=[{label:"Devices",value:m.DEVICES},{label:"Applications",value:m.APPS},{label:"Modules",value:m.MODULES},{label:"Device Groups",value:m.GROUPS},...l?[{label:"Media Flow",value:m.MEDIA_BOXES}]:[],...r?[{label:"Activity Log",value:m.ACTIVITY_LOG}]:[],{label:"Exit",value:"exit"}];return n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,marginBottom:1,children:"Main Menu"}),t(S.Ay,{items:i,onSelect:e})]})},A="1"===process.env.BRICKS_CLI_DISTRIBUTION,B=e=>{var l=s((0,d.useState)(null),2),r=l[0],n=l[1];return((0,d.useEffect)(()=>{if(!A){var e=!0;return i.e(166).then(i.bind(i,29557)).then(l=>{e&&n(()=>l.default)}).catch(()=>{e&&n(!1)}),()=>{e=!1}}},[]),A||!1===r)?t(u.Text,{color:"gray",children:"Image preview is not available in this CLI build."}):r?t(r,{...e}):t(D,{text:"Preparing image preview..."})},C=({devices:e,loading:l,onSelect:r,countdown:i,lastRefreshTime:o})=>{if(l)return t(D,{text:"Loading devices..."});if(!e?.length)return n(u.Box,{flexDirection:"column",children:[t(u.Text,{color:"yellow",children:"No devices found"}),t(_,{countdown:i,lastRefreshTime:o})]});var a=[...e.map(e=>{var l=(e=>{if(!e)return"○ Unknown";var l=Date.now()-new Date(e).getTime();if(l<=p)return"● Online";var r=Math.floor(l/6e4);if(r<60)return`○ ${r}m ago`;var t=Math.floor(r/60);if(t<24)return`○ ${t}h ago`;var n=Math.floor(t/24);return`○ ${n}d ago`})(e.entry_detail?.watch_dog_timer?.last_alive_time);return{label:`${l} - ${e.name||e.device_name}`,value:e._id,device:e}}),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(u.Box,{flexDirection:"column",children:[n(u.Box,{marginBottom:1,children:[n(u.Text,{bold:!0,children:["Devices (",e.length,")"]}),t(u.Text,{color:"gray",children:" - "}),t(_,{countdown:i,lastRefreshTime:o})]}),t(S.Ay,{items:a,onSelect:r})]})},L=({device:e,loading:l,error:r,onSelect:i,mediaEnabled:o,countdown:a,lastRefreshTime:c})=>{if(l)return t(D,{text:"Loading device..."});if(r)return n(u.Box,{flexDirection:"column",children:[n(u.Text,{color:"red",children:["Error: ",r]}),t(S.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]});if(!e)return t(u.Text,{color:"red",children:"Device not found"});var d=[{label:"Control Device",value:"control"},...o?[{label:"View Screenshot",value:"screenshot"}]:[],{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],s=e.entry_detail,h=s?.screen,x=s?.update,g=s?.local_sync;return n(u.Box,{flexDirection:"column",children:[n(u.Box,{children:[t(u.Text,{bold:!0,color:"cyan",children:e.name||e.device_name}),t(u.Text,{color:"gray",children:" - "}),t(_,{countdown:a,lastRefreshTime:c})]}),e.description&&t(u.Text,{color:"gray",children:e.description}),n(u.Box,{marginY:1,flexDirection:"column",children:[n(u.Box,{children:[t(u.Text,{color:"gray",children:"Status: "}),t(E,{lastAliveTime:s?.watch_dog_timer?.last_alive_time})]}),n(u.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&n(u.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),s?.application&&n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Application"}),n(u.Text,{color:"gray",children:[" Name: ",s.application.name]}),n(u.Text,{color:"gray",children:[" Mode: ",s.operation_mode||"N/A"]})]}),h&&n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Screen"}),h.resolution&&n(u.Text,{color:"gray",children:[" ","Resolution: ",h.resolution.width,"x",h.resolution.height,h.resolution.scale&&` @${h.resolution.scale}x`]}),h.orientation&&n(u.Text,{color:"gray",children:[" Orientation: ",h.orientation]}),h.touch&&n(u.Text,{color:"gray",children:[" ","Touch:"," ",h.touch.available?`Yes (${h.touch.touch_point} points)`:"No"]})]}),(s?.memory_usage||s?.disk_usage)&&n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"System"}),s.memory_usage&&n(u.Text,{color:"gray",children:[" Memory: ",Math.round(100*s.memory_usage),"%"]}),s.disk_usage&&n(u.Text,{color:"gray",children:[" Disk: ",Math.round(100*s.disk_usage),"%"]})]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Capabilities"}),n(u.Text,{color:"gray",children:[" ","Sound: ",s?.sound?.available?"✓":"✗"," | ","Camera: ",s?.camera?.available?"✓":"✗"," | ","Audio In: ",s?.audio_in?.available?"✓":"✗"]})]}),g&&n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Local Sync"}),n(u.Text,{color:"gray",children:[" ","Role: ",g.is_main?"Main":"Peer",g.peer_count>0&&` | Peers: ${g.peer_count}`,g.mean_latency&&` | Latency: ${g.mean_latency}ms`]})]}),x&&n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Update"}),n(u.Text,{color:x.need_update?"yellow":"gray",children:[" ","Status: ",x.need_update?"⚠ Update available":"✓ Up to date"]}),x.current_version&&n(u.Text,{color:"gray",children:[" Version: ",x.current_version]})]})]}),t(S.Ay,{items:d,onSelect:i})]})},k=({device:e,onSelect:l,controlling:r,controlResult:i})=>n(u.Box,{flexDirection:"column",children:[n(u.Text,{bold:!0,color:"cyan",children:["Control: ",e?.name||e?.device_name]}),r&&t(D,{text:"Sending command..."}),i&&t(u.Text,{color:i.success?"green":"red",children:i.message}),t(u.Box,{marginTop:1,children:t(S.Ay,{items:T,onSelect:l})})]}),w=({device:e,screenshot:l,loading:r,error:i,onSelect:o})=>{var a=l?.file?.meta,c=a?.originalWidth!=null&&a?.originalHeight!=null,d=a?.originalFileSize!=null;return n(u.Box,{flexDirection:"column",children:[n(u.Text,{bold:!0,color:"cyan",children:["Screenshot: ",e?.name||e?.device_name||"Unknown"]}),r&&t(D,{text:"Loading screenshot..."}),i&&t(u.Box,{marginY:1,children:t(u.Text,{color:"red",children:String(i)})}),!r&&!i&&l&&n(u.Box,{flexDirection:"column",children:[t(u.Box,{height:30,children:t(B,{src:l.path,width:80,alt:"Device screenshot"})}),n(u.Box,{marginY:1,flexDirection:"column",children:[t(u.Text,{bold:!0,color:"white",children:"Screenshot Details"}),n(u.Box,{marginY:1,children:[t(u.Text,{color:"green",children:"Screenshot saved to: "}),t(u.Text,{color:"cyan",children:String(l.path||"")})]}),c&&n(u.Text,{color:"gray",children:["Size: ",String(a.originalWidth),"x",String(a.originalHeight)]}),d&&n(u.Text,{color:"gray",children:["File: ",(Number(a.originalFileSize)/1024).toFixed(1)," KB"]}),l.file?.updatedAt&&n(u.Text,{color:"gray",children:["Updated: ",new Date(l.file.updatedAt).toLocaleString()]})]})]}),!r&&!i&&!l&&t(u.Box,{marginY:1,children:t(u.Text,{color:"yellow",children:"No screenshot available. Try taking a new one."})}),t(u.Box,{marginTop:1,children:t(S.Ay,{items:[{label:"Take New Screenshot",value:"take"},{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:o})})]})},O=({apps:e,loading:l,onSelect:r})=>{if(l)return t(D,{text:"Loading applications..."});if(!e?.length)return t(u.Text,{color:"yellow",children:"No applications found"});var i=[...e.map(e=>({label:`${e.has_unreleased_changes?"●":"○"} ${e.name}`,value:e._id,app:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(u.Box,{flexDirection:"column",children:[n(u.Text,{bold:!0,marginBottom:1,children:["Applications (",e.length,")"]}),t(S.Ay,{items:i,onSelect:r})]})},M=({app:e,loading:l,error:r,onSelect:i})=>{if(l)return t(D,{text:"Loading application..."});if(r)return n(u.Box,{flexDirection:"column",children:[n(u.Text,{color:"red",children:["Error: ",r]}),t(S.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]});if(!e)return t(u.Text,{color:"red",children:"Application not found"});var o=[{label:"⚡ Initialize Project",value:"project_init"},...e.short_edit?.enabled&&e.short_edit.ref_map?[{label:"Short Edit",value:"short_edit"}]:[],{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],a=e.devices?.length||0,c=e.devices?.filter(e=>"online"===e.status)?.length||0;return n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,color:"cyan",children:e.name}),e.description&&t(u.Text,{color:"gray",children:e.description}),n(u.Box,{marginY:1,flexDirection:"column",children:[n(u.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&n(u.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Version"}),n(u.Text,{color:"gray",children:[" ","Current: ",e.current_version?`v${e.current_version}`:"N/A"]}),n(u.Text,{color:e.has_unreleased_changes?"yellow":"gray",children:[" ","Changes:"," ",e.has_unreleased_changes?"● Unreleased changes":"○ No pending changes"]}),e.current_version_details&&n(u.Text,{color:"gray",children:[" ","Released: v",e.current_version_details.version||"N/A"]})]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Devices"}),n(u.Text,{color:"gray",children:[" ","Total: ",a,a>0&&` (${c} online)`]})]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Features"}),n(u.Text,{color:"gray",children:[" ","Short Edit: ",e.short_edit?.enabled?"✓ Enabled":"✗ Disabled"]}),n(u.Text,{color:"gray",children:[" ","Canvas Control: ",e.canvas_control?.enabled?"✓ Enabled":"✗ Disabled"]}),n(u.Text,{color:"gray",children:[" ","Device Control: ",e.device_control?.enabled?"✓ Enabled":"✗ Disabled"]}),n(u.Text,{color:e.lock?.enabled?"yellow":"gray",children:[" ","Lock: ",e.lock?.enabled?"\uD83D\uDD12 Locked":"\uD83D\uDD13 Unlocked"]})]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Timestamps"}),e.create_datetime&&n(u.Text,{color:"gray",children:[" Created: ",new Date(e.create_datetime).toLocaleString()]}),e.last_modify_datetime&&n(u.Text,{color:"gray",children:[" ","Modified: ",new Date(e.last_modify_datetime).toLocaleString()]})]})]}),t(S.Ay,{items:o,onSelect:i})]})},P=({modules:e,loading:l,onSelect:r})=>{if(l)return t(D,{text:"Loading modules..."});var i=[...(e||[]).map(e=>({label:`${e.current_version?"●":"○"} ${e.name}`,value:e._id,module:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(u.Box,{flexDirection:"column",children:[n(u.Text,{bold:!0,marginBottom:1,children:["Modules (",e?.length||0,")"]}),!e?.length&&t(u.Text,{color:"yellow",children:"No modules found"}),t(S.Ay,{items:i,onSelect:r})]})},R=({module:e,loading:l,error:r,onSelect:i})=>{if(l)return t(D,{text:"Loading module..."});if(r)return n(u.Box,{flexDirection:"column",children:[n(u.Text,{color:"red",children:["Error: ",r]}),t(S.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]});if(!e)return t(u.Text,{color:"red",children:"Module not found"});var o=[{label:"⚡ Initialize Project",value:"project_init"},...e.short_edit?.enabled&&e.short_edit.ref_map?[{label:"Short Edit",value:"short_edit"}]:[],{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,color:"cyan",children:e.name}),e.description&&t(u.Text,{color:"gray",children:e.description}),n(u.Box,{marginY:1,flexDirection:"column",children:[n(u.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&n(u.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Version"}),n(u.Text,{color:"gray",children:[" ","Current: ",e.current_version?`v${e.current_version}`:"N/A"]}),n(u.Text,{color:e.has_unreleased_changes?"yellow":"gray",children:[" ","Changes:"," ",e.has_unreleased_changes?"● Unreleased changes":"○ No pending changes"]})]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Usage"}),n(u.Text,{color:"gray",children:[" ","Used in: ",e.use_count?.total_count||0," application(s)"]})]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Settings"}),n(u.Text,{color:"gray",children:[" ","Public: ",e.is_public?"✓ Yes":"✗ No"]}),n(u.Text,{color:"gray",children:[" ","Modifiable: ",e.is_allow_modify?"✓ Yes":"✗ No"]}),n(u.Text,{color:"gray",children:[" ","Short Edit: ",e.short_edit?.enabled?"✓ Enabled":"✗ Disabled"]})]}),e.expose_properties?.length>0&&n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Exposed Properties"}),n(u.Text,{color:"gray",children:[" ",e.expose_properties.length," properties exposed"]})]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Timestamps"}),e.create_datetime&&n(u.Text,{color:"gray",children:[" Created: ",new Date(e.create_datetime).toLocaleString()]}),e.last_modify_datetime&&n(u.Text,{color:"gray",children:[" ","Modified: ",new Date(e.last_modify_datetime).toLocaleString()]})]})]}),t(S.Ay,{items:o,onSelect:i})]})},N=({groups:e,loading:l,onSelect:r,countdown:i,lastRefreshTime:o})=>{if(l)return t(D,{text:"Loading device groups..."});var a=[...(e||[]).map(e=>({label:`📁 ${e.name} (${e.devices?.length||0} devices)`,value:e._id,group:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(u.Box,{flexDirection:"column",children:[n(u.Box,{marginBottom:1,children:[n(u.Text,{bold:!0,children:["Device Groups (",e?.length||0,")"]}),t(u.Text,{color:"gray",children:" - "}),t(_,{countdown:i,lastRefreshTime:o})]}),!e?.length&&t(u.Text,{color:"yellow",children:"No device groups found"}),t(S.Ay,{items:a,onSelect:r})]})},U=({loading:e,groupDevices:l})=>e?t(D,{text:"Loading devices..."}):l?.length?n(r,{children:[l.slice(0,10).map(e=>n(u.Box,{children:[t(u.Text,{color:"gray",children:" "}),t(E,{lastAliveTime:e.entry_detail?.watch_dog_timer?.last_alive_time}),n(u.Text,{color:"gray",children:[" ",e.name||e.device_name]}),e.device_target_name&&n(u.Text,{color:"gray",dimColor:!0,children:[" ","(",e.device_target_name,")"]})]},e._id)),l.length>10&&n(u.Text,{color:"gray",dimColor:!0,children:[" ","... and ",l.length-10," more"]})]}):t(u.Text,{color:"gray",children:" No devices in this group"}),G=({group:e,groupDevices:l,loading:r,error:i,onSelect:o,countdown:a,lastRefreshTime:c})=>r&&!e?t(D,{text:"Loading device group..."}):i?n(u.Box,{flexDirection:"column",children:[n(u.Text,{color:"red",children:["Error: ",i]}),t(S.Ay,{items:[{label:"← Back",value:"back"}],onSelect:o})]}):e?n(u.Box,{flexDirection:"column",children:[n(u.Box,{children:[t(u.Text,{bold:!0,color:"cyan",children:e.name}),t(u.Text,{color:"gray",children:" - "}),t(_,{countdown:a,lastRefreshTime:c})]}),e.description&&t(u.Text,{color:"gray",children:e.description}),n(u.Box,{marginY:1,flexDirection:"column",children:[n(u.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&n(u.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[n(u.Text,{bold:!0,color:"white",children:["Devices (",e.devices?.length||0,")"]}),t(U,{loading:r,groupDevices:l})]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Timestamps"}),e.create_datetime&&n(u.Text,{color:"gray",children:[" Created: ",new Date(e.create_datetime).toLocaleString()]}),e.last_modify_datetime&&n(u.Text,{color:"gray",children:[" ","Modified: ",new Date(e.last_modify_datetime).toLocaleString()]})]})]}),t(S.Ay,{items:[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:o})]}):t(u.Text,{color:"red",children:"Device group not found"}),$=({boxes:e,loading:l,onSelect:r})=>{if(l)return t(D,{text:"Loading media boxes..."});if(!e?.length)return t(u.Text,{color:"yellow",children:"No media boxes found"});var i=[...e.map(e=>({label:`📦 ${e.name||"Unnamed"}`,value:e.id,box:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(u.Box,{flexDirection:"column",children:[n(u.Text,{bold:!0,marginBottom:1,children:["Media Boxes (",e.length,")"]}),t(S.Ay,{items:i,onSelect:r})]})},V=({box:e,loading:l,error:r,onSelect:i})=>l&&!e?t(D,{text:"Loading media box..."}):r?n(u.Box,{flexDirection:"column",children:[n(u.Text,{color:"red",children:["Error: ",r]}),t(S.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]}):e?n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,color:"cyan",children:e.name||"Unnamed"}),e.description&&t(u.Text,{color:"gray",children:e.description}),n(u.Box,{marginY:1,flexDirection:"column",children:[n(u.Text,{color:"gray",children:["ID: ",e.id]}),e.tags?.length>0&&n(u.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),null!=e.size&&n(u.Text,{color:"gray",children:["Size: ",e.size]}),e.passcodes?.length>0&&n(u.Box,{flexDirection:"column",marginTop:1,children:[n(u.Text,{bold:!0,color:"white",children:["Passcodes (",e.passcodes.length,")"]}),e.passcodes.slice(0,5).map(e=>n(u.Text,{color:"gray",children:[" ",e.name||"Passcode",": ",e.code]},e.id)),e.passcodes.length>5&&n(u.Text,{color:"gray",dimColor:!0,children:[" ","... and ",e.passcodes.length-5," more"]})]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Timestamps"}),e.createdAt&&n(u.Text,{color:"gray",children:[" Created: ",new Date(e.createdAt).toLocaleString()]}),e.updatedAt&&n(u.Text,{color:"gray",children:[" Modified: ",new Date(e.updatedAt).toLocaleString()]})]})]}),t(S.Ay,{items:[{label:"List Files",value:"files"},{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:i})]}):t(u.Text,{color:"red",children:"Media box not found"}),F=({files:e,loading:l,onSelect:r,box:i})=>{if(l)return t(D,{text:"Loading media files..."});if(!e?.length)return t(u.Text,{color:"yellow",children:"No media files found"});var o=[...e.map(e=>{var l;return{label:`${"Image"===(l=e.fileType)?"\uD83D\uDDBC":"Video"===l?"\uD83C\uDF9E":"Audio"===l?"\uD83C\uDFB5":"\uD83D\uDCC4"} ${e.name||"Unnamed"}`,value:e.id,file:e}}),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(u.Box,{flexDirection:"column",children:[n(u.Text,{bold:!0,marginBottom:1,children:["Media Files (",e.length,")",i?.name?` - ${i.name}`:""]}),t(S.Ay,{items:o,onSelect:r})]})},j=({file:e,loading:l,error:r,onSelect:i})=>{if(l&&!e)return t(D,{text:"Loading media file..."});if(r)return n(u.Box,{flexDirection:"column",children:[n(u.Text,{color:"red",children:["Error: ",r]}),t(S.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]});if(!e)return t(u.Text,{color:"red",children:"Media file not found"});var o=e.meta,a=(0,g.Gu)(e),c=(0,g.Gu)(e,{preferThumbnail:!0}),d=!!(c&&c!==a);return n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,color:"cyan",children:e.name||"Unnamed"}),e.description&&t(u.Text,{color:"gray",children:e.description}),n(u.Box,{marginY:1,flexDirection:"column",children:[n(u.Text,{color:"gray",children:["ID: ",e.id]}),n(u.Text,{color:"gray",children:["Box ID: ",e.boxId]}),n(u.Text,{color:"gray",children:["Type: ",e.fileType]}),e.userTags?.length>0&&n(u.Text,{color:"gray",children:["Tags: ",e.userTags.join(", ")]}),o?.originalWidth!=null&&o?.originalHeight!=null&&n(u.Text,{color:"gray",children:["Size: ",o.originalWidth,"x",o.originalHeight]}),o?.originalFileSize!=null&&n(u.Text,{color:"gray",children:["File: ",(Number(o.originalFileSize)/1024).toFixed(1)," KB"]}),a&&n(u.Text,{color:"gray",children:["Original URL: ",a]}),d&&n(u.Text,{color:"gray",children:["Thumbnail URL: ",c]}),n(u.Box,{flexDirection:"column",marginTop:1,children:[t(u.Text,{bold:!0,color:"white",children:"Timestamps"}),e.createdAt&&n(u.Text,{color:"gray",children:[" Created: ",new Date(e.createdAt).toLocaleString()]}),e.updatedAt&&n(u.Text,{color:"gray",children:[" Modified: ",new Date(e.updatedAt).toLocaleString()]})]})]}),t(S.Ay,{items:[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:i})]})},H=i(92642),Y=(e,l)=>{if(!e)return"";var r="string"==typeof e?e:JSON.stringify(e);return r.length>l?r.slice(0,l-1)+"…":r},z=({onBack:e})=>{var l=s((0,d.useState)([]),2),r=l[0],i=l[1],o=s((0,d.useState)(!0),2),a=o[0],h=o[1],g=s((0,d.useState)(null),2),m=g[0],T=g[1];return(0,d.useEffect)(()=>{var e,l=(0,x.getCurrentProfile)(),r=(0,x.getToken)(l),t=(0,x.getActivityLogBaseUrl)();if(!r){T("Not logged in. Run `bricks auth login` first."),h(!1);return}if(!t){T("Activity log URL not configured."),h(!1);return}var n=(0,H.W)(t,r),o=new Date(Date.now()-36e5).toISOString(),a=new Date().toISOString(),d=new AbortController;return(e=c(function*(){try{var e=yield n.collectEvents({start_time:o,end_time:a},{limit:50,signal:d.signal});i(e)}catch(e){"AbortError"!==e.name&&T(e.message)}h(!1)}),function(){return e.apply(this,arguments)})(),()=>d.abort()},[]),n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,marginBottom:1,children:"Activity Log (last 1h)"}),a&&t(D,{text:"Fetching events..."}),m&&n(u.Text,{color:"red",children:["Error: ",m]}),!a&&!m&&0===r.length&&t(u.Text,{color:"yellow",children:"No events found in the last hour"}),!a&&r.length>0&&n(u.Box,{flexDirection:"column",marginBottom:1,children:[n(u.Text,{color:"gray",children:["Timestamp".padEnd(22)," ","Type".padEnd(12)," ","Device".padEnd(14)," ","Event Name".padEnd(24)," Sender"]}),r.map((e,l)=>n(u.Text,{children:[new Date(e.timestamp).toISOString().replace("T"," ").replace(/\.\d+Z$/,"Z").padEnd(22)," ",Y(e.event_type||"",12).padEnd(12)," ",Y(e.device_id||"",14).padEnd(14)," ",Y(e.event_name||"",24).padEnd(24)," ",Y(e.sender||"",16)]},l)),r.length>=50&&n(u.Text,{color:"yellow",children:["Showing first ",50," events"]})]}),t(S.Ay,{items:[{label:"← Back",value:"back"}],onSelect:l=>"back"===l.value&&e()})]})},X=i(29253),J=i(44618),W=["B","C","G","D"],q=({instanceType:e,instance:l,client:r,onDone:i,onCancel:o})=>{var a,h=(0,u.useApp)().exit,x=s((0,d.useState)("select_ref"),2),g=x[0],m=x[1],T=s((0,d.useState)(""),2),p=T[0],f=T[1],v=s((0,d.useState)("search"),2),_=v[0],y=v[1],b=s((0,d.useState)(null),2),E=b[0],I=b[1],A=s((0,d.useState)(null),2),B=A[0],C=A[1],L=s((0,d.useState)(""),2),k=L[0],w=L[1],O=s((0,d.useState)(""),2),M=O[0],P=O[1],R=s((0,d.useState)(null),2),N=R[0],U=R[1],G=l?.short_edit?.ref_map||{},$=Object.entries(G).filter(([,e])=>e&&!e.hide),V=(0,J.V)(G,{keyword:p,types:W}),F=V.flatMap(e=>[{label:e.label,value:`__header_${e.prefix}__`,isHeader:!0},...e.refs.map(({shortId:e,ref:l})=>({label:`${l.title||e} (${e})`,value:e,ref:l}))]),j=[...p?[{label:"↻ Clear Search",value:"__clear_search__"}]:[],{label:"← Back",value:"__back__"}],H=F.length>0?[...F,...j]:j,Y=H.findIndex(e=>!e.isHeader&&!e.value?.startsWith("__"));(0,u.useInput)((e,l)=>{l.tab&&"select_ref"===g?y(e=>"search"===e?"list":"search"):(l.escape&&("select_ref"===g&&o(),"input_path"===g&&m("select_ref"),"input_content"===g&&m("input_path"),"confirm"===g&&m("input_content"),"done"===g&&o()),"q"===e&&"input_path"!==g&&"input_content"!==g&&("select_ref"!==g||"search"!==_)&&h())},{isActive:!0});var z=(a=c(function*(){if(r&&l?._id&&E){m("submitting"),U(null);try{var t={shortId:E,path:k.trim(),content:(e=>{var l=e.trim();if(""===l)return null;try{return JSON.parse(l)}catch{return l}})(M),forwardDataLink:!0};B?.inner_ref?.pid&&(t.innerRefParentShortId=B.inner_ref.pid),"application"===e?yield r.shortEditApplication({id:l._id,list:[t]}):yield r.shortEditModule({id:l._id,list:[t]}),yield i(),m("done")}catch(e){U(e.message),m("confirm")}}}),function(){return a.apply(this,arguments)});return l?.short_edit?.enabled?0===$.length?n(u.Box,{flexDirection:"column",children:[t(u.Text,{color:"yellow",children:"No Short Edit references found."}),t(S.Ay,{items:[{label:"← Back",value:"back"}],onSelect:o})]}):"select_ref"===g?n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,children:"Short Edit References"}),t(u.Text,{color:"gray",dimColor:!0,children:"Showing: Brick, Canvas, Generator, Data"}),n(u.Box,{marginTop:1,flexDirection:"column",children:[t(u.Text,{color:"gray",children:"Search (title or shortId)"}),t(X.A,{value:p,placeholder:"type to filter, Enter to focus list",onChange:e=>f(e),onSubmit:()=>y("list"),focus:"search"===_}),t(u.Text,{color:"gray",dimColor:!0,children:"Press Tab to switch focus"})]}),n(u.Box,{marginTop:1,children:[0===V.length&&t(u.Text,{color:"yellow",children:"No references match your search."}),t(S.Ay,{items:H,isFocused:"list"===_,initialIndex:Y>-1?Y:0,indicatorComponent:()=>null,itemComponent:({label:e,isSelected:l,isHeader:r})=>r?t(u.Box,{marginTop:1,children:t(u.Text,{bold:!0,color:"white",children:e})}):n(u.Text,{color:l?"blue":void 0,children:[l?"❯":" "," ",e]}),onSelect:e=>{if("__back__"===e.value)return void o();if("__clear_search__"===e.value){f(""),y("search");return}e.isHeader||(I(e.value),C(e.ref),m("input_path"))}})]})]}):"input_path"===g?n(u.Box,{flexDirection:"column",children:[n(u.Text,{children:["Reference:"," ",n(u.Text,{color:"cyan",children:[B?.title||E," (",E,")"]})]}),t(u.Text,{marginTop:1,children:"Enter property path (e.g. title, property.backgroundColor)"}),N&&n(u.Text,{color:"red",children:["Error: ",N]}),t(X.A,{value:k,placeholder:"path",onChange:e=>{w(e),N&&U(null)},onSubmit:e=>{var l=e.trim();l?(w(l),m("input_content")):U("Path is required")},focus:!0})]}):"input_content"===g?n(u.Box,{flexDirection:"column",children:[n(u.Text,{children:["Path: ",t(u.Text,{color:"cyan",children:k})]}),t(u.Text,{marginTop:1,children:"Enter new content (JSON or plain text). Empty to clear."}),N&&n(u.Text,{color:"red",children:["Error: ",N]}),t(X.A,{value:M,placeholder:"content",onChange:e=>{P(e),N&&U(null)},onSubmit:()=>m("confirm"),focus:!0})]}):"submitting"===g?t(D,{text:"Applying short edit..."}):"done"===g?n(u.Box,{flexDirection:"column",children:[t(u.Text,{color:"green",children:"Short edit applied successfully."}),t(S.Ay,{items:[{label:"Edit another property",value:"again"},{label:"← Back",value:"back"}],onSelect:e=>{"again"===e.value?(m("select_ref"),I(null),C(null),w(""),P(""),U(null)):o()}})]}):n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,marginBottom:1,children:"Confirm Short Edit"}),n(u.Text,{children:["Reference:"," ",n(u.Text,{color:"cyan",children:[B?.title||E," (",E,")"]})]}),n(u.Text,{children:["Path: ",t(u.Text,{color:"cyan",children:k})]}),n(u.Text,{children:["Content: ",t(u.Text,{color:"cyan",children:M||"<empty>"})]}),N&&n(u.Text,{color:"red",children:["Error: ",N]}),t(S.Ay,{items:[{label:"Apply",value:"apply"},{label:"Edit Path",value:"edit_path"},{label:"Edit Content",value:"edit_content"},{label:"← Back",value:"back"}],onSelect:e=>{"apply"===e.value&&z(),"edit_path"===e.value&&m("input_path"),"edit_content"===e.value&&m("input_content"),"back"===e.value&&o()}})]}):n(u.Box,{flexDirection:"column",children:[n(u.Text,{color:"yellow",children:["Short Edit is not enabled for this ",e,"."]}),t(S.Ay,{items:[{label:"← Back",value:"back"}],onSelect:o})]})},K=i(16928),Z=i(79896),Q=i(35317),ee=i(10750),el="options",er="output_dir",et="confirm",en="generating",ei="post_install",eo="done",ea=e=>{try{return(0,Q.execSync)(`which ${e}`,{stdio:"ignore"}),!0}catch{return!1}},ec=(e,l,r)=>new Promise((t,n)=>{var i=[e,...l].join(" "),o=(0,Q.spawn)(i,[],{cwd:r,stdio:"pipe",shell:!0});o.on("close",e=>{0===e?t():n(Error(`Command failed with code ${e}`))}),o.on("error",n)}),ed=(o=c(function*(e,l){try{var r=(yield i.e(456).then(i.bind(i,79491))).format;return(yield r(l,e,{trailingComma:"all",tabWidth:2,semi:!1,singleQuote:!0,printWidth:100})).code}catch{}return e}),function(e,l){return o.apply(this,arguments)}),eu=({type:e,instance:l,client:r,onDone:i,onCancel:o})=>{var a,h=(0,u.useApp)().exit,x=s((0,d.useState)(el),2),g=x[0],m=x[1],T=s((0,d.useState)({setupGitHubActions:!0,setupAgents:!0,setupClaudeCode:!0,setupGeminiCLI:!1,runBunInstall:!0,initGit:!0}),2),p=T[0],v=T[1],_=s((0,d.useState)(process.cwd()),2),y=_[0],b=_[1],D=s((0,d.useState)(""),2),E=D[0],I=D[1],A=s((0,d.useState)(null),2),B=A[0],C=A[1],L=s((0,d.useState)(null),2),k=L[0],w=L[1],O=ee(l?.name||"bricks-ctor"),M=K.resolve(y,O),P=(0,d.useCallback)(e=>{"back"===e.value?o():"continue"===e.value?m(er):v(l=>({...l,[e.value]:!l[e.value]}))},[o]),R=(0,d.useCallback)(()=>{Z.existsSync(M)?C(`Directory already exists: ${M}`):(C(null),m(et))},[M]),N=(0,d.useCallback)((a=c(function*(t){if("back"===t.value)return void m(er);if("cancel"===t.value)return void o();if("confirm"===t.value){m(en);try{I("Fetching project from BRICKS...");var n,i="application"===e,a=i?r.queries.applicationProject:r.queries.moduleProject,d=(yield r.query(a,{id:l._id,buildApplicationOnly:!1,setupGitHubActions:p.setupGitHubActions,setupAgents:p.setupAgents,setupClaudeCode:p.setupClaudeCode,setupGeminiCLI:p.setupGeminiCLI}))[i?"UNSTABLE_applicationProject":"UNSTABLE_moduleProject"];if(!d?.files)throw Error("Failed to fetch project files");I("Creating project directory..."),Z.mkdirSync(M,{recursive:!0}),I(`Writing ${d.files.length} files...`),(yield Promise.all(d.files.map((n=c(function*(e){var l=K.join(M,e.name),r=e.input;return e.formatable&&(r=yield ed(r,l)),{...e,filePath:l,content:r}}),function(e){return n.apply(this,arguments)})))).forEach(e=>{var l=K.dirname(e.filePath);Z.existsSync(l)||Z.mkdirSync(l,{recursive:!0}),Z.writeFileSync(e.filePath,e.content)}),m(ei);var u={path:M,files:d.files.length,bunInstalled:!1,gitInitialized:!1};if(p.runBunInstall&&ea("bun")){I("Installing dependencies (bun install)...");try{yield ec("bun",["install"],M),u.bunInstalled=!0}catch{}}if(p.initGit&&ea("git")){I("Initializing git repository...");try{yield ec("git",["init"],M),yield ec("git",["add","."],M),yield ec("git",["-c 'user.name=BRICKS CLI'","-c 'user.email=cli@bricks.tools'","commit","-m 'chore: initialize commit'"],M),u.gitInitialized=!0}catch{}}w(u),m(eo)}catch(e){C(e.message),m(el)}}}),function(e){return a.apply(this,arguments)}),[r,l,e,p,M,o]),U=(0,d.useCallback)(e=>{"exit"===e.value?h():i()},[h,i]);if(g===el){var G=[{label:`${p.setupGitHubActions?"[x]":"[ ]"} GitHub Actions workflow`,value:"setupGitHubActions"},{label:`${p.setupAgents?"[x]":"[ ]"} AGENTS.md`,value:"setupAgents"},{label:`${p.setupClaudeCode?"[x]":"[ ]"} CLAUDE.md`,value:"setupClaudeCode"},{label:`${p.setupGeminiCLI?"[x]":"[ ]"} GEMINI.md`,value:"setupGeminiCLI"},{label:`${p.runBunInstall?"[x]":"[ ]"} Run bun install after generation`,value:"runBunInstall"},{label:`${p.initGit?"[x]":"[ ]"} Initialize git repository`,value:"initGit"},{label:"→ Continue",value:"continue"},{label:"← Back",value:"back"}];return n(u.Box,{flexDirection:"column",children:[n(u.Text,{bold:!0,color:"cyan",children:["Initialize BRICKS Project: ",l?.name||"Untitled"]}),t(u.Text,{color:"gray",marginBottom:1,children:"Select options for project generation (press Enter to toggle)"}),B&&n(u.Text,{color:"red",marginBottom:1,children:["Error: ",B]}),t(S.Ay,{items:G,onSelect:P})]})}return g===er?n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,color:"cyan",children:"Output Directory"}),t(u.Text,{color:"gray",marginBottom:1,children:"Enter the parent directory for the project:"}),B&&t(u.Text,{color:"red",marginBottom:1,children:B}),n(u.Box,{children:[t(u.Text,{children:"Directory: "}),t(X.A,{value:y,onChange:b,onSubmit:R})]}),n(u.Text,{color:"gray",marginTop:1,children:["Project will be created at: ",M]})]}):g===et?n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,color:"cyan",children:"Confirm Project Generation"}),n(u.Box,{marginY:1,flexDirection:"column",children:[n(u.Text,{children:["Name: ",t(u.Text,{color:"green",children:l?.name||"Untitled"})]}),n(u.Text,{children:["Type: ",t(u.Text,{color:"yellow",children:e})]}),n(u.Text,{children:["Path: ",t(u.Text,{color:"cyan",children:M})]}),t(u.Text,{color:"gray",marginTop:1,children:"Options:"}),n(u.Text,{color:"gray",children:[" - GitHub Actions: ",p.setupGitHubActions?"Yes":"No"]}),n(u.Text,{color:"gray",children:[" - AGENTS.md: ",p.setupAgents?"Yes":"No"]}),n(u.Text,{color:"gray",children:[" - CLAUDE.md: ",p.setupClaudeCode?"Yes":"No"]}),n(u.Text,{color:"gray",children:[" - GEMINI.md: ",p.setupGeminiCLI?"Yes":"No"]}),n(u.Text,{color:"gray",children:[" - Run bun install: ",p.runBunInstall?"Yes":"No"]}),n(u.Text,{color:"gray",children:[" - Initialize git: ",p.initGit?"Yes":"No"]})]}),t(S.Ay,{items:[{label:"Confirm & Generate",value:"confirm"},{label:"← Change Directory",value:"back"},{label:"Cancel",value:"cancel"}],onSelect:N})]}):g===en||g===ei?n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,color:"cyan",children:"Generating Project..."}),n(u.Box,{marginY:1,children:[t(u.Text,{color:"green",children:t(f.A,{type:"dots"})}),n(u.Text,{children:[" ",E]})]})]}):g===eo&&k?n(u.Box,{flexDirection:"column",children:[t(u.Text,{bold:!0,color:"green",children:"Project initialized successfully!"}),n(u.Box,{marginY:1,flexDirection:"column",children:[n(u.Text,{children:["Path: ",t(u.Text,{color:"cyan",children:k.path})]}),n(u.Text,{children:["Files: ",t(u.Text,{color:"green",children:k.files})]}),n(u.Text,{children:["Dependencies:"," ",t(u.Text,{color:k.bunInstalled?"green":"yellow",children:k.bunInstalled?"Installed":"Not installed (run bun install manually)"})]}),n(u.Text,{children:["Git:"," ",t(u.Text,{color:k.gitInitialized?"green":"yellow",children:k.gitInitialized?"Initialized":"Not initialized"})]})]}),t(u.Text,{bold:!0,marginY:1,children:"Next steps:"}),n(u.Text,{color:"gray",children:[" cd ",O]}),!k.bunInstalled&&t(u.Text,{color:"gray",children:" bun install"}),t(u.Text,{color:"gray",children:" bun preview"}),n(u.Text,{color:"gray",marginTop:1,children:["For more information, see ",O,"/README.md"]}),t(u.Box,{marginTop:1,children:t(S.Ay,{items:[{label:"← Back to Detail",value:"back"},{label:"Exit CLI",value:"exit"}],onSelect:U})})]}):null};let es=()=>{var e,l,r,i,o,a,T,p,f=(0,u.useApp)().exit,_=s((0,d.useState)(m.MAIN),2),E=_[0],S=_[1],A=s((0,d.useState)(null),2),B=A[0],U=A[1],H=s((0,d.useState)(null),2),Y=H[0],X=H[1],J=s((0,d.useState)(!0),2),W=J[0],K=J[1],Z=s((0,d.useState)(null),2),Q=Z[0],ee=Z[1],el=s((0,d.useState)([]),2),er=el[0],et=el[1],en=s((0,d.useState)(null),2),ei=en[0],eo=en[1],ea=s((0,d.useState)([]),2),ec=ea[0],ed=ea[1],es=s((0,d.useState)(null),2),eh=es[0],ex=es[1],eg=s((0,d.useState)([]),2),em=eg[0],eT=eg[1],ep=s((0,d.useState)(null),2),ef=ep[0],ev=ep[1],e_=s((0,d.useState)([]),2),ey=e_[0],eb=e_[1],eD=s((0,d.useState)(null),2),eE=eD[0],eS=eD[1],eI=s((0,d.useState)([]),2),eA=eI[0],eB=eI[1],eC=s((0,d.useState)(!1),2),eL=eC[0],ek=eC[1],ew=s((0,d.useState)(null),2),eO=ew[0],eM=ew[1],eP=s((0,d.useState)(null),2),eR=eP[0],eN=eP[1],eU=s((0,d.useState)(null),2),eG=eU[0],e$=eU[1],eV=s((0,d.useState)(null),2),eF=eV[0],ej=eV[1],eH=s((0,d.useState)([]),2),eY=eH[0],ez=eH[1],eX=s((0,d.useState)(null),2),eJ=eX[0],eW=eX[1],eq=s((0,d.useState)([]),2),eK=eq[0],eZ=eq[1],eQ=s((0,d.useState)(null),2),e0=eQ[0],e1=eQ[1],e2=E===m.DEVICES,e4=E===m.DEVICE_DETAIL,e6=E===m.GROUPS,e5=E===m.GROUP_DETAIL;(0,d.useEffect)(()=>{var e=(0,x.getCurrentProfile)(),l=(0,x.getToken)(e);if(!l){ee("Not logged in. Run `bricks auth login` first."),K(!1);return}var r=(0,h.createClient)((0,x.getBaseUrl)(),l);U(r),r.workspace().then(e=>{X(e),K(!1)}).catch(e=>{ee(e.message),K(!1)})},[]),(0,u.useInput)((e,l)=>{"q"===e&&f(),l.escape&&(E===m.DEVICE_CONTROL?(S(m.DEVICE_DETAIL),eM(null)):E===m.DEVICE_SCREENSHOT?(S(m.DEVICE_DETAIL),e$(null),ej(null)):E===m.DEVICE_DETAIL?(S(m.DEVICES),eo(null)):E===m.APP_DETAIL?(S(m.APPS),ex(null)):E===m.MODULE_DETAIL?(S(m.MODULES),ev(null)):E===m.GROUP_DETAIL?(S(m.GROUPS),eS(null),eB([])):E===m.MEDIA_FILE_DETAIL?(S(m.MEDIA_FILES),e1(null)):E===m.MEDIA_FILES?(S(m.MEDIA_BOX_DETAIL),e1(null)):E===m.MEDIA_BOX_DETAIL?(S(m.MEDIA_BOXES),eW(null),eZ([])):E===m.MEDIA_BOXES?S(m.MAIN):E!==m.MAIN&&S(m.MAIN))},{isActive:E!==m.APP_SHORT_EDIT&&E!==m.MODULE_SHORT_EDIT&&E!==m.APP_PROJECT_INIT&&E!==m.MODULE_PROJECT_INIT});var e9=(0,d.useCallback)(c(function*(){if(B){K(!0);try{var e=yield B.devices({});et(e||[])}catch(e){ee(e.message)}K(!1)}}),[B]),e8=(0,d.useCallback)((e=c(function*(e){if(B){K(!0),eN(null);try{var l=yield B.device({id:e});eo(l)}catch(e){eN(e.message)}K(!1)}}),function(l){return e.apply(this,arguments)}),[B]),e3=(0,d.useCallback)(c(function*(){if(B){K(!0);try{var e=yield B.applications({});ed(e||[])}catch(e){ee(e.message)}K(!1)}}),[B]),e7=(0,d.useCallback)((l=c(function*(e){if(B){K(!0),eN(null);try{var l=yield B.application({id:e});ex(l)}catch(e){eN(e.message)}K(!1)}}),function(e){return l.apply(this,arguments)}),[B]),le=(0,d.useCallback)(c(function*(){if(B){K(!0);try{var e=yield B.modules({});eT(e||[])}catch(e){ee(e.message)}K(!1)}}),[B]),ll=(0,d.useCallback)((r=c(function*(e){if(B){K(!0),eN(null);try{var l=yield B.module({id:e});ev(l)}catch(e){eN(e.message)}K(!1)}}),function(e){return r.apply(this,arguments)}),[B]),lr=(0,d.useCallback)(c(function*(){if(B){K(!0);try{var e=yield B.deviceGroups({});eb(e||[])}catch(e){ee(e.message)}K(!1)}}),[B]),lt=(0,d.useCallback)((i=c(function*(e){if(B){K(!0),eN(null);try{var l=yield Promise.all([B.deviceGroup({id:e}),B.devicesByGroup({id:e})]),r=s(l,2),t=r[0],n=r[1];eS(t),eB(n||[])}catch(e){eN(e.message)}K(!1)}}),function(e){return i.apply(this,arguments)}),[B]),ln=(0,d.useCallback)(c(function*(){if(B){K(!0);try{var e=yield B.mediaBoxes();ez(e||[])}catch(e){ee(e.message)}K(!1)}}),[B]),li=(0,d.useCallback)((o=c(function*(e){if(B){K(!0),eN(null);try{var l=yield B.mediaBox({id:e});eW(l)}catch(e){eN(e.message)}K(!1)}}),function(e){return o.apply(this,arguments)}),[B]),lo=(0,d.useCallback)((a=c(function*(e){if(B){K(!0);try{var l=yield B.mediaFiles({boxId:e});eZ(l||[])}catch(e){ee(e.message)}K(!1)}}),function(e){return a.apply(this,arguments)}),[B]),la=(0,d.useCallback)((T=c(function*(e){if(B){K(!0),eN(null);try{var l=yield B.mediaFile({id:e});e1(l)}catch(e){eN(e.message)}K(!1)}}),function(e){return T.apply(this,arguments)}),[B]),lc=(0,d.useCallback)((p=c(function*(e){if(B&&ei){ek(!0),eM(null);try{yield B.controlDevice({id:ei._id,type:e}),eM({success:!0,message:`Command sent: ${e}`})}catch(e){eM({success:!1,message:e.message})}ek(!1)}}),function(e){return p.apply(this,arguments)}),[B,ei]),ld=(0,d.useCallback)(c(function*(e=!1){if(B&&ei&&Y){K(!0),ej(null),e$(null);try{e&&(yield B.controlDevice({id:ei._id,type:"take-screenshot"}),yield new Promise(e=>setTimeout(e,3e3)));var l=yield(0,g.he)(B,Y,ei._id,null,{preferThumbnail:!0});l.error?ej(l.error):e$(l)}catch(e){ej(e.message)}K(!1)}}),[B,ei,Y]),lu=v((0,d.useCallback)(()=>{B&&e9()},[B,e9]),e2),ls=v((0,d.useCallback)(()=>{B&&ei&&e8(ei._id)},[B,ei,e8]),e4),lh=v((0,d.useCallback)(()=>{B&&lr()},[B,lr]),e6),lx=v((0,d.useCallback)(()=>{B&&eE&&lt(eE._id)},[B,eE,lt]),e5);return W&&!Y?n(u.Box,{flexDirection:"column",children:[t(y,{workspace:Y,view:E}),t(D,{text:"Connecting to workspace..."})]}):Q&&!Y?n(u.Box,{flexDirection:"column",children:[t(y,{workspace:Y,view:E}),n(u.Text,{color:"red",children:["Error: ",Q]}),t(b,{})]}):n(u.Box,{flexDirection:"column",children:[t(y,{workspace:Y,view:E}),E===m.MAIN&&t(I,{onSelect:e=>{"exit"===e.value?f():(S(e.value),e.value===m.DEVICES?e9():e.value===m.APPS?e3():e.value===m.MODULES?le():e.value===m.GROUPS?lr():e.value===m.MEDIA_BOXES&&ln())},mediaEnabled:(0,g.wR)(Y),activityLogEnabled:!!(0,x.getActivityLogBaseUrl)()}),E===m.DEVICES&&t(C,{devices:er,loading:W,onSelect:e=>{if("back"===e.value)return void S(m.MAIN);if("refresh"===e.value){e9(),lu.resetCountdown();return}eo(null),K(!0),S(m.DEVICE_DETAIL),e8(e.value)},countdown:lu.countdown,lastRefreshTime:lu.lastRefreshTime}),E===m.DEVICE_DETAIL&&t(L,{device:ei,loading:W,error:eR,onSelect:e=>{if("back"===e.value){S(m.DEVICES),eo(null);return}if("refresh"===e.value){e8(ei._id),ls.resetCountdown();return}"control"===e.value&&(S(m.DEVICE_CONTROL),eM(null)),"screenshot"===e.value&&(S(m.DEVICE_SCREENSHOT),e$(null),ej(null),ld(!1))},mediaEnabled:(0,g.wR)(Y),countdown:ls.countdown,lastRefreshTime:ls.lastRefreshTime}),E===m.DEVICE_CONTROL&&t(k,{device:ei,onSelect:e=>{if("back"===e.value){S(m.DEVICE_DETAIL),eM(null);return}lc(e.value)},controlling:eL,controlResult:eO}),E===m.DEVICE_SCREENSHOT&&t(w,{device:ei,screenshot:eG,loading:W,error:eF,onSelect:e=>{if("back"===e.value){S(m.DEVICE_DETAIL),e$(null),ej(null);return}"refresh"===e.value?ld(!1):"take"===e.value&&ld(!0)}}),E===m.APPS&&t(O,{apps:ec,loading:W,onSelect:e=>{"back"===e.value?S(m.MAIN):"refresh"===e.value?e3():(ex(null),K(!0),S(m.APP_DETAIL),e7(e.value))}}),E===m.APP_DETAIL&&t(M,{app:eh,loading:W,error:eR,onSelect:e=>{if("back"===e.value){S(m.APPS),ex(null);return}"refresh"===e.value?e7(eh._id):("short_edit"===e.value&&(S(m.APP_SHORT_EDIT),eN(null)),"project_init"===e.value&&(S(m.APP_PROJECT_INIT),eN(null)))}}),E===m.APP_SHORT_EDIT&&t(q,{instanceType:"application",instance:eh,client:B,onDone:c(function*(){return e7(eh._id)}),onCancel:()=>S(m.APP_DETAIL)}),E===m.APP_PROJECT_INIT&&t(eu,{type:"application",instance:eh,client:B,onDone:()=>S(m.APP_DETAIL),onCancel:()=>S(m.APP_DETAIL)}),E===m.MODULES&&t(P,{modules:em,loading:W,onSelect:e=>{"back"===e.value?S(m.MAIN):"refresh"===e.value?le():(ev(null),K(!0),S(m.MODULE_DETAIL),ll(e.value))}}),E===m.MODULE_DETAIL&&t(R,{module:ef,loading:W,error:eR,onSelect:e=>{if("back"===e.value){S(m.MODULES),ev(null);return}"refresh"===e.value?ll(ef._id):("short_edit"===e.value&&(S(m.MODULE_SHORT_EDIT),eN(null)),"project_init"===e.value&&(S(m.MODULE_PROJECT_INIT),eN(null)))}}),E===m.MODULE_SHORT_EDIT&&t(q,{instanceType:"module",instance:ef,client:B,onDone:c(function*(){return ll(ef._id)}),onCancel:()=>S(m.MODULE_DETAIL)}),E===m.MODULE_PROJECT_INIT&&t(eu,{type:"module",instance:ef,client:B,onDone:()=>S(m.MODULE_DETAIL),onCancel:()=>S(m.MODULE_DETAIL)}),E===m.GROUPS&&t(N,{groups:ey,loading:W,onSelect:e=>{if("back"===e.value)return void S(m.MAIN);if("refresh"===e.value){lr(),lh.resetCountdown();return}eS(null),eB([]),K(!0),S(m.GROUP_DETAIL),lt(e.value)},countdown:lh.countdown,lastRefreshTime:lh.lastRefreshTime}),E===m.GROUP_DETAIL&&t(G,{group:eE,groupDevices:eA,loading:W,error:eR,onSelect:e=>{if("back"===e.value){S(m.GROUPS),eS(null),eB([]);return}"refresh"===e.value&&(lt(eE._id),lx.resetCountdown())},countdown:lx.countdown,lastRefreshTime:lx.lastRefreshTime}),E===m.ACTIVITY_LOG&&t(z,{onBack:()=>S(m.MAIN)}),E===m.MEDIA_BOXES&&t($,{boxes:eY,loading:W,onSelect:e=>{"back"===e.value?S(m.MAIN):"refresh"===e.value?ln():(eW(null),eZ([]),K(!0),S(m.MEDIA_BOX_DETAIL),li(e.value))}}),E===m.MEDIA_BOX_DETAIL&&t(V,{box:eJ,loading:W,error:eR,onSelect:e=>{if("back"===e.value){S(m.MEDIA_BOXES),eW(null),eZ([]);return}"refresh"===e.value?li(eJ.id):"files"===e.value&&(eZ([]),e1(null),S(m.MEDIA_FILES),lo(eJ.id))}}),E===m.MEDIA_FILES&&t(F,{files:eK,box:eJ,loading:W,onSelect:e=>{if("back"===e.value){S(m.MEDIA_BOX_DETAIL),e1(null);return}"refresh"===e.value?lo(eJ.id):(e1(null),K(!0),S(m.MEDIA_FILE_DETAIL),la(e.value))}}),E===m.MEDIA_FILE_DETAIL&&t(j,{file:e0,loading:W,error:eR,onSelect:e=>{if("back"===e.value){S(m.MEDIA_FILES),e1(null);return}"refresh"===e.value&&la(e0.id)}}),t(b,{})]})};var eh="1"===process.env.BRICKS_CLI_DISTRIBUTION,ex=(a=c(function*(){if(eh)return void(0,u.render)(t(es,{}));var e=(yield i.e(166).then(i.bind(i,29557))).TerminalInfoProvider;(0,u.render)(t(e,{children:t(es,{})}))}),function(){return a.apply(this,arguments)})}};
1
+ import*as e from"ink";import*as l from"react";import{Fragment as r,jsx as t,jsxs as n}from"react/jsx-runtime";export const __rspack_esm_id=940;export const __rspack_esm_ids=[940];export const __webpack_modules__={8498(l){l.exports=e},51649(e){e.exports=l},92319(e,l,i){i.r(l),i.d(l,{AppList:()=>w,CONTROL_ACTIONS:()=>x,MainMenu:()=>S,Header:()=>y,ModuleDetail:()=>M,ONLINE_THRESHOLD_MS:()=>p,ShortEditEditor:()=>J,MediaFileList:()=>$,App:()=>ea,DeviceDetail:()=>C,VIEWS:()=>m,runInteractiveMode:()=>ed,DeviceList:()=>B,MediaBoxList:()=>G,Loading:()=>b,DeviceControl:()=>k,ProjectInitView:()=>eo,GroupDetail:()=>U,ModuleList:()=>P,MediaBoxDetail:()=>j,GroupList:()=>R,Footer:()=>_,DeviceStatus:()=>D,AppDetail:()=>O,DeviceScreenshot:()=>L,MediaFileDetail:()=>V});var o,a=i(99436),c=i(51649),d=i(8498),u=i(68832),s=i(85382),h=i(47988),g=i(60450),m={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",APP_PROJECT_INIT:"app_project_init",MODULES:"modules",MODULE_DETAIL:"module_detail",MODULE_SHORT_EDIT:"module_short_edit",MODULE_PROJECT_INIT:"module_project_init",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",ACTIVITY_LOG:"activity_log"},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"}],p=3e5,f=i(47882),T=(e,l=!0)=>{var r=Math.floor(60),t=u((0,c.useState)(r),2),n=t[0],i=t[1],o=u((0,c.useState)(null),2),a=o[0],d=o[1],s=(0,c.useRef)(e);(0,c.useEffect)(()=>{s.current=e},[e]);var h=(0,c.useCallback)(()=>{i(r),d(Date.now())},[r]);return(0,c.useEffect)(()=>{if(l){var e=setInterval(()=>{i(e=>e<=1?(s.current?.(),d(Date.now()),r):e-1)},1e3);return()=>clearInterval(e)}},[l,r]),(0,c.useEffect)(()=>{l&&(i(r),d(Date.now()))},[l,r]),{countdown:n,lastRefreshTime:a,resetCountdown:h}},v=({countdown:e,lastRefreshTime:l})=>t(d.Box,{children:n(d.Text,{color:"gray",children:["Next refresh in ",n(d.Text,{color:"cyan",children:[e,"s"]}),l&&n(d.Text,{color:"gray",children:[" (last: ",l?new Date(l).toLocaleTimeString():null,")"]})]})}),y=({workspace:e,view:l})=>n(d.Box,{flexDirection:"column",marginBottom:1,children:[n(d.Box,{children:[t(d.Text,{bold:!0,color:"cyan",children:"BRICKS CLI"}),t(d.Text,{color:"gray",children:" - Interactive Mode"})]}),n(d.Box,{children:[t(d.Text,{color:"gray",children:"Workspace: "}),t(d.Text,{color:"green",children:e?.name||"Not connected"}),t(d.Text,{color:"gray",children:" | View: "}),t(d.Text,{color:"yellow",children:l})]}),t(d.Text,{color:"gray",children:"─".repeat(60)})]}),_=()=>n(d.Box,{marginTop:1,flexDirection:"column",children:[t(d.Text,{color:"gray",children:"─".repeat(60)}),n(d.Text,{color:"gray",children:["Press ",t(d.Text,{color:"cyan",children:"q"})," to quit, ",t(d.Text,{color:"cyan",children:"Esc"})," to go back"]})]}),b=({text:e})=>n(d.Box,{children:[t(d.Text,{color:"green",children:t(f.A,{type:"dots"})}),n(d.Text,{children:[" ",e||"Loading..."]})]}),D=({lastAliveTime:e})=>{if(!e)return t(d.Text,{color:"gray",children:"○ Unknown"});var l=Date.now()-new Date(e).getTime();if(l<=p)return t(d.Text,{color:"green",children:"● Online"});var r=Math.floor(l/6e4);if(r<60)return n(d.Text,{color:"yellow",children:["○ Offline (",r,"m ago)"]});var i=Math.floor(r/60);if(i<24)return n(d.Text,{color:"red",children:["○ Offline (",i,"h ago)"]});var o=Math.floor(i/24);return n(d.Text,{color:"red",children:["○ Offline (",o,"d ago)"]})},E=i(48724),S=({onSelect:e,mediaEnabled:l,activityLogEnabled:r})=>{var i=[{label:"Devices",value:m.DEVICES},{label:"Applications",value:m.APPS},{label:"Modules",value:m.MODULES},{label:"Device Groups",value:m.GROUPS},...l?[{label:"Media Flow",value:m.MEDIA_BOXES}]:[],...r?[{label:"Activity Log",value:m.ACTIVITY_LOG}]:[],{label:"Exit",value:"exit"}];return n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,marginBottom:1,children:"Main Menu"}),t(E.Ay,{items:i,onSelect:e})]})},I="1"===process.env.BRICKS_CLI_DISTRIBUTION,A=e=>{var l=u((0,c.useState)(null),2),r=l[0],n=l[1];return((0,c.useEffect)(()=>{if(!I){var e=!0;return i.e(166).then(i.bind(i,29557)).then(l=>{e&&n(()=>l.default)}).catch(()=>{e&&n(!1)}),()=>{e=!1}}},[]),I||!1===r)?t(d.Text,{color:"gray",children:"Image preview is not available in this CLI build."}):r?t(r,{...e}):t(b,{text:"Preparing image preview..."})},B=({devices:e,loading:l,onSelect:r,countdown:i,lastRefreshTime:o})=>{if(l)return t(b,{text:"Loading devices..."});if(!e?.length)return n(d.Box,{flexDirection:"column",children:[t(d.Text,{color:"yellow",children:"No devices found"}),t(v,{countdown:i,lastRefreshTime:o})]});var a=[...e.map(e=>{var l=(e=>{if(!e)return"○ Unknown";var l=Date.now()-new Date(e).getTime();if(l<=p)return"● Online";var r=Math.floor(l/6e4);if(r<60)return`○ ${r}m ago`;var t=Math.floor(r/60);if(t<24)return`○ ${t}h ago`;var n=Math.floor(t/24);return`○ ${n}d ago`})(e.entry_detail?.watch_dog_timer?.last_alive_time);return{label:`${l} - ${e.name||e.device_name}`,value:e._id,device:e}}),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(d.Box,{flexDirection:"column",children:[n(d.Box,{marginBottom:1,children:[n(d.Text,{bold:!0,children:["Devices (",e.length,")"]}),t(d.Text,{color:"gray",children:" - "}),t(v,{countdown:i,lastRefreshTime:o})]}),t(E.Ay,{items:a,onSelect:r})]})},C=({device:e,loading:l,error:r,onSelect:i,mediaEnabled:o,countdown:a,lastRefreshTime:c})=>{if(l)return t(b,{text:"Loading device..."});if(r)return n(d.Box,{flexDirection:"column",children:[n(d.Text,{color:"red",children:["Error: ",r]}),t(E.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]});if(!e)return t(d.Text,{color:"red",children:"Device not found"});var u=[{label:"Control Device",value:"control"},...o?[{label:"View Screenshot",value:"screenshot"}]:[],{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],s=e.entry_detail,h=s?.screen,g=s?.update,m=s?.local_sync;return n(d.Box,{flexDirection:"column",children:[n(d.Box,{children:[t(d.Text,{bold:!0,color:"cyan",children:e.name||e.device_name}),t(d.Text,{color:"gray",children:" - "}),t(v,{countdown:a,lastRefreshTime:c})]}),e.description&&t(d.Text,{color:"gray",children:e.description}),n(d.Box,{marginY:1,flexDirection:"column",children:[n(d.Box,{children:[t(d.Text,{color:"gray",children:"Status: "}),t(D,{lastAliveTime:s?.watch_dog_timer?.last_alive_time})]}),n(d.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&n(d.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),s?.application&&n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Application"}),n(d.Text,{color:"gray",children:[" Name: ",s.application.name]}),n(d.Text,{color:"gray",children:[" Mode: ",s.operation_mode||"N/A"]})]}),h&&n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Screen"}),h.resolution&&n(d.Text,{color:"gray",children:[" ","Resolution: ",h.resolution.width,"x",h.resolution.height,h.resolution.scale&&` @${h.resolution.scale}x`]}),h.orientation&&n(d.Text,{color:"gray",children:[" Orientation: ",h.orientation]}),h.touch&&n(d.Text,{color:"gray",children:[" ","Touch:"," ",h.touch.available?`Yes (${h.touch.touch_point} points)`:"No"]})]}),(s?.memory_usage||s?.disk_usage)&&n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"System"}),s.memory_usage&&n(d.Text,{color:"gray",children:[" Memory: ",Math.round(100*s.memory_usage),"%"]}),s.disk_usage&&n(d.Text,{color:"gray",children:[" Disk: ",Math.round(100*s.disk_usage),"%"]})]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Capabilities"}),n(d.Text,{color:"gray",children:[" ","Sound: ",s?.sound?.available?"✓":"✗"," | ","Camera: ",s?.camera?.available?"✓":"✗"," | ","Audio In: ",s?.audio_in?.available?"✓":"✗"]})]}),m&&n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Local Sync"}),n(d.Text,{color:"gray",children:[" ","Role: ",m.is_main?"Main":"Peer",m.peer_count>0&&` | Peers: ${m.peer_count}`,m.mean_latency&&` | Latency: ${m.mean_latency}ms`]})]}),g&&n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Update"}),n(d.Text,{color:g.need_update?"yellow":"gray",children:[" ","Status: ",g.need_update?"⚠ Update available":"✓ Up to date"]}),g.current_version&&n(d.Text,{color:"gray",children:[" Version: ",g.current_version]})]})]}),t(E.Ay,{items:u,onSelect:i})]})},k=({device:e,onSelect:l,controlling:r,controlResult:i})=>n(d.Box,{flexDirection:"column",children:[n(d.Text,{bold:!0,color:"cyan",children:["Control: ",e?.name||e?.device_name]}),r&&t(b,{text:"Sending command..."}),i&&t(d.Text,{color:i.success?"green":"red",children:i.message}),t(d.Box,{marginTop:1,children:t(E.Ay,{items:x,onSelect:l})})]}),L=({device:e,screenshot:l,loading:r,error:i,onSelect:o})=>{var a=l?.file?.meta,c=a?.originalWidth!=null&&a?.originalHeight!=null,u=a?.originalFileSize!=null;return n(d.Box,{flexDirection:"column",children:[n(d.Text,{bold:!0,color:"cyan",children:["Screenshot: ",e?.name||e?.device_name||"Unknown"]}),r&&t(b,{text:"Loading screenshot..."}),i&&t(d.Box,{marginY:1,children:t(d.Text,{color:"red",children:String(i)})}),!r&&!i&&l&&n(d.Box,{flexDirection:"column",children:[t(d.Box,{height:30,children:t(A,{src:l.path,width:80,alt:"Device screenshot"})}),n(d.Box,{marginY:1,flexDirection:"column",children:[t(d.Text,{bold:!0,color:"white",children:"Screenshot Details"}),n(d.Box,{marginY:1,children:[t(d.Text,{color:"green",children:"Screenshot saved to: "}),t(d.Text,{color:"cyan",children:String(l.path||"")})]}),c&&n(d.Text,{color:"gray",children:["Size: ",String(a.originalWidth),"x",String(a.originalHeight)]}),u&&n(d.Text,{color:"gray",children:["File: ",(Number(a.originalFileSize)/1024).toFixed(1)," KB"]}),l.file?.updatedAt&&n(d.Text,{color:"gray",children:["Updated: ",new Date(l.file.updatedAt).toLocaleString()]})]})]}),!r&&!i&&!l&&t(d.Box,{marginY:1,children:t(d.Text,{color:"yellow",children:"No screenshot available. Try taking a new one."})}),t(d.Box,{marginTop:1,children:t(E.Ay,{items:[{label:"Take New Screenshot",value:"take"},{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:o})})]})},w=({apps:e,loading:l,onSelect:r})=>{if(l)return t(b,{text:"Loading applications..."});if(!e?.length)return t(d.Text,{color:"yellow",children:"No applications found"});var i=[...e.map(e=>({label:`${e.has_unreleased_changes?"●":"○"} ${e.name}`,value:e._id,app:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(d.Box,{flexDirection:"column",children:[n(d.Text,{bold:!0,marginBottom:1,children:["Applications (",e.length,")"]}),t(E.Ay,{items:i,onSelect:r})]})},O=({app:e,loading:l,error:r,onSelect:i})=>{if(l)return t(b,{text:"Loading application..."});if(r)return n(d.Box,{flexDirection:"column",children:[n(d.Text,{color:"red",children:["Error: ",r]}),t(E.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]});if(!e)return t(d.Text,{color:"red",children:"Application not found"});var o=[{label:"⚡ Initialize Project",value:"project_init"},...e.short_edit?.enabled&&e.short_edit.ref_map?[{label:"Short Edit",value:"short_edit"}]:[],{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],a=e.devices?.length||0,c=e.devices?.filter(e=>"online"===e.status)?.length||0;return n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,color:"cyan",children:e.name}),e.description&&t(d.Text,{color:"gray",children:e.description}),n(d.Box,{marginY:1,flexDirection:"column",children:[n(d.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&n(d.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Version"}),n(d.Text,{color:"gray",children:[" ","Current: ",e.current_version?`v${e.current_version}`:"N/A"]}),n(d.Text,{color:e.has_unreleased_changes?"yellow":"gray",children:[" ","Changes:"," ",e.has_unreleased_changes?"● Unreleased changes":"○ No pending changes"]}),e.current_version_details&&n(d.Text,{color:"gray",children:[" ","Released: v",e.current_version_details.version||"N/A"]})]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Devices"}),n(d.Text,{color:"gray",children:[" ","Total: ",a,a>0&&` (${c} online)`]})]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Features"}),n(d.Text,{color:"gray",children:[" ","Short Edit: ",e.short_edit?.enabled?"✓ Enabled":"✗ Disabled"]}),n(d.Text,{color:"gray",children:[" ","Canvas Control: ",e.canvas_control?.enabled?"✓ Enabled":"✗ Disabled"]}),n(d.Text,{color:"gray",children:[" ","Device Control: ",e.device_control?.enabled?"✓ Enabled":"✗ Disabled"]}),n(d.Text,{color:e.lock?.enabled?"yellow":"gray",children:[" ","Lock: ",e.lock?.enabled?"\uD83D\uDD12 Locked":"\uD83D\uDD13 Unlocked"]})]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Timestamps"}),e.create_datetime&&n(d.Text,{color:"gray",children:[" Created: ",new Date(e.create_datetime).toLocaleString()]}),e.last_modify_datetime&&n(d.Text,{color:"gray",children:[" ","Modified: ",new Date(e.last_modify_datetime).toLocaleString()]})]})]}),t(E.Ay,{items:o,onSelect:i})]})},P=({modules:e,loading:l,onSelect:r})=>{if(l)return t(b,{text:"Loading modules..."});var i=[...(e||[]).map(e=>({label:`${e.current_version?"●":"○"} ${e.name}`,value:e._id,module:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(d.Box,{flexDirection:"column",children:[n(d.Text,{bold:!0,marginBottom:1,children:["Modules (",e?.length||0,")"]}),!e?.length&&t(d.Text,{color:"yellow",children:"No modules found"}),t(E.Ay,{items:i,onSelect:r})]})},M=({module:e,loading:l,error:r,onSelect:i})=>{if(l)return t(b,{text:"Loading module..."});if(r)return n(d.Box,{flexDirection:"column",children:[n(d.Text,{color:"red",children:["Error: ",r]}),t(E.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]});if(!e)return t(d.Text,{color:"red",children:"Module not found"});var o=[{label:"⚡ Initialize Project",value:"project_init"},...e.short_edit?.enabled&&e.short_edit.ref_map?[{label:"Short Edit",value:"short_edit"}]:[],{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,color:"cyan",children:e.name}),e.description&&t(d.Text,{color:"gray",children:e.description}),n(d.Box,{marginY:1,flexDirection:"column",children:[n(d.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&n(d.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Version"}),n(d.Text,{color:"gray",children:[" ","Current: ",e.current_version?`v${e.current_version}`:"N/A"]}),n(d.Text,{color:e.has_unreleased_changes?"yellow":"gray",children:[" ","Changes:"," ",e.has_unreleased_changes?"● Unreleased changes":"○ No pending changes"]})]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Usage"}),n(d.Text,{color:"gray",children:[" ","Used in: ",e.use_count?.total_count||0," application(s)"]})]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Settings"}),n(d.Text,{color:"gray",children:[" ","Public: ",e.is_public?"✓ Yes":"✗ No"]}),n(d.Text,{color:"gray",children:[" ","Modifiable: ",e.is_allow_modify?"✓ Yes":"✗ No"]}),n(d.Text,{color:"gray",children:[" ","Short Edit: ",e.short_edit?.enabled?"✓ Enabled":"✗ Disabled"]})]}),e.expose_properties?.length>0&&n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Exposed Properties"}),n(d.Text,{color:"gray",children:[" ",e.expose_properties.length," properties exposed"]})]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Timestamps"}),e.create_datetime&&n(d.Text,{color:"gray",children:[" Created: ",new Date(e.create_datetime).toLocaleString()]}),e.last_modify_datetime&&n(d.Text,{color:"gray",children:[" ","Modified: ",new Date(e.last_modify_datetime).toLocaleString()]})]})]}),t(E.Ay,{items:o,onSelect:i})]})},R=({groups:e,loading:l,onSelect:r,countdown:i,lastRefreshTime:o})=>{if(l)return t(b,{text:"Loading device groups..."});var a=[...(e||[]).map(e=>({label:`📁 ${e.name} (${e.devices?.length||0} devices)`,value:e._id,group:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(d.Box,{flexDirection:"column",children:[n(d.Box,{marginBottom:1,children:[n(d.Text,{bold:!0,children:["Device Groups (",e?.length||0,")"]}),t(d.Text,{color:"gray",children:" - "}),t(v,{countdown:i,lastRefreshTime:o})]}),!e?.length&&t(d.Text,{color:"yellow",children:"No device groups found"}),t(E.Ay,{items:a,onSelect:r})]})},N=({loading:e,groupDevices:l})=>e?t(b,{text:"Loading devices..."}):l?.length?n(r,{children:[l.slice(0,10).map(e=>n(d.Box,{children:[t(d.Text,{color:"gray",children:" "}),t(D,{lastAliveTime:e.entry_detail?.watch_dog_timer?.last_alive_time}),n(d.Text,{color:"gray",children:[" ",e.name||e.device_name]}),e.device_target_name&&n(d.Text,{color:"gray",dimColor:!0,children:[" ","(",e.device_target_name,")"]})]},e._id)),l.length>10&&n(d.Text,{color:"gray",dimColor:!0,children:[" ","... and ",l.length-10," more"]})]}):t(d.Text,{color:"gray",children:" No devices in this group"}),U=({group:e,groupDevices:l,loading:r,error:i,onSelect:o,countdown:a,lastRefreshTime:c})=>r&&!e?t(b,{text:"Loading device group..."}):i?n(d.Box,{flexDirection:"column",children:[n(d.Text,{color:"red",children:["Error: ",i]}),t(E.Ay,{items:[{label:"← Back",value:"back"}],onSelect:o})]}):e?n(d.Box,{flexDirection:"column",children:[n(d.Box,{children:[t(d.Text,{bold:!0,color:"cyan",children:e.name}),t(d.Text,{color:"gray",children:" - "}),t(v,{countdown:a,lastRefreshTime:c})]}),e.description&&t(d.Text,{color:"gray",children:e.description}),n(d.Box,{marginY:1,flexDirection:"column",children:[n(d.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&n(d.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[n(d.Text,{bold:!0,color:"white",children:["Devices (",e.devices?.length||0,")"]}),t(N,{loading:r,groupDevices:l})]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Timestamps"}),e.create_datetime&&n(d.Text,{color:"gray",children:[" Created: ",new Date(e.create_datetime).toLocaleString()]}),e.last_modify_datetime&&n(d.Text,{color:"gray",children:[" ","Modified: ",new Date(e.last_modify_datetime).toLocaleString()]})]})]}),t(E.Ay,{items:[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:o})]}):t(d.Text,{color:"red",children:"Device group not found"}),G=({boxes:e,loading:l,onSelect:r})=>{if(l)return t(b,{text:"Loading media boxes..."});if(!e?.length)return t(d.Text,{color:"yellow",children:"No media boxes found"});var i=[...e.map(e=>({label:`📦 ${e.name||"Unnamed"}`,value:e.id,box:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(d.Box,{flexDirection:"column",children:[n(d.Text,{bold:!0,marginBottom:1,children:["Media Boxes (",e.length,")"]}),t(E.Ay,{items:i,onSelect:r})]})},j=({box:e,loading:l,error:r,onSelect:i})=>l&&!e?t(b,{text:"Loading media box..."}):r?n(d.Box,{flexDirection:"column",children:[n(d.Text,{color:"red",children:["Error: ",r]}),t(E.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]}):e?n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,color:"cyan",children:e.name||"Unnamed"}),e.description&&t(d.Text,{color:"gray",children:e.description}),n(d.Box,{marginY:1,flexDirection:"column",children:[n(d.Text,{color:"gray",children:["ID: ",e.id]}),e.tags?.length>0&&n(d.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),null!=e.size&&n(d.Text,{color:"gray",children:["Size: ",e.size]}),e.passcodes?.length>0&&n(d.Box,{flexDirection:"column",marginTop:1,children:[n(d.Text,{bold:!0,color:"white",children:["Passcodes (",e.passcodes.length,")"]}),e.passcodes.slice(0,5).map(e=>n(d.Text,{color:"gray",children:[" ",e.name||"Passcode",": ",e.code]},e.id)),e.passcodes.length>5&&n(d.Text,{color:"gray",dimColor:!0,children:[" ","... and ",e.passcodes.length-5," more"]})]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Timestamps"}),e.createdAt&&n(d.Text,{color:"gray",children:[" Created: ",new Date(e.createdAt).toLocaleString()]}),e.updatedAt&&n(d.Text,{color:"gray",children:[" Modified: ",new Date(e.updatedAt).toLocaleString()]})]})]}),t(E.Ay,{items:[{label:"List Files",value:"files"},{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:i})]}):t(d.Text,{color:"red",children:"Media box not found"}),$=({files:e,loading:l,onSelect:r,box:i})=>{if(l)return t(b,{text:"Loading media files..."});if(!e?.length)return t(d.Text,{color:"yellow",children:"No media files found"});var o=[...e.map(e=>{var l;return{label:`${"Image"===(l=e.fileType)?"\uD83D\uDDBC":"Video"===l?"\uD83C\uDF9E":"Audio"===l?"\uD83C\uDFB5":"\uD83D\uDCC4"} ${e.name||"Unnamed"}`,value:e.id,file:e}}),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return n(d.Box,{flexDirection:"column",children:[n(d.Text,{bold:!0,marginBottom:1,children:["Media Files (",e.length,")",i?.name?` - ${i.name}`:""]}),t(E.Ay,{items:o,onSelect:r})]})},V=({file:e,loading:l,error:r,onSelect:i})=>{if(l&&!e)return t(b,{text:"Loading media file..."});if(r)return n(d.Box,{flexDirection:"column",children:[n(d.Text,{color:"red",children:["Error: ",r]}),t(E.Ay,{items:[{label:"← Back",value:"back"}],onSelect:i})]});if(!e)return t(d.Text,{color:"red",children:"Media file not found"});var o=e.meta,a=(0,g.Gu)(e),c=(0,g.Gu)(e,{preferThumbnail:!0}),u=!!(c&&c!==a);return n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,color:"cyan",children:e.name||"Unnamed"}),e.description&&t(d.Text,{color:"gray",children:e.description}),n(d.Box,{marginY:1,flexDirection:"column",children:[n(d.Text,{color:"gray",children:["ID: ",e.id]}),n(d.Text,{color:"gray",children:["Box ID: ",e.boxId]}),n(d.Text,{color:"gray",children:["Type: ",e.fileType]}),e.userTags?.length>0&&n(d.Text,{color:"gray",children:["Tags: ",e.userTags.join(", ")]}),o?.originalWidth!=null&&o?.originalHeight!=null&&n(d.Text,{color:"gray",children:["Size: ",o.originalWidth,"x",o.originalHeight]}),o?.originalFileSize!=null&&n(d.Text,{color:"gray",children:["File: ",(Number(o.originalFileSize)/1024).toFixed(1)," KB"]}),a&&n(d.Text,{color:"gray",children:["Original URL: ",a]}),u&&n(d.Text,{color:"gray",children:["Thumbnail URL: ",c]}),n(d.Box,{flexDirection:"column",marginTop:1,children:[t(d.Text,{bold:!0,color:"white",children:"Timestamps"}),e.createdAt&&n(d.Text,{color:"gray",children:[" Created: ",new Date(e.createdAt).toLocaleString()]}),e.updatedAt&&n(d.Text,{color:"gray",children:[" Modified: ",new Date(e.updatedAt).toLocaleString()]})]})]}),t(E.Ay,{items:[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:i})]})},F=i(92642),H=(e,l)=>{if(!e)return"";var r="string"==typeof e?e:JSON.stringify(e);return r.length>l?r.slice(0,l-1)+"…":r},z=({onBack:e})=>{var l=u((0,c.useState)([]),2),r=l[0],i=l[1],o=u((0,c.useState)(!0),2),s=o[0],g=o[1],m=u((0,c.useState)(null),2),x=m[0],p=m[1];return(0,c.useEffect)(()=>{var e,l=(0,h.getCurrentProfile)(),r=(0,h.getToken)(l),t=(0,h.getActivityLogBaseUrl)();if(!r){p("Not logged in. Run `bricks auth login` first."),g(!1);return}if(!t){p("Activity log URL not configured."),g(!1);return}var n=(0,F.W)(t,r),o=new Date(Date.now()-36e5).toISOString(),c=new Date().toISOString(),d=new AbortController;return(e=a(function*(){try{var e=yield n.collectEvents({start_time:o,end_time:c},{limit:50,signal:d.signal});i(e)}catch(e){"AbortError"!==e.name&&p(e.message)}g(!1)}),function(){return e.apply(this,arguments)})(),()=>d.abort()},[]),n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,marginBottom:1,children:"Activity Log (last 1h)"}),s&&t(b,{text:"Fetching events..."}),x&&n(d.Text,{color:"red",children:["Error: ",x]}),!s&&!x&&0===r.length&&t(d.Text,{color:"yellow",children:"No events found in the last hour"}),!s&&r.length>0&&n(d.Box,{flexDirection:"column",marginBottom:1,children:[n(d.Text,{color:"gray",children:["Timestamp".padEnd(22)," ","Type".padEnd(12)," ","Device".padEnd(14)," ","Event Name".padEnd(24)," Sender"]}),r.map((e,l)=>n(d.Text,{children:[new Date(e.timestamp).toISOString().replace("T"," ").replace(/\.\d+Z$/,"Z").padEnd(22)," ",H(e.event_type||"",12).padEnd(12)," ",H(e.device_id||"",14).padEnd(14)," ",H(e.event_name||"",24).padEnd(24)," ",H(e.sender||"",16)]},l)),r.length>=50&&n(d.Text,{color:"yellow",children:["Showing first ",50," events"]})]}),t(E.Ay,{items:[{label:"← Back",value:"back"}],onSelect:l=>"back"===l.value&&e()})]})},Y=i(29253),q=i(44618),X=["B","C","G","D"],J=({instanceType:e,instance:l,client:r,onDone:i,onCancel:o})=>{var s,h=(0,d.useApp)().exit,g=u((0,c.useState)("select_ref"),2),m=g[0],x=g[1],p=u((0,c.useState)(""),2),f=p[0],T=p[1],v=u((0,c.useState)("search"),2),y=v[0],_=v[1],D=u((0,c.useState)(null),2),S=D[0],I=D[1],A=u((0,c.useState)(null),2),B=A[0],C=A[1],k=u((0,c.useState)(""),2),L=k[0],w=k[1],O=u((0,c.useState)(""),2),P=O[0],M=O[1],R=u((0,c.useState)(null),2),N=R[0],U=R[1],G=l?.short_edit?.ref_map||{},j=Object.entries(G).filter(([,e])=>e&&!e.hide),$=(0,q.V)(G,{keyword:f,types:X}),V=$.flatMap(e=>[{label:e.label,value:`__header_${e.prefix}__`,isHeader:!0},...e.refs.map(({shortId:e,ref:l})=>({label:`${l.title||e} (${e})`,value:e,ref:l}))]),F=[...f?[{label:"↻ Clear Search",value:"__clear_search__"}]:[],{label:"← Back",value:"__back__"}],H=V.length>0?[...V,...F]:F,z=H.findIndex(e=>!e.isHeader&&!e.value?.startsWith("__"));(0,d.useInput)((e,l)=>{l.tab&&"select_ref"===m?_(e=>"search"===e?"list":"search"):(l.escape&&("select_ref"===m&&o(),"input_path"===m&&x("select_ref"),"input_content"===m&&x("input_path"),"confirm"===m&&x("input_content"),"done"===m&&o()),"q"===e&&"input_path"!==m&&"input_content"!==m&&("select_ref"!==m||"search"!==y)&&h())},{isActive:!0});var J=(s=a(function*(){if(r&&l?._id&&S){x("submitting"),U(null);try{var t={shortId:S,path:L.trim(),content:(e=>{var l=e.trim();if(""===l)return null;try{return JSON.parse(l)}catch{return l}})(P),forwardDataLink:!0};B?.inner_ref?.pid&&(t.innerRefParentShortId=B.inner_ref.pid),"application"===e?yield r.shortEditApplication({id:l._id,list:[t]}):yield r.shortEditModule({id:l._id,list:[t]}),yield i(),x("done")}catch(e){U(e.message),x("confirm")}}}),function(){return s.apply(this,arguments)});return l?.short_edit?.enabled?0===j.length?n(d.Box,{flexDirection:"column",children:[t(d.Text,{color:"yellow",children:"No Short Edit references found."}),t(E.Ay,{items:[{label:"← Back",value:"back"}],onSelect:o})]}):"select_ref"===m?n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,children:"Short Edit References"}),t(d.Text,{color:"gray",dimColor:!0,children:"Showing: Brick, Canvas, Generator, Data"}),n(d.Box,{marginTop:1,flexDirection:"column",children:[t(d.Text,{color:"gray",children:"Search (title or shortId)"}),t(Y.A,{value:f,placeholder:"type to filter, Enter to focus list",onChange:e=>T(e),onSubmit:()=>_("list"),focus:"search"===y}),t(d.Text,{color:"gray",dimColor:!0,children:"Press Tab to switch focus"})]}),n(d.Box,{marginTop:1,children:[0===$.length&&t(d.Text,{color:"yellow",children:"No references match your search."}),t(E.Ay,{items:H,isFocused:"list"===y,initialIndex:z>-1?z:0,indicatorComponent:()=>null,itemComponent:({label:e,isSelected:l,isHeader:r})=>r?t(d.Box,{marginTop:1,children:t(d.Text,{bold:!0,color:"white",children:e})}):n(d.Text,{color:l?"blue":void 0,children:[l?"❯":" "," ",e]}),onSelect:e=>{if("__back__"===e.value)return void o();if("__clear_search__"===e.value){T(""),_("search");return}e.isHeader||(I(e.value),C(e.ref),x("input_path"))}})]})]}):"input_path"===m?n(d.Box,{flexDirection:"column",children:[n(d.Text,{children:["Reference:"," ",n(d.Text,{color:"cyan",children:[B?.title||S," (",S,")"]})]}),t(d.Text,{marginTop:1,children:"Enter property path (e.g. title, property.backgroundColor)"}),N&&n(d.Text,{color:"red",children:["Error: ",N]}),t(Y.A,{value:L,placeholder:"path",onChange:e=>{w(e),N&&U(null)},onSubmit:e=>{var l=e.trim();l?(w(l),x("input_content")):U("Path is required")},focus:!0})]}):"input_content"===m?n(d.Box,{flexDirection:"column",children:[n(d.Text,{children:["Path: ",t(d.Text,{color:"cyan",children:L})]}),t(d.Text,{marginTop:1,children:"Enter new content (JSON or plain text). Empty to clear."}),N&&n(d.Text,{color:"red",children:["Error: ",N]}),t(Y.A,{value:P,placeholder:"content",onChange:e=>{M(e),N&&U(null)},onSubmit:()=>x("confirm"),focus:!0})]}):"submitting"===m?t(b,{text:"Applying short edit..."}):"done"===m?n(d.Box,{flexDirection:"column",children:[t(d.Text,{color:"green",children:"Short edit applied successfully."}),t(E.Ay,{items:[{label:"Edit another property",value:"again"},{label:"← Back",value:"back"}],onSelect:e=>{"again"===e.value?(x("select_ref"),I(null),C(null),w(""),M(""),U(null)):o()}})]}):n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,marginBottom:1,children:"Confirm Short Edit"}),n(d.Text,{children:["Reference:"," ",n(d.Text,{color:"cyan",children:[B?.title||S," (",S,")"]})]}),n(d.Text,{children:["Path: ",t(d.Text,{color:"cyan",children:L})]}),n(d.Text,{children:["Content: ",t(d.Text,{color:"cyan",children:P||"<empty>"})]}),N&&n(d.Text,{color:"red",children:["Error: ",N]}),t(E.Ay,{items:[{label:"Apply",value:"apply"},{label:"Edit Path",value:"edit_path"},{label:"Edit Content",value:"edit_content"},{label:"← Back",value:"back"}],onSelect:e=>{"apply"===e.value&&J(),"edit_path"===e.value&&x("input_path"),"edit_content"===e.value&&x("input_content"),"back"===e.value&&o()}})]}):n(d.Box,{flexDirection:"column",children:[n(d.Text,{color:"yellow",children:["Short Edit is not enabled for this ",e,"."]}),t(E.Ay,{items:[{label:"← Back",value:"back"}],onSelect:o})]})},K=i(16928),W=i(79896),Z=i(10750),Q=i(77768),ee="options",el="output_dir",er="confirm",et="generating",en="post_install",ei="done",eo=({type:e,instance:l,client:r,onDone:i,onCancel:o})=>{var s,h=(0,d.useApp)().exit,g=u((0,c.useState)(ee),2),m=g[0],x=g[1],p=u((0,c.useState)({setupGitHubActions:!0,setupAgents:!0,setupClaudeCode:!0,setupGeminiCLI:!1,runBunInstall:!0,initGit:!0}),2),T=p[0],v=p[1],y=u((0,c.useState)(process.cwd()),2),_=y[0],b=y[1],D=u((0,c.useState)(""),2),S=D[0],I=D[1],A=u((0,c.useState)(null),2),B=A[0],C=A[1],k=u((0,c.useState)(null),2),L=k[0],w=k[1],O=Z(l?.name||"bricks-ctor"),P=K.resolve(_,O),M=(0,c.useCallback)(e=>{"back"===e.value?o():"continue"===e.value?x(el):v(l=>({...l,[e.value]:!l[e.value]}))},[o]),R=(0,c.useCallback)(()=>{W.existsSync(P)?C(`Directory already exists: ${P}`):(C(null),x(er))},[P]),N=(0,c.useCallback)((s=a(function*(t){if("back"===t.value)return void x(el);if("cancel"===t.value)return void o();if("confirm"===t.value){x(et);try{I("Fetching project from BRICKS...");var n="application"===e,i=n?r.queries.applicationProject:r.queries.moduleProject,a=(yield r.query(i,{id:l._id,buildApplicationOnly:!1,setupGitHubActions:T.setupGitHubActions,setupAgents:T.setupAgents,setupClaudeCode:T.setupClaudeCode,setupGeminiCLI:T.setupGeminiCLI}))[n?"applicationProject":"moduleProject"];if(!a?.files)throw Error("Failed to fetch project files");I("Creating project directory..."),W.mkdirSync(P,{recursive:!0}),I(`Writing ${a.files.length} files...`);var c=yield(0,Q.KN)(a.files,P);(0,Q.oz)(c),x(en);var d={path:P,files:a.files.length,bunInstalled:!1,gitInitialized:!1};Object.assign(d,(yield(0,Q.o0)(P,{install:T.runBunInstall,git:T.initGit,onStatus:I}))),w(d),x(ei)}catch(e){C(e.message),x(ee)}}}),function(e){return s.apply(this,arguments)}),[r,l,e,T,P,o]),U=(0,c.useCallback)(e=>{"exit"===e.value?h():i()},[h,i]);if(m===ee){var G=[{label:`${T.setupGitHubActions?"[x]":"[ ]"} GitHub Actions workflow`,value:"setupGitHubActions"},{label:`${T.setupAgents?"[x]":"[ ]"} AGENTS.md`,value:"setupAgents"},{label:`${T.setupClaudeCode?"[x]":"[ ]"} CLAUDE.md`,value:"setupClaudeCode"},{label:`${T.setupGeminiCLI?"[x]":"[ ]"} GEMINI.md`,value:"setupGeminiCLI"},{label:`${T.runBunInstall?"[x]":"[ ]"} Run bun install after generation`,value:"runBunInstall"},{label:`${T.initGit?"[x]":"[ ]"} Initialize git repository`,value:"initGit"},{label:"→ Continue",value:"continue"},{label:"← Back",value:"back"}];return n(d.Box,{flexDirection:"column",children:[n(d.Text,{bold:!0,color:"cyan",children:["Initialize BRICKS Project: ",l?.name||"Untitled"]}),t(d.Text,{color:"gray",marginBottom:1,children:"Select options for project generation (press Enter to toggle)"}),B&&n(d.Text,{color:"red",marginBottom:1,children:["Error: ",B]}),t(E.Ay,{items:G,onSelect:M})]})}return m===el?n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,color:"cyan",children:"Output Directory"}),t(d.Text,{color:"gray",marginBottom:1,children:"Enter the parent directory for the project:"}),B&&t(d.Text,{color:"red",marginBottom:1,children:B}),n(d.Box,{children:[t(d.Text,{children:"Directory: "}),t(Y.A,{value:_,onChange:b,onSubmit:R})]}),n(d.Text,{color:"gray",marginTop:1,children:["Project will be created at: ",P]})]}):m===er?n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,color:"cyan",children:"Confirm Project Generation"}),n(d.Box,{marginY:1,flexDirection:"column",children:[n(d.Text,{children:["Name: ",t(d.Text,{color:"green",children:l?.name||"Untitled"})]}),n(d.Text,{children:["Type: ",t(d.Text,{color:"yellow",children:e})]}),n(d.Text,{children:["Path: ",t(d.Text,{color:"cyan",children:P})]}),t(d.Text,{color:"gray",marginTop:1,children:"Options:"}),n(d.Text,{color:"gray",children:[" - GitHub Actions: ",T.setupGitHubActions?"Yes":"No"]}),n(d.Text,{color:"gray",children:[" - AGENTS.md: ",T.setupAgents?"Yes":"No"]}),n(d.Text,{color:"gray",children:[" - CLAUDE.md: ",T.setupClaudeCode?"Yes":"No"]}),n(d.Text,{color:"gray",children:[" - GEMINI.md: ",T.setupGeminiCLI?"Yes":"No"]}),n(d.Text,{color:"gray",children:[" - Run bun install: ",T.runBunInstall?"Yes":"No"]}),n(d.Text,{color:"gray",children:[" - Initialize git: ",T.initGit?"Yes":"No"]})]}),t(E.Ay,{items:[{label:"Confirm & Generate",value:"confirm"},{label:"← Change Directory",value:"back"},{label:"Cancel",value:"cancel"}],onSelect:N})]}):m===et||m===en?n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,color:"cyan",children:"Generating Project..."}),n(d.Box,{marginY:1,children:[t(d.Text,{color:"green",children:t(f.A,{type:"dots"})}),n(d.Text,{children:[" ",S]})]})]}):m===ei&&L?n(d.Box,{flexDirection:"column",children:[t(d.Text,{bold:!0,color:"green",children:"Project initialized successfully!"}),n(d.Box,{marginY:1,flexDirection:"column",children:[n(d.Text,{children:["Path: ",t(d.Text,{color:"cyan",children:L.path})]}),n(d.Text,{children:["Files: ",t(d.Text,{color:"green",children:L.files})]}),n(d.Text,{children:["Dependencies:"," ",t(d.Text,{color:L.bunInstalled?"green":"yellow",children:L.bunInstalled?"Installed":"Not installed (run bun install manually)"})]}),n(d.Text,{children:["Git:"," ",t(d.Text,{color:L.gitInitialized?"green":"yellow",children:L.gitInitialized?"Initialized":"Not initialized"})]})]}),t(d.Text,{bold:!0,marginY:1,children:"Next steps:"}),n(d.Text,{color:"gray",children:[" cd ",O]}),!L.bunInstalled&&t(d.Text,{color:"gray",children:" bun install"}),t(d.Text,{color:"gray",children:" bun invoke-simulator"}),n(d.Text,{color:"gray",marginTop:1,children:["For more information, see ",O,"/README.md"]}),t(d.Box,{marginTop:1,children:t(E.Ay,{items:[{label:"← Back to Detail",value:"back"},{label:"Exit CLI",value:"exit"}],onSelect:U})})]}):null};let ea=()=>{var e,l,r,i,o,x,p,f,v=(0,d.useApp)().exit,D=u((0,c.useState)(m.MAIN),2),E=D[0],I=D[1],A=u((0,c.useState)(null),2),N=A[0],F=A[1],H=u((0,c.useState)(null),2),Y=H[0],q=H[1],X=u((0,c.useState)(!0),2),K=X[0],W=X[1],Z=u((0,c.useState)(null),2),Q=Z[0],ee=Z[1],el=u((0,c.useState)([]),2),er=el[0],et=el[1],en=u((0,c.useState)(null),2),ei=en[0],ea=en[1],ec=u((0,c.useState)([]),2),ed=ec[0],eu=ec[1],es=u((0,c.useState)(null),2),eh=es[0],eg=es[1],em=u((0,c.useState)([]),2),ex=em[0],ep=em[1],ef=u((0,c.useState)(null),2),eT=ef[0],ev=ef[1],ey=u((0,c.useState)([]),2),e_=ey[0],eb=ey[1],eD=u((0,c.useState)(null),2),eE=eD[0],eS=eD[1],eI=u((0,c.useState)([]),2),eA=eI[0],eB=eI[1],eC=u((0,c.useState)(!1),2),ek=eC[0],eL=eC[1],ew=u((0,c.useState)(null),2),eO=ew[0],eP=ew[1],eM=u((0,c.useState)(null),2),eR=eM[0],eN=eM[1],eU=u((0,c.useState)(null),2),eG=eU[0],ej=eU[1],e$=u((0,c.useState)(null),2),eV=e$[0],eF=e$[1],eH=u((0,c.useState)([]),2),ez=eH[0],eY=eH[1],eq=u((0,c.useState)(null),2),eX=eq[0],eJ=eq[1],eK=u((0,c.useState)([]),2),eW=eK[0],eZ=eK[1],eQ=u((0,c.useState)(null),2),e0=eQ[0],e1=eQ[1],e2=E===m.DEVICES,e4=E===m.DEVICE_DETAIL,e6=E===m.GROUPS,e9=E===m.GROUP_DETAIL;(0,c.useEffect)(()=>{var e=(0,h.getCurrentProfile)(),l=(0,h.getToken)(e);if(!l){ee("Not logged in. Run `bricks auth login` first."),W(!1);return}var r=(0,s.createClient)((0,h.getBaseUrl)(),l);F(r),r.workspace().then(e=>{q(e),W(!1)}).catch(e=>{ee(e.message),W(!1)})},[]),(0,d.useInput)((e,l)=>{"q"===e&&v(),l.escape&&(E===m.DEVICE_CONTROL?(I(m.DEVICE_DETAIL),eP(null)):E===m.DEVICE_SCREENSHOT?(I(m.DEVICE_DETAIL),ej(null),eF(null)):E===m.DEVICE_DETAIL?(I(m.DEVICES),ea(null)):E===m.APP_DETAIL?(I(m.APPS),eg(null)):E===m.MODULE_DETAIL?(I(m.MODULES),ev(null)):E===m.GROUP_DETAIL?(I(m.GROUPS),eS(null),eB([])):E===m.MEDIA_FILE_DETAIL?(I(m.MEDIA_FILES),e1(null)):E===m.MEDIA_FILES?(I(m.MEDIA_BOX_DETAIL),e1(null)):E===m.MEDIA_BOX_DETAIL?(I(m.MEDIA_BOXES),eJ(null),eZ([])):E===m.MEDIA_BOXES?I(m.MAIN):E!==m.MAIN&&I(m.MAIN))},{isActive:E!==m.APP_SHORT_EDIT&&E!==m.MODULE_SHORT_EDIT&&E!==m.APP_PROJECT_INIT&&E!==m.MODULE_PROJECT_INIT});var e5=(0,c.useCallback)(a(function*(){if(N){W(!0);try{var e=yield N.devices({});et(e||[])}catch(e){ee(e.message)}W(!1)}}),[N]),e8=(0,c.useCallback)((e=a(function*(e){if(N){W(!0),eN(null);try{var l=yield N.device({id:e});ea(l)}catch(e){eN(e.message)}W(!1)}}),function(l){return e.apply(this,arguments)}),[N]),e7=(0,c.useCallback)(a(function*(){if(N){W(!0);try{var e=yield N.applications({});eu(e||[])}catch(e){ee(e.message)}W(!1)}}),[N]),e3=(0,c.useCallback)((l=a(function*(e){if(N){W(!0),eN(null);try{var l=yield N.application({id:e});eg(l)}catch(e){eN(e.message)}W(!1)}}),function(e){return l.apply(this,arguments)}),[N]),le=(0,c.useCallback)(a(function*(){if(N){W(!0);try{var e=yield N.modules({});ep(e||[])}catch(e){ee(e.message)}W(!1)}}),[N]),ll=(0,c.useCallback)((r=a(function*(e){if(N){W(!0),eN(null);try{var l=yield N.module({id:e});ev(l)}catch(e){eN(e.message)}W(!1)}}),function(e){return r.apply(this,arguments)}),[N]),lr=(0,c.useCallback)(a(function*(){if(N){W(!0);try{var e=yield N.deviceGroups({});eb(e||[])}catch(e){ee(e.message)}W(!1)}}),[N]),lt=(0,c.useCallback)((i=a(function*(e){if(N){W(!0),eN(null);try{var l=yield Promise.all([N.deviceGroup({id:e}),N.devicesByGroup({id:e})]),r=u(l,2),t=r[0],n=r[1];eS(t),eB(n||[])}catch(e){eN(e.message)}W(!1)}}),function(e){return i.apply(this,arguments)}),[N]),ln=(0,c.useCallback)(a(function*(){if(N){W(!0);try{var e=yield N.mediaBoxes();eY(e||[])}catch(e){ee(e.message)}W(!1)}}),[N]),li=(0,c.useCallback)((o=a(function*(e){if(N){W(!0),eN(null);try{var l=yield N.mediaBox({id:e});eJ(l)}catch(e){eN(e.message)}W(!1)}}),function(e){return o.apply(this,arguments)}),[N]),lo=(0,c.useCallback)((x=a(function*(e){if(N){W(!0);try{var l=yield N.mediaFiles({boxId:e});eZ(l||[])}catch(e){ee(e.message)}W(!1)}}),function(e){return x.apply(this,arguments)}),[N]),la=(0,c.useCallback)((p=a(function*(e){if(N){W(!0),eN(null);try{var l=yield N.mediaFile({id:e});e1(l)}catch(e){eN(e.message)}W(!1)}}),function(e){return p.apply(this,arguments)}),[N]),lc=(0,c.useCallback)((f=a(function*(e){if(N&&ei){eL(!0),eP(null);try{yield N.controlDevice({id:ei._id,type:e}),eP({success:!0,message:`Command sent: ${e}`})}catch(e){eP({success:!1,message:e.message})}eL(!1)}}),function(e){return f.apply(this,arguments)}),[N,ei]),ld=(0,c.useCallback)(a(function*(e=!1){if(N&&ei&&Y){W(!0),eF(null),ej(null);try{e&&(yield N.controlDevice({id:ei._id,type:"take-screenshot"}),yield new Promise(e=>setTimeout(e,3e3)));var l=yield(0,g.he)(N,Y,ei._id,null,{preferThumbnail:!0});l.error?eF(l.error):ej(l)}catch(e){eF(e.message)}W(!1)}}),[N,ei,Y]),lu=T((0,c.useCallback)(()=>{N&&e5()},[N,e5]),e2),ls=T((0,c.useCallback)(()=>{N&&ei&&e8(ei._id)},[N,ei,e8]),e4),lh=T((0,c.useCallback)(()=>{N&&lr()},[N,lr]),e6),lg=T((0,c.useCallback)(()=>{N&&eE&&lt(eE._id)},[N,eE,lt]),e9);return K&&!Y?n(d.Box,{flexDirection:"column",children:[t(y,{workspace:Y,view:E}),t(b,{text:"Connecting to workspace..."})]}):Q&&!Y?n(d.Box,{flexDirection:"column",children:[t(y,{workspace:Y,view:E}),n(d.Text,{color:"red",children:["Error: ",Q]}),t(_,{})]}):n(d.Box,{flexDirection:"column",children:[t(y,{workspace:Y,view:E}),E===m.MAIN&&t(S,{onSelect:e=>{"exit"===e.value?v():(I(e.value),e.value===m.DEVICES?e5():e.value===m.APPS?e7():e.value===m.MODULES?le():e.value===m.GROUPS?lr():e.value===m.MEDIA_BOXES&&ln())},mediaEnabled:(0,g.wR)(Y),activityLogEnabled:!!(0,h.getActivityLogBaseUrl)()}),E===m.DEVICES&&t(B,{devices:er,loading:K,onSelect:e=>{if("back"===e.value)return void I(m.MAIN);if("refresh"===e.value){e5(),lu.resetCountdown();return}ea(null),W(!0),I(m.DEVICE_DETAIL),e8(e.value)},countdown:lu.countdown,lastRefreshTime:lu.lastRefreshTime}),E===m.DEVICE_DETAIL&&t(C,{device:ei,loading:K,error:eR,onSelect:e=>{if("back"===e.value){I(m.DEVICES),ea(null);return}if("refresh"===e.value){e8(ei._id),ls.resetCountdown();return}"control"===e.value&&(I(m.DEVICE_CONTROL),eP(null)),"screenshot"===e.value&&(I(m.DEVICE_SCREENSHOT),ej(null),eF(null),ld(!1))},mediaEnabled:(0,g.wR)(Y),countdown:ls.countdown,lastRefreshTime:ls.lastRefreshTime}),E===m.DEVICE_CONTROL&&t(k,{device:ei,onSelect:e=>{if("back"===e.value){I(m.DEVICE_DETAIL),eP(null);return}lc(e.value)},controlling:ek,controlResult:eO}),E===m.DEVICE_SCREENSHOT&&t(L,{device:ei,screenshot:eG,loading:K,error:eV,onSelect:e=>{if("back"===e.value){I(m.DEVICE_DETAIL),ej(null),eF(null);return}"refresh"===e.value?ld(!1):"take"===e.value&&ld(!0)}}),E===m.APPS&&t(w,{apps:ed,loading:K,onSelect:e=>{"back"===e.value?I(m.MAIN):"refresh"===e.value?e7():(eg(null),W(!0),I(m.APP_DETAIL),e3(e.value))}}),E===m.APP_DETAIL&&t(O,{app:eh,loading:K,error:eR,onSelect:e=>{if("back"===e.value){I(m.APPS),eg(null);return}"refresh"===e.value?e3(eh._id):("short_edit"===e.value&&(I(m.APP_SHORT_EDIT),eN(null)),"project_init"===e.value&&(I(m.APP_PROJECT_INIT),eN(null)))}}),E===m.APP_SHORT_EDIT&&t(J,{instanceType:"application",instance:eh,client:N,onDone:a(function*(){return e3(eh._id)}),onCancel:()=>I(m.APP_DETAIL)}),E===m.APP_PROJECT_INIT&&t(eo,{type:"application",instance:eh,client:N,onDone:()=>I(m.APP_DETAIL),onCancel:()=>I(m.APP_DETAIL)}),E===m.MODULES&&t(P,{modules:ex,loading:K,onSelect:e=>{"back"===e.value?I(m.MAIN):"refresh"===e.value?le():(ev(null),W(!0),I(m.MODULE_DETAIL),ll(e.value))}}),E===m.MODULE_DETAIL&&t(M,{module:eT,loading:K,error:eR,onSelect:e=>{if("back"===e.value){I(m.MODULES),ev(null);return}"refresh"===e.value?ll(eT._id):("short_edit"===e.value&&(I(m.MODULE_SHORT_EDIT),eN(null)),"project_init"===e.value&&(I(m.MODULE_PROJECT_INIT),eN(null)))}}),E===m.MODULE_SHORT_EDIT&&t(J,{instanceType:"module",instance:eT,client:N,onDone:a(function*(){return ll(eT._id)}),onCancel:()=>I(m.MODULE_DETAIL)}),E===m.MODULE_PROJECT_INIT&&t(eo,{type:"module",instance:eT,client:N,onDone:()=>I(m.MODULE_DETAIL),onCancel:()=>I(m.MODULE_DETAIL)}),E===m.GROUPS&&t(R,{groups:e_,loading:K,onSelect:e=>{if("back"===e.value)return void I(m.MAIN);if("refresh"===e.value){lr(),lh.resetCountdown();return}eS(null),eB([]),W(!0),I(m.GROUP_DETAIL),lt(e.value)},countdown:lh.countdown,lastRefreshTime:lh.lastRefreshTime}),E===m.GROUP_DETAIL&&t(U,{group:eE,groupDevices:eA,loading:K,error:eR,onSelect:e=>{if("back"===e.value){I(m.GROUPS),eS(null),eB([]);return}"refresh"===e.value&&(lt(eE._id),lg.resetCountdown())},countdown:lg.countdown,lastRefreshTime:lg.lastRefreshTime}),E===m.ACTIVITY_LOG&&t(z,{onBack:()=>I(m.MAIN)}),E===m.MEDIA_BOXES&&t(G,{boxes:ez,loading:K,onSelect:e=>{"back"===e.value?I(m.MAIN):"refresh"===e.value?ln():(eJ(null),eZ([]),W(!0),I(m.MEDIA_BOX_DETAIL),li(e.value))}}),E===m.MEDIA_BOX_DETAIL&&t(j,{box:eX,loading:K,error:eR,onSelect:e=>{if("back"===e.value){I(m.MEDIA_BOXES),eJ(null),eZ([]);return}"refresh"===e.value?li(eX.id):"files"===e.value&&(eZ([]),e1(null),I(m.MEDIA_FILES),lo(eX.id))}}),E===m.MEDIA_FILES&&t($,{files:eW,box:eX,loading:K,onSelect:e=>{if("back"===e.value){I(m.MEDIA_BOX_DETAIL),e1(null);return}"refresh"===e.value?lo(eX.id):(e1(null),W(!0),I(m.MEDIA_FILE_DETAIL),la(e.value))}}),E===m.MEDIA_FILE_DETAIL&&t(V,{file:e0,loading:K,error:eR,onSelect:e=>{if("back"===e.value){I(m.MEDIA_FILES),e1(null);return}"refresh"===e.value&&la(e0.id)}}),t(_,{})]})};var ec="1"===process.env.BRICKS_CLI_DISTRIBUTION,ed=(o=a(function*(){if(ec)return void(0,d.render)(t(ea,{}));var e=(yield i.e(166).then(i.bind(i,29557))).TerminalInfoProvider;(0,d.render)(t(e,{children:t(ea,{})}))}),function(){return o.apply(this,arguments)})},77768(e,l,r){r.d(l,{BZ:()=>v,KN:()=>p,kU:()=>x,o0:()=>T,oz:()=>f});var t,n,i,o,a=r(99436),c=r(16928),d=r(79896),u=r(35317),s=r(10750),h=e=>{try{return(0,u.execSync)(`which ${e}`,{stdio:"ignore"}),!0}catch{return!1}},g=(e,l,r)=>new Promise((t,n)=>{var i=[e,...l].join(" "),o=(0,u.spawn)(i,[],{cwd:r,stdio:"pipe",shell:!0}),a=[];o.stderr.on("data",e=>a.push(e)),o.on("close",e=>{0===e?t():n(Error(Buffer.concat(a).toString().trim()||`Command failed with code ${e}`))}),o.on("error",n)}),m=(t=a(function*(e,l){try{var t=(yield r.e(75).then(r.bind(r,79491))).format;return(yield t(l,e,{trailingComma:"all",tabWidth:2,semi:!1,singleQuote:!0,printWidth:100})).code}catch{}return e}),function(e,l){return t.apply(this,arguments)}),x=(e=[])=>{var l=e.find(e=>"application.json"===e.name);if(!l)return"bricks-ctor";try{var r=JSON.parse(l.input);return s(r.name||"bricks-ctor")}catch{return"bricks-ctor"}},p=(n=a(function*(e,l){var r;return Promise.all(e.map((r=a(function*(e){var r=c.join(l,e.name),t=e.input;return e.formatable&&(t=yield m(t,r)),{...e,filePath:r,content:t}}),function(e){return r.apply(this,arguments)})))}),function(e,l){return n.apply(this,arguments)}),f=e=>{e.forEach(e=>{d.mkdirSync(c.dirname(e.filePath),{recursive:!0}),d.writeFileSync(e.filePath,e.content)})},T=(i=a(function*(e,l={}){var r="function"==typeof l.onStatus?l.onStatus:()=>{},t=!1,n=!1;if(!1!==l.install&&h("bun")){r("Installing dependencies (bun install)...");try{yield g("bun",["install"],e),t=!0}catch{}}if(!1!==l.git&&h("git")){r("Initializing git repository...");try{yield g("git",["init"],e),yield g("git",["add","."],e),yield g("git",["-c 'user.name=BRICKS CLI'","-c 'user.email=cli@bricks.tools'","commit","-m 'chore: initialize commit'"],e),n=!0}catch{}}return{bunInstalled:t,gitInitialized:n}}),function(e){return i.apply(this,arguments)}),v=(o=a(function*(e,l,r){var t=r.client,n=r.output,i=r.outputAsTarget;if(!t)throw Error("client is required");if(!n)throw Error("output directory is required");var o=(e=>{for(var l=c.resolve(e);;){if(d.existsSync(c.join(l,"application.json"))||d.existsSync(c.join(l,"module.json")))return l;var r=c.dirname(l);if(r===l)return null;l=r}})(i?c.dirname(c.resolve(n)):n);if(o)throw Error(`Cannot initialize a new BRICKS project inside an existing project (${o}). Choose a directory outside the project.`);var a="application"===e,u=a?t.queries.applicationProject:t.queries.moduleProject,s=(yield t.query(u,{id:l,buildApplicationOnly:!1,setupGitHubActions:!1!==r.githubActions,setupAgents:!1!==r.agents,setupClaudeCode:!1!==r.claude,setupGeminiCLI:!0===r.gemini}))[a?"applicationProject":"moduleProject"];if(!s?.files)throw Error(`${e} project not found`);var h=x(s.files),g=i?c.resolve(n):c.resolve(n,h);if(d.existsSync(g))throw Error(`Directory already exists: ${g}`);d.mkdirSync(g,{recursive:!0}),f((yield p(s.files,g)));var m=yield T(g,r),v=m.bunInstalled,y=m.gitInitialized;return{success:!0,path:g,files:s.files.length,bunInstalled:v,gitInitialized:y}}),function(e,l,r){return o.apply(this,arguments)})}};