1"use strict";(self["webpackChunkmat_cloud"]=self["webpackChunkmat_cloud"]||[]).push([[574],{24926:function(e,t,s){s.d(t,{Z:function(){return d}});var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("mp-confirm-modal",{attrs:{icon:"location-marker",visible:e.visible,title:e.title,okText:e.loading?"å¼éä¸":"ç»§ç»",confirmLoading:e.loading},on:{"update:visible":function(t){return e.$emit("update:visible",t)},ok:e.onCreateDomain},scopedSlots:e._u([{key:"content",fn:function(){return[e._t("content",(function(){return[e._v(" "+e._s(e.content)+" ")]}))]},proxy:!0}],null,!0)})},n=[],a=s(20629),r=s(31309),o={model:{prop:"visible",event:"update:visible"},props:{visible:{type:Boolean},title:{type:String,required:!0},content:{type:String,default:""},domain:{type:Number}},computed:{...(0,a.rn)(["currentDomain"])},data(){return{loading:!1}},methods:{...(0,a.nv)(["changeCurrentDomain","fetchUserInfo"]),async onCreateDomain(){if(!this.domain)return;this.loading=!0;const e=await r.Z.domainRegister({domain:this.domain},{errMsg:"å¼éæ°åºå失败ï¼è¯·éè¯"});this.loading=!1,0===e.code?(this.$emit("update:visible",!1),await this.fetchUserInfo(),this.$emit("success")):this.$emit("error")}}},l=o,c=s(1001),u=(0,c.Z)(l,i,n,!1,null,"ad432440",null),d=u.exports},30574:function(e,t,s){s.d(t,{Z:function(){return Vs}});var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"host-market"},[s("div",{staticClass:"safe-area mp-flex-start main"},[s("affix",{staticClass:"sidebar",attrs:{"relative-element-selector":"#market-content",offset:{top:0,bottom:0}}},[e._t("sidebar",(function(){return[s("sidebar-filter",{attrs:{disabled:e.loading},on:{change:e.handleFilterChange}})]}))],2),s("div",{ref:"market",staticClass:"market-container",attrs:{id:"market-content"}},[s("sort-bar",{staticClass:"market-sort-bar",attrs:{mode:e.mode,disabled:e.loading},on:{"update:mode":function(t){e.mode=t},sortChange:e.handleSortChange}}),e.loading||e.pagination.total>0?s("div",{staticClass:"market-hosts",class:{loading:e.loading}},[e.mode===e.gridMode?[s("ul",{staticClass:"host-grid"},e._l(e.dataSource,(function(t){return s("li",{key:t.agentId,staticClass:"mp-flex host-container"},[s("host-card",{attrs:{host:t},on:{rentClick:function(s){return e.handleRentClick(t)}}})],1)})),0),e.loading?s("mp-loading"):e._e()]:s("host-list",{attrs:{"data-source":e.dataSource,loading:e.loading},on:{rentClick:function(t){return e.handleRentClick(t)}}}),e.pagination.total>e.pagination.perPage?s("a-pagination",{staticClass:"market-pagination",attrs:{total:e.pagination.total,pageSize:e.pagination.perPage,disabled:e.loading},on:{change:e.handlePaginationChange},model:{value:e.pagination.page,callback:function(t){e.$set(e.pagination,"page",t)},expression:"pagination.page"}}):e._e()],2):s("default-map")],1)],1),s("div",{staticClass:"footer-banner"},[s("div",{staticClass:"safe-area mp-flex-justify content"},[e._m(0),s("div",{staticClass:"apply-btn-container"},[s("router-link",{staticClass:"mp-flex-justify mp-text-h6 apply-btn",attrs:{to:"/user/cluster"},nativeOn:{click:function(t){return e.onApplyCluster.apply(null,arguments)}}},[e._v(" åå¾ä½¿ç¨ "),s("mp-icon",{staticClass:"btn-icon",attrs:{name:"arrow-right-bold"}})],1)],1)])]),s("order-detail",{attrs:{visible:e.detailVisible},on:{"update:visible":function(t){e.detailVisible=t}},model:{value:e.selectedHost,callback:function(t){e.selectedHost=t},expression:"selectedHost"}})],1)},n=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("h3",{staticClass:"mp-h3 title"},[e._v("åå¸å¼é群")]),s("p",{staticClass:"desc"},[e._v(" æ¯ç©æ± äºæ°æ¨åºçGPUåå¸å¼è®ç»æå¡ï¼å®è½è°åº¦å¤æºå¤å¡GPUï¼æ¯åæºè®ç»ææ´å¿«çè®ç»é度ã ")])])}],a=(s(82801),s(38862),s(2707),s(12571)),r=s(60955),o=s(1194),l=s(25097),c=s(48465),u=s(9669),d=s.n(u),h=s(90023),p=s(20629),m=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},f=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"market-default-map"},[i("img",{staticClass:"default-img",attrs:{src:s(35604),alt:""}}),i("h3",{staticClass:"mp-h5 title"},[e._v("天å¦ï¼æ²¡ææºå¨äº")]),i("p",{staticClass:"mp-text-h6"},[e._v("亲ï¼è¯·æ´æ¹ç鿡件æå¨é¡µé¢å·¦ä¾§åæ¢åºå以æ¥çæ´å¤ä¸»æºå¦")])])}],v=s(1001),g={},b=(0,v.Z)(g,m,f,!1,null,null,null),C=b.exports,y=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"mp-text-normal host-card",class:{"time-limited":e.deadline,"beta-test":e.attributes.isBetaTest,avail:e.available,proprietary:e.proprietary.is},on:{mouseover:function(t){e.isHovered=!0},mouseleave:function(t){e.isHovered=!1}}},[e.proprietary.is?[e.proprietary.logo?s("mp-img",{staticClass:"proprietary-logo",attrs:{src:e.proprietary.logo}}):s("mp-icon",{staticClass:"proprietary-logo",attrs:{name:"proprietary-logo"}})]:e._e(),s("div",{staticClass:"host-card-container",class:{cpu:e.isCPU}},[s("div",{staticClass:"header"},[s("h3",{staticClass:"mp-h6 title"},[e._v(e._s(e.title))]),s("div",{staticClass:"mp-text-h6 price"},[s("span",{staticClass:"color-dark symbol"},[e._v("ï¿¥")]),s("span",{staticClass:"mp-h3 color-dark value"},[e._v(e._s(e._f("formatPrice")(e.price.currentPrice.value,!1,"")))]),s("span",[e._v("/"+e._s(e.unitHostName)+"*å°æ¶")])]),s("div",{staticClass:"mp-flex row-tag"},[s("avail-tag",{staticClass:"tag",attrs:{num:e.availNum}}),e.attributes.isWinEnabled?[s("IconWindows",{attrs:{"is-hovered":e.isHovered&&e.available}})]:e._e(),e.attributes.isDistributed?[s("IconNetwork",{attrs:{"is-hovered":e.isHovered&&e.available}})]:e._e(),e.attributes.isHyperContainer?[s("IconVirtual",{attrs:{"is-hovered":e.isHovered&&e.available}})]:e._e()],2)]),s("ul",{staticClass:"configs"},[s("li",{staticClass:"item"},[s("mp-icon",{attrs:{name:"location-marker",title:e.host.domain.label}}),e._v("åºå "+e._s(e.host.domain.label)+" "),s("span",{staticClass:"ml-2"},[e._v("ID "+e._s(e.encodeAgentId(e.host.agentId)))])],1),e._l(e.badges,(function(t,i){return s("li",{key:i,staticClass:"item",attrs:{title:t.value}},[s("mp-icon",{attrs:{name:t.icon}}),e._v(e._s(t.label)+" "),s("span",{domProps:{innerHTML:e._s(t.value)}})],1)}))],2),s("a-button",{class:["btn",e.available?"avail":"unavail"],attrs:{disabled:!e.available},on:{click:function(t){return e.$emit("rentClick")}}},[e._v(" "+e._s(e.available?"ç§ç¨":"å®ç½")+" ")]),e.deadline?s("p",{staticClass:"mp-text-small deadline"},[e._v(" å¯ç§ç¨è³ "+e._s(e._f("formatDate")(e.deadline,"YYYY-MM-DD"))+" ")]):e._e(
1)],1)],2)},k=[],x=s(47223),_=s(93707),Z=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a-tag",{class:["avail-tag",e.available?"avail":"unavail"]},[s("span",{staticClass:"mp-text-normal value"},[e._v(e._s(e.num))]),e._v(" "+e._s(e.hostUnit)+"å¯ç¨ ")])},w=[],S=(s(49365),s(45862)),T={inject:["hostUnit"],components:{[S.Z.name]:S.Z},props:{num:{type:Number,required:!0}},computed:{available(){return this.num>0}}},P=T,M=(0,v.Z)(P,Z,w,!1,null,null,null),$=M.exports,N=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ATooltip",{attrs:{placement:"bottom",title:"æ¯æåå¸å¼é群",getPopupContainer:e.getPopupContainer}},[e.isHovered?s("mp-icon",{staticClass:"clickable",attrs:{name:"host-network-hover"},nativeOn:{click:function(t){return t.stopPropagation(),e.onClick.apply(null,arguments)}}}):s("mp-icon",{staticClass:"clickable",attrs:{name:"host-network-normal"},nativeOn:{click:function(t){return t.stopPropagation(),e.onClick.apply(null,arguments)}}})],1)},R=[],V={props:{isHovered:{type:Boolean,default:!1}},methods:{getPopupContainer(e){return e.parentElement},onClick(){this.$router.push("/user/cluster")}}},I=V,F=(0,v.Z)(I,N,R,!1,null,null,null),H=F.exports,E=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ATooltip",{attrs:{placement:"bottom",title:"æ¯æDocker",getPopupContainer:e.getPopupContainer},nativeOn:{click:function(t){return t.stopPropagation(),e.onClick.apply(null,arguments)}}},[e.isHovered?s("mp-icon",{attrs:{name:"host-virtual-hover"}}):s("mp-icon",{attrs:{name:"host-virtual-normal"}})],1)},D=[],O=s(87843),A={props:{isHovered:{type:Boolean,default:!1}},methods:{getPopupContainer(e){return e.parentElement},onClick(){(0,O.P3)("https://matpool.com/supports/doc-use-docker-on-matpool/")}}},B=A,j=(0,v.Z)(B,E,D,!1,null,null,null),U=j.exports,L=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ATooltip",{attrs:{placement:"bottom",title:"æ¯æå¯å¨Windows Serveræä½ç³»ç»",getPopupContainer:e.getPopupContainer},nativeOn:{click:function(t){return t.stopPropagation(),e.onClick.apply(null,arguments)}}},[e.isHovered?s("mp-icon",{staticClass:"clickable",attrs:{name:"host-windows-hover"}}):s("mp-icon",{staticClass:"clickable",attrs:{name:"host-windows-normal"}})],1)},W=[],G={props:{isHovered:{type:Boolean,default:!1}},methods:{getPopupContainer(e){return e.parentElement},onClick(){(0,O.P3)("https://matpool.com/supports/doc-use-windows-server-on-matpool/")}}},K=G,Y=(0,v.Z)(K,L,W,!1,null,null,null),q=Y.exports,z={inject:["hostType","hostKey","hostUnit","hostName"],components:{AvailTag:$,IconNetwork:H,IconVirtual:U,IconWindows:q},props:{host:{type:Object,required:!0}},data(){return{isHovered:!1}},methods:{encodeAgentId:_.tQ},computed:{title(){return(0,c.c9)(this.host)},price(){return(0,c.pT)(this.host,r.AC.BILL_ON_TIME,"")},unitHostName(){return this.host.unitStep>1?`${this.host.unitStep}${this.hostName}`:this.hostName},isCPU(){return this.hostType===x.VW},availNum(){return this.host[this.hostKey]?this.host[this.hostKey].available:0},available(){return this.host.unit.available>0},badges(){return(0,c.Cv)(this.host.hardware,1,this.hostType)},deadline(){return(0,c.fQ)(this.host)},proprietary(){const{isProprietary:e,desc:t}=this.host;return{is:e,name:t&&t.name,logo:t&&t.iconURL||x.Yq}},attributes(){return this.host.attributes||{}}}},Q=z,X=(0,v.Z)(Q,y,k,!1,null,null,null),J=X.exports,ee=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a-table",e._b({staticClass:"host-list",attrs:{columns:e.columns,"row-key":"agentId","data-source":e.dataSource,pagination:!1,rowClassName:e.getRowClassName,customRow:e.setCustomRow},scopedSlots:e._u([{key:"name",fn:function(t){return s("span",{staticClass:"mp-flex"},[t.isProprietary?[t.desc.iconURL?s("mp-img",{staticClass:"proprietary-logo",attrs:{src:t.desc.iconURL}}):s("mp-icon",{staticClass:"proprietary-logo",attrs:{name:"proprietary-logo"}})]:e._e(),e._v(" "+e._s(e.displayHostTitle(t))+" "),t.attributes.isWinEnabled?s("IconWindows",{staticClass:"feature",attrs:{"is-hovered":!1}}):e._e(),t.attributes.isDistributed?s("IconNetwork",{staticClass:"feature",attrs:{"is-hovered":!1}}
1):e._e(),t.attributes.isHyperContainer?s("mp-icon",{staticClass:"feature",attrs:{name:"host-virtual-normal"}}):e._e()],2)}},{key:"id",fn:function(t){return s("span",{},[e._v(" "+e._s(e.encodeAgentId(t.agentId))+" ")])}},{key:"domain",fn:function(t){return s("span",{},[e._v(" "+e._s(t.domain.label)+" ")])}},{key:"gpuRam",fn:function(t){return s("span",{},[e._v(e._s(e._f("convertMbToGb")(t))+"G")])}},{key:"availNum",fn:function(t){return s("span",{},[s("avail-tag",{attrs:{num:e.getAvailNum(t)}})],1)}},{key:"cpu",fn:function(t){var i=t.cpuIds,n=t.cpuName;return s("span",{},[e._v(e._s(e.getCpuName(i,n)))])}},{key:"ramMB",fn:function(t){return s("span",{},[e._v(e._s(e._f("convertMbToGb")(t))+"G")])}},{key:"diskGB",fn:function(t){return s("span",{},[e._v(e._s(t)+"G")])}},{key:"originPrice",fn:function(t){return s("span",{staticClass:"mp-flex price"},[s("span",{staticClass:"origin-price"},[e._v(e._s(e._f("formatPrice")(e.getOriginPrice(t),!1)))])])}},{key:"price",fn:function(t){return s("span",{staticClass:"mp-flex price"},[s("span",{staticClass:"price-symbol"},[e._v("ï¿¥")]),s("span",{staticClass:"mp-h4 price-value"},[e._v(e._s(e._f("formatPrice")(e.getHostPrice(t),!1,"")))]),s("span",[e._v("/"+e._s(e.getHostName(t))+"*å°æ¶")])])}}])},"a-table",e.$attrs,!1))},te=[],se=(s(88375),s(15932));s(26699);const{BILL_ON_TIME:ie}=r.AC,ne=["gpuRam","cpu"],ae=[{title:"æºå¨åç§°",key:"name",scopedSlots:{customRender:"name"},customCell:e=>{const t=(0,c.fQ)(e),{isProprietary:s}=e;return{class:["host-name",t?"time-limited":"",s?"proprietary":""]}}},{title:"ID",key:"id",scopedSlots:{customRender:"id"},align:"center"},{title:"åºå",key:"domain",scopedSlots:{customRender:"domain"},align:"center"},{title:"å¯ç¨å¼ æ°",key:"availNum",scopedSlots:{customRender:"availNum"},align:"center"},{title:"æ¾å",key:ne[0],dataIndex:"hardware.gpu.gpuRamMB",scopedSlots:{customRender:"gpuRam"}},{title:"CPU",key:ne[1],dataIndex:"hardware.machine",scopedSlots:{customRender:"cpu"},align:"center"},{title:"å
å",key:"ram",dataIndex:"hardware.machine.ramMB",scopedSlots:{customRender:"ramMB"}},{title:"硬ç",key:"disk",dataIndex:"hardware.machine.diskGB",scopedSlots:{customRender:"diskGB"}},{title:"ä»·æ ¼",key:"price",scopedSlots:{customRender:"price"},align:"right",customCell:e=>{const t=(0,c.pT)(e,ie,"");return{class:[t.currentPrice.value?"":"free"]}}}];var re={inject:["hostType","hostKey","hostName"],components:{[se.Z.name]:se.Z,[se.Z.Column.name]:se.Z.Column,[S.Z.name]:S.Z,AvailTag:$,IconNetwork:H,IconWindows:q},props:{dataSource:{type:Array,required:!0}},computed:{isCPU(){return this.hostType===x.VW},columns(){return this.isCPU?ae.filter((e=>!ne.includes(e.key))):ae}},methods:{displayHostTitle:c.c9,getCpuName:c.kc,encodeAgentId:_.tQ,setCustomRow(e){return{on:{click:()=>{this.$emit("rentClick",e)}}}},getRowClassName(e){const{available:t}=e[this.hostKey]||{};return["host-row",t?"":"disabled"]},getHostPrice(e){const t=(0,c.pT)(e,ie,"");return t.currentPrice.value},getOriginPrice(e){const t=(0,c.pT)(e,ie,"");return t.originPrice.value},getAvailNum(e){return e[this.hostKey]?e[this.hostKey].available:1},getHostName(e){return e.unitStep>1?`${e.unitStep}${this.hostName}`:this.hostName}}},oe=re,le=(0,v.Z)(oe,ee,te,!1,null,null,null),ce=le.exports,ue=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a-drawer",{attrs:{placement:"right",closable:!1,visible:e.visible,destroyOnClose:!0,width:"840px",wrapClassName:"order-detail",afterVisibleChange:e.afterVisibleChange},on:{close:function(t){return e.handleClose()}}},[e.host?[s("HostTitle",{attrs:{slot:"title",proprietary:e.proprietary,iconName:e.hostIconName,title:e.title,deadline:e.deadline},slot:"title"},[s("div",{staticClass:"available relative",attrs:{slot:"available"},slot:"available"},[s("span",{staticClass:"mp-text-h6"},[e._v(" x"),s("span",{staticClass:"mp-h3 value"},[e._v(e._s(e.maxRentableNum))])]),s("span",{staticClass:"unit"},[e._v(e._s(e.hostUnit)+"å¯ç¨")])]),s("HostBadges",{attrs:{hardware:e.host.hardware,"host-type":e.hostType,"unit-num":e.unitNum}})],1),11===e.host.domain.id?s("div",{staticClass:"mb-4 p-2 rounded-lg bg-warning-box border border-warning/10 text-on-container-normal"},[e._v(" æ§è½æç¤ºï¼äºå¤ª2åºç½ç读åéåº¦è¾æ
¢ãå¦éè¿è¡æ¨¡åè®ç»ï¼å»ºè®®å°æ°æ®ç´æ¥åå¨å¨è®¡ç®å®ä¾ä¸ ")]):e._e(
1),s("h4",{staticClass:"mp-h6 subtitle"},[e._v("ç§èµ "+e._s(e.hostName)+" æ°")]),s("div",{staticClass:"mt-3 mb-6"},[s("host-num-input",{ref:"hostNumInput",attrs:{step:e.unitStep,min:e.minRentableNum,max:e.maxRentableNum},on:{change:e.onHostNumChange},model:{value:e.hostNum,callback:function(t){e.hostNum=t},expression:"hostNum"}})],1),s("h4",{staticClass:"mp-h6 subtitle"},[e._v(" 计费æ¹å¼ "),s("a",{staticClass:"bill-instruct mp-text-normal",attrs:{href:"/supports/reference/faqs/#%E5%A6%82%E4%BD%95%E8%AE%A1%E8%B4%B9%EF%BC%9F",target:"_blank"}},[e._v(" 计费说æ "),s("mp-icon",{attrs:{name:"help"}})],1)]),s("a-radio-group",{staticClass:"bill-methods",model:{value:e.leaseTerm,callback:function(t){e.leaseTerm=t},expression:"leaseTerm"}},e._l(e.billMethods,(function(t){return s("a-radio",{key:t.value,staticClass:"item",attrs:{value:t.value}},[s("div",{staticClass:"content",attrs:{slot:"default"},slot:"default"},[s("mp-icon",{staticClass:"icon",attrs:{name:e.leaseTerm===t.value?"gold-medal":"silver-medal"}}),s("div",[s("div",{staticClass:"mp-text-h6 color-dark label"},[e._v(e._s(t.label))]),t.price?s("div",{staticClass:"price-container"},[s("span",{staticClass:"mp-h6 price"},[e._v("ï¿¥")]),s("span",{staticClass:"mp-h3 price"},[e._v(e._s(e._f("formatPrice")(t.price*e.unitNum,!1,"")))]),t.unit?s("span",{staticClass:"mp-text-h6"},[e._v("/"+e._s(t.unit))]):e._e()]):s("span",{staticClass:"mp-h3 price"},[e._v("å
è´¹")]),s("div",{staticClass:"price-average color-normal mp-text-small"},[e._v(" "+e._s(t.averageStr(e.unitNum))+" ")])])],1)])})),1),s("rent-form",{ref:"rentForm",attrs:{presetVisible:!e.attributes.isWinEnabled,loginVisible:!e.attributes.isWinEnabled,envsVisible:!e.attributes.isWinEnabled&&!e.attributes.isHyperContainer,cmdVisible:!e.attributes.isWinEnabled&&!e.attributes.isHyperContainer,host:e.host,"host-type":e.hostType,"unit-num":e.unitNum,isThirdParty:e.isThirdParty},on:{snapChange:e.onSnapChange}}),s("div",{staticClass:"footer-order flex justify-between"},[s("div",{staticClass:"absolute left-0 bottom-0 h-[71px] flex items-center gap-2.5 text-md text-on-container-secondary pl-8"},[s("mp-icon",{staticClass:"text-lg",attrs:{name:"location-marker"}}),s("span",[e._v("æå¨åºå")]),s("span",[e._v(e._s(e.host.domain.label))])],1),s("div",{staticClass:"mp-flex footer-order-container"},[s("span",{staticClass:"tip"},[e._v(e._s(e.billNote))]),e.host.isPreempt?s("a-tooltip",{attrs:{title:"该主æºè¢«å
¶ä»ç¨æ·æ¢å
ç§èµ°æå 为å
¶ä»ä¸»æºåå¨å¯¼è´è¯¥ä¸»æºç§»å°å
¶ä»é¡µé¢"}},[s("a-button",{staticClass:"btn",attrs:{type:"warning"},on:{click:e.handleClose}},[s("span",{staticClass:"mp-text-h6 btn-content"},[e._v(" æ´æ¢ä¸»æº "),s("mp-icon",{staticClass:"attention",attrs:{name:"tips-attention"}})],1)])],1):s("a-button",{staticClass:"btn",attrs:{loading:e.isRenting},on:{click:e.confirmRent}},[e.isRenting?s("mp-icon",{attrs:{name:"loading"}}):e._e(),s("span",{staticClass:"mp-flex mp-text-h6 btn-content"},[e._v(" ä¸åï¼"),s("span",{staticClass:"mp-h5 price"},[e._v("ï¿¥")]),s("span",{staticClass:"mp-h3 price"},[e._v(e._s(e._f("formatPrice")(e.currentPrice.value,!1,"")))]),e.currentPrice.unit?s("span",{staticClass:"mp-text-h6"},[e._v("/"+e._s(e.currentPrice.unit))]):e._e()])],1)],1)]),s("third-party-alert",{attrs:{visible:e.thirdPartyVisible},on:{"update:visible":function(t){e.thirdPartyVisible=t},clickConfirm:e.rentHost}}),s("alert-offline",{attrs:{visible:e.offlineVisible},on:{"update:visible":function(t){e.offlineVisible=t},clickConfirm:e.rentHost}}),s("payment-detail",{attrs:{visible:e.paymentDetailVisible,title:e.title,"lease-term":e.leaseTerm,price:e.currentPrice.value,"is-purchasing":e.isRenting},on:{"update:visible":function(t){e.paymentDetailVisible=t},purchase:e.handlePackPurchase}}),s("alert-disk-capacity",{attrs:{visible:e.diskPromptConfig.visible,size:e.diskPromptConfig.size},on:{"update:visible":function(t){return e.$set(e.diskPromptConfig,"visible",t)},clickConfirm:e.onDiskCapacityConfirm}})]:e._e(),e.host?s("domain-register-modal",{attrs:{domain:e.host.domain.id,title:"ç§ç¨æ°åºåå®ä¾"},on:{success:e.onRegisterDomainSuccess},scopedSlots:e._u([{key:"content",fn:function(){return[e._v(" æ¨æ£å¨ç§ç¨"),s("b",{staticClass:"text-on-container-normal"},[e._v(e._s(e.host.domain.label))]),e._v("çå®ä¾ï¼å®ä¾åªè½è®¿é®å
¶æå¨åºåçç½çæç¯å¢ï¼
1æ¯å¦ç»§ç»åæ¢æä½ï¼ ")]},proxy:!0}],null,!1,3576383291),model:{value:e.domainRegisterVisible,callback:function(t){e.domainRegisterVisible=t},expression:"domainRegisterVisible"}}):e._e()],2)},de=[],he=(s(52506),s(88106)),pe=s(62746),me=s(94184),fe=s.n(me),ve=s(70804),ge=s(38072),be=s(43240),Ce=s(82859),ye=s(13305),ke=s(32050),xe=s(6192);function _e(){}var Ze={type:ge.Z.oneOf(["success","info","warning","error"]),closable:ge.Z.bool,closeText:ge.Z.any,message:ge.Z.any,description:ge.Z.any,afterClose:ge.Z.func.def(_e),showIcon:ge.Z.bool,iconType:ge.Z.string,prefixCls:ge.Z.string,banner:ge.Z.bool,icon:ge.Z.any},we={name:"AAlert",props:Ze,mixins:[ve.Z],inject:{configProvider:{default:function(){return ke.W}}},data:function(){return{closing:!1,closed:!1}},methods:{handleClose:function(e){e.preventDefault();var t=this.$el;t.style.height=t.offsetHeight+"px",t.style.height=t.offsetHeight+"px",this.setState({closing:!0}),this.$emit("close",e)},animationEnd:function(){this.setState({closing:!1,closed:!0}),this.afterClose()}},render:function(){var e,t=arguments[0],s=this.prefixCls,i=this.banner,n=this.closing,a=this.closed,r=this.configProvider.getPrefixCls,o=r("alert",s),l=this.closable,c=this.type,u=this.showIcon,d=this.iconType,h=(0,Ce.rj)(this,"closeText"),p=(0,Ce.rj)(this,"description"),m=(0,Ce.rj)(this,"message"),f=(0,Ce.rj)(this,"icon");u=!(!i||void 0!==u)||u,c=i&&void 0===c?"warning":c||"info";var v="filled";if(!d){switch(c){case"success":d="check-circle";break;case"info":d="info-circle";break;case"error":d="close-circle";break;case"warning":d="exclamation-circle";break;default:d="default"}p&&(v="outlined")}h&&(l=!0);var g=fe()(o,(e={},(0,he.Z)(e,o+"-"+c,!0),(0,he.Z)(e,o+"-closing",n),(0,he.Z)(e,o+"-with-description",!!p),(0,he.Z)(e,o+"-no-icon",!u),(0,he.Z)(e,o+"-banner",!!i),(0,he.Z)(e,o+"-closable",l),e)),b=l?t("button",{attrs:{type:"button",tabIndex:0},on:{click:this.handleClose},class:o+"-close-icon"},[h?t("span",{class:o+"-close-text"},[h]):t(pe.Z,{attrs:{type:"close"}})]):null,C=f&&((0,Ce.l$)(f)?(0,ye.Tm)(f,{class:o+"-icon"}):t("span",{class:o+"-icon"},[f]))||t(pe.Z,{class:o+"-icon",attrs:{type:d,theme:v}}),y=(0,be.Z)(o+"-slide-up",{appear:!1,afterLeave:this.animationEnd});return a?null:t("transition",y,[t("div",{directives:[{name:"show",value:!n}],class:g,attrs:{"data-show":!n}},[u?C:null,t("span",{class:o+"-message"},[m]),t("span",{class:o+"-description"},[p]),b])])},install:function(e){e.use(xe.Z),e.component(we.name,we)}},Se=we,Te=(s(25157),s(75145)),Pe=(s(33793),s(96650)),Me=(s(33948),s(85551)),$e=s(44028),Ne=s(24926),Re=s(8697),Ve=s(41064),Ie=s(16224),Fe=s(2370),He=s(33014),Ee=s(47577),De=s(23806),Oe=s(81030),Ae=s(91531),Be=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a-modal",e._b({attrs:{maskClosable:!1,keyboard:!1,closable:!1,width:"520px","dialog-class":"disk-capacity-dialog"},on:{cancel:function(t){return e.$emit("update:visible",!1)}}},"a-modal",e.$attrs,!1),[s("template",{slot:"title"},[s("h3",{staticClass:"mp-h4 title"},[e._v("ç£çæ©å®¹æç¤º")])]),s("div",{staticClass:"mp-text-normal mt-9 px-4"},[e._v(" æ¬ç¯å¢ä¾èµæ´å¤§çç£ç容éï¼è¯·å¢å å½åæéæºå¨çç£ç容éé
ç½®ã "),s("div",{staticClass:"text-tertiary mt-4"},[e._v(" 注: ç£çæ©å®¹åï¼ç¸åºGPU塿°ãCPUæ ¸æ°ãå
ååæºå¨è´¹ç¨çä¹å°åæ¥ä¸è°ã ")])]),s("div",{staticClass:"dialog-footer flex justify-center mt-8",attrs:{slot:"footer"},slot:"footer"},[s("div",{staticClass:"w-[150px] h-10 border border-solid border-hover rounded-full flex items-center justify-center gap-2 text-lg text-primary cursor-pointer",on:{click:e.handleAlertClick}},[s("mp-icon",{staticClass:"text-2xl",attrs:{name:"disc-02"}}),e._v("æ©å®¹ç£ç ")],1)])],2)},je=[],Ue={props:{size:{type:Number,required:!1}},data(){return{noThirdReminder:!1}},methods:{handleAlertClick(){this.$emit("update:visible",!1),this.$emit("clickConfirm")}}},Le=Ue,We=(0,v.Z)(Le,Be,je,!1,null,null,null),Ge=We.exports,Ke=s(30265),Ye=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("a-modal",e._b({attrs:{maskClosable:!1,keyboard:!1,width:"500px","dialog-class":"rental-notice-dialog"},on:{cancel:function(t){return e.$emit("update:visible",!1)}}},"a-modal",e.$attrs,!1),[s("template",{slot:"title"},[s("h3",{staticClass:"mp-h4 title"},[e._v("é£é©æç¤º")])]),s("template",{slot:"closeIcon"},[s("mp-icon",{attrs:{name:"close-white"}})],1),s("ol",{staticClass:"mp-text-normal content"},[s("li",[e._v(" 该æºå¨ä¸ºç¬¬ä¸æ¹æºå¨ã"),s("br"),s("span",{staticClass:"warning"},[e._v("*䏿¯æä¸ªäºº/å¢éç/课ç¨çç½çæè½½")]),s("br"),s("span",{staticClass:"warning"}
1,[e._v("*䏿¯æè®¿é®ç©æ± äºå
¬å¼æ°æ®éåé¢è®ç»æ¨¡å")]),s("br"),s("span",{staticClass:"warning"},[e._v("*䏿¯æä¿åæè
使ç¨ç¯å¢")]),s("br")]),s("li",[e._v("ç¬¬ä¸æ¹æºå¨å æå¨æºæ¿çé®é¢ç¨³å®æ§ä¸å¯æ§ï¼è¯·ç¥æã"),s("br")]),s("li",[e._v("使ç¨ä¸è¯·åæ¶ä¿åæ¨çæ°æ®ï¼å¯ä½¿ç¨Scpå½ä»¤ä¿åè³æ¨çæ¬å°ï¼ãæºå¨éæ¾åæ°æ®ä¸åä¿åã")])]),s("div",{staticClass:"dialog-footer third-dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("a-checkbox",{model:{value:e.noThirdReminder,callback:function(t){e.noThirdReminder=t},expression:"noThirdReminder"}},[e._v("䏿¬¡ä¸åæç¤º")]),s("a-button",{attrs:{size:"large",shape:"round"},on:{click:e.handleThirdAlertClick}},[e._v("æç¥éäº")])],1)],2)},qe=[],ze={data(){return{noThirdReminder:!1}},methods:{handleThirdAlertClick(){this.noThirdReminder&&localStorage.setItem(Ee.K9,Date.now()),this.$emit("update:visible",!1),this.$emit("clickConfirm")}}},Qe=ze,Xe=(0,v.Z)(Qe,Ye,qe,!1,null,null,null),Je=Xe.exports;const{BILL_ON_TIME:et,ONE_DAY:tt,SEVEN_DAYS:st,THIRTY_DAYS:it}=r.AC,nt={visible:!1,size:0,hwQty:1},at=(e,t,s)=>t<s?e*t:e*(t+2);var rt={inject:["hostType","hostKey","hostName","hostUnit"],components:{[Pe.Z.name]:Pe.Z,[Te.ZP.name]:Te.ZP,[Te.ZP.TabPane.name]:Te.ZP.TabPane,[Se.name]:Se,HostBadges:Re.Z,HostTitle:Ve.Z,RentForm:Fe.Z,AlertDiskCapacity:Ge,ThirdPartyAlert:Je,AlertOffline:$e.Z,HostNumInput:Ke.Z,PaymentDetail:Ie.Z,DomainRegisterModal:Ne.Z},model:{prop:"host",event:"change"},props:{host:{type:Object,required:!1},visible:{type:Boolean,default:!1}},data(){return{hostNum:0,leaseTerm:et,thirdPartyVisible:!1,offlineVisible:!1,paymentDetailVisible:!1,isRenting:!1,purchased:!1,diskPromptConfig:{...nt},domainRegisterVisible:!1}},computed:{...(0,p.rn)(["balance","channel","domains"]),...(0,p.Se)(["isDisabledUser"]),title(){return(0,c.c9)(this.host)},minRentableNum(){const{size:e,hwQty:t}=this.diskPromptConfig;return e&&e>this.diskSize?this.attributes.isWinEnabled&&this.diskSize*(t-1)<e?Math.max(Math.ceil(e/this.diskSize)-2,t)*this.unitStep:Math.ceil(e/this.diskSize)*this.unitStep:this.unitStep},maxRentableNum(){return this.host[this.hostKey]?this.host[this.hostKey].max:1},unitStep(){return this.host.unitStep},unitNum(){return Math.floor(this.hostNum/this.unitStep)},hostIconName(){return(0,c.a1)(this.hostType)},unitPriceOnTime(){const e=(0,c.pT)(this.host,et,"");return e.currentPrice.value},deadline(){return(0,c.fQ)(this.host)},attributes(){return this.host.attributes||{}},isThirdParty(){return!!this.attributes.isThirdParty},proprietary(){const{isProprietary:e,desc:t}=this.host;return{is:e,name:t&&t.name,logo:t&&t.iconURL||x.Yq}},billMethods(){const e=[],t=this.host.items||[];return t.forEach((t=>{if([tt,st,it].includes(t.paymentType)){const s=(0,c.pT)({item:t},t.paymentType);e.push(new De.W(t.paymentType,s.currentPrice.value))}})),e.sort(((e,t)=>t.value-e.value)),[new De.W(et,this.unitPriceOnTime),...e]},currentPrice(){const e=this.billMethods.find((e=>e.value===this.leaseTerm));return{value:e.price*this.unitNum,unit:e.unit}},billNote(){const e=this.unitPriceOnTime*this.unitNum;if(this.leaseTerm===et)return e?`*约å¯ç§å <${Math.ceil(this.balance/e)} å°æ¶`:"";const t=24*r.oH[this.leaseTerm].value,s=e*t-this.currentPrice.value;return s>0?`*为æ¨èçï¼${Ae.ZP.formatPrice(s,!1)}`:""},diskSize(){const{diskGB:e}=(0,c.M3)(this.host.hardware);return(0,Ae.g1)(e)}},methods:{...(0,p.OI)({setRentalNotice:"app/setRentalNotice"}),afterVisibleChange(e){e||(this.$emit("change",null),this.leaseTerm=et,this.hostNum=0,this.purchased&&this.$router.push("/user/node-list?category=all"),this.purchased=!1)},handleClose(){this.resetStatus(),this.$emit("update:visible",!1)},resetStatus(){this.diskPromptConfig={...nt}},confirmRent(){if(this.isDisabledUser)He.Z.error("æ¬è´¦å·ææ æéä½¿ç¨æ¤åè½");else if(this.$refs.hostNumInput&&this.$refs.hostNumInput.validate())if(this.$refs.rentForm&&this.$refs.rentForm.validateAll()){if(!this.domains.some((e=>e.value===this.host.domain.id)))return void(this.domainRegisterVisible=!0);if(this.leaseTerm===et){const e=localStorage.getItem(Ee.K9),t=localStorage.getItem(Ee.TM),s=2===this.host.domain.id;s&&!t?this.offlineVisible=!0:this.isThirdParty&&!e?this.thirdPartyVisible=!0:this.rentHost()}else this.paymentDetailVisible=!0}else this.$refs.rentForm&&this.$refs.rentForm.scrollToErrorItem()},onRegisterDomainSuccess(){this.confirmRent()},async rentHost(){if(!this.$refs.rentForm||this.isRenting)return;const e=this.$refs.rentForm.getRentParams();e.machine_category=this.hostType,e.hardware_qty=this.unitNum,this.isRenting=!0;const t=await a.Z.nodeRent(e,{errMsg:{53:"æ±æï¼æ²¡æè¶³å¤çæºå¨äºï¼è¯·æ ¸å¯¹GPUæ°",57:"æ±æï¼è¯¥æºå¨å·²è¢«å
¶ä»äººç§èµ°äºï¼åéä¸å°å§",default:"ç§ç¨å¤±è´¥"}});0===t.code?(He.Z.success("æåæ¨ï¼ç§ç¨æåï¼"),this.setRentalNotice({isFromMarket:!0}),this.$router.push("/user/node-list?category=all")):this.isRenting=!1},async handlePackPurchase(e){if(!this.$refs.rentForm||this.isRenting)return;const t=this.$refs.rentForm.getRentParams();t.machine_category=this.hostType,t.hardware_qty=this.unitNum;const s=this.host.items.find((e=>e.paymentType===this.leaseTerm)),i={item_id:s.id,info:JSON.stringify(t),order_to_billing:e};this.isRenting=!0;const n=await Me.Z.purchaseProduct(i,{errMsg:{46:"ä½é¢ä¸è¶³",default:"ç§ç¨å¤±è´¥"}});0===n.code?(He.Z.success("æåæ¨ï¼ç§ç¨æåï¼"),this.paymentDetailVisible=!1,this.setRentalNotice({isFromMarket:!0}),this.handleClose(),this.purchased=!0):this.isRenting=!1},onSnapChange(e){var t,s;const i=+(null===e||void 0===e||null===(t=e.snapInfo)||void 0===t?void 0:t.volSizeByte)||0;this.diskPromptConfig.size=i,this.diskPromptConfig.hwQty=+(null===e||void 0===e||null===(s=e.node)||void 0===s?void 0:s.hwQty)||1,i&&i>at(this.diskSize,this.unitNum,this.diskPromptConfig.hwQty)&&(this.diskPromptConfig.visible=!0)},onDiskCapacityConfirm(){setTimeout((()=>{var e;null===(e=this.$refs.hostNumInput)||void 0===e||e.rotateInputNumber(this.minRentableNum),(0,Oe.i)(".node-badges .config-item","flipInY",{classes:["animate__delay-0.3s"]})}),300)},onHostNumChange(){(0,Oe.i)(".node-badges .config-item","flipInY",{classes:["animate__faster"]})}}},ot=rt,lt=(0,v.Z)(ot,ue,de,!1,null,null,null),ct=lt.exports,ut=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"sidebar-filter"},[e.chineseDomains.length?[s("h3",{staticClass:"mp-flex-justify mp-text-normal"},[s("span",{staticClass:"title"}
1,[e._v("åºå")]),e.hasError?e._e():s("span",{staticClass:"mp-flex clear",class:{disabled:e.disabled},on:{click:e.clearFilter}},[s("mp-icon",{staticClass:"clear-icon",attrs:{name:"clear"}}),e._v("æ¸
é¤ ")],1)]),s("div",{staticClass:"filter-pay mt-4 mb-8"},[s("a-checkbox-group",{staticClass:"!grid grid-cols-2 gap-4",attrs:{options:e.chineseDomains},on:{change:e.handleFilterChange},model:{value:e.domains,callback:function(t){e.domains=t},expression:"domains"}})],1)]:e._e(),e.isGPU?[e.chineseModels.length||e.inferenceModels.length||e.computeModels.length||e.renderModels.length?s("div",{staticClass:"filter-gpu mt-8"},[s("h3",{staticClass:"text-md mb-3"},[e._v("åå·")]),e.loading?s("mp-loading"):s("div",[e.chineseModels.length?[s("h4",{staticClass:"mb-2 text-sm text-on-container-secondary font-normal"},[e._v(" å½äº§å¡ ")]),s("a-checkbox-group",{staticClass:"!grid grid-cols-2 gap-4",attrs:{disabled:e.disabled,options:e.chineseModels},on:{change:e.handleFilterChange},scopedSlots:e._u([{key:"label",fn:function(t){var i=t.name,n=t.isNew;return s("span",{},[e._v(" "+e._s(i)+" "),n?s("mp-icon",{staticClass:"absolute top-[-5px] right-[-7px] !w-[40px] !h-[18px]",attrs:{name:"new-1"}}):e._e()],1)}}],null,!1,1891772776),model:{value:e.rawFilters.chineseModels,callback:function(t){e.$set(e.rawFilters,"chineseModels",t)},expression:"rawFilters.chineseModels"}})]:e._e(),e.inferenceModels.length?[s("h4",{staticClass:"mt-6 mb-2 text-sm text-on-container-secondary font-normal"},[e._v("æ¨çå¡")]),s("a-checkbox-group",{staticClass:"!grid grid-cols-2 gap-4",attrs:{disabled:e.disabled,options:e.inferenceModels},on:{change:e.handleFilterChange},scopedSlots:e._u([{key:"label",fn:function(t){var i=t.name,n=t.isNew;return s("span",{},[e._v(" "+e._s(i)+" "),n?s("mp-icon",{staticClass:"absolute top-[-5px] right-[-7px] !w-[40px] !h-[18px]",attrs:{name:"new-1"}}):e._e()],1)}}],null,!1,1891772776),model:{value:e.rawFilters.inferenceModels,callback:function(t){e.$set(e.rawFilters,"inferenceModels",t)},expression:"rawFilters.inferenceModels"}})]:e._e(),e.computeModels.length?[s("h4",{staticClass:"mt-6 mb-2 text-sm text-on-container-secondary font-normal"},[e._v("计ç®å¡")]),s("a-checkbox-group",{staticClass:"!grid grid-cols-2 gap-4",attrs:{disabled:e.disabled,options:e.computeModels},on:{change:e.handleFilterChange},scopedSlots:e._u([{key:"label",fn:function(t){var i=t.name,n=t.isNew;return s("span",{},[e._v(" "+e._s(i)+" "),n?s("mp-icon",{staticClass:"absolute top-[-5px] right-[-7px] !w-[40px] !h-[18px]",attrs:{name:"new-1"}}):e._e()],1)}}],null,!1,1891772776),model:{value:e.rawFilters.computeModels,callback:function(t){e.$set(e.rawFilters,"computeModels",t)},expression:"rawFilters.computeModels"}})]:e._e(),e.renderModels.length?[s("h4",{staticClass:"mt-6 mb-2 text-sm text-on-container-secondary font-normal"},[e._v("渲æå¡")]),s("a-checkbox-group",{staticClass:"!grid grid-cols-2 gap-4",attrs:{disabled:e.disabled,options:e.renderModels},on:{change:e.handleFilterChange},scopedSlots:e._u([{key:"label",fn:function(t){var i=t.name,n=t.isNew;return s("span",{},[e._v(" "+e._s(i)+" "),n?s("mp-icon",{staticClass:"absolute top-[-5px] right-[-7px] !w-[40px] !h-[18px]",attrs:{name:"new-1"}}):e._e()],1)}}],null,!1,1891772776),model:{value:e.rawFilters.renderModels,callback:function(t){e.$set(e.rawFilters,"renderModels",t)},expression:"rawFilters.renderModels"}})]:e._e()],2)],1):e._e(),s("div",{staticClass:"filter-contents"},[e.hasError?s("mp-reload",{on:{click:e.handleReloadClick}}):e.loading?s("mp-loading"):e._l(e.sliders,(function(t){return s("slider-gpu",{key:t.name,staticClass:"mt-8",attrs:{disabled:e.disabled,range:t.range,title:t.title},on:{change:e.handleFilterChange},model:{value:t.value,callback:function(s){e.$set(t,"value",s)},expression:"s.value"}})}))],2),s("div",{staticClass:"h-px bg-l3 mt-8"}),s("div",{staticClass:"filter-features mt-8"},[s("h3",{staticClass:"text-md mb-4"},[e._v("åè½")]),s("a-checkbox-group",{staticClass:"!flex justify-between",on:{change:e.handleFilterChange},model:{value:e.rawFilters.features,callback:function(t){e.$set(e.rawFilters,"features",t)},expression:"rawFilters.features"}},e._l(e.featureOptions,(function(t){return s("a-checkbox",{key:t.value,attrs:{value:t.value}},[s("a-tooltip",{attrs:{title:t.tip}},[s("mp-icon",{staticClass:"text-[30px]",attrs:{name:e.getFeatureIconName(t)}})],1)],1)})),1)],1)]:[s("h3",{staticClass:"mp-text-normal title"},[e._v("æºå¨çé")]),s("div",{staticClass:"filter-contents"},[s("a-checkbox",{attrs:{disabled:e.disabled},on:{change:e.triggerChange},model:{value:e.rawFilters.avail,callback:function(t){e.$set(e.rawFilters,"avail",t)},expression:"rawFilters.avail"}},[e._v(" å¯ç¨æºå¨ ")])],1)]],2)},dt=[],ht=(s(85827),s(96486)),pt=s.n(ht),mt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"slider-gpu"},[s("h4",{staticClass:"mp-text-normal color-normal"},[e._v(e._s(e.title))]),s("a-slider",{staticClass:"content",attrs:{range:"",disabled:e.disabled,"tooltip-visible":e.show,"get-tooltip-popup-container":e.getTooltipPopupContainer,"tip-formatter":e.tipFormatter,marks:e.config.marks,min:e.config.min,max:e.config.max,value:e.value},on:{change:e.handleChange}}),s("div",{ref:"tooltipContainer",staticClass:"tooltip-container"})],1)},ft=[],vt=(s(89746),s(42723)),gt=s(88239),bt=s(78646),Ct={functional:!0,render:function(e,t){var s,i,n=t.props,a=n.included,r=n.vertical,o=n.offset,l=n.length,c=n.reverse,u=t.data,d=u.style,h=u["class"],p=r?(s={}
1,(0,he.Z)(s,c?"top":"bottom",o+"%"),(0,he.Z)(s,c?"bottom":"top","auto"),(0,he.Z)(s,"height",l+"%"),s):(i={},(0,he.Z)(i,c?"right":"left",o+"%"),(0,he.Z)(i,c?"left":"right","auto"),(0,he.Z)(i,"width",l+"%"),i),m=(0,gt["default"])({},d,p);return a?e("div",{class:h,style:m}):null}},yt=Ct,kt=s(55742),xt=function(e,t,s,i,n,a){(0,bt.Z)(!s||i>0,"Slider","`Slider[step]` should be a positive number in order to make Slider[dots] work.");var r=Object.keys(t).map(parseFloat).sort((function(e,t){return e-t}));if(s&&i)for(var o=n;o<=a;o+=i)-1===r.indexOf(o)&&r.push(o);return r},_t={functional:!0,render:function(e,t){var s=t.props,i=s.prefixCls,n=s.vertical,a=s.reverse,r=s.marks,o=s.dots,l=s.step,c=s.included,u=s.lowerBound,d=s.upperBound,h=s.max,p=s.min,m=s.dotStyle,f=s.activeDotStyle,v=h-p,g=xt(n,r,o,l,p,h).map((function(t){var s,r=Math.abs(t-p)/v*100+"%",o=!c&&t===d||c&&t<=d&&t>=u,l=n?(0,gt["default"])({},m,(0,he.Z)({},a?"top":"bottom",r)):(0,gt["default"])({},m,(0,he.Z)({},a?"right":"left",r));o&&(l=(0,gt["default"])({},l,f));var h=fe()((s={},(0,he.Z)(s,i+"-dot",!0),(0,he.Z)(s,i+"-dot-active",o),(0,he.Z)(s,i+"-dot-reverse",a),s));return e("span",{class:h,style:l,key:t})}));return e("div",{class:i+"-step"},[g])}},Zt=_t,wt=s(72444),St={functional:!0,render:function(e,t){var s=t.props,i=s.className,n=s.vertical,a=s.reverse,r=s.marks,o=s.included,l=s.upperBound,c=s.lowerBound,u=s.max,d=s.min,h=t.listeners.clickLabel,p=Object.keys(r),m=u-d,f=p.map(parseFloat).sort((function(e,t){return e-t})).map((function(t){var s,u="function"===typeof r[t]?r[t](e):r[t],p="object"===("undefined"===typeof u?"undefined":(0,wt.Z)(u))&&!(0,Ce.l$)(u),f=p?u.label:u;if(!f&&0!==f)return null;var v=!o&&t===l||o&&t<=l&&t>=c,g=fe()((s={},(0,he.Z)(s,i+"-text",!0),(0,he.Z)(s,i+"-text-active",v),s)),b=(0,he.Z)({marginBottom:"-50%"},a?"top":"bottom",(t-d)/m*100+"%"),C=(0,he.Z)({transform:"translateX(-50%)",msTransform:"translateX(-50%)"},a?"right":"left",a?(t-d/4)/m*100+"%":(t-d)/m*100+"%"),y=n?b:C,k=p?(0,gt["default"])({},y,u.style):y;return e("span",{class:g,style:k,key:t,on:{mousedown:function(e){return h(e,t)},touchstart:function(e){return h(e,t)}}},[f])}));return e("div",{class:i},[f])}},Tt=St,Pt={name:"Handle",mixins:[ve.Z],props:{prefixCls:ge.Z.string,vertical:ge.Z.bool,offset:ge.Z.number,disabled:ge.Z.bool,min:ge.Z.number,max:ge.Z.number,value:ge.Z.number,tabIndex:ge.Z.number,className:ge.Z.string,reverse:ge.Z.bool},data:function(){return{clickFocused:!1}},mounted:function(){this.onMouseUpListener=(0,kt.Z)(document,"mouseup",this.handleMouseUp)},beforeDestroy:function(){this.onMouseUpListener&&this.onMouseUpListener.remove()},methods:{setClickFocus:function(e){this.setState({clickFocused:e})},handleMouseUp:function(){document.activeElement===this.$refs.handle&&this.setClickFocus(!0)},handleBlur:function(e){this.setClickFocus(!1),this.__emit("blur",e)},handleKeyDown:function(){this.setClickFocus(!1)},clickFocus:function(){this.setClickFocus(!0),this.focus()},focus:function(){this.$refs.handle.focus()},blur:function(){this.$refs.handle.blur()},handleMousedown:function(e){this.focus(),this.__emit("mousedown",e)}},render:function(){var e,t,s=arguments[0],i=(0,Ce.oZ)(this),n=i.prefixCls,a=i.vertical,r=i.reverse,o=i.offset,l=i.disabled,c=i.min,u=i.max,d=i.value,h=i.tabIndex,p=fe()(this.$props.className,(0,he.Z)({},n+"-handle-click-focused",this.clickFocused)),m=a?(e={},(0,he.Z)(e,r?"top":"bottom",o+"%"),(0,he.Z)(e,r?"bottom":"top","auto"),(0,he.Z)(e,"transform","translateY(+50%)"),e):(t={},(0,he.Z)(t,r?"right":"left",o+"%"),(0,he.Z)(t,r?"left":"right","auto"),(0,he.Z)(t,"transform","translateX("+(r?"+":"-")+"50%)"),t),f={"aria-valuemin":c,"aria-valuemax":u,"aria-valuenow":d,"aria-disabled":!!l},v=h||0;(l||null===h)&&(v=null);var g={attrs:(0,gt["default"])({role:"slider",tabIndex:v},f),class:p,on:(0,gt["default"])({},(0,Ce.CL)(this),{blur:this.handleBlur,keydown:this.handleKeyDown,mousedown:this.handleMousedown}),ref:"handle",style:m};return s("div",g)}},Mt=s(85315),$t=s(31973);function Nt(e,t){try{return Object.keys(t).some((function(s){return e.target===t[s].$el||e.target===t[s]}))}catch(s){return!1}}function Rt(e,t){var s=t.min,i=t.max;return e<s||e>i}function Vt(e){return e.touches.length>1||"touchend"===e.type.toLowerCase()&&e.touches.length>0}function It(e,t){var s=t.marks,i=t.step,n=t.min,a=t.max,r=Object.keys(s).map(parseFloat);if(null!==i){var o=Math.pow(10,Ft(i)),l=Math.floor((a*o-n*o)/(i*o)),c=Math.min((e-n)/i,l),u=Math.round(c)*i+n;r.push(u)}var d=r.map((function(t){return Math.abs(e-t)}));return r[d.indexOf(Math.min.apply(Math,(0,Mt.Z)(d)))]}function Ft(e){var t=e.toString(),s=0;return t.indexOf(".")>=0&&(s=t.length-t.indexOf(".")-1),s}function Ht(e,t){var s=1;
1return window.visualViewport&&(s=+(window.visualViewport.width/document.body.getBoundingClientRect().width).toFixed(2)),(e?t.clientY:t.pageX)/s}function Et(e,t){var s=1;return window.visualViewport&&(s=+(window.visualViewport.width/document.body.getBoundingClientRect().width).toFixed(2)),(e?t.touches[0].clientY:t.touches[0].pageX)/s}function Dt(e,t){var s=t.getBoundingClientRect();return e?s.top+.5*s.height:window.pageXOffset+s.left+.5*s.width}function Ot(e,t){var s=t.max,i=t.min;return e<=i?i:e>=s?s:e}function At(e,t){var s=t.step,i=isFinite(It(e,t))?It(e,t):0;return null===s?i:parseFloat(i.toFixed(Ft(s)))}function Bt(e){e.stopPropagation(),e.preventDefault()}function jt(e,t,s){var i={increase:function(e,t){return e+t},decrease:function(e,t){return e-t}},n=i[e](Object.keys(s.marks).indexOf(JSON.stringify(t)),1),a=Object.keys(s.marks)[n];return s.step?i[e](t,s.step):Object.keys(s.marks).length&&s.marks[a]?s.marks[a]:t}function Ut(e,t,s){var i="increase",n="decrease",a=i;switch(e.keyCode){case $t.Z.UP:a=t&&s?n:i;break;case $t.Z.RIGHT:a=!t&&s?n:i;break;case $t.Z.DOWN:a=t&&s?i:n;break;case $t.Z.LEFT:a=!t&&s?i:n;break;case $t.Z.END:return function(e,t){return t.max};case $t.Z.HOME:return function(e,t){return t.min};case $t.Z.PAGE_UP:return function(e,t){return e+2*t.step};case $t.Z.PAGE_DOWN:return function(e,t){return e-2*t.step};default:return}return function(e,t){return jt(a,e,t)}}function Lt(){}function Wt(e){var t={min:ge.Z.number,max:ge.Z.number,step:ge.Z.number,marks:ge.Z.object,included:ge.Z.bool,prefixCls:ge.Z.string,disabled:ge.Z.bool,handle:ge.Z.func,dots:ge.Z.bool,vertical:ge.Z.bool,reverse:ge.Z.bool,minimumTrackStyle:ge.Z.object,maximumTrackStyle:ge.Z.object,handleStyle:ge.Z.oneOfType([ge.Z.object,ge.Z.arrayOf(ge.Z.object)]),trackStyle:ge.Z.oneOfType([ge.Z.object,ge.Z.arrayOf(ge.Z.object)]),railStyle:ge.Z.object,dotStyle:ge.Z.object,activeDotStyle:ge.Z.object,autoFocus:ge.Z.bool};return{name:"createSlider",mixins:[e],model:{prop:"value",event:"change"},props:(0,Ce.SQ)(t,{prefixCls:"rc-slider",min:0,max:100,step:1,marks:{},included:!0,disabled:!1,dots:!1,vertical:!1,reverse:!1,trackStyle:[{}],handleStyle:[{}],railStyle:{},dotStyle:{},activeDotStyle:{}}),data:function(){var e=this.step,t=this.max,s=this.min,i=!isFinite(t-s)||(t-s)%e===0;return(0,bt.Z)(!e||Math.floor(e)!==e||i,"Slider","Slider[max] - Slider[min] (%s) should be a multiple of Slider[step] (%s)",t-s,e),this.handlesRefs={},{}},mounted:function(){var e=this;this.$nextTick((function(){e.document=e.$refs.sliderRef&&e.$refs.sliderRef.ownerDocument;var t=e.autoFocus,s=e.disabled;t&&!s&&e.focus()}))},beforeDestroy:function(){var e=this;this.$nextTick((function(){e.removeDocumentEvents()}))},methods:{defaultHandle:function(e){var t=e.index,s=e.directives,i=e.className,n=e.style,a=e.on,r=(0,vt.Z)(e,["index","directives","className","style","on"]),o=this.$createElement;if(delete r.dragging,null===r.value)return null;var l={props:(0,gt["default"])({},r),class:i,style:n,key:t,directives:s,on:a};return o(Pt,l)},onMouseDown:function(e){if(0===e.button){var t=this.vertical,s=Ht(t,e);if(Nt(e,this.handlesRefs)){var i=Dt(t,e.target);this.dragOffset=s-i,s=i}else this.dragOffset=0;this.removeDocumentEvents(),this.onStart(s),this.addDocumentMouseEvents(),Bt(e)}},onTouchStart:function(e){if(!Vt(e)){var t=this.vertical,s=Et(t,e);if(Nt(e,this.handlesRefs)){var i=Dt(t,e.target);this.dragOffset=s-i,s=i}else this.dragOffset=0;this.onStart(s),this.addDocumentTouchEvents(),Bt(e)}},onFocus:function(e){var t=this.vertical;if(Nt(e,this.handlesRefs)){var s=Dt(t,e.target);this.dragOffset=0,this.onStart(s),Bt(e),this.$emit("focus",e)}},onBlur:function(e){this.onEnd(),this.$emit("blur",e)},onMouseUp:function(){this.handlesRefs[this.prevMovedHandleIndex]&&this.handlesRefs[this.prevMovedHandleIndex].clickFocus()},onMouseMove:function(e){if(this.$refs.sliderRef){var t=Ht(this.vertical,e);this.onMove(e,t-this.dragOffset)}else this.onEnd()},onTouchMove:function(e){if(!Vt(e)&&this.$refs.sliderRef){var t=Et(this.vertical,e);this.onMove(e,t-this.dragOffset)}else this.onEnd()},onKeyDown:function(e){this.$refs.sliderRef&&Nt(e,this.handlesRefs)&&this.onKeyboard(e)},onClickMarkLabel:function(e,t){var s=this;e.stopPropagation(),this.onChange({sValue:t}),this.setState({sValue:t},(function(){return s.onEnd(!0)}))},getSliderStart:function(){var e=this.$refs.sliderRef,t=this.vertical,s=this.reverse,i=e.getBoundingClientRect();return t?s?i.bottom:i.top:window.pageXOffset+(s?i.right:i.left)},getSliderLength:function(){var e=this.$refs.sliderRef;if(!e)return 0;var t=e.getBoundingClientRect();return this.vertical?t.height:t.width},addDocumentTouchEvents:function(){this.onTouchMoveListener=(0,kt.Z)(this.document,"touchmove",this.onTouchMove),this.onTouchUpListener=(0,kt.Z)(this.document,"touchend",this.onEnd)},addDocumentMouseEvents:function(){this.onMouseMoveListener=(0,kt.Z)(this.document,"mousemove",this.onMouseMove),this.onMouseUpListener=(0,kt.Z)(this.document,"mouseup",this.onEnd)},removeDocumentEvents:function(){this.onTouchMoveListener&&this.onTouchMoveListener.remove(),this.onTouchUpListener&&this.onTouchUpListener.remove(),this.onMouseMoveListener&&this.onMouseMoveListener.remove(),this.onMouseUpListener&&this.onMouseUpListener.remove()},focus:function(){this.disabled||this.handlesRefs[0].focus()},blur:function(){var e=this;
1this.disabled||Object.keys(this.handlesRefs).forEach((function(t){e.handlesRefs[t]&&e.handlesRefs[t].blur&&e.handlesRefs[t].blur()}))},calcValue:function(e){var t=this.vertical,s=this.min,i=this.max,n=Math.abs(Math.max(e,0)/this.getSliderLength()),a=t?(1-n)*(i-s)+s:n*(i-s)+s;return a},calcValueByPos:function(e){var t=this.reverse?-1:1,s=t*(e-this.getSliderStart()),i=this.trimAlignValue(this.calcValue(s));return i},calcOffset:function(e){var t=this.min,s=this.max,i=(e-t)/(s-t);return 100*i},saveHandle:function(e,t){this.handlesRefs[e]=t}},render:function(e){var t,s=this.prefixCls,i=this.marks,n=this.dots,a=this.step,r=this.included,o=this.disabled,l=this.vertical,c=this.reverse,u=this.min,d=this.max,h=this.maximumTrackStyle,p=this.railStyle,m=this.dotStyle,f=this.activeDotStyle,v=this.renderSlider(e),g=v.tracks,b=v.handles,C=fe()(s,(t={},(0,he.Z)(t,s+"-with-marks",Object.keys(i).length),(0,he.Z)(t,s+"-disabled",o),(0,he.Z)(t,s+"-vertical",l),t)),y={props:{vertical:l,marks:i,included:r,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:d,min:u,reverse:c,className:s+"-mark"},on:{clickLabel:o?Lt:this.onClickMarkLabel}};return e("div",{ref:"sliderRef",attrs:{tabIndex:"-1"},class:C,on:{touchstart:o?Lt:this.onTouchStart,mousedown:o?Lt:this.onMouseDown,mouseup:o?Lt:this.onMouseUp,keydown:o?Lt:this.onKeyDown,focus:o?Lt:this.onFocus,blur:o?Lt:this.onBlur}},[e("div",{class:s+"-rail",style:(0,gt["default"])({},h,p)}),g,e(Zt,{attrs:{prefixCls:s,vertical:l,reverse:c,marks:i,dots:n,step:a,included:r,lowerBound:this.getLowerBound(),upperBound:this.getUpperBound(),max:d,min:u,dotStyle:m,activeDotStyle:f}}),b,e(Tt,y),this.$slots["default"]])}}}var Gt={name:"Slider",mixins:[ve.Z],props:{defaultValue:ge.Z.number,value:ge.Z.number,disabled:ge.Z.bool,autoFocus:ge.Z.bool,tabIndex:ge.Z.number,reverse:ge.Z.bool,min:ge.Z.number,max:ge.Z.number},data:function(){var e=void 0!==this.defaultValue?this.defaultValue:this.min,t=void 0!==this.value?this.value:e;return(0,bt.Z)(!(0,Ce.m2)(this,"minimumTrackStyle"),"Slider","minimumTrackStyle will be deprecate, please use trackStyle instead."),(0,bt.Z)(!(0,Ce.m2)(this,"maximumTrackStyle"),"Slider","maximumTrackStyle will be deprecate, please use railStyle instead."),{sValue:this.trimAlignValue(t),dragging:!1}},watch:{value:{handler:function(e){this.setChangeValue(e)},deep:!0},min:function(){var e=this.sValue;this.setChangeValue(e)},max:function(){var e=this.sValue;this.setChangeValue(e)}},methods:{setChangeValue:function(e){var t=void 0!==e?e:this.sValue,s=this.trimAlignValue(t,this.$props);s!==this.sValue&&(this.setState({sValue:s}),Rt(t,this.$props)&&this.$emit("change",s))},onChange:function(e){var t=!(0,Ce.m2)(this,"value"),s=e.sValue>this.max?(0,gt["default"])({},e,{sValue:this.max}):e;t&&this.setState(s);var i=s.sValue;this.$emit("change",i)},onStart:function(e){this.setState({dragging:!0});var t=this.sValue;this.$emit("beforeChange",t);var s=this.calcValueByPos(e);this.startValue=s,this.startPosition=e,s!==t&&(this.prevMovedHandleIndex=0,this.onChange({sValue:s}))},onEnd:function(e){var t=this.dragging;this.removeDocumentEvents(),(t||e)&&this.$emit("afterChange",this.sValue),this.setState({dragging:!1})},onMove:function(e,t){Bt(e);var s=this.sValue,i=this.calcValueByPos(t);i!==s&&this.onChange({sValue:i})},onKeyboard:function(e){var t=this.$props,s=t.reverse,i=t.vertical,n=Ut(e,i,s);if(n){Bt(e);var a=this.sValue,r=n(a,this.$props),o=this.trimAlignValue(r);if(o===a)return;this.onChange({sValue:o}),this.$emit("afterChange",o),this.onEnd()}},getLowerBound:function(){return this.min},getUpperBound:function(){return this.sValue},trimAlignValue:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===e)return null;var s=(0,gt["default"])({},this.$props,t),i=Ot(e,s);return At(i,s)},getTrack:function(e){var t=e.prefixCls,s=e.reverse,i=e.vertical,n=e.included,a=e.offset,r=e.minimumTrackStyle,o=e._trackStyle,l=this.$createElement;return l(yt,{class:t+"-track",attrs:{vertical:i,included:n,offset:0,reverse:s,length:a},style:(0,gt["default"])({},r,o)})},renderSlider:function(){var e=this,t=this.prefixCls,s=this.vertical,i=this.included,n=this.disabled,a=this.minimumTrackStyle,r=this.trackStyle,o=this.handleStyle,l=this.tabIndex,c=this.min,u=this.max,d=this.reverse,h=this.handle,p=this.defaultHandle,m=h||p,f=this.sValue,v=this.dragging,g=this.calcOffset(f),b=m({className:t+"-handle",prefixCls:t,vertical:s,offset:g,value:f,dragging:v,disabled:n,min:c,max:u,reverse:d,index:0,tabIndex:l,style:o[0]||o,directives:[{name:"ant-ref",value:function(t){return e.saveHandle(0,t)}}],on:{focus:this.onFocus,blur:this.onBlur}}),C=r[0]||r;return{tracks:this.getTrack({prefixCls:t,reverse:d,vertical:s,included:i,offset:g,minimumTrackStyle:a,_trackStyle:C}),handles:b}}}},Kt=Wt(Gt),Yt=function(e){var t=e.value,s=e.handle,i=e.bounds,n=e.props,a=n.allowCross,r=n.pushable,o=Number(r),l=Ot(t,n),c=l;return a||null==s||void 0===i||(s>0&&l<=i[s-1]+o&&(c=i[s-1]+o),s<i.length-1&&l>=i[s+1]-o&&(c=i[s+1]-o)),At(c,n)},qt={defaultValue:ge.Z.arrayOf(ge.Z.number),value:ge.Z.arrayOf(ge.Z.number),count:ge.Z.number,pushable:ge.Z.oneOfType([ge.Z.bool,ge.Z.number]),allowCross:ge.Z.bool,disabled:ge.Z.bool,reverse:ge.Z.bool,tabIndex:ge.Z.arrayOf(ge.Z.number),prefixCls:ge.Z.string,min:ge.Z.number,max:ge.Z.number,autoFocus:ge.Z.bool},zt={name:"Range",displayName:"Range",mixins:[ve.Z],props:(0,Ce.SQ)(qt,{c
1ount:1,allowCross:!0,pushable:!1,tabIndex:[]}),data:function(){var e=this,t=this.count,s=this.min,i=this.max,n=Array.apply(void 0,(0,Mt.Z)(Array(t+1))).map((function(){return s})),a=(0,Ce.m2)(this,"defaultValue")?this.defaultValue:n,r=this.value;void 0===r&&(r=a);var o=r.map((function(t,s){return Yt({value:t,handle:s,props:e.$props})})),l=o[0]===i?0:o.length-1;return{sHandle:null,recent:l,bounds:o}},watch:{value:{handler:function(e){var t=this.bounds;this.setChangeValue(e||t)},deep:!0},min:function(){var e=this.value;this.setChangeValue(e||this.bounds)},max:function(){var e=this.value;this.setChangeValue(e||this.bounds)}},methods:{setChangeValue:function(e){var t=this,s=this.bounds,i=e.map((function(e,i){return Yt({value:e,handle:i,bounds:s,props:t.$props})}));if((i.length!==s.length||!i.every((function(e,t){return e===s[t]})))&&(this.setState({bounds:i}),e.some((function(e){return Rt(e,t.$props)})))){var n=e.map((function(e){return Ot(e,t.$props)}));this.$emit("change",n)}},onChange:function(e){var t=!(0,Ce.m2)(this,"value");if(t)this.setState(e);else{var s={};["sHandle","recent"].forEach((function(t){void 0!==e[t]&&(s[t]=e[t])})),Object.keys(s).length&&this.setState(s)}var i=(0,gt["default"])({},this.$data,e),n=i.bounds;this.$emit("change",n)},onStart:function(e){var t=this.bounds;this.$emit("beforeChange",t);var s=this.calcValueByPos(e);this.startValue=s,this.startPosition=e;var i=this.getClosestBound(s);this.prevMovedHandleIndex=this.getBoundNeedMoving(s,i),this.setState({sHandle:this.prevMovedHandleIndex,recent:this.prevMovedHandleIndex});var n=t[this.prevMovedHandleIndex];if(s!==n){var a=[].concat((0,Mt.Z)(t));a[this.prevMovedHandleIndex]=s,this.onChange({bounds:a})}},onEnd:function(e){var t=this.sHandle;this.removeDocumentEvents(),(null!==t||e)&&this.$emit("afterChange",this.bounds),this.setState({sHandle:null})},onMove:function(e,t){Bt(e);var s=this.bounds,i=this.sHandle,n=this.calcValueByPos(t),a=s[i];n!==a&&this.moveTo(n)},onKeyboard:function(e){var t=this.$props,s=t.reverse,i=t.vertical,n=Ut(e,i,s);if(n){Bt(e);var a=this.bounds,r=this.sHandle,o=a[null===r?this.recent:r],l=n(o,this.$props),c=Yt({value:l,handle:r,bounds:a,props:this.$props});if(c===o)return;var u=!0;this.moveTo(c,u)}},getClosestBound:function(e){for(var t=this.bounds,s=0,i=1;i<t.length-1;++i)e>t[i]&&(s=i);return Math.abs(t[s+1]-e)<Math.abs(t[s]-e)&&(s+=1),s},getBoundNeedMoving:function(e,t){var s=this.bounds,i=this.recent,n=t,a=s[t+1]===s[t];return a&&s[i]===s[t]&&(n=i),a&&e!==s[t+1]&&(n=e<s[t+1]?t:t+1),n},getLowerBound:function(){return this.bounds[0]},getUpperBound:function(){var e=this.bounds;return e[e.length-1]},getPoints:function(){var e=this.marks,t=this.step,s=this.min,i=this.max,n=this._getPointsCache;if(!n||n.marks!==e||n.step!==t){var a=(0,gt["default"])({},e);if(null!==t)for(var r=s;r<=i;r+=t)a[r]=r;var o=Object.keys(a).map(parseFloat);o.sort((function(e,t){return e-t})),this._getPointsCache={marks:e,step:t,points:o}}return this._getPointsCache.points},moveTo:function(e,t){var s=this,i=[].concat((0,Mt.Z)(this.bounds)),n=this.sHandle,a=this.recent,r=null===n?a:n;i[r]=e;var o=r;!1!==this.$props.pushable?this.pushSurroundingHandles(i,o):this.$props.allowCross&&(i.sort((function(e,t){return e-t})),o=i.indexOf(e)),this.onChange({recent:o,sHandle:o,bounds:i}),t&&(this.$emit("afterChange",i),this.setState({},(function(){s.handlesRefs[o].focus()})),this.onEnd())},pushSurroundingHandles:function(e,t){var s=e[t],i=this.pushable;i=Number(i);var n=0;if(e[t+1]-s<i&&(n=1),s-e[t-1]<i&&(n=-1),0!==n){var a=t+n,r=n*(e[a]-s);this.pushHandle(e,a,n,i-r)||(e[t]=e[a]-n*i)}},pushHandle:function(e,t,s,i){var n=e[t],a=e[t];while(s*(a-n)<i){if(!this.pushHandleOnePoint(e,t,s))return e[t]=n,!1;a=e[t]}return!0},pushHandleOnePoint:function(e,t,s){var i=this.getPoints(),n=i.indexOf(e[t]),a=n+s;if(a>=i.length||a<0)return!1;var r=t+s,o=i[a],l=this.pushable,c=s*(e[r]-o);return!!this.pushHandle(e,r,s,l-c)&&(e[t]=o,!0)},trimAlignValue:function(e){var t=this.sHandle,s=this.bounds;return Yt({value:e,handle:t,bounds:s,props:this.$props})},ensureValueNotConflict:function(e,t,s){var i=s.allowCross,n=s.pushable,a=this.$data||{},r=a.bounds;if(e=void 0===e?a.sHandle:e,n=Number(n),!i&&null!=e&&void 0!==r){if(e>0&&t<=r[e-1]+n)return r[e-1]+n;if(e<r.length-1&&t>=r[e+1]-n)return r[e+1]-n}return t},getTrack:function(e){var t=e.bounds,s=e.prefixCls,i=e.reverse,n=e.vertical,a=e.included,r=e.offsets,o=e.trackStyle,l=this.$createElement;return t.slice(0,-1).map((function(e,t){var c,u=t+1,d=fe()((c={},(0,he.Z)(c,s+"-track",!0),(0,he.Z)(c,s+"-track-"+u,!0),c));return l(yt,{class:d,attrs:{vertical:n,reverse:i,included:a,offset:r[u-1],length:r[u]-r[u-1]},style:o[t],key:u})}))},renderSlider:function(){var e=this,t=this.sHandle,s=this.bounds,i=this.prefixCls,n=this.vertical,a=this.included,r=this.disabled,o=this.min,l=this.max,c=this.reverse,u=this.handle,d=this.defaultHandle,h=this.trackStyle,p=this.handleStyle,m=this.tabIndex,f=u||d,v=s.map((function(t){return e.calcOffset(t)})),g=i+"-handle",b=s.map((function(s,a){var u,d=m[a]||0;return(r||null===m[a])&&(d=null),f({className:fe()((u={},(0,he.Z)(u,g,!0),(0,he.Z)(u,g+"-"+(a+1),!0),u)),prefixCls:i,vertical:n,offset:v[a],value:s,dragging:t===a,index:a,tabIndex:d,min:o,max:l,reverse:c,disabled:r,style:p[a],directives:[{name:"ant-ref",value:function(t){return e.saveHandle(a,t)}}],on:{focus:e.onFocus,blur:e.onBlur}})}));return{tracks:this.getTrack({bounds:s,prefixCls:i,reverse:c,vertical:n,included:a,offsets:v,trackStyle:h}),handles:b}}}},Qt=Wt(zt),Xt=s(60333),Jt=s(32347),es=(0,Jt.Z)(),ts=function(){return{prefixCls:ge.Z.string,tooltipPrefixCls:ge.Z.string,range:ge.Z.bool,reverse:ge.Z.bool,min:ge.Z.number,max:ge.Z.number,step:ge.Z.oneOfType([ge.Z.number,ge.Z.any]),marks:ge.Z.object,dots:ge.Z.bool,value:ge.Z.oneOfType([ge.Z.number,ge.Z.arrayOf(ge.Z.number)]),defaultValue:ge.Z.oneOfType([ge.Z.number,ge.Z.arrayOf(ge.Z.number)]),included:ge.Z.bool,disabled:ge.Z.bool,vertical:ge.Z.bool,tipFormatter:ge.Z.oneOfType([ge.Z.func,ge.Z.object]),tooltipVisible:ge.Z.bool,tooltipPlacement:es.placement,getTooltipPopupContainer:ge.Z.func}},ss={name:"ASlider",model:{prop:"value",event:"change"},mixins:[ve.Z],inject:{configProvider:{default:function(){return ke.W}}},props:(0,gt["default"])({},ts(),{tipFormatter:ge.Z.oneOfType([ge.Z.func,ge.Z.object]).def((function(e){return e.toString()}))}),data:function(){return{visibles:{}}},methods:{toggleTooltipVisible:function(e,t){this.setState((function(s){var i=s.visibles;return{visibles:(0,gt["default"])({},i,(0,he.Z)({},e,t))}}))},handleWithTooltip:function(e,t,s){var i=this,n=s.value,a=s.dragging,r=s.index,o=s.directives,l=s.on,c=(0,vt.Z)(s,["value","dragging","index","directives","on"]),u=this.$createElement,d=this.$props,h=d.tipFormatter,p=d.tooltipVisible,m=d.tooltipPlacement,f=d.getTooltipPopupContainer,v=this.visibles,g=!!h&&(v[r]||a),b=p||void 0===p&&g,C={props:{prefixCls:e,title:h?h(n):"",visible:b,placement:m||"top",transitionName:"zoom-down",overlayClassName:t+"-tooltip",getPopupContainer:f||function(){return document.body}},key:r},y={props:(0,gt["default"])({value:n},c),directives:o,on:(0,gt["default"])({},l,{mouseenter:function(){return i.toggleTooltipVisible(r,!0)},mouseleave:function(){return i.toggleTooltipVisible(r,!1)}})};return u(Xt.Z,C,[u(Pt,y)])},focus:function(){this.$refs.sliderRef.focus()},blur:function(){this.$refs.sliderRef.blur()}},render:function(){var e=this,t=arguments[0],s=(0,Ce.oZ)(this),i=s.range,n=s.prefixCls,a=s.tooltipPrefixCls,r=(0,vt.Z)(s,["range","prefixCls","tooltipPrefixCls"]),o=this.configProvider.getPrefixCls,l=o("slider",n),c=o("tooltip",a),u=(0,Ce.CL)(this);if(i){var d={props:(0,gt["default"])({},r,{prefixCls:l,tooltipPrefixCls:c,handle:function(t){return e.handleWithTooltip(c,l,t)}}),ref:"sliderRef",on:u};return t(Qt,d)}var h={props:(0,gt["default"])({},r,{prefixCls:l,tooltipPrefixCls:c,handle:function(t){return e.handleWithTooltip(c,l,t)}}),ref:"sliderRef",on:u};return t(Kt,h)},install:function(e){e.use(xe.Z),e.component(ss.name,ss)}},is=ss,ns={components:{[is.name]:is},props:{title:{type:String,required:!0},range:{type:Array,required:!0,validator:function(e){return!(!Array.isArray(e)||!e.length)&&e.every((e=>Number.isInteger(e)))}},value:{type:Array,required:!0,validator:function(e){return!!Array.isArray(e)&&e.every((e=>Number.isInteger(e)))}},disabled:{type:Boolean,default:!1}},data(){return{show:!1}},computed:{config(){const e=this.range[0],t=this.range[1];return{min:e,max:t,marks:{[e]:`æå°${e}`,[t]:`æå¤§${t}`}}}},methods:{getTooltipPopupContainer(){return this.$refs.tooltipContainer},tipFormatter(){return this.value.join("ï½")},handleChange(e){this.$emit("input",e),this.$emit("change",e)}},mounted(){this.$nextTick((()=>{setTimeout((()=>{this.show=!0}),400)}))}},as=ns,rs=(0,v.Z)(as,mt,ft,!1,null,null,null),os=rs.exports;const ls={NUM:"nums",RAM:"rams",PRICE:"prices"},cs=()=>({avail:!x.Mk,features:[],inferenceModels:[],computeModels:[],renderModels:[],chineseModels:[],payModels:[]}),us=function(e,t){const s=Math.floor((t.min||0)/e.coefficient),i=Math.ceil(t.max/e.coefficient);e.range=[s,i],e.value=[...e.range]},ds=function(e){const{range:t,value:s,coefficient:i,name:n}=e;if(s&&(s[0]!==t[0]||s[1]!==t[1])){const e=s[0]*i-1,t=s[1]*i+1;return[{name:n,value:String(e),op:"gt"},{name:n,value:String(t),op:"lt"}]}return[]},hs=function(e,t){var s,i;const n=["A100-40G"];return(null===e||void 0===e||null===(s=e.find((e=>e.category===t)))||void 0===s||null===(i=s.infos)||void 0===i?void 0:i.map((e=>({name:e.displayname,value:e.name,isNew:n.includes(e.displayname)}))))||[]},ps=[r.AC.ONE_DAY,r.AC.SEVEN_DAYS,r.AC.THIRTY_DAYS].map((e=>({...r.oH[e],value:e})));var ms={inject:["hostType"],components:{SliderGpu:os}
1,props:{disabled:{type:Boolean,default:!1}},data(){return{loading:!1,hasError:!1,sliderTypes:ls,gpuNumRange:null,gpuRamRange:null,gpuPriceRange:null,inferenceModels:[],computeModels:[],renderModels:[],chineseModels:[],rawFilters:cs(),domains:[],sliders:[{title:"GPUæ¾å(GB)",range:[],value:[],coefficient:1024,name:"gpu_ram_mb"},{title:"GPUæ°",range:[],value:[],coefficient:1,name:"gpu_cores"},{title:"GPUä»·æ ¼(å
)",range:[],value:[],coefficient:2e5,name:"price_millicent"}],payTypes:ps,featureOptions:[{iconName:"host-windows-dark",iconNameActive:"host-windows-active",tip:"æ¯æWindows Server",value:2048},{iconName:"host-network-dark",iconNameActive:"host-network-active",tip:"æ¯æåå¸å¼é群",value:512},{iconName:"host-virtual-dark",iconNameActive:"host-virtual-active",tip:"æ¯æDocker",value:1024}]}},computed:{...(0,p.rn)(["chineseDomains"]),isGPU(){return this.hostType===x.U7}},watch:{domains(){this.getRange()},"$route.query.domestic":function(e){"1"===e?(this.rawFilters=cs(),this.rawFilters.chineseModels=this.chineseModels.map((e=>e.value)),this.triggerChange()):(this.rawFilters=cs(),this.triggerChange())}},methods:{async init(){this.isGPU&&(this.loading=!0,await this.getRange(),this.loading=!1)},async getRange(){const e=await a.Z.getMachineRange({domains:0===this.domains.length?this.chineseDomains.map((e=>e.value)):this.domains},{noErrMsg:!0});if(0===e.code&&e.hardwareRange){const{gpuCores:t,gpuRamMB:s,priceMillicent:i,modelInfos:n}=e.hardwareRange;us(this.sliders[0],s),us(this.sliders[1],t),us(this.sliders[2],i),this.resetFilters(),this.inferenceModels=hs(n,1),this.computeModels=hs(n,2),this.renderModels=hs(n,3),this.chineseModels=hs(n,4),"1"===this.$route.query.domestic&&(this.rawFilters.chineseModels=this.chineseModels.map((e=>e.value)),this.triggerChange())}else this.hasError=!0},handleReloadClick(){this.hasError=!1,this.init()},triggerChange(){const e=[],{avail:t,features:s,chineseModels:i,inferenceModels:n,computeModels:a,renderModels:r,payModels:o}=this.rawFilters,l=[...n,...a,...r,...i];this.sliders.forEach((t=>{e.push(...ds(t))})),l&&l.length&&e.push({name:"model",value:l.join(","),op:"eq"});const c=s.reduce(((e,t)=>e+t),0);this.$emit("change",{filters:e,avail:t,payTypes:o,tags:c,domains:this.domains})},resetFilters(){this.rawFilters=cs(),this.sliders.forEach((e=>{e.value=[...e.range]}))},clearFilter(){this.domains=[],this.resetFilters(),this.triggerChange()},getFeatureIconName(e){return this.rawFilters.features.includes(e.value)?e.iconNameActive:e.iconName}},created(){this.handleFilterChange=pt().debounce(this.triggerChange,500),this.init()}},fs=ms,vs=(0,v.Z)(fs,ut,dt,!1,null,null,null),gs=vs.exports,bs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"mp-flex-justify market-sortbar",class:{disabled:e.disabled}},[s("div",{staticClass:"mp-text-normal left"},[s("label",{attrs:{for:""}},[s("mp-icon",{staticClass:"filter-icon",attrs:{name:"filter"}}),e._v("æåº")],1),e._l(e.sortTypes,(function(t){return s("span",{key:t.value,staticClass:"sort-item",class:{arrow:!t.noArrow,active:e.sort.by===t.value,desc:e.sort.by===t.value&&e.sort.isDescending},on:{click:function(s){return e.handleSortChange(t.value)}}},[e._v(" "+e._s(t.label)+" ")])}))],2),s("div",{staticClass:"mp-flex"},[e._l(e.modeTypes,(function(t,i){return[s("mp-icon",{key:t,staticClass:"mode-icon",class:{active:e.mode===t},attrs:{name:t+"-mode"},nativeOn:{click:function(s){return e.handleModeClick(t)}}}),i<e.modeTypes.length-1?s("div",{key:i,staticClass:"split"}):e._e()]}))],2)])},Cs=[];const ys="default",ks="price_millicent",xs="list",_s="grid",Zs=!0,ws=[{label:"综å",value:ys,noArrow:!0},{label:"ä»·æ ¼",value:ks}];var Ss={props:{mode:{type:String,default:_s,validator:function(e){return-1!==[_s,xs].indexOf(e)}},disabled:{type:Boolean,default:!1}},data(){return{sort:{by:ys,isDescending:Zs}}},methods:{handleSortChange(e){if(this.disabled||e===ys&&e===this.sort.by)return;this.sort.by===e?this.sort.isDescending=!this.sort.isDescending:this.sort={by:e,isDescending:Zs};let t=null;this.sort.by!==ys&&(t=[{name:this.sort.by,desc:this.sort.isDescending}]),this.$emit("sortChange",t)},handleModeClick(e){this.disabled||(this.$emit("update:mode",e),this.$emit("modeChange",e))}},created(){this.sortTypes=ws,this.modeTypes=[xs,_s]}},Ts=Ss,Ps=(0,v.Z)(Ts,bs,Cs,!1,null,null,null),Ms=Ps.exports,$s={inject:["hostType","hostKey"],components:{Affix:h.Aff
1ix,SidebarFilter:gs,SortBar:Ms,DefaultMap:C,HostCard:J,HostList:ce,OrderDetail:ct},mixins:[o.Z],data(){return{loading:!0,condition:{filters:null,sorts:null},tags:0,payTypes:[],domains:[],pagination:{page:1,perPage:12,total:0},dataSource:[],fetchSource:null,mode:_s,detailVisible:!1,selectedHost:null}},computed:{...(0,p.rn)(["channel","chineseDomains"]),...(0,p.Se)(["hasUserInfo"])},methods:{async fetchData(e){this.fetchSource&&this.fetchSource.cancel("å³å°åèµ·æ°çè¯·æ± ");const t={page:this.pagination.page,per_page:this.pagination.perPage,condition:btoa(JSON.stringify(this.condition)),tags:this.tags,payment_types:this.payTypes,channel:this.channel,machine_category:this.hostType,domains:0===this.domains.length?this.chineseDomains.map((e=>e.value)):this.domains};this.fetchSource=d().CancelToken.source(),null!==e&&void 0!==e&&e.ws||(this.loading=!0);const s=await a.Z.getMachines(t,{errMsg:"è·å主æºå表失败ï¼è¯·éè¯ãå¦é®é¢ä¾æ§åå¨ï¼è¯·è系客æã",cancelToken:this.fetchSource.token});this.fetchSource=null,-5!==s.code&&(this.loading=!1),0===s.code&&(this.dataSource=(s.machines||[]).map((e=>{var t;const{unit:s}=e,{total:i,max:n,available:a}=e[this.hostKey],r=Math.floor(i/s.total),o=l.q.fromID(e.domain);return n||(e[this.hostKey].max=a),{...e,attributes:(null===(t=e.hardware)||void 0===t?void 0:t.attributes)||{},unitStep:r,domain:o}})),this.dataSource.sort(((e,t)=>{const s=(0,c.c9)(e),i=(0,c.pT)(e,r.AC.BILL_ON_TIME,""),n=e.unit.available>0,a=e.isProprietary,o=(0,c.c9)(t),l=(0,c.pT)(t,r.AC.BILL_ON_TIME,""),u=t.unit.available>0,d=t.isProprietary;return!a&&!d&&n&&u&&s===o&&i.currentPrice.value===l.currentPrice.value?Math.random()-.5:0})),this.pagination.total=s.pagination.total,this.pagination.page=s.pagination.page,null!==e&&void 0!==e&&e.scroll&&this.$nextTick((()=>{this.$refs.market&&this.$refs.market.scrollIntoView()})),null!==e&&void 0!==e&&e.ws&&this.updateSelectedHost())},handleFilterChange(e){this.$emit("availChange",e.avail),this.payTypes=e.payTypes,this.tags=e.tags,this.domains=e.domains,this.onConditionChange({filters:e.filters},!0)},handleDomainsChange(e){this.domains=e,this.pagination.page=1,this.fetchData({scroll:!0})},handleSortChange(e){this.onConditionChange({sorts:e})},onConditionChange(e,t){Object.assign(this.condition,e),this.pagination.page=1,this.fetchData({scroll:t})},handlePaginationChange(){this.fetchData({scroll:!0})},handleRentClick(e){this.hasUserInfo?e&&(this.selectedHost=e,this.detailVisible=!0):this.$router.push(`/login?redirect=${this.$route.path}`)},updateSelectedHost(){if(!this.selectedHost)return;const e=this.dataSource.find((e=>e.agentId===this.selectedHost.agentId));e?this.selectedHost=e:this.$set(this.selectedHost,"isPreempt",!0)},onApplyCluster(){}},created(){this.gridMode=_s,this.$_wsType=2,this.fetchData()}},Ns=$s,Rs=(0,v.Z)(Ns,i,n,!1,null,null,null),Vs=Rs.exports},45862:function(e,t,s){s.d(t,{Z:function(){return y}});var i=s(3933),n=s.n(i),a=s(88106),r=s(38072),o=s(62746),l=s(43240),c=s(97435),u=s(41202),d=s(82859),h=s(70804),p=s(32050),m=s(78646),f=["pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"],v=new RegExp("^("+f.join("|")+")(-inverse)?$"),g={name:"ATag",mixins:[h.Z],model:{prop:"visible",event:"close.visible"},props:{prefixCls:r.Z.string,color:r.Z.string,closable:r.Z.bool.def(!1),visible:r.Z.bool,afterClose:r.Z.func},inject:{configProvider:{default:function(){return p.W}}},data:function(){var e=!0,t=(0,d.oZ)(this);return"visible"in t&&(e=this.visible),(0,m.Z)(!("afterClose"in t),"Tag","'afterClose' will be deprecated, please use 'close' event, we will remove this in the next version."),{_visible:e}},watch:{visible:function(e){this.setState({_visible:e})}},methods:{setVisible:function(e,t){this.$emit("close",t),this.$emit("close.visible",!1);var s=this.afterClose;s&&s(),t.defaultPrevented||(0,d.m2)(this,"visible")||this.setState({_visible:e})},handleIconClick:function(e){e.stopPropagation(),this.setVisible(!1,e)},isPresetColor:function(){var e=this.$props.color;return!!e&&v.test(e)},getTagStyle:function(){var e=this.$props.color,t=this.isPresetColor();return{backgroundColor:e&&!t?e:void 0}},getTagClassName:function(e){var t,s=this.$props.color,i=this.isPresetColor();return t={},(0,a.Z)(t,e,!0),(0,a.Z)(t,e+"-"+s,i),(0,a.Z)(t,e+"-has-color",s&&!i),t},renderCloseIcon:function(){var e=this.$createElement,t=this.$props.closable;return t?e(o.Z,{attrs:{type:"close"},on:{click:this.handleIconClick}}):null}},render:function(){var e=arguments[0],t=this.$props.prefixCls,s=this.configProvider.getPrefixCls,i=s("tag",t),a=this.$data._visible,r=e("span",n()([{directives:[{name:"show",value:a}]},{on:(0,c.Z)((0,d.CL)(this),["close"])},{class:this.getTagClassName(i),style:this.getTagStyle()}]),[this.$slots["default"],this.renderCloseIcon()]),o=(0,l.Z)(i+"-zoom",{appear:!1});return e(u.Z,[e("transition",o,[r])])}},b={name:"ACheckableTag",model:{prop:"checked"},props:{prefixCls:r.Z.string,checked:Boolean},inject:{configProvider:{default:function(){return p.W}}},computed:{classes:function(){var e,t=this.checked,s=this.prefixCls,i=this.configProvider.getPrefixCls,n=i("tag",s);return e={},(0,a.Z)(e,""+n,!0),(0,a.Z)(e,n+"-checkable",!0),(0,a.Z)(e,n+"-checkable-checked",t),e}},methods:{handleClick:function(){var e=this.checked;this.$emit("input",!e),this.$emit("change",!e)}},render:function(){var e=arguments[0],t=this.classes,s=this.handleClick,i=this.$slots;return e("div",{class:t,on:{click:s}},[i["default"]])}},C=s(6192);g.CheckableTag=b,g.install=function(e){e.use(C.Z),e.component(g.name,g),e.component(g.CheckableTag.name,g.CheckableTag)};var y=g},49365:function(e,t,s){s(52506)}}]); 2//# sourceMappingURL=574.e3cdce4d.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.