PageSourceSearch

https://callytics.ai/_next/static/chunks/pages/agent-portal/library-b86889eba91c63fb.js

js callytics.ai collected 2026-10-05 11:53:17 UTC 25,056 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1847],{11318:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return w}});var a=n(50029),r=n(90116),l=n(64687),s=n.n(l),o=n(67294),i=n(45770),c=n(87494),u=n(2709),d=n(22969),x=n(34555),f=n(6679),p=n(11163),h=n(27656),m=n(67814),g=n(59417),b=n(2255),v=n(85893);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function j(e){var t=e.value,n=e.onChange,a=e.options,r=e.placeholder,l=e.className,s=e.clearable,i=(0,o.useState)(!1),c=i[0],u=i[1],d=(0,o.useRef)(null);(0,o.useEffect)(function(){var e=function(e){d.current&&!d.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var x=a.find(function(e){return String(e.value)===String(t)});return(0,v.jsxs)("div",{ref:d,className:"relative ".concat(l||"w-40"),children:[(0,v.jsxs)("button",{type:"button",onClick:function(){return u(!c)},className:"w-full flex items-center justify-between px-2.5 py-1.5 rounded-md bg-[#252525] text-xs text-white hover:bg-[#2a2a2a] transition-colors",children:[(0,v.jsx)("span",{className:"truncate ".concat(x?"text-white":"text-gray-500"),children:x?x.label:r||"Select..."}),(0,v.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(void 0===s||s)&&t&&(0,v.jsx)("span",{onClick:function(e){e.stopPropagation(),n(null)},className:"text-gray-500 hover:text-white cursor-pointer",children:(0,v.jsx)(m.G,{icon:g.NBC,className:"text-xs"})}),(0,v.jsx)(m.G,{icon:g.ptq,className:"text-xs text-gray-400 transition-transform ".concat(c?"rotate-180":"")})]})]}),c&&(0,v.jsxs)("div",{className:"absolute z-50 mt-1 w-full max-h-60 overflow-y-auto rounded-md py-1",style:{backgroundColor:"#0a0a0a",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.6)"},children:[a.map(function(e){var a=String(e.value)===String(t);return(0,v.jsx)("button",{type:"button",onClick:function(){n(e.value),u(!1)},className:"w-full text-left px-3 py-2 text-xs transition-colors ".concat(a?"text-white":"text-gray-300"),style:{backgroundColor:a?"#1a1a1a":"#0a0a0a"},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#1a1a1a"},onMouseLeave:function(e){return e.currentTarget.style.backgroundColor=a?"#1a1a1a":"#0a0a0a"},children:e.label},e.value)}),0===a.length&&(0,v.jsx)("div",{className:"px-3 py-2 text-xs text-gray-500",children:"No options"})]})]})}function N(e){var t=e.values,n=e.onChange,a=e.options,l=e.placeholder,s=e.className,i=(0,o.useState)(!1),c=i[0],u=i[1],d=(0,o.useRef)(null);(0,o.useEffect)(function(){var e=function(e){d.current&&!d.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var x=a.filter(function(e){return t.includes(e.value)}).map(function(e){return e.label}),f=function(e){t.includes(e)?n(t.filter(function(t){return t!==e})):n([].concat((0,r.Z)(t),[e]))};return(0,v.jsxs)("div",{ref:d,className:"relative ".concat(s||"w-40"),children:[(0,v.jsxs)("button",{type:"button",onClick:function(){return u(!c)},className:"w-full flex items-center justify-between px-2.5 py-1.5 rounded-md bg-[#252525] text-xs text-white hover:bg-[#2a2a2a] transition-colors",children:[(0,v.jsx)("span",{className:"truncate ".concat(x.length>0?"text-white":"text-gray-500"),children:x.length>0?x.join(", "):l||"Select..."}),(0,v.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[t.length>0&&(0,v.jsx)("span",{onClick:function(e){e.stopPropagation(),n([])},className:"text-gray-500 hover:text-white cursor-pointer",children:(0,v.jsx)(m.G,{icon:g.NBC,className:"text-xs"})}),(0,v.jsx)(m.G,{icon:g.ptq,className:"text-xs text-gray-400 transition-transform ".concat(c?"rotate-180":"")})]})]}),c&&(0,v.jsxs)("div",{className:"absolute z-50 mt-1 w-full max-h-60 overflow-y-auto rounded-md py-1",style:{backgroundColor:"#0a0a0a",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.6)"},children:[a.map(function(e){var n=t.includes(e.value);return(0,v.jsxs)("button",{type:"button",onClick:function(){return f(e.value)},className:"w-full text-left px-3 py-2 text-xs transition-colors flex items-center gap-2 ".concat(n?"text-white":"text-gray-300"),style:{backgroundColor:n?"#1a1a1a":"#0a0a0a"},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#1a1a1a"},onMouseLeave:function(e){return e.currentTarget.style.backgroundColor=n?"#1a1a1a":"#0a0a0a"},children:[(0,v.jsx)("span",{className:"w-3.5 h-3.5 rounded flex-shrink-0 flex items-center justify-center",style:{backgroundColor:n?"#3B82F6":"#252525"},children:n&&(0,v.jsx)(m.G,{icon:g.LEp,className:"text-[8px] text-white"})}),e.label]},e.value)}),0===a.length&&(0,v.jsx)("div",{className:"px-3 py-2 text-xs text-gray-500",children:"No options"})]})]})}function w(){var e,t,n,l=(0,c.C$)(),w=(0,p.useRouter)(),_=(0,o.useRef)(null),k=w.query,C=k.folder_id,S=k.page,E=k.sort,M=k.direction,G=k.per_page,T=k.search,W=(0,o.useState)(!0),L=W[0],R=W[1],F=(0,o.useState)([]),I=F[0],H=F[1],z=(0,o.useState)(0),Z=z[0],A=z[1],B=(0,o.useState)(1),O=B[0],D=B[1],U=(0,o.useState)(parseInt(S)||1),V=U[0],P=U[1],Y=(0,o.useState)({column:E||"created",direction:M||"descending"}),q=Y[0],X=Y[1],$=(0,o.useState)(parseInt(G)||20),J=$[0],K=$[1],Q=(0,o.useState)({personal:[],shared:[],unfiled:{personal:0,shared:0}}),ee=Q[0],et=Q[1],en=(0,o.useState)(function(){if(!C)return null;if("string"==typeof C&&C.startsWith("unfiled-"))return C;var e=parseInt(C);return Number.isNaN(e)?null:e}),ea=en[0],er=en[1],el=(0,o.useState)([]),es=el[0],eo=el[1],ei=(0,o.useState)([]),ec=ei[0],eu=ei[1],ed=(0,o.useState)(T||""),ex=ed[0],ef=ed[1],ep=(0,o.useState)(T||""),eh=ep[0],em=ep[1],eg=(0,o.useState)(function(){return T?["search"]:[]}),eb=eg[0],ev=eg[1],ey=(0,o.useState)(!1),ej=ey[0],eN=ey[1],ew=(0,o.useRef)(null);(0,o.useEffect)(function(){return _.current&&clearTimeout(_.current),_.current=setTimeout(function(){em(ex),P(1)},400),function(){return clearTimeout(_.current)}},[ex]),(0,o.useEffect)(function(){if(w.isReady){var e={};null!=ea&&(e.folder_id=String(ea)),1!==V&&(e.page=String(V)),"created"!==q.column&&(e.sort=q.column),"desce
1nding"!==q.direction&&(e.direction=q.direction),20!==J&&(e.per_page=String(J)),eh&&(e.search=eh),w.replace({pathname:w.pathname,query:e},void 0,{shallow:!0})}},[ea,V,q,J,eh,w.isReady]),(0,o.useEffect)(function(){var e=function(e){ew.current&&!ew.current.contains(e.target)&&eN(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var e_=(e=(0,a.Z)(s().mark(function e(){var t,n,a;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=l&&l.selected_organisation_id){e.next=2;break}return e.abrupt("return");case 2:return n=l.selected_organisation_id,e.next=5,(0,i.t)("agent-portal/library/folders/tree?org_id=".concat(n),"GET");case 5:null!=(a=e.sent)&&null!==(t=a.response)&&void 0!==t&&t.data&&et(a.response.data);case 7:case"end":return e.stop()}},e)})),function(){return e.apply(this,arguments)}),ek=(t=(0,a.Z)(s().mark(function e(){var t,n,a;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=l&&l.selected_organisation_id){e.next=2;break}return e.abrupt("return");case 2:return n=l.selected_organisation_id,e.next=5,(0,i.t)("call-library/tags?org_id=".concat(n),"GET");case 5:null!=(a=e.sent)&&null!==(t=a.response)&&void 0!==t&&t.data&&eo(a.response.data);case 7:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),eC=(n=(0,a.Z)(s().mark(function e(){var t,n,a,r,o;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=l&&l.selected_organisation_id){e.next=2;break}return e.abrupt("return");case 2:return R(!0),e.prev=3,a=l.selected_organisation_id,r="agent-portal/library?org_id=".concat(a,"&page=").concat(V,"&per_page=").concat(J,"&sort=").concat(q.column,"&direction=").concat(q.direction),"string"==typeof ea&&ea.startsWith("unfiled-")?r+="&unfiled=shared":ea&&(r+="&folder_ids=".concat(ea)),ec.length>0&&(r+="&tag_ids=".concat(ec.join(","))),eh&&(r+="&search=".concat(encodeURIComponent(eh))),e.next=11,(0,i.t)(r,"GET");case 11:null!=(o=e.sent)&&null!==(t=o.response)&&void 0!==t&&t.data&&null!=o&&null!==(n=o.response)&&void 0!==n&&n.meta?(H(o.response.data),A(o.response.meta.total),D(Math.ceil(o.response.meta.pages))):(H([]),A(0),D(1)),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(3),console.error("Error fetching agent library:",e.t0),H([]);case 19:R(!1);case 20:case"end":return e.stop()}},e,null,[[3,15]])})),function(){return n.apply(this,arguments)});if((0,o.useEffect)(function(){null!=l&&l.selected_organisation_id&&(e_(),ek())},[null==l?void 0:l.selected_organisation_id]),(0,o.useEffect)(function(){null!=l&&l.selected_organisation_id&&eC()},[null==l?void 0:l.selected_organisation_id,V,q,J,ea,ec,eh]),!l)return null;var eS=es.map(function(e){return{value:e.id,label:e.name}}),eE=ec.length>0||ex,eM=function(e){eb.includes(e)?(ev(function(t){return t.filter(function(t){return t!==e})}),"tag"===e&&(eu([]),P(1)),"search"===e&&(ef(""),P(1))):ev(function(t){return[].concat((0,r.Z)(t),[e])})},eG=null;return"string"==typeof ea&&ea.startsWith("unfiled-")?eG=[{id:ea,name:"Unfiled",color:null,scope:"shared"}]:ea&&(eG=function e(t,n){var a,l=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return y(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,void 0)}}(e))){n&&(e=n);var a=0,r=function(){};return{s:r,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,l=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw l}}}}(t);try{for(l.s();!(a=l.n()).done;){var s,o=a.value;if(o.id===ea)return[].concat((0,r.Z)(n),[o]);if(null!==(s=o.children)&&void 0!==s&&s.length){var i=e(o.children,[].concat((0,r.Z)(n),[o]));if(i)return i}}}catch(e){l.e(e)}finally{l.f()}return null}((null==ee?void 0:ee.shared)||[],[])),(0,v.jsxs)("div",{className:"w-full",children:[(0,v.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,v.jsxs)("div",{className:"flex items-center gap-3",children:[(0,v.jsx)(m.G,{icon:g.cnt,className:"text-2xl icon-green -translate-y-[3px]"}),(0,v.jsx)("h1",{className:"text-2xl font-bold text-white leading-none",children:"Call Library"})]}),(0,v.jsx)("div",{className:"flex items-center gap-2",children:(0,v.jsxs)("div",{ref:ew,className:"relative",children:[(0,v.jsxs)("button",{onClick:function(){return eN(!ej)},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-[#252525] text-xs text-gray-400 hover:text-white hover:bg-[#2a2a2a] transition-colors",children:[(0,v.jsx)(m.G,{icon:g.G_j,className:"text-[10px]"}),"Filters",eb.length>0?" (".concat(eb.length,")"):""]}),ej&&(0,v.jsx)("div",{className:"absolute right-0 z-50 mt-1 w-36 rounded-md overflow-hidden py-1",style:{backgroundColor:"#0a0a0a",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.6)"},children:[{key:"tag",label:"Tag"},{key:"search",label:"Search"}
1].map(function(e){var t=eb.includes(e.key);return(0,v.jsxs)("button",{type:"button",onClick:function(){return eM(e.key)},className:"w-full text-left px-3 py-2 text-xs transition-colors flex items-center gap-2 ".concat(t?"text-white":"text-gray-300"),style:{backgroundColor:t?"#1a1a1a":"#0a0a0a"},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#1a1a1a"},onMouseLeave:function(e){return e.currentTarget.style.backgroundColor=t?"#1a1a1a":"#0a0a0a"},children:[(0,v.jsx)("span",{className:"w-3.5 h-3.5 rounded flex-shrink-0 flex items-center justify-center",style:{backgroundColor:t?"#3B82F6":"#252525"},children:t&&(0,v.jsx)(m.G,{icon:g.LEp,className:"text-[8px] text-white"})}),e.label]},e.key)})})]})})]}),(0,v.jsxs)("div",{className:"grid grid-cols-[240px_1fr] gap-4",children:[(0,v.jsx)("div",{className:"border-r border-gray-800 pr-3",children:(0,v.jsx)(b.Z,{orgId:l.selected_organisation_id,tree:ee,selectedFolderId:ea,onSelect:function(e){er(e),P(1)},readOnly:!0,hidePersonal:!0})}),(0,v.jsxs)("div",{className:"min-w-0",children:[eG&&eG.length>0&&(0,v.jsxs)("div",{className:"flex items-center gap-1.5 mb-2 text-xs flex-wrap",children:[(0,v.jsx)("button",{type:"button",onClick:function(){return er(null)},className:"text-gray-500 hover:text-white bg-transparent border-none p-0",children:"All calls"}),eG.map(function(e,t){var n=t===eG.length-1;return(0,v.jsxs)(o.Fragment,{children:[(0,v.jsx)(m.G,{icon:g._tD,className:"text-[8px] text-gray-600"}),n?(0,v.jsxs)("span",{className:"text-white flex items-center gap-1.5",children:[(0,v.jsx)(m.G,{icon:g.FVb,className:"text-[9px] text-gray-500"}),e.name]}):(0,v.jsx)("button",{type:"button",onClick:function(){return er(e.id)},className:"text-gray-400 hover:text-white bg-transparent border-none p-0",children:e.name})]},e.id)})]}),(0,v.jsxs)("div",{className:"flex items-center justify-between mb-2 gap-3",children:[(0,v.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,v.jsxs)("span",{className:"text-sm text-gray-300",children:[Z," calls"]}),(0,v.jsx)("span",{className:"text-sm text-gray-500",children:"\xb7"}),(0,v.jsx)("span",{className:"text-sm text-gray-300",children:"Rows"}),(0,v.jsx)(j,{value:J,onChange:function(e){K(Number(e)),P(1)},options:[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"}],className:"w-16",clearable:!1}),(0,v.jsx)("span",{className:"text-sm text-gray-500",children:"\xb7"}),(0,v.jsx)("span",{className:"text-sm text-gray-300",children:"Sort"}),(0,v.jsx)(j,{value:q.direction,onChange:function(e){return X({column:"created",direction:e||"descending"})},options:[{value:"descending",label:"Newest first"},{value:"ascending",label:"Oldest first"}],className:"w-32",clearable:!1})]}),eb.length>0&&(0,v.jsxs)("div",{className:"flex flex-wrap gap-2 items-center justify-end",children:[eb.includes("tag")&&(0,v.jsx)(N,{values:ec,onChange:function(e){eu(e),P(1)},options:eS,placeholder:"All tags"}),eb.includes("search")&&(0,v.jsxs)("div",{className:"relative w-52",children:[(0,v.jsx)(m.G,{icon:g.wn1,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500 text-sm"}),(0,v.jsx)("input",{type:"text",placeholder:"Search titles, descriptions, phone...",value:ex,onChange:function(e){return ef(e.target.value)},className:"w-full pl-8 pr-8 py-1.5 rounded-md bg-[#252525] text-xs text-white placeholder-gray-500 outline-none"}),ex&&(0,v.jsx)("button",{onClick:function(){return ef("")},className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-white bg-transparent border-none p-0",children:(0,v.jsx)(m.G,{icon:g.NBC,className:"text-xs"})})]}),eE&&(0,v.jsx)("button",{onClick:function(){ev([]),eu([]),ef(""),P(1)},className:"px-2.5 py-1.5 rounded-md text-xs text-white",style:{backgroundColor:"#0a0a0a"},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#1a1a1a"},onMouseLeave:function(e){return e.currentTarget.style.backgroundColor="#0a0a0a"},children:"Clear all"})]})]}),L?(0,v.jsx)("div",{className:"flex justify-center py-16",children:(0,v.jsx)(u.c,{})}):0===I.length?(0,v.jsxs)("div",{className:"text-center py-12 text-gray-400",children:[(0,v.jsx)(m.G,{icon:g.cnt,className:"text-4xl mb-3"}),ea?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("p",{className:"text-lg",children:"This folder is empty"}),(0,v.jsx)("p",{className:"text-sm mt-1",children:"Your team hasn't shared any calls into this folder yet."})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("p",{className:"text-lg",children:"No library items available"}),(0,v.jsx)("p",{className:"text-sm mt-1",children:"Your team hasn't shared any calls to the library yet."})]})]}):(0,v.jsx)("div",{className:"space-y-1.5",children:I.map(function(e){var t,n,a,r,l,s,o=(null===(t=e.submission)||void 0===t?void 0:t.agent_name)||(null===(n=e.call_note)||void 0===n?void 0:n.agent_name),i=(null===(a=e.submission)||void 0===a?void 0:a.campaign_name)||(null===(r=e.call_note)||void 0===r?void 0:r.campaign_name),c=e.title||(o?"".concat(o).concat(e.call_date?" — ".concat((0,h.WU)(new Date(e.call_date),"dd MMM")):""):"Untitled call"),u=(null===(l=e.folder)||void 0===l||null===(l=l.path)||void 0===l?void 0:l.map(function(e){return e.name}).join(" / "))||(null===(s=e.folder)||void 0===s?void 0:s.name),f=e.call_duration?"".concat(Math.floor(e.call_duration/60),":").concat(String(e.call_duration%60).padStart(2,"0")):null;return(0,v.jsx)("div",{onClick:function(t){if(!t.target.closest("[data-no-row-click]")){var n;n=e.public_id,w.push("/agent-portal/library/".concat(n))}},className:"group !border-0 rounded-md cursor-pointer transition-colors hover:brightness-125",style:{background:"linear-gradient(0deg, hsl(0 0% 11%), hsl(0 0% 14%))"},children:(0,v.jsxs)("div",{className:"flex items-start gap-2 px-2.5 py-1.5",children:[(0,v.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,v.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[(0,v.jsx)("span",{className:"text-sm leading-tight ".concat(e.title?"text-white font-medium":"text-gray-400 italic"),children:c}),e.call_outcome&&(0,v.jsx)(d.z,{size:"sm",variant:"flat",className:"font-medium",style:{backgroundColor:"rgba(20, 184, 166, 0.15)",color:"#2dd4bf",borderColor:"rgba(20, 184, 166, 0.4)"},children:e.call_outcome}),e.description&&(0,v.jsxs)("span",{className:"text-xs text-gray-300 truncate min-w-0 flex-1",children:["\xb7 ",e.description]})]}),(0,v.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-0 text-[11px] text-gray-300 leading-tight mt-0.5",children:[o&&(0,v.jsxs)("span",{className:"flex items-center gap-1",children:[(0,v.jsx)(m.G,{icon:g.ILF,className:"text-[9px] text-blue-400/70"}),o]}),i&&(0,v.jsxs)("span",{className:"flex items-center gap-1",children:[(0,v.jsx)(m.G,{icon:g.Acd,className:"text-[9px] text-blue-400/70"}),i]}),e.phone_number&&(0,v.jsxs)("span",{className:"flex items-center gap-1",children:[(0,v.jsx)(m.G,{icon:g.j1w,className:"text-[9px] text-blue-400/70"}),e.phone_number]}),f&&(0,v.jsxs)("span",{className:"flex items-center gap-1",children:[(0,v.jsx)(m.G,{icon:g.SZw,className:"text-[9px] text-blue-400/70"}),f]}),e.call_date&&(0,v.jsxs)("span",{className:"flex items-center gap-1",children:[(0,v.jsx)(m.G,{icon:g.fT7,className:"text-[9px] text-blue-400/70"}),(0,h.WU)(new Date(e.call_date),"dd MMM yyyy")]})]})]}),(0,v.jsxs)("div",{className:"flex flex-col items-end gap-0.5 flex-shrink-0","data-no-row-click":!0,children:[(0,v.jsxs)("div",{className:"flex items-center gap-1",children:[e.tags&&e.tags.length>0&&(0,v.jsxs)(v.Fragment,{children:[e.tags.slice(0,2).map(function(e){return(0,v.jsx)(d.z,{size:"sm",variant:"flat",color:e.color?void 0:"default",style:e.color?{backgroundColor:"".concat(e.color,"20"),color:e.color,borderColor:e.color}:{},children:e.name},e.id)}),e.tags.length>2&&(0,v.jsx)(x.e,{content:(0,v.jsx)("div",{className:"flex flex-wrap gap-1 max-w-[250px] p-1",children:e.tags.slice(2).map(function(e){return(0,v.jsx)(d.z,{size:"sm",variant:"flat",color:e.color?void 0:"default",style:e.color?{backgroundColor:"".concat(e.color,"20"),color:e.color,borderColor:e.color}:{},children:e.name},e.id)})}),placement:"top",classNames:{content:"bg-[#1a1a1a]"},children:(0,v.jsxs)(d.z,{size:"sm",variant:"flat",className:"cursor-pointer",children:["+",e.tags.length-2]})})]}),e.highlight_count>0&&(0,v.jsx)(x.e,{content:"".concat(e.highlight_count," highlight").concat(1===e.highlight_count?"":"s"),placement:"top",classNames:{content:"bg-[#1a1a1a] text-xs"},children:(0,v.jsxs)("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded bg-yellow-500/15 text-yellow-400 text-[11px]",children:[(0,v.jsx)(m.G,{icon:g.Y6N,className:"text-[9px]"}),e.highlight_count]})}),e.folder&&(0,v.jsx)(x.e,{content:u,placement:"top",classNames:{content:"bg-[#1a1a1a] text-xs"},children:(0,v.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-gray-200 pl-2 ml-1 border-l border-gray-700",children:[(0,v.jsx)(m.G,{icon:g.Pk,style:{color:e.folder.color||"#9ca3af"},className:"text-[10px]"}),(0,v.jsx)("span",{children:e.folder.name}),(0,v.jsx)(m.G,{icon:g.FVb,className:"text-[8px] text-gray-400 ml-0.5"})]})})]}),e.saved_by&&(0,v.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-gray-200 leading-tight",children:[(0,v.jsx)(m.G,{icon:g.xVw,className:"text-[9px] text-blue-400/70"}),e.saved_by,e.created?" \xb7 ".concat((0,h.WU)(new Date(e.created),"dd MMM")):""]})]})]})},e.public_id)})}),O>1&&(0,v.jsx)("div",{className:"flex justify-center mt-4",children:(0,v.jsx)(f.g,{total:O,page:V,onChange:P,showControls:!0,classNames:{cursor:"bg-blue-500"}})})]})]})]})}},81359:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/agent-portal/library",function(){return n(11318)}])},61014:function(e,t,n){"use strict";n.d(t,{W:function(){return l}});var a=n(67294),r=n(98137);function l(e,t=[]){let n=(0,a.useRef)(e);return(0,r.G)(()=>{n.current=e}),(0,a.useCallback)((...e)=>{var t;return null==(t=n.current)?void 0:t.call(n,...e)},t)}},17423:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});let a=e=>"object"==typeof e&&null!=e&&1===e.nodeType,r=(e,t)=>
1(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,l=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return r(n.overflowY,t)||r(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},s=(e,t,n,a,r,l,s,o)=>l<e&&s>t||l>e&&s<t?0:l<=e&&o<=n||s>=t&&o>=n?l-e-a:s>t&&o<n||l<e&&o>n?s-t+r:0,o=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},i=(e,t)=>{var n,r,i,c;if("undefined"==typeof document)return[];let{scrollMode:u,block:d,inline:x,boundary:f,skipOverflowHiddenElements:p}=t,h="function"==typeof f?f:e=>e!==f;if(!a(e))throw TypeError("Invalid target");let m=document.scrollingElement||document.documentElement,g=[],b=e;for(;a(b)&&h(b);){if((b=o(b))===m){g.push(b);break}null!=b&&b===document.body&&l(b)&&!l(document.documentElement)||null!=b&&l(b,p)&&g.push(b)}let v=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,y=null!=(c=null==(i=window.visualViewport)?void 0:i.height)?c:innerHeight,{scrollX:j,scrollY:N}=window,{height:w,width:_,top:k,right:C,bottom:S,left:E}=e.getBoundingClientRect(),{top:M,right:G,bottom:T,left:W}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),L="start"===d||"nearest"===d?k-M:"end"===d?S+T:k+w/2-M+T,R="center"===x?E+_/2-W+G:"end"===x?C+G:E-W,F=[];for(let e=0;e<g.length;e++){let t=g[e],{height:n,width:a,top:r,right:o,bottom:i,left:c}=t.getBoundingClientRect();if("if-needed"===u&&k>=0&&E>=0&&S<=y&&C<=v&&(t===m&&!l(t)||k>=r&&S<=i&&E>=c&&C<=o))break;let f=getComputedStyle(t),p=parseInt(f.borderLeftWidth,10),h=parseInt(f.borderTopWidth,10),b=parseInt(f.borderRightWidth,10),M=parseInt(f.borderBottomWidth,10),G=0,T=0,W="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-b:0,I="offsetHeight"in t?t.offsetHeight-t.clientHeight-h-M:0,H="offsetWidth"in t?0===t.offsetWidth?0:a/t.offsetWidth:0,z="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(m===t)G="start"===d?L:"end"===d?L-y:"nearest"===d?s(N,N+y,y,h,M,N+L,N+L+w,w):L-y/2,T="start"===x?R:"center"===x?R-v/2:"end"===x?R-v:s(j,j+v,v,p,b,j+R,j+R+_,_),G=Math.max(0,G+N),T=Math.max(0,T+j);else{G="start"===d?L-r-h:"end"===d?L-i+M+I:"nearest"===d?s(r,i,n,h,M+I,L,L+w,w):L-(r+n/2)+I/2,T="start"===x?R-c-p:"center"===x?R-(c+a/2)+W/2:"end"===x?R-o+b+W:s(c,o,a,p,b+W,R,R+_,_);let{scrollLeft:e,scrollTop:l}=t;G=0===z?0:Math.max(0,Math.min(l+G/z,t.scrollHeight-n/z+I)),T=0===H?0:Math.max(0,Math.min(e+T/H,t.scrollWidth-a/H+W)),L+=l-G,R+=e-T}F.push({el:t,top:G,left:T})}return F},c=e=>!1===e?{block:"end",inline:"nearest"}:e===Object(e)&&0!==Object.keys(e).length?e:{block:"start",inline:"nearest"};function u(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(i(e,t));let n="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:a,top:r,left:l}of i(e,c(t)))a.scroll({top:r,left:l,behavior:n})}}},function(e){e.O(0,[6679,2255,2888,9774,179],function(){return e(e.s=81359)}),_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.