1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[1160],{97654:(e,s,a)=>{a.d(s,{A:()=>m});a(35062);var t=a(76848),n=a(91609),l=a(15435),i=a(9950),o=a(50663),r=a(28695),c=a(55246),d=a(44414);const h={...o.A1,position:"relative",lines:12,radius:6};function u(){return(0,d.jsxs)("div",{className:"bg-[#F7F2EA] rounded-[14px] p-4 mb-4",children:[(0,d.jsx)("p",{className:"font-roboto-medium text-[14px] mb-1",children:c.vY.UPSELL_TITLE}),(0,d.jsx)("p",{className:"font-roboto text-[13px] text-[#6A5C43] mb-3",children:c.vY.UPSELL_BODY}),(0,d.jsx)(n.$n,{className:"shelf-tag-upsell-cta justify-center",color:"DARK_ORANGE",disabled:!1,link:(0,l.sz)(!0,r.TA.SHELF_TAGS),loading:!1,title:c.vY.UPSELL_CTA})]})}function g({tags:e,isLoading:s,isUpdating:a,canWrite:n,editingId:l,editingName:i,onEditingNameChange:o,onStartEdit:r,onSaveEdit:u,onCancelEdit:g,onRequestDelete:m}){return s?(0,d.jsx)("div",{className:"py-8 text-center",children:(0,d.jsx)(t.y$,{config:h})}):e.length?(0,d.jsx)("ul",{className:"list-none p-0 m-0 max-h-[300px] overflow-y-auto",children:e.map((e=>(0,d.jsx)("li",{className:"shelf-tag-list-item",children:l===e.id?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("input",{"aria-label":c.vY.RENAME,className:"shelf-tag-name-input",disabled:a,maxLength:c.Ok,onChange:e=>o(e.target.value),type:"text",value:i}),(0,d.jsx)("button",{className:"shelf-tag-inline-action shrink-0",disabled:a,onClick:u,type:"button",children:c.vY.SAVE}),(0,d.jsx)("button",{className:"shelf-tag-inline-action shrink-0",disabled:a,onClick:g,type:"button",children:c.vY.CANCEL})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"flex-1 font-roboto text-[14px] truncate",title:e.name,children:e.name}),n&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{className:"shelf-tag-inline-action shrink-0",disabled:a,onClick:()=>r(e),type:"button",children:[(0,d.jsx)("i",{"aria-hidden":"true",className:"ficon ficon-pencil"}),c.vY.RENAME]}),(0,d.jsxs)("button",{className:"shelf-tag-inline-action shelf-tag-inline-action--delete shrink-0",disabled:a,onClick:()=>m(e),type:"button",children:[(0,d.jsx)("i",{"aria-hidden":"true",className:"ficon ficon-trash"}),c.vY.DELETE]})]})]})},e.id)))}):(0,d.jsx)("p",{className:"py-8 text-center font-roboto-light text-[14px] text-[#818181]",children:c.vY.EMPTY_TITLE})}const m=({tags:e,isOpen:s,isLoading:a,isUpdating:l,canWrite:o,error:r,onClose:h,onCreate:m,onRename:x,onDelete:p,onClearError:f})=>{const[b,E]=(0,i.useState)(""),[j,v]=(0,i.useState)(null),[N,C]=(0,i.useState)(""),[_,A]=(0,i.useState)(null),[L,k]=(0,i.useState)(""),R=e.length>=c.eU,T=o||a||e.length>0,Y=()=>{E(""),v(null),C(""),A(null),k(""),f(),h()};return(0,d.jsxs)(t.aF,{ariaHideApp:!1,className:"shelf-tags-modal absolute max-w-[calc(100%_-_35px)] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 shadow-[0_4px_10px_rgba(0,0,0,0.25)] rounded-[6px] bg-white text-start outline-none",isOpen:s,onRequestClose:Y,children:[(0,d.jsx)("div",{className:"flex justify-end items-center",children:(0,d.jsx)("button",{"aria-label":c.vY.CLOSE,className:"ficon ficon-close p-[15px]",onClick:Y,type:"button"})}),(0,d.jsxs)("div",{className:"px-[25px] pb-[30px]",children:[(0,d.jsx)("h2",{className:"shelf-tag-modal-title mb-3",children:c.vY.MANAGE_TITLE}),!o&&(0,d.jsx)(u,{}),o&&(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("input",{"aria-label":c.vY.NAME_PLACEHOLDER,className:"shelf-tag-name-input",disabled:l||R,maxLength:c.Ok,onChange:e=>E(e.target.value),placeholder:c.vY.NAME_PLACEHOLDER,type:"text",value:b}),(0,d.jsx)(n.$n,{className:"shelf-tag-create-btn justify-center shrink-0",color:"DARK_ORANGE",disabled:l||R,loading:l,onSubmit:()=>{const e=b.trim();e?(k(""),m(e).then((e=>{e&&E("")}))):k(c.vY.ERROR_NAME_REQUIRED)},title:c.vY.CREATE})]}),o&&(0,d.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,d.jsx)("span",{className:"shelf-tag-hint",children:c.vY.MANAGE_HINT}),(0,d.jsx)("span",{className:R?"shelf-tag-counter is-at-limit":"shelf-tag-counter",children:c.vY.count(e.length)})]}),(L||r)&&(0,d.jsx)("p",{className:"txt-error font-roboto text-[13px] mb-3",children:L||r}
1),T&&(0,d.jsx)(g,{canWrite:o,editingId:j,editingName:N,isLoading:a,isUpdating:l,onCancelEdit:()=>v(null),onEditingNameChange:C,onRequestDelete:A,onSaveEdit:()=>{const e=N.trim();e&&null!==j?(k(""),x(j,e).then((e=>{e&&(v(null),C(""))}))):k(c.vY.ERROR_NAME_REQUIRED)},onStartEdit:e=>{f(),k(""),v(e.id),C(e.name)},tags:e})]}),(0,d.jsx)(n.rI,{error:!1,loading:l,message:c.vY.DELETE_CONFIRMATION,messageButtonConfirm:c.vY.DELETE,modalIsOpen:null!==_,onCloseModal:()=>A(null),onConfirm:()=>{_&&p(_.id).then((()=>A(null)))},title:c.vY.deleteTitle((null===_||void 0===_?void 0:_.name)||"")})]})}},7712:(e,s,a)=>{a.d(s,{A:()=>i});a(35062);var t=a(80202),n=(a(9950),a(55246)),l=a(44414);const i=({tags:e,canWrite:s,onEdit:a,onSelectTag:i})=>(0,l.jsxs)("div",{className:"shelf-tags",children:[e.length>0&&(0,l.jsx)("ul",{className:"shelf-tag-chips",children:e.map((e=>(0,l.jsx)("li",{children:(0,l.jsxs)("button",{"aria-label":n.vY.filterByTag(e.name),className:"shelf-tag-chip",onClick:()=>null===i||void 0===i?void 0:i(e.id),type:"button",children:[(0,l.jsx)(t.A,{className:"shelf-tag-chip__icon",size:11}),(0,l.jsx)("span",{className:"shelf-tag-chip__label",title:e.name,children:e.name})]})},e.id)))}),(0,l.jsxs)("button",{"aria-label":s?n.vY.EDIT:n.vY.UPSELL_TITLE,className:s?"shelf-tag-edit":"shelf-tag-edit is-locked",onClick:a,type:"button",children:[(0,l.jsx)(t.A,{className:"shelf-tag-edit__icon",size:15}),e.length?n.vY.EDIT:n.vY.ADD]})]})},78942:(e,s,a)=>{a.d(s,{A:()=>l});a(35062),a(9950);var t=a(55246),n=a(44414);const l=({keyword:e,tags:s,isCreating:a,onCreate:l})=>{const i=e.trim().slice(0,t.Ok),o=i.toLowerCase(),r=s.some((e=>e.name.toLowerCase()===o));return!i||r?null:(0,n.jsxs)("button",{className:"shelf-tag-create-option",disabled:a,onClick:()=>l(i),type:"button",children:[(0,n.jsx)("i",{"aria-hidden":"true",className:"ficon ficon-add"}),(0,n.jsx)("span",{className:"shelf-tag-create-option__label",title:i,children:t.vY.createOption(i)})]})}},80202:(e,s,a)=>{a.d(s,{A:()=>l,i:()=>n});a(9950);var t=a(44414);const n=({className:e,size:s})=>(0,t.jsxs)("svg",{"aria-hidden":"true",className:e,fill:"none",height:s,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:s,children:[(0,t.jsx)("path",{d:"M3 6h18"}),(0,t.jsx)("path",{d:"M7 12h10"}),(0,t.jsx)("path",{d:"M10 18h4"})]}),l=({className:e,size:s})=>(0,t.jsxs)("svg",{"aria-hidden":"true",className:e,fill:"none",height:s,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:s,children:[(0,t.jsx)("path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}),(0,t.jsx)("circle",{cx:"7.5",cy:"7.5",fill:"currentColor",r:".5"})]})},99532:(e,s,a)=>{a.r(s),a.d(s,{default:()=>u});a(35062);var t=a(97654),n=a(7712),l=a(78942),i=a(80202),o=a(10914),r=a(9950),c=a(55246),d=a(44414);function h({userId:e}){const s=(0,o.r)(e),[a,l]=(0,r.useState)(!1);return(0,d.jsxs)("div",{className:"shelf-tag-new-book",children:[(0,d.jsx)(n.A,{canWrite:!1,onEdit:()=>l(!0),tags:[]}),(0,d.jsx)(t.A,{canWrite:!1,error:s.error,isLoading:s.isLoading,isOpen:a,isUpdating:s.isUpdating,onClearError:s.handleClearError,onClose:()=>l(!1),onCreate:s.handleCreate,onDelete:s.handleDelete,onRename:s.handleRename,tags:s.tags})]})}const u=({userId:e,selectedTagIds:s,onChange:a})=>{const t=(0,o.r)(e),[n,u]=(0,r.useState)(""),[g,m]=(0,r.useState)(!1),[x,p]=(0,r.useState)(c.D5);if(!t.canWrite)return(0,d.jsx)(h,{userId:e});const f=n.trim().toLowerCase(),b=f?t.tags.filter((e=>e.name.toLowerCase().includes(f))):t.tags,E=b.filter(((e,a)=>a<x||s.includes(e.id))),j=E.length<b.length,v=Math.min(b.length-E.length,c.D5),N=e=>{u(e),p(c.D5)};return(0,d.jsxs)("div",{className:"shelf-tag-new-book",children:[(0,d.jsx)("p",{className:"shelf-tag-new-book__label",children:c.vY.ADD_BOOK_LABEL}),(0,d.jsx)("input",{"aria-label":c.vY.SEARCH_OR_CREATE,className:"shelf-tag-new-book__search",maxLength:c.Ok,onChange:e=>N(e.target.value),placeholder:c.vY.SEARCH_OR_CREATE,type:"text",value:n}),Boolean(t.error)&&(0,d.jsx)("p",{className:"txt-error font-roboto text-[13px] mb-1",children:t.error}),(0,d.jsx)(l.A,{isCreating:g,keyword:n,onCreate:e=>{m(!0),t.handleCreate(e).then((e=>
1{m(!1),e&&(a([...s,e.id]),N(""))}))},tags:t.tags}),(0,d.jsxs)("div",{className:"shelf-tag-new-book__chips",children:[E.map((e=>(0,d.jsxs)("button",{"aria-pressed":s.includes(e.id),className:"shelf-tag-new-book__chip",onClick:()=>{return t=e.id,void a(s.includes(t)?s.filter((e=>e!==t)):[...s,t]);var t},title:e.name,type:"button",children:[(0,d.jsx)(i.A,{className:"shelf-tag-new-book__chip-icon",size:11}),(0,d.jsx)("span",{className:"shelf-tag-new-book__chip-label",children:e.name})]},e.id))),j&&(0,d.jsx)("button",{className:"shelf-tag-new-book__more",onClick:()=>p((e=>e+c.D5)),type:"button",children:c.vY.showMore(v)})]})]})}},10914:(e,s,a)=>{a.d(s,{r:()=>o});var t=a(10965),n=a(9950),l=a(60853),i=a(28695);function o(e){const s=(0,l.wA)(),a=(0,l.d4)((e=>e.shelfTags)),o=(0,l.d4)((e=>{var s;return null===(s=e.auth)||void 0===s?void 0:s.userInfo})),r=(0,n.useCallback)((e=>{s((0,t.fl)(e))}),[s]),c=(0,n.useMemo)((()=>(0,i.wW)(o,i.AT.hasShelfTags)),[o]);(0,n.useEffect)((()=>{e&&s((0,t.Qg)(e))}),[s,e]);const d=(0,n.useCallback)((()=>{s((0,t.v6)(""))}),[s]),h=(0,n.useCallback)((a=>s((0,t.zl)(e,a))),[s,e]),u=(0,n.useCallback)(((a,n)=>s((0,t.Tk)(e,a,n))),[s,e]),g=(0,n.useCallback)((a=>s((0,t.co)(e,a))),[s,e]),m=(0,n.useCallback)(((a,n)=>s((0,t.Qj)(e,a,n))),[s,e]),x=(0,n.useCallback)(((a,n)=>s((0,t.$2)(e,a,n))),[s,e]);return{tags:a.results,isLoading:a.isLoading&&!a.isLoaded,isLoaded:a.isLoaded,isUpdating:a.isUpdating,error:a.error,canWrite:c,selectedTagIds:a.selectedTagIds,handleSelectTags:r,handleClearError:d,handleCreate:h,handleRename:u,handleDelete:g,handleAssign:m,handleUnassign:x}}},35062:()=>{}}]);
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.