define(["react","gpui-style-inject","mobx"],(function(n,e,t){"use strict";function r(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var o=r(n),i=r(e);
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */
function s(n,e,t,r){return new(t||(t=Promise))((function(o,i){function s(n){try{c(r.next(n))}catch(n){i(n)}}function a(n){try{c(r.throw(n))}catch(n){i(n)}}function c(n){var e;n.done?o(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(s,a)}c((r=r.apply(n,e||[])).next())}))}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function a(n){var e={exports:{}};return n(e,e.exports),e.exports
/*
    object-assign
    (c) Sindre Sorhus
    @license MIT
    */}Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de","5"===Object.getOwnPropertyNames(n)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(n){return e[n]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(n){r[n]=n})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(n){return!1}}()||Object.assign;
/** @license React v17.0.2
     * react-jsx-runtime.production.min.js
     *
     * Copyright (c) Facebook, Inc. and its affiliates.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE file in the root directory of this source tree.
     */
var c=a((function(n,e){var t=60103;if(e.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;t=r("react.element"),e.Fragment=r("react.fragment")}var i=o.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,a={key:!0,ref:!0,__self:!0,__source:!0};function c(n,e,r){var o,c={},u=null,d=null;for(o in void 0!==r&&(u=""+r),void 0!==e.key&&(u=""+e.key),void 0!==e.ref&&(d=e.ref),e)s.call(e,o)&&!a.hasOwnProperty(o)&&(c[o]=e[o]);if(n&&n.defaultProps)for(o in e=n.defaultProps)void 0===c[o]&&(c[o]=e[o]);return{$$typeof:t,type:n,key:u,ref:d,props:c,_owner:i.current}}e.jsx=c,e.jsxs=c})),u=a((function(n){n.exports=c}));i.default('/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n   ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n  line-height: 1; /* 1 */\n  -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n   ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n  margin: 0;\n}\n\n/**\n * Render the `main` element consistently in IE.\n */\n\nmain {\n  display: block;\n}\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n  font-size: 2em;\n  margin: 0.67em 0;\n}\n\n/* Grouping content\n   ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n  box-sizing: content-box; /* 1 */\n  height: 0; /* 1 */\n  overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\npre {\n  font-family: monospace, monospace; /* 1 */\n  font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n   ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n  background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n  border-bottom: none; /* 1 */\n  text-decoration: underline; /* 2 */\n  text-decoration: underline dotted; /* 2 */\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\nb,\nstrong {\n  font-weight: bolder;\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n  font-family: monospace, monospace; /* 1 */\n  font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n  font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n  font-size: 75%;\n  line-height: 0;\n  position: relative;\n  vertical-align: baseline;\n}\n\nsub {\n  bottom: -0.25em;\n}\n\nsup {\n  top: -0.5em;\n}\n\n/* Embedded content\n   ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n  border-style: none;\n}\n\n/* Forms\n   ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n  font-family: inherit; /* 1 */\n  font-size: 100%; /* 1 */\n  line-height: 1; /* 1 */\n  margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput { /* 1 */\n  overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect { /* 1 */\n  text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type="button"],\n[type="reset"],\n[type="submit"] {\n  -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type="button"]::-moz-focus-inner,\n[type="reset"]::-moz-focus-inner,\n[type="submit"]::-moz-focus-inner {\n  border-style: none;\n  padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\nbutton:-moz-focusring,\n[type="button"]:-moz-focusring,\n[type="reset"]:-moz-focusring,\n[type="submit"]:-moz-focusring {\n  outline: 1px dotted ButtonText;\n}\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n  padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n *    `fieldset` elements in all browsers.\n */\n\nlegend {\n  box-sizing: border-box; /* 1 */\n  color: inherit; /* 2 */\n  display: table; /* 1 */\n  max-width: 100%; /* 1 */\n  padding: 0; /* 3 */\n  white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n  vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n  overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type="checkbox"],\n[type="radio"] {\n  box-sizing: border-box; /* 1 */\n  padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type="number"]::-webkit-inner-spin-button,\n[type="number"]::-webkit-outer-spin-button {\n  height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type="search"] {\n  -webkit-appearance: textfield; /* 1 */\n  outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type="search"]::-webkit-search-decoration {\n  -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n\n::-webkit-file-upload-button {\n  -webkit-appearance: button; /* 1 */\n  font: inherit; /* 2 */\n}\n\n/* Interactive\n   ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n  display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n  display: list-item;\n}\n\n/* Misc\n   ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n  display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n  display: none;\n}\n');i.default('@font-face {\n  font-family: \'DS-Digital\';\n  src: url(\'./fonts/DS-Digital.ttf\');\n  font-weight: normal;\n  font-style: normal;\n}\n\n.led-font {\n  /* use !important to prevent issues with browser extensions that change fonts */\n  font-family: \'DS-Digital\' !important;\n  speak: none;\n  font-style: normal;\n  font-weight: normal;\n  font-variant: normal;\n  text-transform: none;\n  line-height: 1;\n  \n  /* Enable Ligatures ================ */\n  letter-spacing: 0;\n  -webkit-font-feature-settings: "liga";\n  -moz-font-feature-settings: "liga=1";\n  -moz-font-feature-settings: "liga";\n  -ms-font-feature-settings: "liga" 1;\n  font-feature-settings: "liga";\n  -webkit-font-variant-ligatures: discretionary-ligatures;\n  font-variant-ligatures: discretionary-ligatures;\n\n  /* Better Font Rendering =========== */\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n');i.default('@charset "UTF-8";\nhtml, body {\n  width: 100%;\n  height: 100%;\n  overflow: hidden;\n  background-color: transparent !important;\n}\n\ndiv {\n  line-height: 1;\n  font-family: "PingFang SC", "思源黑体", "微软雅黑", "Microsoft YaHei", "Arial", "sans-serif";\n}\n\n/* 组件的基础样式 */\n.g__component {\n  position: relative;\n  width: 100%;\n  height: 100%;\n}\n.g__component--has-title {\n  margin-top: 60px;\n  height: calc(100% - 60px);\n}\n\n/* 组件用的浮动样式 */\n.g__float {\n  position: absolute;\n  right: 30px;\n  top: -20px;\n  font-size: 16px;\n  color: #e5e5e5;\n  cursor: pointer;\n}\n\n/* 页面的基础样式 */\n.g__page {\n  position: relative;\n  margin-top: 2px;\n  box-sizing: border-box;\n  width: 100%;\n  height: calc(100% - 2px);\n  overflow: auto;\n}\n\n/* 页面的带边框的盒子 */\n.g__box {\n  box-sizing: border-box;\n  border: 1px solid rgba(255, 255, 255, 0.18);\n  background-color: rgba(255, 255, 255, 0.04);\n}\n.g__box--radius {\n  border-radius: 8px;\n}\n\n/* 页面的带边框不带背景色的盒子 */\n.g__box__border {\n  box-sizing: border-box;\n  border: 1px solid rgba(255, 255, 255, 0.18);\n}\n.g__box__border--radius {\n  border-radius: 8px;\n}\n\n/* 页面标签 */\n.g__tag {\n  margin-left: 10px;\n  box-sizing: border-box;\n  width: 84px;\n  height: 26px;\n  line-height: 26px;\n  font-size: 18px;\n  border-radius: 4px;\n  text-align: center;\n}\n.g__tag--accept-reserv {\n  color: #1fb5f9;\n  border: 1px solid #1fb5f9;\n}\n.g__tag--accept-sample {\n  color: #fdb82c;\n  border: 1px solid #fdb82c;\n}\n\n/* 超出文字省略号显示 */\n.g__text-overflow {\n  display: inline-block;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}');var d={content:"index-module_content__3yyXB",null:"index-module_null__CBQYB",status:"index-module_status__2wl4u",status__name:"index-module_status__name__KrQ8c",status__progress:"index-module_status__progress__1_45_",status__count:"index-module_status__count__2sNl3"};i.default(".index-module_content__3yyXB {\n  box-sizing: border-box;\n  padding: 8px 30px 0;\n  width: 100%;\n  height: 100%;\n}\n\n.index-module_null__CBQYB {\n  color: white;\n  padding: 50px;\n  font-size: 20px;\n}\n\n.index-module_status__2wl4u {\n  display: flex;\n  justify-content: space-between;\n  box-sizing: border-box;\n  padding-top: 28px;\n  width: 100%;\n  height: 48px;\n  font-size: 20px;\n  color: #e5e5e5;\n}\n.index-module_status__name__KrQ8c {\n  width: 100px;\n  height: 100%;\n}\n.index-module_status__progress__1_45_ {\n  flex: 1;\n  height: 100%;\n}\n.index-module_status__count__2sNl3 {\n  width: 40px;\n  height: 100%;\n  color: #83b6dc;\n  text-align: right;\n}");var l="progressbar-module_progress__RBl_N",f="progressbar-module_progress__bar__27Pg6",p="progressbar-module_progress__bar__inner__1YNnK";i.default(".progressbar-module_progress__RBl_N {\n  display: flex;\n  align-items: center;\n  width: 100%;\n  height: 100%;\n}\n.progressbar-module_progress__bar__27Pg6 {\n  left: 0;\n  top: 50%;\n  width: 100%;\n  overflow: hidden;\n}\n.progressbar-module_progress__bar__inner__1YNnK {\n  height: 100%;\n}");const h=({height:e,progress:t,background:r,progressColor:o})=>{n.useEffect((()=>{console.log(e,"height")}),[]);const i=n.useMemo((()=>({height:`${e}px`,borderRadius:e/2+"px",background:r})),[e,r]),s=n.useMemo((()=>({borderRadius:e/2+"px",width:`${t}%`,background:o})),[e,t,o]);return u.jsx("div",Object.assign({className:l},{children:u.jsx("div",Object.assign({className:f,style:i},{children:u.jsx("div",{className:p,style:s},void 0)}),void 0)}),void 0)};var m=a((function(n,e){var t;t=function(){return function(n){var e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={exports:{},id:r,loaded:!1};return n[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}return t.m=n,t.c=e,t.p="",t(0)}([function(n,e,t){n.exports=t(1)},function(n,e,t){var r=t(2),o=t(3),i=t(4),s=t(22);function a(n){var e=new i(n),t=o(i.prototype.request,e);return r.extend(t,i.prototype,e),r.extend(t,e),t}var c=a(t(10));c.Axios=i,c.create=function(n){return a(s(c.defaults,n))},c.Cancel=t(23),c.CancelToken=t(24),c.isCancel=t(9),c.all=function(n){return Promise.all(n)},c.spread=t(25),c.isAxiosError=t(26),n.exports=c,n.exports.default=c},function(n,e,t){var r=t(3),o=Object.prototype.toString;function i(n){return"[object Array]"===o.call(n)}function s(n){return void 0===n}function a(n){return null!==n&&"object"==typeof n}function c(n){if("[object Object]"!==o.call(n))return!1;var e=Object.getPrototypeOf(n);return null===e||e===Object.prototype}function u(n){return"[object Function]"===o.call(n)}function d(n,e){if(null!=n)if("object"!=typeof n&&(n=[n]),i(n))for(var t=0,r=n.length;t<r;t++)e.call(null,n[t],t,n);else for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.call(null,n[o],o,n)}n.exports={isArray:i,isArrayBuffer:function(n){return"[object ArrayBuffer]"===o.call(n)},isBuffer:function(n){return null!==n&&!s(n)&&null!==n.constructor&&!s(n.constructor)&&"function"==typeof n.constructor.isBuffer&&n.constructor.isBuffer(n)},isFormData:function(n){return"undefined"!=typeof FormData&&n instanceof FormData},isArrayBufferView:function(n){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer&&n.buffer instanceof ArrayBuffer},isString:function(n){return"string"==typeof n},isNumber:function(n){return"number"==typeof n},isObject:a,isPlainObject:c,isUndefined:s,isDate:function(n){return"[object Date]"===o.call(n)},isFile:function(n){return"[object File]"===o.call(n)},isBlob:function(n){return"[object Blob]"===o.call(n)},isFunction:u,isStream:function(n){return a(n)&&u(n.pipe)},isURLSearchParams:function(n){return"undefined"!=typeof URLSearchParams&&n instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:d,merge:function n(){var e={};function t(t,r){c(e[r])&&c(t)?e[r]=n(e[r],t):c(t)?e[r]=n({},t):i(t)?e[r]=t.slice():e[r]=t}for(var r=0,o=arguments.length;r<o;r++)d(arguments[r],t);return e},extend:function(n,e,t){return d(e,(function(e,o){n[o]=t&&"function"==typeof e?r(e,t):e})),n},trim:function(n){return n.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(n){return 65279===n.charCodeAt(0)&&(n=n.slice(1)),n}}},function(n,e){n.exports=function(n,e){return function(){for(var t=new Array(arguments.length),r=0;r<t.length;r++)t[r]=arguments[r];return n.apply(e,t)}}},function(n,e,t){var r=t(2),o=t(5),i=t(6),s=t(7),a=t(22);function c(n){this.defaults=n,this.interceptors={request:new i,response:new i}}c.prototype.request=function(n){"string"==typeof n?(n=arguments[1]||{}).url=arguments[0]:n=n||{},(n=a(this.defaults,n)).method?n.method=n.method.toLowerCase():this.defaults.method?n.method=this.defaults.method.toLowerCase():n.method="get";var e=[s,void 0],t=Promise.resolve(n);for(this.interceptors.request.forEach((function(n){e.unshift(n.fulfilled,n.rejected)})),this.interceptors.response.forEach((function(n){e.push(n.fulfilled,n.rejected)}));e.length;)t=t.then(e.shift(),e.shift());return t},c.prototype.getUri=function(n){return n=a(this.defaults,n),o(n.url,n.params,n.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(n){c.prototype[n]=function(e,t){return this.request(a(t||{},{method:n,url:e,data:(t||{}).data}))}})),r.forEach(["post","put","patch"],(function(n){c.prototype[n]=function(e,t,r){return this.request(a(r||{},{method:n,url:e,data:t}))}})),n.exports=c},function(n,e,t){var r=t(2);function o(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}n.exports=function(n,e,t){if(!e)return n;var i;if(t)i=t(e);else if(r.isURLSearchParams(e))i=e.toString();else{var s=[];r.forEach(e,(function(n,e){null!=n&&(r.isArray(n)?e+="[]":n=[n],r.forEach(n,(function(n){r.isDate(n)?n=n.toISOString():r.isObject(n)&&(n=JSON.stringify(n)),s.push(o(e)+"="+o(n))})))})),i=s.join("&")}if(i){var a=n.indexOf("#");-1!==a&&(n=n.slice(0,a)),n+=(-1===n.indexOf("?")?"?":"&")+i}return n}},function(n,e,t){var r=t(2);function o(){this.handlers=[]}o.prototype.use=function(n,e){return this.handlers.push({fulfilled:n,rejected:e}),this.handlers.length-1},o.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},o.prototype.forEach=function(n){r.forEach(this.handlers,(function(e){null!==e&&n(e)}))},n.exports=o},function(n,e,t){var r=t(2),o=t(8),i=t(9),s=t(10);function a(n){n.cancelToken&&n.cancelToken.throwIfRequested()}n.exports=function(n){return a(n),n.headers=n.headers||{},n.data=o(n.data,n.headers,n.transformRequest),n.headers=r.merge(n.headers.common||{},n.headers[n.method]||{},n.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete n.headers[e]})),(n.adapter||s.adapter)(n).then((function(e){return a(n),e.data=o(e.data,e.headers,n.transformResponse),e}),(function(e){return i(e)||(a(n),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,n.transformResponse))),Promise.reject(e)}))}},function(n,e,t){var r=t(2);n.exports=function(n,e,t){return r.forEach(t,(function(t){n=t(n,e)})),n}},function(n,e){n.exports=function(n){return!(!n||!n.__CANCEL__)}},function(n,e,t){var r=t(2),o=t(11),i={"Content-Type":"application/x-www-form-urlencoded"};function s(n,e){!r.isUndefined(n)&&r.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}var a,c={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(a=t(12)),a),transformRequest:[function(n,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(n)||r.isArrayBuffer(n)||r.isBuffer(n)||r.isStream(n)||r.isFile(n)||r.isBlob(n)?n:r.isArrayBufferView(n)?n.buffer:r.isURLSearchParams(n)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):r.isObject(n)?(s(e,"application/json;charset=utf-8"),JSON.stringify(n)):n}],transformResponse:[function(n){if("string"==typeof n)try{n=JSON.parse(n)}catch(n){}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(n){c.headers[n]={}})),r.forEach(["post","put","patch"],(function(n){c.headers[n]=r.merge(i)})),n.exports=c},function(n,e,t){var r=t(2);n.exports=function(n,e){r.forEach(n,(function(t,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(n[e]=t,delete n[r])}))}},function(n,e,t){var r=t(2),o=t(13),i=t(16),s=t(5),a=t(17),c=t(20),u=t(21),d=t(14);n.exports=function(n){return new Promise((function(e,t){var l=n.data,f=n.headers;r.isFormData(l)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(n.auth){var h=n.auth.username||"",m=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";f.Authorization="Basic "+btoa(h+":"+m)}var g=a(n.baseURL,n.url);if(p.open(n.method.toUpperCase(),s(g,n.params,n.paramsSerializer),!0),p.timeout=n.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?c(p.getAllResponseHeaders()):null,i={data:n.responseType&&"text"!==n.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:n,request:p};o(e,t,i),p=null}},p.onabort=function(){p&&(t(d("Request aborted",n,"ECONNABORTED",p)),p=null)},p.onerror=function(){t(d("Network Error",n,null,p)),p=null},p.ontimeout=function(){var e="timeout of "+n.timeout+"ms exceeded";n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),t(d(e,n,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var b=(n.withCredentials||u(g))&&n.xsrfCookieName?i.read(n.xsrfCookieName):void 0;b&&(f[n.xsrfHeaderName]=b)}if("setRequestHeader"in p&&r.forEach(f,(function(n,e){void 0===l&&"content-type"===e.toLowerCase()?delete f[e]:p.setRequestHeader(e,n)})),r.isUndefined(n.withCredentials)||(p.withCredentials=!!n.withCredentials),n.responseType)try{p.responseType=n.responseType}catch(e){if("json"!==n.responseType)throw e}"function"==typeof n.onDownloadProgress&&p.addEventListener("progress",n.onDownloadProgress),"function"==typeof n.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",n.onUploadProgress),n.cancelToken&&n.cancelToken.promise.then((function(n){p&&(p.abort(),t(n),p=null)})),l||(l=null),p.send(l)}))}},function(n,e,t){var r=t(14);n.exports=function(n,e,t){var o=t.config.validateStatus;t.status&&o&&!o(t.status)?e(r("Request failed with status code "+t.status,t.config,null,t.request,t)):n(t)}},function(n,e,t){var r=t(15);n.exports=function(n,e,t,o,i){var s=new Error(n);return r(s,e,t,o,i)}},function(n,e){n.exports=function(n,e,t,r,o){return n.config=e,t&&(n.code=t),n.request=r,n.response=o,n.isAxiosError=!0,n.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},n}},function(n,e,t){var r=t(2);n.exports=r.isStandardBrowserEnv()?{write:function(n,e,t,o,i,s){var a=[];a.push(n+"="+encodeURIComponent(e)),r.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(n){var e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(n,e,t){var r=t(18),o=t(19);n.exports=function(n,e){return n&&!r(e)?o(n,e):e}},function(n,e){n.exports=function(n){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(n)}},function(n,e){n.exports=function(n,e){return e?n.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):n}},function(n,e,t){var r=t(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];n.exports=function(n){var e,t,i,s={};return n?(r.forEach(n.split("\n"),(function(n){if(i=n.indexOf(":"),e=r.trim(n.substr(0,i)).toLowerCase(),t=r.trim(n.substr(i+1)),e){if(s[e]&&o.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([t]):s[e]?s[e]+", "+t:t}})),s):s}},function(n,e,t){var r=t(2);n.exports=r.isStandardBrowserEnv()?function(){var n,e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");function o(n){var r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=o(window.location.href),function(e){var t=r.isString(e)?o(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0}},function(n,e,t){var r=t(2);n.exports=function(n,e){e=e||{};var t={},o=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(n,e){return r.isPlainObject(n)&&r.isPlainObject(e)?r.merge(n,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function u(o){r.isUndefined(e[o])?r.isUndefined(n[o])||(t[o]=c(void 0,n[o])):t[o]=c(n[o],e[o])}r.forEach(o,(function(n){r.isUndefined(e[n])||(t[n]=c(void 0,e[n]))})),r.forEach(i,u),r.forEach(s,(function(o){r.isUndefined(e[o])?r.isUndefined(n[o])||(t[o]=c(void 0,n[o])):t[o]=c(void 0,e[o])})),r.forEach(a,(function(r){r in e?t[r]=c(n[r],e[r]):r in n&&(t[r]=c(void 0,n[r]))}));var d=o.concat(i).concat(s).concat(a),l=Object.keys(n).concat(Object.keys(e)).filter((function(n){return-1===d.indexOf(n)}));return r.forEach(l,u),t}},function(n,e){function t(n){this.message=n}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,n.exports=t},function(n,e,t){var r=t(23);function o(n){if("function"!=typeof n)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(n){e=n}));var t=this;n((function(n){t.reason||(t.reason=new r(n),e(t.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var n;return{token:new o((function(e){n=e})),cancel:n}},n.exports=o},function(n,e){n.exports=function(n){return function(e){return n.apply(null,e)}}},function(n,e){n.exports=function(n){return"object"==typeof n&&!0===n.isAxiosError}}])},n.exports=t()}));class g{constructor({baseURL:n="",timeout:e=6e4,headers:t={}}){this.passenger=m.create({baseURL:n,timeout:e,headers:Object.assign({"Content-Type":"application/x-www-form-urlencoded; chartset=UTF-8"},t)}),this.passenger.interceptors.response.use((n=>n),(n=>Promise.reject(n)))}call({method:n,params:e={}}){var t,r;return s(this,void 0,void 0,(function*(){const o=yield this.passenger.post("",{jsonrpc:"2.0",method:n,id:1,params:e instanceof Array?e:[e]});return(null===(t=o.data)||void 0===t?void 0:t.result)?o.data.result:null===(r=o.data)||void 0===r?void 0:r.error}))}get({method:n,params:e={},path:t={}}){return s(this,void 0,void 0,(function*(){let r=n;if(Object.keys(t).length&&n)for(const n in t)r=r.replace(`:${n}`,t[n]);const o=yield this.passenger.get(r,{params:e});return o.data?o.data:o.data.error}))}}return({gpui:e})=>{const[r,o]=n.useState(null),[i,a]=n.useState(!1),[c,l]=n.useState(!1),[f,p]=n.useState({total:0,share:0,using:0,maintain:0}),m=(n,t)=>s(void 0,void 0,void 0,(function*(){const r=new g({baseURL:n,headers:e.params.lims_gpui_headers}),i=yield r.call({method:"gpui/equipment/runingStatus",params:[{equipmentIds:t}]});if(i){let n=(n=>{const{totalCount:e,shareCount:t,usingCount:r,unUsingCount:o,controlCount:i,outServiceCount:s}=n;return{total:Number(e||0),share:Number(t||0),using:Number(r||0),maintain:Number(s||0)}})(i);o(n.total),p(n)}})),b=n.useCallback((()=>s(void 0,void 0,void 0,(function*(){e.root.navigate(e.params.uri||"@layout:root/overview")}))),[e]);return n.useEffect((()=>{let n=!0;const r=t.reaction((()=>{var n,t,r,o;return{baseURL:null===(n=e.params)||void 0===n?void 0:n.equipment_base_url,equipmentIds:null===(t=e.params)||void 0===t?void 0:t.equipment_ids,hasTitle:null===(r=e.params)||void 0===r?void 0:r.hasTitle,canGoDetail:null===(o=e.params)||void 0===o?void 0:o.canGoDetail}}),(({baseURL:e,equipmentIds:t,hasTitle:r,canGoDetail:o})=>s(void 0,void 0,void 0,(function*(){n&&e&&t&&n&&(yield m(e,t),a(!!r),l(!!o))}))),{fireImmediately:!0});return()=>{n=!1,r()}}),[e]),f?u.jsx("div",Object.assign({className:i?"g__component g__component--has-title":"g__component",onClick:c?b:()=>{}},{children:u.jsxs("div",Object.assign({className:d.content},{children:[u.jsxs("div",Object.assign({className:`${d.status} ${d["status--all"]}`},{children:[u.jsx("div",Object.assign({className:d.status__name},{children:"设备总数"}),void 0),u.jsx("div",Object.assign({className:d.status__progress},{children:u.jsx(h,{height:6,background:"transparent",progress:f.total/r*100,progressColor:"linear-gradient(to left, #8a46d9, #f950a5)"},void 0)}),void 0),u.jsx("div",Object.assign({className:d.status__count},{children:f.total}),void 0)]}),void 0),u.jsxs("div",Object.assign({className:`${d.status} ${d["status--in-share"]}`},{children:[u.jsx("div",Object.assign({className:d.status__name},{children:"共享中"}),void 0),u.jsx("div",Object.assign({className:d.status__progress},{children:u.jsx(h,{height:6,background:"transparent",progress:f.share/r*100,progressColor:"linear-gradient(to left, #00e4f2, #2a95ff)"},void 0)}),void 0),u.jsx("div",Object.assign({className:d.status__count},{children:f.share}),void 0)]}),void 0),u.jsxs("div",Object.assign({className:`${d.status} ${d["status--in-use"]}`},{children:[u.jsx("div",Object.assign({className:d.status__name},{children:"使用中"}),void 0),u.jsx("div",Object.assign({className:d.status__progress},{children:u.jsx(h,{height:6,background:"transparent",progress:f.using/r*100,progressColor:"linear-gradient(to left, #00e4f2, #2a95ff)"},void 0)}),void 0),u.jsx("div",Object.assign({className:d.status__count},{children:f.using}),void 0)]}),void 0),u.jsxs("div",Object.assign({className:`${d.status} ${d["status--in-maintenance"]}`},{children:[u.jsx("div",Object.assign({className:d.status__name},{children:"维护中"}),void 0),u.jsx("div",Object.assign({className:d.status__progress},{children:u.jsx(h,{height:6,background:"transparent",progress:f.maintain/r*100,progressColor:"linear-gradient(to left, #f6685b, #fee287)"},void 0)}),void 0),u.jsx("div",Object.assign({className:d.status__count},{children:f.maintain}),void 0)]}),void 0)]}),void 0)}),void 0):u.jsx("div",Object.assign({className:d.null},{children:"暂无数据"}),void 0)}}));
