1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8274],{26124:(e,t,s)=>{s.d(t,{A:()=>n});var l,a=s(20801);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var l in s)({}).hasOwnProperty.call(s,l)&&(e[l]=s[l])}return e}).apply(null,arguments)}let n=function(e){return a.createElement("svg",r({xmlns:"http://www.w3.org/2000/svg",width:6,height:10,fill:"none"},e),l||(l=a.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M.228 9.782a.72.72 0 0 1 0-1.053L4.122 5 .228 1.271a.72.72 0 0 1 0-1.053.8.8 0 0 1 1.1 0l4.444 4.255a.72.72 0 0 1 0 1.054L1.328 9.782a.8.8 0 0 1-1.1 0",clipRule:"evenodd"})))}},48274:(e,t,s)=>{s.r(t),s.d(t,{default:()=>O});var l,a,r,n,i=s(80069),d=s(44485),x=s.n(d),c=s(95702),m=s(85087),o=s(20801),p=s(66926),h=s(70140),u=s(28852);function f(){return(f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var l in s)({}).hasOwnProperty.call(s,l)&&(e[l]=s[l])}return e}).apply(null,arguments)}let v=function(e){return o.createElement("svg",f({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},e),l||(l=o.createElement("path",{fill:"#8D8E92",d:"M10.6 6A4.6 4.6 0 1 0 6 10.6V12A6 6 0 1 1 6 0a6 6 0 0 1 0 12v-1.4A4.6 4.6 0 0 0 10.6 6"})),a||(a=o.createElement("path",{fill:"#8D8E92",fillRule:"evenodd",d:"M6 3.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5m0 6A.75.75 0 0 1 5.25 9V5.25a.75.75 0 0 1 1.5 0V9a.75.75 0 0 1-.75.75",clipRule:"evenodd"})))};var j=s(22505);function g(){return(g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var l in s)({}).hasOwnProperty.call(s,l)&&(e[l]=s[l])}return e}).apply(null,arguments)}let b=function(e){return o.createElement("svg",g({xmlns:"http://www.w3.org/2000/svg",width:28,height:28,fill:"none"},e),r||(r=o.createElement("path",{fill:"#2EBD85",fillRule:"evenodd",d:"M13.997 1.168c-7.087 0-12.833 5.746-12.833 12.833 0 7.088 5.746 12.834 12.833 12.834 7.088 0 12.834-5.746 12.834-12.834S21.085 1.168 13.997 1.168",clipRule:"evenodd"})),n||(n=o.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M19.56 11.832a1.167 1.167 0 1 0-1.792-1.494l-5.016 6.018-2.596-2.596a1.167 1.167 0 0 0-1.65 1.65l3.5 3.5a1.167 1.167 0 0 0 1.721-.078z",clipRule:"evenodd"})))};var N=s(74649),w=s(26124),k=s(56006),_=s(76055),y=s(85784),C=s(42351),E=s(34733);let A=/[^\d.,]/g,S=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)$/;function O(){let{t:e}=(0,p.Bd)(),t=(0,c.useRouter)(),{showApikeyHintDialog:s}=(0,_.s)(),l=(0,y.OJ)(e=>{var t;return(null==(t=e.userConfig)?void 0:t.apiKeyMaxCount)||0}),[a,r]=(0,o.useState)(0),[n,d]=(0,o.useState)(!1),[f,g]=(0,o.useState)(""),[O,D]=(0,o.useState)(""),[K,R]=(0,o.useState)(""),[M,P]=(0,o.useState)(!1),[V,F]=(0,o.useState)(null),I=(0,o.useCallback)(()=>{(0,h.oP)().then(e=>{e&&r(e.length)})},[]);(0,o.useEffect)(()=>{(0,y.fG)(),I()},[I]);let[L]=(0,o.useState)(()=>{let e=sessionStorage.getItem(C.VX);if(e){let t=JSON.parse(e);return g(t.name),D(t.ipWhitelist),t}return null}),W=t=>{if(!t)return R(""),!0;let s=t.split(",").filter(e=>e.length>0);if(s.length>40)return R(e("api.ip_address_limit_error",{defaultValue:"Maximum 40 IP addresses allowed."})),!1;let l=s.every(e=>S.test(e));return R(l?"":e("api.ip_address_error",{defaultValue:"Please enter valid IP addresses."})),l},z=()=>{W(O)&&(d(!0),(0,h.Iq)({name:f,permissions:["read","trade"],ipWhitelist:O}).then(e=>{e&&(F(e),(0,y.fG)(),I())}).finally(()=>{d(!1)}))},B=()=>{W(O)&&L&&(d(!0),(0,h.XW)({id:L.id,name:f,permissions:["read","trade"],ipWhitelist:O}).then(()=>{P(!0)}).finally(()=>{d(!1)}))},G=()=>{t.push("/api")};return(0,i.jsx)("div",{className:"w-full flex justify-center h-[calc(100svh-122px)] md:h-[calc(100vh-112px)] overflow-y-scroll",children:(0,i.jsxs)("div",{className:"w-full md:w-[1316px] mt-4 md:mt-8 relative px-4 ",children:[(0,i.jsxs)("div",{className:"text-sm flex items-center gap-1.5",children:[(0,i.jsx)(x(),{href:{pathname:"/api"},children:(0,i.jsx)("span",{className:"text-text-light",children:e("api.key_manager")})}),(0,i.jsx)(w.A,{className:"text-text-light"}),(0,i.jsx)("span",{className:"text-text-dark",children:L?e("api.view_api_key"):e("api.create_key")})]}),V||M?(()=>{let t=M?null==L?void 0:L.apiKey:null==V?void 0:V.apiKey;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex items-center mt-3 md:mt-8",children:[(0,i.jsx)("div",{className:"flex-shrink-0",children:(0,i.jsx)(b,{})}),(0,i.jsx)("span",{className:"text-[24px] md:text-[32px] font-semibold text-text-dark ml-2.5",children:M?e("api.update_success"):e("api.create_success")})]}),(0,i.jsx)("div",{className:"border-t border-panel-border-color w-full mt-3 md:mt-8"}),(0,i.jsxs)("div",{className:"flex flex-col mt-8",children:[(0,i.jsx)("span",{className:"text-text-dark text-sm",children:e("api.create_success_hint")}),(0,i.jsx)("span",{className:"text-[#E43C5A] text-sm",children:e("api.create_success_hint1")})]}),(0,i.jsxs)("div",{className:"flex flex-col mt-8",children:[(0,i.jsx)("span",{className:"text-text-light text-sm",children:"Key"}),(0,i.jsxs)("div",{className:"flex items-center gap-1.5 mt-4",children:[(0,i.jsx)("span",{className:"text-text-dark text-sm font-medium",children:t}),(0,i.jsx)(N.A,{className:"cursor-pointer text-text-light",onClick:()=>(0,E.Dk)(t||"")})]})]}),!M&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex flex-col mt-8",children:[(0,i.jsx)("span",{className:"text-text-light text-sm",children:"Secret"}),(0,i.jsxs)("div",{className:"flex items-center gap-1.5 mt-4 w-full break-all",children:[(0,i.jsx)("span",{className:"text-text-dark text-sm font-medium",children:null==V?void 0:V.apiSecret}),(0,i.jsx)(N.A,{className:"cursor-pointer text-text-light shrink-0",onClick:()=>(0,E.Dk)((null==V?void 0:V.apiSecret)||"")})]})]}),(0,i.jsxs)("div",{className:"flex items-center mt-4 h-12 bg-[#EA941D0F] border border-[#
1EA941D]/20 rounded-[12px] px-4",children:[(0,i.jsx)("div",{className:"flex-shrink-0",children:(0,i.jsx)(u.A,{})}),(0,i.jsx)("span",{className:"text-[#EA941D] text-sm ml-1.5",children:e("api.create_success_hint2")})]})]}),(0,i.jsxs)("div",{className:"flex flex-col mt-8",children:[(0,i.jsx)("span",{className:"text-text-light text-sm",children:e("api.remark_name")}),(0,i.jsx)("span",{className:"text-text-dark text-sm font-medium mt-4",children:f})]}),(0,i.jsx)("div",{className:"flex w-full mt-8 mb-4 md:mb-0 pb-4",children:(0,i.jsx)("div",{className:"flex w-full md:w-auto md:min-w-[156px] items-center justify-center h-10 px-4 bg-text-dark text-order-setting-text text-base font-medium rounded-[8px] cursor-pointer",onClick:G,children:e("api.back_list")})})]})})():(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"text-text-dark text-[24px] md:text-[32px] mt-3 md:mt-8 font-semibold flex items-center",children:[L?e("api.view_api_key"):e("api.create_key"),(0,i.jsx)(v,{className:"ml-1.5 md:hidden",onClick:s})]}),(0,i.jsx)("div",{className:"border-t border-panel-border-color w-full mt-3 md:mt-8"}),(0,i.jsxs)("div",{className:"flex gap-10 mt-8",children:[(0,i.jsxs)("div",{className:"flex flex-col flex-1",children:[L&&(0,i.jsxs)("div",{className:" flex flex-col mb-8",children:[(0,i.jsx)("span",{className:"text-sm font-medium text-text-dark",children:"Key"}),(0,i.jsxs)("div",{className:"flex w-full h-10 mt-4 border border-panel-border-color bg-data-table-frozen-start rounded-[8px] items-center px-4",children:[(0,i.jsx)("span",{className:"text-text-light text-sm font-medium",children:(0,E.oF)(L.apiKey)}),(0,i.jsx)(N.A,{className:"cursor-pointer ml-auto text-text-light",onClick:()=>(0,E.Dk)(L.apiKey)})]})]}),(0,i.jsxs)("div",{className:" flex flex-col",children:[(0,i.jsx)("span",{className:"text-sm font-medium text-text-dark",children:e("api.api_key_remark")}),(0,i.jsx)("div",{className:"flex w-full mt-4 border border-panel-border-color rounded-[8px] items-center px-4 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,i.jsx)(k.A,{value:f,maxLength:30,placeholder:e("api.api_key_remark_hint"),inputClass:"flex-1 w-full h-9.5 min-w-0 text-sm text-text-dark transfer pr-2 placeholder:!text-text-light placeholder:!text-sm",countClass:"text-sm text-text-light",onChange:g})})]}),(0,i.jsxs)("div",{className:"mt-8 flex flex-col",children:[(0,i.jsx)("span",{className:"text-sm font-medium text-text-dark",children:e("api.ip_address")}),(0,i.jsx)("div",{className:"w-full flex flex-row items-center gap-1 mt-4 text-sm relative border input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border rounded-lg ".concat(K?"border-[#E43C5A]":"border-panel-border-color"),children:(0,i.jsx)("textarea",{className:"w-full h-50 resize-none p-4 text-sm text-text-dark placeholder:!text-text-light placeholder:!text-sm",value:O,placeholder:e("api.ip_address_hint"),"aria-invalid":!!K,onChange:e=>(e=>{let t=e.replace(A,"");D(t),K&&W(t)})(e.target.value),onBlur:()=>W(O)})}),K?(0,i.jsx)("span",{className:"mt-2 text-xs text-[#E43C5A]",children:K}):null]}),(0,i.jsx)("div",{className:"mt-8 text-sm text-text-dark",children:(0,i.jsx)(p.x6,{i18nKey:"api.api_key_num",values:{num:Math.max(0,l-a)},components:{red:(0,i.jsx)("span",{className:"text-[#E43C5A]"})}})}),(0,i.jsxs)("div",{className:"flex mt-8 mb-4 ".concat(L?"gap-2.5":""),children:[(0,i.jsx)("div",{className:"flex-1 md:flex-none md:w-[96px] h-10 flex items-center justify-center bg-withdraw-button-color text-text-dark text-base font-medium rounded-[10px] cursor-pointer ".concat(L?"visible":"hidden"),onClick:G,children:e("trade.cancel")}),(0,i.jsxs)("div",{className:"relative ".concat(L?"flex-1 md:flex-none md:w-[96px]":"w-full md:w-[156px]"),children:[(0,i.jsx)(m.$,{className:"w-full h-10 !bg-text-dark !border-none !text-order-setting-text !text-base !py-1.75 !rounded-[8px]",rounded:!0,onClick:()=>{L?B():z()},label:e("api.submit"),disabled:n||0===f.length||!!K}),n?(0,i.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-5 top-[50%] -translate-y-1/2",src:j,alt:""}):null]})]})]}),(0,i.jsxs)("div",{className:"hidden md:flex flex-col w-[388px] h-fit border border-panel-border-color roun
1ded-[12px] px-6 pt-6 pb-13",children:[(0,i.jsx)("span",{className:"text-[20px] font-medium text-text-dark",children:e("api.reminder")}),(0,i.jsx)("div",{className:"text-sm font-medium text-text-dark mt-5",children:(0,i.jsx)(p.x6,{i18nKey:"api.hint_content",components:{white:(0,i.jsx)("span",{className:"text-main-color cursor-pointer",onClick:E.LH})}})}),(0,i.jsxs)("div",{className:"flex mt-3 gap-2 text-sm text-text-light",children:[(0,i.jsx)("span",{children:"1."}),(0,i.jsx)("span",{children:e("api.hint_des1",{num:null!=l?l:0})})]}),(0,i.jsxs)("div",{className:"flex mt-3 gap-2 text-sm text-text-light",children:[(0,i.jsx)("span",{children:"2."}),(0,i.jsx)("span",{children:e("api.hint_des2")})]}),(0,i.jsxs)("div",{className:"flex mt-3 gap-2 text-sm text-text-light",children:[(0,i.jsx)("span",{children:"3."}),(0,i.jsx)("span",{children:e("api.hint_des3")})]})]})]})]})]})})}}}]);
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.