1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6bb248e3-dd83-45a9-ba3c-37305da9b514",e._sentryDebugIdIdentifier="sentry-dbid-6bb248e3-dd83-45a9-ba3c-37305da9b514")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6317],{7880:(e,t,r)=>{r.d(t,{A:()=>a});var l=r(53074);let a=l.forwardRef(function(e,t){let{title:r,titleId:a,...o}=e;return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},o),r?l.createElement("title",{id:a},r):null,l.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))})},8065:(e,t,r)=>{r.d(t,{U:()=>o});var l=r(19713),a=r(14500);async function o(e){try{let t,r;try{t=await (0,l.A)(e)}catch(t){return{error:"SERVICE_FETCH_ERROR",message:"Unable to fetch service details for ".concat(e)}}if(null==t)return{error:"SERVICE_NOT_FOUND",message:"Service not found for key ".concat(e)};try{r=(0,a.A)(t)}catch(t){return{error:"SERVICE_DETAILS_PROCESSING_ERROR",message:"Unable to process service details for ".concat(e)}}return{serviceKey:e,...r}}catch(t){return{error:"UNKNOWN_ERROR",message:"An unexpected error occurred while fetching service details for ".concat(e)}}}},14500:(e,t,r)=>{r.d(t,{A:()=>s,r:()=>n});let l=function(e){try{let t=e.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/);if(!t)throw Error("Unable to extract domain from URL");return t[1]}catch(e){throw Error("Invalid URL provided: ".concat(e.message))}};var a=r(75020),o=r(87880);function n(e){var t,r,n,s,i,c,d,u,h,m,v;let f,y,p,g,x,b,w,S=[];try{let l=function(e){var t,r;let l=null!=(r=null==e||null==(t=e.schemes)?void 0:t[0])?r:"https",o=null==e?void 0:e.host,n=null==e?void 0:e.basePath;if(null!=o&&null!=n)return(0,a._)("".concat(l,"://").concat(o),n)}(e);f=(null==e||null==(r=e.servers)||null==(t=r[0])?void 0:t.url)||l||""}catch(e){S.push("Error in serviceUrlRootFromService: ".concat(e)),f=void 0}try{(y=null==e||null==(s=e.info)||null==(n=s["x-logo"])?void 0:n.url)&&!((v=y)&&/^(https?:\/\/)?([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?$/.test(v)&&!/:\d+/.test(v)&&!/^\/[\w- .\/?%&=]*$/.test(v))&&(S.push("Invalid logo URL"),y=void 0)}catch(e){S.push("Error processing x-logo URL: ".concat(e)),y=void 0}if(!y)try{y=function(e){if(null==e)return;let t=function(e){let t=e.split("."),r=t[t.length-1],l=t[t.length-2];return(t.slice(0,t.length-2).join("."),"googleapis.com"==="".concat(l,".").concat(r))?"google.com":e}(l(e));return"https://logo.clearbit.com/".concat(t,"?size=256")}(f)}catch(e){S.push("Error generating logo URL from root: ".concat(e)),y=void 0}f&&(f.includes("flowstack.wtf")||f.includes("localhost:"))&&(y="/flowstacknogrid.png");try{p=null!=(c=null==e||null==(i=e.info)?void 0:i.title)?c:void 0}catch(e){S.push("Error extracting service name: ".concat(e)),p=void 0}try{g=null!=(u=null==e||null==(d=e.info)?void 0:d.description)?u:void 0}catch(e){S.push("Error extracting service description: ".concat(e)),g=void 0}(void 0===p||void 0===g)&&S.push("Service details are missing required fields");try{x=Object.values(e.paths||{}).reduce((e,t)=>e+Object.keys(t).filter(e=>["get","post","put","delete","patch","options","head"].includes(e.toLowerCase())).length,0)}catch(e){S.push("Error counting endpoints: ".concat(e)),x=void 0}try{let t=function(e){var t,r,l,a,n,s,i,c,d,u,h;let m=(null==e||null==(t=e.components)?void 0:t.securitySchemes)||(null==e?void 0:e.securitySchemes),v=(null==e||null==(r=e.security)?void 0:r.map(e=>Object.keys(e)[0]))||Object.keys(m||{});if(v)for(let e of v){let t=null==m?void 0:m[e];if(t)switch(t.type){case"oauth":{let e={consumerKey:"",consumerSecret:"",authorizationUrl:(null==(a=t.flows)||null==(l=a.authorizationCode)?void 0:l.authorizationUrl)||"",accessTokenUrl:(null==(s=t.flows)||null==(n=s.authorizationCode)?void 0:n.tokenUrl)||"",callbackUrl:"",requestTokenUrl:(null==(c=t.flows)||null==(i=c.authorizationCode)?void 0:i.requestTokenUrl)||""};return{authType:o.h.OAuth1,authSchema:{config:e}}}case"oauth2":{let e=(null==(d=t.flows)?void 0:d.authorizationCode)||(null==(u=t.flows)?void 0:u.implicit);return{authType:o.h.OAuth2,authSchema:{config:{clientId:"",clientSecret:"",authorizationUrl:(null==e?void 0:e.authorizationUrl)||"",tokenUrl:(null==e?void 0:e.tokenUrl)||"",redirectUri:"",scopes:Object.keys((null==e?void 0:e.scopes)||{}),responseType:(null==e?void 0:e.responseType)||((null==(h=t.flows)?void 0:h.implicit)?"token":"code")}}}}case"http":if("basic"===t.scheme)return{authType:o.h.BasicAuth,authSchema:{username:"",password:""}};if("bearer"===t.scheme)return{authType:o.h.ApiKey,authSchema:{apiKey:"",headerName:"Authorization",headerPrefix:"Bearer ",in:"header"}};break;case"apiKey":return{authType:o.h.ApiKey,authSchema:{apiKey:"",headerName:t.name,headerPrefix:"header"===t.in?"Bearer ":"",in:t.in}}}}}(e);b=null!=(h=null==t?void 0:t.authType)?h:void 0,w=null!=(m=null==t?void 0:t.authSchema)?m:void 0}catch(e){S.push("Error extracting auth details: ".concat(e)),b=void 0,w=void 0}return{name:p,description:g,serviceUrlRoot:f,serviceLogoUrl:y,endpointCount:x,authType:b,authSchema:w,metadata:{errors:S.length>0?S:void 0}}}let s=n},19713:(e,t,r)=>{r.d(t,{A:()=>n,c:()=>o});var l=r(77756),a=r(76233);async function o(e){try{let t="".concat(a.Jl).concat(e,".json");return await l.Rt.readJsonFile({Key:t})}catch(e){return null}}let n=o},41673:(e,t,r)=>{r.d(t,{_:()=>c});var l=r(85256),a=r.n(l),o=r(563),n=r.n(o),s=r(77756);let i=r(76233).Jl;async function c(){try{let e=((await s.Rt.listObjects({Prefix:i})).Contents||[]).map(e=>e.Key).filter(e=>!!e&&e.endsWith(".json")).map(e=>{let t=e.split("/");return t[t.length-1].replace(/\.json$/,"")}).filter(e=>".file_placeholder"!==e);return n()(e,a(),"asc")}catch(e){return[]}}},96317:(e,t,r)=>{r.r(t),r.d(t,{default:()=>v});var l=r(52058),a=r(53074),o=r(7880),n=r(95023),s=r(41673),i=r(8065),c=r(50400),d=r(8788
10),u=r(59876),h=r(17342);let m=e=>{let{label:t,type:r,value:a,onChange:o,required:s=!1,options:i=[],disabled:c=!1,onClear:d}=e;return(0,l.jsxs)("div",{className:"mb-4","data-sentry-component":"FormField","data-sentry-source-file":"AddServiceModal.tsx",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-black",children:t}),(0,l.jsxs)("div",{className:"flex items-center",children:["select"===r?(0,l.jsx)(n.Ay,{value:i.find(e=>e.value===a),onChange:e=>o((null==e?void 0:e.value)||""),options:i,className:"mt-1 text-black flex-grow",classNamePrefix:"react-select",required:s,isClearable:!0,isSearchable:!0,isDisabled:c}):"color"===r?(0,l.jsxs)("div",{className:"flex items-center mt-1",children:[(0,l.jsx)("input",{type:r,value:a,onChange:e=>o(e.target.value),className:"w-8 h-8 rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50",required:s,disabled:c}),(0,l.jsx)("span",{className:"ml-2 text-sm text-gray-600",children:a||"Not set"})]}):(0,l.jsx)("input",{type:r,value:a,onChange:e=>o(e.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 text-black",required:s,disabled:c}),d&&(0,l.jsx)("button",{type:"button",onClick:d,className:"ml-2 px-2 py-1 text-sm text-gray-600 hover:text-gray-800",children:"Clear"})]})]})},v=e=>{let{userAddress:t,onClose:r,onAddService:v,isLoading:f,setIsLoading:y}=e,{services:p}=(0,u.y)(t),[g,x]=(0,a.useState)([]),[b,w]=(0,a.useState)(null),[S,j]=(0,a.useState)(""),[N,k]=(0,a.useState)(""),[A,C]=(0,a.useState)(""),[E,U]=(0,a.useState)(""),[R,_]=(0,a.useState)(""),[T,F]=(0,a.useState)(),[O,L]=(0,a.useState)();(0,a.useEffect)(()=>{let e=async()=>{try{let e=await (0,s._)();if(e&&Array.isArray(e)){let t=e.filter(e=>!p[e]);x(t.map(e=>({value:e,label:e})))}}catch(e){}};t&&e()},[p,t]);let I=async e=>{if(w(e),e){let t=await (0,i.U)(e.value);if("error"in t)return void h.toast.error(t.message);j((null==t?void 0:t.name)||""),k((null==t?void 0:t.name)||""),C((null==t?void 0:t.serviceLogoUrl)||""),U(""),_(""),F(null==t?void 0:t.authType),L(null==t?void 0:t.authSchema)}else j(""),k(""),C(""),U(""),_(""),F(void 0),L(void 0)},M=async e=>{if(e.preventDefault(),!b)return;let t={id:Date.now().toString(),serviceKey:b.value,displayName:N,logoUrl:A,color:E,bgColor:R,authType:T,authSchema:O};await v(t),r()};return(0,l.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center","data-sentry-component":"AddServiceModal","data-sentry-source-file":"AddServiceModal.tsx",children:(0,l.jsxs)("div",{className:"bg-white rounded-lg p-8 max-w-md w-full",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,l.jsx)("h2",{className:"text-black text-2xl font-bold",children:"Add New Service"}),(0,l.jsx)("button",{onClick:r,className:"text-gray-500 hover:text-gray-700",children:(0,l.jsx)(o.A,{className:"h-6 w-6","data-sentry-element":"XMarkIcon","data-sentry-source-file":"AddServiceModal.tsx"})})]}),(0,l.jsxs)("form",{onSubmit:M,children:[(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-black",children:"Supported Services"}),(0,l.jsx)(n.Ay,{value:b,onChange:I,options:g,className:"mt-1",classNamePrefix:"react-select",required:!0,isClearable:!0,isSearchable:!0,"data-sentry-element":"Select","data-sentry-source-file":"AddServiceModal.tsx"})]}),(0,l.jsx)(m,{label:"Service Name",type:"text",value:S,onChange:j,required:!0,"data-sentry-element":"FormField","data-sentry-source-file":"AddServiceModal.tsx"}),(0,l.jsx)(m,{label:"Display Name",type:"text",value:N,onChange:k,required:!0,"data-sentry-element":"FormField","data-sentry-source-file":"AddServiceModal.tsx"}),(0,l.jsx)(m,{label:"Logo URL",type:"url",value:A,onChange:C,"data-sentry-element":"FormField","data-sentry-source-file":"AddServiceModal.tsx"}),A&&(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-black",children:"Logo Preview"}),(0,l.jsx)("img",{src:A,alt:"Logo Preview",className:"mt-1 max-w-full h-auto",style:{maxHeight:"100px"}})]}),(0,l.jsx)(m,{label:"Color",type:"color",value:E,onChange:U,onClear:()=>U(""),"data-sentry-element":"FormField","data-sentry-source-file":"AddServiceModal.tsx"}
1),(0,l.jsx)(m,{label:"Background Color",type:"color",value:R,onChange:_,onClear:()=>_(""),"data-sentry-element":"FormField","data-sentry-source-file":"AddServiceModal.tsx"}),(0,l.jsx)(m,{label:"Auth Type",type:"select",value:T||"",onChange:e=>F(e),options:Object.values(d.h).map(e=>({value:e,label:e})),"data-sentry-element":"FormField","data-sentry-source-file":"AddServiceModal.tsx"}),(0,l.jsx)("div",{className:"flex justify-end",children:(0,l.jsx)(c.$,{type:"submit",variant:"default","data-sentry-element":"Button","data-sentry-source-file":"AddServiceModal.tsx",children:"Add Service"})})]})]})})}}}]);
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.