PageSourceSearch

https://app.tyra.ai/_next/static/chunks/pages/settings/catalogs-58d317db85005124.js

js tyra.ai collected 2026-10-05 14:32:12 UTC 11,401 bytes, 1 lines download raw bytes

1!function(){try{var 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]="dc000d52-695e-40bd-af7a-b16386205a2e",e._sentryDebugIdIdentifier="sentry-dbid-dc000d52-695e-40bd-af7a-b16386205a2e")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8947],{81239:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/catalogs",function(){return n(91242)}])},11120:function(e,t,n){"use strict";var a=n(85893),r=n(67294),s=n(73935);t.Z=e=>{let{options:t,render:n,...l}=e,i=(0,r.useRef)(null),o=(0,r.useRef)(null),[d,c]=(0,r.useState)(!1),[u,x]=(0,r.useState)({top:0,left:0}),p=(0,r.useCallback)(()=>{c(!1)},[]);(0,r.useEffect)(()=>{if(!d)return;let e=e=>{o.current&&!o.current.contains(e.target)&&i.current&&!i.current.contains(e.target)&&p()},t=e=>{"Escape"===e.key&&p()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[d,p]);let h=n||(e=>(0,a.jsx)("button",{...e,className:"p-1.5 rounded-lg text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 transition-colors cursor-pointer",title:"More options",children:(0,a.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})})}));return(0,a.jsxs)(a.Fragment,{children:[h({ref:i,onClick:()=>{if(i.current){let e=i.current.getBoundingClientRect();x({top:e.bottom+4,left:e.right})}c(!0)}}),d&&(0,s.createPortal)((0,a.jsx)("div",{ref:o,className:"fixed z-50 w-48 rounded-lg border border-neutral-200 bg-white shadow-lg py-1 animate-in fade-in duration-100",style:{to
1p:u.top,left:u.left,transform:"translateX(-100%)"},children:t.map((e,t)=>(0,a.jsxs)("button",{onClick:()=>{e.onClickHandler(),p()},className:"flex items-center gap-2.5 w-full px-3 py-2 text-sm text-left text-neutral-700 hover:bg-neutral-50 transition-colors cursor-pointer",style:e.color?{color:e.color}:void 0,children:[e.icon&&(0,a.jsx)("span",{className:"flex-shrink-0 h-4 w-4",style:e.color?{color:e.color}:void 0,children:e.icon}),e.label]},"item"+t))}),document.body)]})}},52639:function(e,t,n){"use strict";var a=n(85893),r=n(35129),s=n(30381),l=n.n(s);t.Z=e=>{let{datetime:t}=e,n=new(l())(t);return n.isValid()?(0,a.jsx)(r.Z,{date:n.valueOf(),locale:"en-US"}):(0,a.jsx)(a.Fragment,{})}},36823:function(e,t,n){"use strict";n.d(t,{a:function(){return s}});var a=n(67294),r=n(2716);let s=()=>{(0,a.useEffect)(()=>{r.w.push({event:"page_view"})},[])}},12246:function(e,t,n){"use strict";var a=n(67294);t.Z=e=>{let[t,n]=(0,a.useState)(e),r=(0,a.useCallback)(e=>{n(t=>({...t,filters:e}))},[]);return{handleFiltersChange:r,handleSortChange:(0,a.useCallback)(e=>{n(t=>({...t,sortBy:e.sortBy,sortDir:e.sortDir}))},[]),handlePageChange:(0,a.useCallback)(e=>{n(t=>({...t,page:e}))},[]),handlePerPageChange:(0,a.useCallback)(e=>{n(t=>({...t,page:1,perPage:parseInt(e.target.value,10)}))},[]),state:t}}},17687:function(e,t,n){"use strict";n.d(t,{n:function(){return s}});var a=n(82729);function r(){let e=(0,a._)(["\n    query($pagination: PaginationInput) {\n        catalogs(pagination: $pagination) {\n            nodes {\n                __typename\n                id\n                description\n                createdAt\n                updatedAt\n            }\n            pageInfo {\n                count\n                currentPage\n                firstItem\n                hasMorePages\n                lastPage\n                perPage\n            }\n        }\n    }\n"]);return r=function(){return e},e}let s=(0,n(75063).Ps)(r())},91242:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return H}});var a=n(85893),r=n(67294),s=n(66308),l=n(36823),i=n(85169),o=n(6388),d=n(50319),c=n(27361),u=n.n(c),x=n(45697),p=n.n(x),h=n(11120),m=n(52639);let g=e=>{let{items:t=[],onDeleteHandler:n=()=>{},onEditHandler:r=()=>{},loading:s}=e;return s?(0,a.jsx)("div",{className:"flex justify-center py-8",children:(0,a.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-neutral-300 border-t-neutral-900"})}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"min-w-full divide-y divide-neutral-200",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-neutral-200",children:[(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-neutral-500",style:{width:"70%"},children:"Name"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-neutral-500",children:"Created"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right text-xs font-medium text-neutral-500"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-neutral-200",children:t.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-neutral-50",children:[(0,a.jsx)("td",{className:"px-6 py-3 text-sm text-neutral-900",children:e.description}),(0,a.jsx)("td",{className:"px-6 py-3 text-xs text-neutral-500",children:(0,a.jsx)(m.Z,{datetime:e.createdAt})}),(0,a.jsx)("td",{className:"px-6 py-3 text-sm text-right",children:(0,a.jsx)(h.Z,{options:[{label:"Rename",onClickHandler:r.bind(void 0,e)},{label:"Delete",onClickHandler:n.bind(void 0,e)}]},"actionMenu")})]},e.id))})]})})};g.propTypes={items:p().array};var f=n(82729),b=n(75063);function v(){let e=(0,f._)(["\n    mutation deleteCatalog($input: DeleteCatalogInput!) {\n      deleteCatalog(input: $input) {\n        success\n      }\n    }\n"]);return v=function(){return e},e}let y=(0,b.Ps)(v());var j=n(24663),w=n(20512),N=n(16310),C=n(86501),P=n(89542),k=n(12847),_=e=>{let{item:t,onSubmitHandler:n,onCancel:r,...s}=e,l=(0,w.TA)({initialValues:{description:null===u()(t,"description",null)?"":u()(t,"description","")},validationSchema:N.Ry({description:N.Z_().nullable()}),onSubmit:async(e,t)=>{try{await n(e),t.setStatus({success:!0}),C.ZP.success("Catalog updated")}catch(e){C.ZP.error("Something went wrong!"),t.setStatus({success:!1}),t.setErrors({submit:e.message})}finally{t.setSubmitting(!1)}}});return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"flex-grow py-4 px-6",children:(0,a.jsx)("div",{className:"max-w-md mx-auto",children:(0,a.jsx)("div",{className:"space-y-8",children:(0,a.jsxs)("form",{onSubmit:l.handleSubmit,...s,children:[(0,a.jsx)(P.I,{error:!!(l.touched.description&&l.errors.description),helperText:l.touched.description&&l.errors.description,label:"Description",name:"description",onBlur:l.handleBlur,onChange:l.handleChange,value:l.values.description}),(0,a.jsx)("div",{className:"flex flex-col sm:flex-row flex-wrap gap-3 mt-6",children:(0,a.jsx)(k.z,{disabled:l.isSubmitting,type:"submit",children:"Save"})})]})})})})})};function S(){let e=(0,f._)(["\n    mutation updateCatalog($input: UpdateCatalogInput!) {\n      updateCatalog(input: $input) {\n        catalog {\n            __typename\n            id\n            description\n            createdAt\n            updatedAt\n        }\n      }\n    }\n"]);return S=function(){return e},e}let E=(0,b.Ps)(S());var I=e=>{let{item:t,onCloseHandler:n}=e,[r]=(0,d.D)(E);return(0,a.jsx)(j.Z,{fullWidth:!0,maxWidth:"sm",open:null!==t,onClose:n,title:"Edit catalog",children:(0,a.jsx)(_,{onSubmitHandler:e=>new Promise((a,s)=>
1{r({variables:{input:{...e,id:t.id}}}).then(()=>{n(),a()}).catch(e=>{s(e.message)})}),item:t,onCancel:()=>{n()}})})},D=n(17687),L=n(12246),M=n(41664),Z=n.n(M);let B=e=>{let{pagination:t}=e,{client:n,loading:a,refetch:r,data:s,error:l}=(0,o.aM)(D.n,{variables:{pagination:t},fetchPolicy:"cache",nextFetchPolicy:"network"});return{client:n,loading:a,data:u()(s,"catalogs.nodes",[]),error:l,refetch:r,pageInfo:u()(s,"catalogs.pageInfo",{count:0,currentPage:1,firstItem:0,hasMorePages:!1,lastPage:1,perPage:50})}},A=()=>{let e=(0,L.Z)({page:1,perPage:50,sortBy:"name",sortDir:"ASC"});(0,l.a)();let{data:t,refetch:n,loading:i,pageInfo:o,error:c}=B({pagination:{page:e.state.page,perPage:e.state.perPage,sortColumn:e.state.sortBy,sortDirection:e.state.sortDir}}),[u,x]=(0,r.useState)(null),[p]=(0,d.D)(y),h=async e=>{window.confirm("Are you sure you want to delete this catalog?")&&p({variables:{input:{id:e.id}}}).then(()=>{n()}).catch(e=>{})},m=Math.ceil(o.count/o.perPage);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.p,{title:"Catalogs"}),(0,a.jsxs)("div",{className:"flex-1 py-6 md:py-8 px-6 -ml-4",children:[(0,a.jsx)(I,{item:u,onCloseHandler:()=>x(null)}),(0,a.jsxs)("div",{className:"mx-auto max-w-7xl space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold tracking-tight text-neutral-900",children:"Catalogs"}),(0,a.jsx)(Z(),{href:"/settings/catalogs/connect",className:"inline-flex items-center rounded-lg bg-neutral-900 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-neutral-800 transition-colors",children:"Connect catalog"})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-neutral-200 bg-white shadow-sm overflow-hidden",children:[(0,a.jsx)(g,{loading:i,items:t,onDeleteHandler:h,onEditHandler:e=>{x(e)}}),!i&&0===t.length&&(0,a.jsx)("div",{className:"px-6 py-8 text-sm text-neutral-500",children:"It looks like you don't have any catalogs at the moment. Let's get started by adding some!"}),!i&&t.length>0&&(0,a.jsxs)("div",{className:"flex items-center justify-between border-t border-neutral-200 px-6 py-3",children:[(0,a.jsxs)("span",{className:"text-sm text-neutral-500",children:[o.count," total"]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("select",{value:o.perPage,onChange:e.handlePerPageChange,className:"rounded-md border border-neutral-300 bg-white px-2 py-1.5 text-sm text-neutral-700 focus:border-neutral-400 focus:outline-none",children:[50,100,250].map(e=>(0,a.jsxs)("option",{value:e,children:[e," per page"]},e))}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{onClick:()=>e.handlePageChange(o.currentPage-1),disabled:o.currentPage<=1,className:"rounded-md p-1.5 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-700 disabled:opacity-30 transition-colors",children:(0,a.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),(0,a.jsxs)("span",{className:"min-w-[3rem] text-center text-sm text-neutral-600",children:[o.currentPage," / ",m||1]}),(0,a.jsx)("button",{onClick:()=>e.handlePageChange(o.currentPage+1),disabled:!o.hasMorePages,className:"rounded-md p-1.5 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-700 disabled:opacity-30 transition-colors",children:(0,a.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})})]})]})]})]})]})]})]})};A.getLayout=e=>(0,a.jsx)(i.A,{children:e});var H=A}},function(e){e.O(0,[6837,5129,5169,2888,9774,179],function(){return e(e.s=81239)}),_N_E=e.O()}]);

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.