1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7924],{67153:function(e,t,o){o.d(t,{Gy:function(){return useCommentInput},S5:function(){return d}});var n=o(32735),l=o(35677),i=o(19499),r=o(38286),a=o(302),c=o(40772),s=o(83833);let d=700;function useCommentInput(e){var t,o,d;let{collectionId:u,replyTo:m,onCancelReply:h,onSubmit:p,onFocusChange:g,onRestricted:C,maxLineBreaks:v=6}=e,[b,f]=(0,n.useState)(""),[Z,k]=(0,n.useState)(!1),y=(0,c.nu)(),w=(0,c.aF)(),I=(0,i.I0)(),B=(0,s.Z)(s.x.WRITE_COMMENTS),{api:z}=(0,a.h_)(()=>c.cG.writeComment({bookCollectionId:u}),[u]),S=(0,n.useRef)(z.status),T=null!==(d=null===(t=null==z?void 0:null===(o=z.response)||void 0===o?void 0:o.data)||void 0===t?void 0:t.result)&&void 0!==d?d:null,R=(0,a.X2)(c.Ap.key,T);(0,n.useEffect)(()=>{S.current===a.br&&z.status===a.MR&&R&&(null==p||p(R)),S.current=z.status},[z.status,R,p]);let x=z.status===a.br,_=b.length>0&&!x,E=!x&&!B,X=(0,n.useCallback)(()=>{if(!y){I(r.Actions.trySmartLogin({}));return}if(!(null==w?void 0:w.nickname)){l.Z.dismiss(),I(r.Actions.requestBookCollectionProfileSetup());return}if(B){null==C||C();return}k(!0),null==g||g(!0)},[y,I,g,C,B,null==w?void 0:w.nickname]),M=(0,n.useCallback)(()=>{k(!1),null==g||g(!1)},[g]),A=(0,n.useCallback)(e=>{let t=(e.match(/\n/g)||[]).length;t>v||f(e)},[v]),P=(0,n.useCallback)(()=>{_&&(f(""),m&&(null==h||h()),I(c.cG.writeComment({content:b,bookCollectionId:u,parentId:null==m?void 0:m.commentId}).createAction()))},[_,I,b,u,m,h]);return{text:b,focused:Z,canSubmit:_,isSubmitting:x,editable:E,writeRestriction:B,handleFocus:X,handleBlur:M,handleChangeText:A,handleSubmit:P}}},7353:function(e,t,o){o.d(t,{Z:function(){return components_BookCollectionCommentList}});var n=o(38839),l=o(32735),i=o(18030),r=o(51276),a=o(7088),c=o(32083),s=o(87904),d=o(31219),u=o(16787),m=o(302),h=o(40772),p=o(48922),g=o(4112),C=o(62287),v=o(44340),b=o(25617),f=o(24037),Z=o(76617),k=o(2036),y=o(74418);let w={[g.SQ0.ENGLISH]:"m",[g.SQ0.FRENCH]:"min",[g.SQ0.GERMAN]:" Min."},I={[g.SQ0.ENGLISH]:"h",[g.SQ0.FRENCH]:"h",[g.SQ0.GERMAN]:" Std."},B={[g.SQ0.ENGLISH]:"d",[g.SQ0.FRENCH]:"j",[g.SQ0.GERMAN]:" T."},z=1/0;function useShortRelativeTimeString(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,{t:o,i18n:n}=(0,v.$)("page-independent-ui"),l=(0,g.XXE)(n),i=(0,g.mPK)(e),r=new Date,a=(0,Z.Z)(r,i),c=(0,y.Z)(r)===(0,y.Z)(i),s=c?"MMM d":"MMM d, yyyy",d=[[1,()=>o("date-format.just-now")],[60,()=>"".concat(a).concat(w[l])],[1440,()=>"".concat((0,f.Z)(r,i)).concat(I[l])],[1440*t,()=>"".concat((0,b.Z)(r,i)).concat(B[l])],[z,()=>(0,k.Z)(i,s,{locale:g.h$v[l]})]],u=d.find(e=>{let[t]=e;return a<t});return u[1]()}var S=o(14385),T=o(19499),R=o(75921),x=o(38286),_=o(78602),hooks_useBookCollectionCommentPopoverMenuOptions=function(e){var t;let{comment:o,isMuted:n,onMute:i,onUnmute:r,onDelete:a}=e,c=(0,h.nu)(),s=(0,h.II)(),d=void 0!==s&&s===o.author,C=(0,T.I0)(),[v,b]=(0,p.T_)(["page-independent-ui","one-dialog"]),f=(0,_.Z)(),Z=(0,m.X2)(h.rC.key,o.author),k=null!==(t=null==Z?void 0:Z.nickname)&&void 0!==t?t:"";return(0,l.useMemo)(()=>d&&a?[{label:v("book-collection.comment-item.actions.delete-comment"),icon:u.rFk,onPress:()=>{f({message:b("collections.comments.delete-confirm.description",g.FVq),confirmText:b("collections.comments.buttons.delete"),cancelText:b("collections.comments.delete-confirm.buttons.cancel"),onConfirm:a,confirmButtonColor:"danger"})}}]:n?[{label:v("book-collection.comment-item.actions.unmute"),icon:u.TBU,onPress:()=>{f({title:b("book-collection.unmute-profile.title",{nickname:k}),message:b("book-collection.unmute-profile.description"),confirmText:b("book-collection.unmute-profile.buttons.unmute"),cancelText:b("book-collection.unmute-profile.buttons.cancel"),onConfirm:r})}}]:[{label:v("book-collection.comment-item.actions.report-comment"),icon:u.eIJ,onPress:()=>{c?C(R.kX.openDialog("BookCollectionReportReason",{targetId:o.id,targetType:"comment"})):C(x.Actions.trySmartLogin())}},{label:v("book-collection.comment-item.actions.mute"),icon:u._jl,onPress:()=>{c?f({title:b("book-collection.mute-profile.title",{nickname:k}),message:b("book-collection.mute-profile.description"),confirmText:b("book-collection.mute-profile.buttons.mute"),cancelText:b("book-collection.mute-profile.buttons.cancel"),onConfirm:i,confirmButtonColor:"danger"}):C(x.Actions.trySmartLogin())}}],[c,d,o.id,f,k,i,r,a,n])},E=o(13873),X=o(50573);let M=(0,d.zo)(s.Z)(e=>{let{theme:t}=e;return{borderRadius:4,backgroundColor:t.palette.fill.weaker,paddingVertical:3,paddingHorizontal:6,marginLeft:4,alignItems:"center",justifyContent:"center"}});var components_BookCollectionCreatorBadge=function(){let[e]=(0,p.T_)("one-dialog");return(0,n.tZ)(M,{children:(0,n.tZ)(d.ZT,{variant:"flag2",weight:"semiBold",color:"weak",align:"center",children:e("collections.comments.labels.creator")})})};let A=(0,d.zo)(d.X2)(e=>{let{isHighlighted:t,highlightColor:o}=e;return{marginBottom:16,paddingHorizontal:16,paddingVertical:t?8:0,gap:8,alignItems:"flex-start",backgroundColor:t?o:"transparent"}}),P=(0,d.zo)(d.Ee)({width:32,height:32,borderRadius:20,overflow:"hidden"}),L=(0,d.zo)(d.sg)({flex:1,minWidth:0}
1),H=(0,d.zo)(d.X2)({gap:8,alignItems:"center",justifyContent:"space-between",marginBottom:5}),F=(0,d.zo)(d.X2)({alignItems:"center",flex:1,overflow:"hidden",minWidth:0,gap:4}),D=(0,d.zo)(c.Z)({flexShrink:1,minWidth:0}),N=(0,d.zo)(s.Z)({width:16,height:16,alignItems:"center",justifyContent:"center",flexShrink:0}),U=(0,d.zo)(d.ZT)(e=>{let{theme:t,isDeactivatedUser:o}=e;return{flexShrink:1,color:o?t.palette.status.disabledLabel:t.palette.text.strong}}),G=(0,d.zo)(d.ZT)({flexShrink:0,marginLeft:4}),O=(0,d.zo)(d.hU)({width:22,height:22}),V=(0,d.zo)(d.X2)({gap:12,marginTop:12,alignItems:"center"}),j=(0,d.zo)(d.sg)(e=>{let{theme:t}=e;return{alignSelf:"flex-start",borderBottomWidth:1,borderBottomColor:t.palette.text.weak}}),W=(0,d.zo)(d.sg)({marginTop:16});var items_BookCollectionCommentItem=function(e){var t;let{comment:o,isCreator:i,onReplyPress:r,onCommentAuthorPress:a,onDelete:s,inlineInput:v,isHighlighted:b,isHidden:f}=e,Z=(0,d.Fg)(),[k,y,w]=(0,p.T_)(["page-dependent-ui","page-independent-ui","one-dialog"]),I="dark"===Z.mode?"#10231F":"#EFFBF8",B=useShortRelativeTimeString(o.createdAt),z=o.author,{isMuted:T,muteUser:R,unmuteUser:x}=(0,S.Z)({showSnackbar:!0,userId:z}),_=(0,m.X2)(h.rC.key,z),M=o.isDeleted,Q=M||f||T,K=(0,l.useCallback)(()=>{r(o.id,z)},[o.id,z,r]),q=null==_?void 0:_.isMembershipSubscribed,Y=null!==(t=null==_?void 0:_.nickname)&&void 0!==t?t:"",$=""===Y,J=$?y("book-collection.comment-item.labels.deactivated"):f||T?(0,g.CdG)(Y):Y,ee="dark"===Z.mode?"https://static.tappytoon.com/assets/images/collections/blocked_profile_dark.png":"https://static.tappytoon.com/assets/images/collections/blocked_profile_light.png",et=Q||$?ee:(0,X.Z)(null==_?void 0:_.thumbnailUrl),eo=M?y("book-collection.comment-item.labels.comment-is-deleted"):f?k("collections.comment.restricted-comment"):T?y("book-collection.comment-item.labels.comment-is-hidden"):o.content,en=(0,l.useCallback)(()=>{Q||$||!z||a(Y,z)},[Q,z,Y,a,$]),[el,ei]=(0,l.useState)(!1),er=hooks_useBookCollectionCommentPopoverMenuOptions({comment:o,isMuted:T,onMute:R,onUnmute:x,onDelete:s}),ea=((null==o?void 0:o.replyCount)||0)>0,ec=(T||$)&&!ea;return(0,n.BX)(A,{isHighlighted:b,highlightColor:I,children:[(0,n.tZ)(c.Z,{onPress:en,children:(0,n.tZ)(P,{source:{uri:et},resizeMode:"cover"})}),(0,n.BX)(L,{children:[f||M?null:(0,n.BX)(H,{children:[(0,n.BX)(F,{children:[(0,n.tZ)(D,{onPress:en,children:(0,n.tZ)(U,{isDeactivatedUser:$,children:J,variant:"body3",weight:"semiBold",numberOfLines:1})}),q&&!$?(0,n.tZ)(N,{children:(0,n.tZ)(E.Z,{width:16,height:16})}):null,i?(0,n.tZ)(components_BookCollectionCreatorBadge,{}):null,(0,n.tZ)(G,{children:B,variant:"caption1",color:"weak",weight:"regular"})]}),$?null:(0,n.tZ)(C.Z,{visible:el,onClose:()=>ei(!1),options:er,children:(0,n.tZ)(O,{onPress:()=>ei(e=>!e),children:(0,n.tZ)(u.yFf,{width:22,height:22})})})]}),(0,n.tZ)(d.ZT,{children:eo,variant:"body3short",weight:"regular",color:Q?"weak":"strong"}),ec?null:(0,n.tZ)(V,{children:(0,n.tZ)(c.Z,{onPress:K,hitSlop:{top:8,bottom:8,left:8,right:8},children:(0,n.tZ)(j,{children:(0,n.tZ)(d.ZT,{children:w("collections.comments.buttons.reply"),variant:"caption1",color:"weak",weight:"medium",lineHeight:13})})})}),v?(0,n.tZ)(W,{children:v}):null]})]})};let Q=(0,d.zo)(d.X2)({marginBottom:16,paddingLeft:48,paddingRight:16,gap:8,alignItems:"flex-start"}),K=(0,d.zo)(d.Ee)({width:24,height:24,borderRadius:14,overflow:"hidden"}),q=(0,d.zo)(d.sg)({flex:1,minWidth:0}),Y=(0,d.zo)(d.X2)({alignItems:"center",flex:1,overflow:"hidden",minWidth:0,gap:4}),$=(0,d.zo)(c.Z)({flexShrink:1,minWidth:0}),J=(0,d.zo)(s.Z)({width:16,height:16,alignItems:"center",justifyContent:"center",flexShrink:0}),ee=(0,d.zo)(d.ZT)(e=>{let{theme:t,isDeactivatedUser:o}=e;return{flexShrink:1,color:o?t.palette.status.disabledLabel:t.palette.text.strong}}),et=(0,d.zo)(d.ZT)({flexShrink:0,marginLeft:4}),eo=(0,d.zo)(d.hU)({width:22,height:22}),en=(0,d.zo)(d.X2)({gap:8,alignItems:"center",justifyContent:"space-between",marginBottom:5});var items_BookCollectionReplyItem=function(e){var t;let{comment:o,isCreator:i,onCommentAuthorPress:r,onDelete:a}=e,s=(0,d.Fg)(),[v]=(0,p.T_)("page-independent-ui"),b=useShortRelativeTimeString(o.createdAt),[f,Z]=(0,l.useState)(!1),k=o.author,y=(0,m.X2)(h.rC.key,k),{isMuted:w,muteUser:I,unmuteUser:B}=(0,S.Z)({showSnackbar:!0,userId:k}),z=null==y?void 0:y.isMembershipSubscribed,T=null!==(t=null==y?void 0:y.nickname)&&void 0!==t?t:"",R=""===T,x=R?v("book-collection.comment-item.labels.deactivated"):w?(0,g.CdG)(T):T,_="dark"===s.mode?"https://static.tappytoon.com/assets/images/collections/blocked_profile_dark.png":"https://static.tappytoon.com/assets/images/collections/blocked_profile_light.png",M=w||R?_:(0,X.Z)(null==y?void 0:y.thumbnailUrl),A=w?v("book-collection.comment-item.labels.comment-is-hidden"):o.content,P=(0,l.useCallback)(()=>{w||R||!k||r(T,k)},[w,k,T,r,R]),L=hooks_useBookCollectionCommentPopoverMenuOptions({comment:o,isMuted:w,onMute:I,onUnmute:B,onDelete:a});return(0,n.BX)(Q,{children:[(0,n.tZ)(c.Z,{onPress:P,children:(0,n.tZ)(K,{source:{uri:null!=M?M:""},resizeMode:"cover"})}),(0,n.BX)(q,{children:[(0,n.BX)(en,{children:[(0,n.BX)(Y,{children:[(0,n.tZ)($,{onPress:P,children:(0,n.tZ)(ee,{isDeactivatedUser:R,children:x,variant:"body3",weight:"semiBold",numberOfLines:1})}),z&&!R?(0,n.tZ)(J,{children:(0,n.tZ)(E.Z,{width:16,height:16})}):null,i?(0,n.tZ)(components_BookCollectionCreatorBadge,{}):null,(0,n.tZ)(et,{children:b,variant:"caption1",color:"weak",weight:"regular"})]}),R?null:(0,n.tZ)(C.Z,{visible:f,onClose:()=>Z(!1),options:L,children:(0,n.tZ)(eo,{onPress:()=>Z(e=>!e),children:(0,n.tZ)(u.yFf,{width:22,height:22})})})]}),(0,n.tZ)(d.ZT,{children:A,variant:"body3short",weight:"regular",color:w?"weak":"strong"})]})]})};let el=(0,d.zo)(d.X2)({marginLeft:56,marginBottom:16,alignItems:"center"}),ei=(0,d.zo)(s.Z)(e=>{let{theme:t}=e;return{width:16,height:1,marginRight:8,backgroundColor:t.palette.border.base}});var components_BookCollectionCommentMoreButton=function(e){let{replyCount:t,onPress:o}=e,[l]=(0,p.T_)("one-dialog"),i=1===t?l("collections.comments.buttons.view-more-single"):l("collections.comments.buttons.view-more-plural",{c
1ount:t});return(0,n.BX)(el,{children:[(0,n.tZ)(ei,{}),(0,n.tZ)(c.Z,{onPress:o,children:(0,n.tZ)(d.ZT,{children:i,variant:"caption1",color:"weak",weight:"medium"})})]})},er=o(36687),components_BookCollectionCommentList=function(e){let{api:t,commentListItems:o,handleEndReached:c,fetchReplies:s,fetchMoreReplies:d,onReplyPress:u,activeCommentId:m,collectionOwnerId:h,onCommentAuthorPress:p,onDeleteComment:g,renderInlineInput:C,onLayout:v,ListEmptyComponent:b}=e,f=(0,a.Z)(),Z=(0,l.useCallback)((e,t)=>{let o=m===e;null==u||u(o?void 0:{commentId:e,authorId:t})},[m,u]),{onEndReached:k,ListFooterComponent:y}=(0,i.p6)({onEndReached:c,ListFooterComponent:er.Z},t.status),w=(0,l.useCallback)(e=>{let{item:t}=e;switch(t.type){case"comment":{let e=t.data.isHidden;if(e&&!t.data.replyCount)return null;let o=t.data.author;return(0,n.tZ)(items_BookCollectionCommentItem,{comment:t.data,isCreator:o===h,onReplyPress:Z,onCommentAuthorPress:p,isHighlighted:!f&&m===t.data.id,isHidden:e,onDelete:()=>null==g?void 0:g(t.data),inlineInput:C&&m===t.data.id?C(t.data.id):void 0})}case"reply":{let e=t.data.author;return(0,n.tZ)(items_BookCollectionReplyItem,{comment:t.data,isCreator:e===h,onCommentAuthorPress:p,onDelete:()=>null==g?void 0:g(t.data)})}case"view-replies-button":return(0,n.tZ)(components_BookCollectionCommentMoreButton,{replyCount:t.remainingCount,onPress:()=>{t.isFirstLoad?s(t.commentId):d(t.commentId)}})}},[Z,s,d,C,m,h,p,g,f]),I=(0,l.useCallback)(e=>"view-replies-button"===e.type?"view-replies-".concat(e.commentId):String(e.data.id),[]);return(0,n.tZ)(i.Y,{onLayout:v,data:o,renderItem:w,keyExtractor:I,onEndReached:k,onEndReachedThreshold:.5,ListFooterComponent:y,ListEmptyComponent:b,scrollEnabled:r.$})}},36687:function(e,t,o){var n=o(38839);o(32735);var l=o(31219),i=o(97674);t.Z=()=>(0,n.tZ)(l.sg,{justifyContent:"center",insets:l.rN.vertical(4),children:(0,n.tZ)(i.Z,{})})},62287:function(e,t,o){o.d(t,{Z:function(){return PopoverMenu}});var n=o(38839),l=o(32735),i=o(32083),r=o(85723),a=o(87904),c=o(91425),s=o(31219);let d=(0,s.zo)(s.sg)(e=>{let{theme:t,top:o,right:n}=e;return{position:"absolute",top:o,right:n,zIndex:t.zIndex.dialog}}),u=(0,s.zo)(s.UT)(e=>{let{theme:t}=e;return{backgroundColor:t.palette.surface.base,borderRadius:t.shape.radius.lg,borderWidth:.5,borderColor:t.palette.border.base}}),m=(0,s.zo)(i.Z)(e=>{let{theme:t}=e;return{alignItems:"center",justifyContent:"space-between",flexDirection:"row",gap:12,paddingVertical:t.spacing(3.5),paddingHorizontal:t.spacing(5)}}),h=(0,s.zo)(s.ZT)({minWidth:126}),p=(0,s.zo)(i.Z)(e=>{let{theme:t}=e;return{...r.Z.absoluteFillObject,zIndex:t.zIndex.dialog}}),g=(0,s.zo)(a.Z)(e=>{let{theme:t}=e;return{height:.5,marginHorizontal:t.spacing(4),backgroundColor:t.palette.border.weaker}}),C={top:0,right:4};function PopoverMenu(e){let{visible:t,onClose:o,options:i,children:r,offset:v={},style:b}=e,f=(0,l.useMemo)(()=>({...C,...v}),[null==v?void 0:v.top,null==v?void 0:v.right]),Z=(0,l.useRef)(null),[k,y]=(0,l.useState)();return(0,l.useEffect)(()=>{if(t){var e;null===(e=Z.current)||void 0===e||e.measure((e,t,o,n,l,i)=>{let r=c.Z.get("window").width;y({top:i+n+f.top,right:r-l-o+f.right})})}else y(void 0)},[t,f]),(0,n.BX)(l.Fragment,{children:[(0,n.tZ)(a.Z,{ref:Z,collapsable:!1,style:b,children:r}),t&&k?(0,n.tZ)(s.h_,{children:(0,n.BX)(l.Fragment,{children:[(0,n.tZ)(p,{onPressIn:()=>o()}),(0,n.tZ)(d,{top:k.top,right:k.right,children:(0,n.tZ)(u,{variant:400,children:i.map((e,t)=>{let i=e.icon;return(0,n.BX)(l.Fragment,{children:[t>0?(0,n.tZ)(g,{}):null,(0,n.BX)(m,{onPress:()=>{e.onPress(),o()},children:[(0,n.tZ)(h,{variant:"body3",weight:"medium",color:"strong",children:e.label}),(0,n.tZ)(i,{size:"small"})]})]},e.label)})})})]})}):null]})}},69500:function(e,t,o){var n=o(32735),l=o(19499),i=o(302),r=o(40772),a=o(56430),c=o(95337);let makeCommentListItems=(e,t,o)=>{var n,l;let r=null!==(n=(0,i.sw)(t))&&void 0!==n?n:[],a=r.map(e=>o[e]).filter(e=>void 0!==e&&!e.isDeleted),c=0!==r.length,s=(null==t?void 0:t.status)===void 0||(null==t?void 0:t.status)===i.qg,d=(null!==(l=e.replyCount)&&void 0!==l?l:0)-r.length,u=[{type:"comment",data:e},...a.map(e=>({type:"reply",data:e}))];return d>0&&u.push({type:"view-replies-button",commentId:e.id,remainingCount:d,isFirstLoad:!c&&s}),u},appendReplyToApiState=(e,t,o)=>{var n,l,a,c;let s=r.cG.getRepliesByCommentId(o.parentId,3).name,d=(0,i.vT)(s)(t),u=null!==(c=null==d?void 0:null===(l=d.response)||void 0===l?void 0:null===(n=l.data)||void 0===n?void 0:n.result)&&void 0!==c?c:[];e(i.oA.successFetchRequest({name:s,response:{...null==d?void 0:d.response,data:{...null==d?void 0:null===(a=d.response)||void 0===a?void 0:a.data,result:[...u,o.id]}}}))},prependCommentToApiState=(e,t,o,n)=>{var l,a,c,s;let d=r.cG.getCommentsByBookCollectionId(o,20).name,u=(0,i.vT)(d)(t),m=null!==(s=null==u?void 0:null===(a=u.response)||void 0===a?void 0:null===(l=a.data)||void 0===l?void 0:l.result)&&void 0!==s?s:[];e(i.oA.successFetchRequest({name:d,response:{...null==u?void 0:u.response,data:{...null==u?void 0:null===(c=u.response)||void 0===c?void 0:c.data,result:[n.id,...m]}}}))};t.Z=e=>{var t,o,s,d;let{bookCollectionId:u,initialCommentCount:m}=e,h=(0,l.I0)(),p=(0,l.oR)();(0,a.i)(()=>r.cG.getById(u),[u],{strategy:a.J.NOT_FETCH_IF_POSSIBLE,predicate:!!u});let g=(0,i.X2)(r.Qb.key,u),C=null!==(o=null!==(t=null==g?void 0:g.commentCount)&&void 0!==t?t:m)&&void 0!==o?o:0,{api:v,createAction:b}=(0,a.i)(()=>r.cG.getCommentsByBookCollectionId(u,20),[u],{strategy:a.J.COMPONENT_DID_MOUNT,predicate:!!u}),f=(0,c.Z)(),Z=(0,n.useMemo)(()=>{var e;return null!==(e=(0,i.sw)(v))&&void 0!==e?e:[]},[v]),k=null!==(s=(0,i.X2)(r.Ap.key,Z))&&void 0!==s?s:[],y=(0,n.useMemo)(()=>e=>Z.reduce((t,o)=>{let{selectApi:n}=r.cG.getRepliesByCommentId(o,3);return t[o]=n(e),t},{}),[Z]),w=(0,l.v9)(y,l.wU),I=(0,n.useMemo)(()=>Object.values(w).flatMap(e=>{var t;return null!==(t=(0,i.sw)(e))&&void 0!==t?t:[]}),[w]),B=null!==(d=(0,i.X2)(r.Ap.key,I))&&void 0!==d?d:[],z=(0,n.useMemo)(()=>B.reduce((e,t)=>
1(e[t.id]=t,e),{}),[B]),S=null==g?void 0:g.owner,T=(0,n.useMemo)(()=>k.filter(e=>{var t;return!e.isDeleted||(null!==(t=e.replyCount)&&void 0!==t?t:0)>0}).flatMap(e=>makeCommentListItems(e,w[e.id],z)),[k,w,z]),R=(0,n.useCallback)(()=>{h(b({pagination:{rel:"next"}}))},[h,b]),x=(0,n.useCallback)(e=>{let{createAction:t}=r.cG.getRepliesByCommentId(e,3);h(t())},[h]),_=(0,n.useCallback)(e=>{let{createAction:t}=r.cG.getRepliesByCommentId(e,3);h(t({pagination:{rel:"next"}}))},[h]),E=v.status===i.qg||v.status===i.br,X=(0,n.useMemo)(()=>Object.values(w).some(e=>e.status===i.br),[w]),M=(0,n.useCallback)(()=>{var e,t,o,n;let l=p.getState(),i=null===(t=l.entities)||void 0===t?void 0:null===(e=t[r.Qb.key])||void 0===e?void 0:e[u],a=null!==(n=null!==(o=null==i?void 0:i.commentCount)&&void 0!==o?o:m)&&void 0!==n?n:0;return{state:l,collection:i,commentCount:a,getComment:e=>{var t,o;return null===(o=l.entities)||void 0===o?void 0:null===(t=o[r.Ap.key])||void 0===t?void 0:t[e]}}},[u]),A=(0,n.useCallback)(e=>{let{state:t,collection:o,commentCount:n,getComment:l}=M(),a={[e.id]:e};if(e.parentId){var c;let t=l(e.parentId);a[e.parentId]={...t,replyCount:(null!==(c=null==t?void 0:t.replyCount)&&void 0!==c?c:0)+1}}h(i.oA.updateEntities({entities:{[r.Qb.key]:{[u]:{...o,commentCount:n+1}},[r.Ap.key]:a}})),e.parentId?appendReplyToApiState(h,t,e):prependCommentToApiState(h,t,u,e)},[u,M]),P=(0,n.useCallback)(e=>{var t,o;f({bookCollectionId:u,commentId:e.id,parentId:null!==(t=e.parentId)&&void 0!==t?t:void 0,hasReplies:(null!==(o=e.replyCount)&&void 0!==o?o:0)>0})},[f,u]);return{api:v,commentListItems:T,handleEndReached:R,fetchReplies:x,fetchMoreReplies:_,isLoading:E,isReplyLoading:X,commentCount:C,collectionOwnerId:S,collectionTitle:null==g?void 0:g.title,onCommentSubmit:A,onCommentDelete:P}}},14385:function(e,t,o){o.d(t,{Z:function(){return useBookCollectionUserMute}});var n=o(32735),l=o(19499),i=o(302),r=o(97178),a=o(40772),c=o(15638);function useBookCollectionUserMute(e){var t;let{userId:o,showSnackbar:s=!1}=e,d=(0,c.bK)(),u=(0,l.I0)(),m=(0,i.X2)(a.rC.key,o),h=null!==(t=null==m?void 0:m.isMuted)&&void 0!==t&&t,p=(0,n.useCallback)(async()=>{try{if(!o)return;await d.request(a._X.muteUser(o)),u(i.oA.updateEntities({entities:{[a.rC.key]:{[o]:{isMuted:!0}}}})),s&&u(r.eX.showSnackbar({key:"one-toast:book-collection.mute-profile",status:"success"}))}catch(e){}},[d,o,s]),g=(0,n.useCallback)(async()=>{try{if(!o)return;await d.request(a._X.unmuteUser(o)),u(i.oA.updateEntities({entities:{[a.rC.key]:{[o]:{isMuted:!1}}}})),s&&u(r.eX.showSnackbar({key:"one-toast:book-collection.unmute-profile",status:"success"}))}catch(e){}},[d,o,s]);return{isMuted:h,muteUser:p,unmuteUser:g}}},78602:function(e,t,o){o.d(t,{Z:function(){return useConfirmDialog}});var n=o(32735),l=o(19499),i=o(75921);function useConfirmDialog(){let e=(0,l.I0)();return n.useCallback(t=>{e(i.kX.openDialog("Confirm",t))},[e])}},95337:function(e,t,o){o.d(t,{Z:function(){return useDeleteBookCollectionComment}});var n=o(32735),l=o(19499),i=o(302),r=o(97178),a=o(40772);function useDeleteBookCollectionComment(){let e=(0,l.I0)(),t=(0,l.oR)();return(0,n.useCallback)(o=>{var n,l,c,s,d,u;let{bookCollectionId:m,commentId:h,parentId:p,hasReplies:g=!1}=o,C=t.getState(),v=null===(l=C.entities)||void 0===l?void 0:null===(n=l[a.Qb.key])||void 0===n?void 0:n[m],b=null!==(c=null==v?void 0:v.commentCount)&&void 0!==c?c:0;e(a.cG.deleteComment(h,{preserveCache:g}).createAction());let f={[h]:{isDeleted:!0}};if(void 0!==p){let e=null===(d=C.entities)||void 0===d?void 0:null===(s=d[a.Ap.key])||void 0===s?void 0:s[p];f[p]={replyCount:Math.max(0,(null!==(u=null==e?void 0:e.replyCount)&&void 0!==u?u:0)-1)}}e(i.oA.updateEntities({entities:{...v?{[a.Qb.key]:{[m]:{commentCount:Math.max(0,b-1)}}}:{},[a.Ap.key]:f}})),e(r.eX.showSnackbar({key:"one-toast:collections.comments.comment-deleted",status:"success"}))},[])}},83833:function(e,t,o){o.d(t,{x:function(){return a}});var n=o(32735),l=o(19499),i=o(40772),r=o(15638);let a={WRITE_COMMENTS:"write_comments"};t.Z=function(e){var t;let o=(0,r.bK)(),a=(0,l.I0)(),c=(0,i.nu)(),s=(null===(t=(0,i.aF)())||void 0===t?void 0:t.restrictions)||[];(0,n.useEffect)(()=>
1{if(!c)return;let fetch=async()=>{try{let{data:e}=await o.request(i._X.getMyRestrictions());a(i.OAuth2Actions.updateUser({restrictions:e}))}catch(e){}};fetch()},[o,a,c]);let d=(0,n.useMemo)(()=>s.reduce((e,t)=>({...e,[t.action]:t}),{}),[s]);return e?d[e]:d}},48263:function(e,t,o){o.d(t,{A:function(){return useTextarea}});var n=o(32735),l=o(11995),i=o(85723);let r="web"===l.Z.OS;function useTextarea(e){let{value:t,onChangeText:o,style:l,maxLine:a}=e,c=(0,n.useRef)(null),s=(0,n.useRef)(""),d=(0,n.useCallback)(e=>{let n=parseFloat(window.getComputedStyle(e).lineHeight)||20;e.style.height="auto";let l=e.scrollHeight/n;return l>a?(null==o||o(s.current),e.style.height="".concat(n*a,"px"),!0):(s.current=null!=t?t:"",!1)},[a,o,t]),u=(0,n.useCallback)(()=>{let e=c.current;!e||a&&d(e)||(e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px"))},[a,d]);(0,n.useLayoutEffect)(()=>{r&&u()},[u,t]);let m=(0,n.useCallback)(e=>{null==o||o(e)},[o]),h=(0,n.useCallback)(e=>{var n;if(void 0===a)return;let r=e.nativeEvent.contentSize.height,c=i.Z.flatten(l),d=null!==(n=null==c?void 0:c.lineHeight)&&void 0!==n?n:20;if(r/d>a){null==o||o(s.current);return}s.current=null!=t?t:""},[a,o,l,t]);return{inputRef:c,handleChangeText:m,handleContentSizeChange:void 0!==a?h:void 0,webOutlineStyle:r?{outlineWidth:0}:void 0}}},77924:function(e,t,o){o.d(t,{Z:function(){return dialogs_BookCollectionDialogContainer}});var n=o(38839),l=o(32735),i=o(75921),r=o(75186),a=o(85723),c=o(76962),s=o(11995),d=o(9959),u=o(19499),m=o(31219),h=o(16787),p=o(21123),g=o(37860),C=o(48922),v=o(7353),b=o(87904),f=o(92837),Z=o(68101),k=o(32083),y=o(68108),w=o(37082),I=o(77826),B=o(302),z=o(40772),S=o(51276),T=o(48263),R=o(67153);let x=(0,m.zo)(b.Z)(e=>{let{theme:t}=e;return{flex:1,borderWidth:.5,borderColor:t.palette.border.weak,backgroundColor:t.palette.background.base,borderRadius:t.shape.radius.xxl,overflow:"hidden",height:"auto"}}),_=(0,m.zo)(b.Z)(e=>{let{theme:t}=e;return{backgroundColor:t.palette.surface.supportive,borderTopWidth:.5,borderTopColor:t.palette.border.weaker,width:"100%"}}),E=(0,m.zo)(m.X2)(e=>{let{theme:t}=e;return{minHeight:52,padding:12,alignItems:"flex-end",justifyContent:"space-between",backgroundColor:t.palette.surface.supportive,gap:6}}),X=(0,m.zo)(f.Z)(e=>{let{theme:t}=e;return{flexGrow:1,minHeight:42,paddingHorizontal:14,paddingVertical:"android"===s.Z.OS?7:12,fontSize:14,lineHeight:18,color:t.palette.text.strong}}),M=(0,m.zo)(b.Z)(e=>{let{disabled:t,theme:o}=e;return{width:36,height:36,borderRadius:o.shape.radius.full,backgroundColor:t?o.palette.status.disabled:o.palette.fill.accent,alignItems:"center",justifyContent:"center"}}),A=(0,m.zo)(b.Z)(e=>{let{theme:t}=e;
1return{alignItems:"center",justifyContent:"center",width:42,height:42}}),P=(0,m.zo)(Z.Z)(e=>{let{theme:t}=e;return{width:36,height:36,borderRadius:18,borderWidth:.5,borderColor:t.palette.border.weaker}}),L=(0,m.zo)(m.X2)(e=>{let{theme:t}=e;return{paddingHorizontal:14,paddingVertical:10,alignItems:"center",justifyContent:"space-between",backgroundColor:t.palette.surface.supportive}}),MobileCommentInputBanner=e=>{let{content:t,onCancel:o}=e;return(0,n.BX)(L,{children:[(0,n.tZ)(m.ZT,{variant:"caption2",color:"weak",weight:"medium",children:t}),(0,n.tZ)(m.Xd,{onPress:o,children:(0,n.tZ)(h.x8P,{color:"base",height:16,width:16})})]})},H=m.mM.create({sendButton:{height:42,alignItems:"center",justifyContent:"center"}});var MobileCommentInput=e=>{var t;let{collectionId:o,replyTo:i,onCancelReply:r,avatarUrl:c,onSubmit:s,onFocusChange:d,onRestricted:u}=e,p=(0,m.Fg)(),[g]=(0,C.T_)("one-dialog"),{bottom:v}=(0,w.HB)(),{text:b,focused:f,canSubmit:Z,isSubmitting:L,editable:F,writeRestriction:D,handleFocus:N,handleBlur:U,handleChangeText:G,handleSubmit:O}=(0,R.Gy)({collectionId:o,replyTo:i,onCancelReply:r,onSubmit:s,onFocusChange:d,onRestricted:u}),{inputRef:V,handleChangeText:j,handleContentSizeChange:W,webOutlineStyle:Q}=(0,T.A)({value:b,onChangeText:G}),K=(0,B.X2)(z.rC.key,null==i?void 0:i.authorId),[q,Y]=(0,l.useState)(0);(0,l.useEffect)(()=>{if(!S.$||!window.visualViewport)return;let handleResize=()=>{let e=window.visualViewport;if(!e)return;let t=window.innerHeight-e.height-e.offsetTop;Y(Math.max(0,t))};return window.visualViewport.addEventListener("resize",handleResize),window.visualViewport.addEventListener("scroll",handleResize),()=>{var e,t;null===(e=window.visualViewport)||void 0===e||e.removeEventListener("resize",handleResize),null===(t=window.visualViewport)||void 0===t||t.removeEventListener("scroll",handleResize)}},[]),(0,l.useEffect)(()=>{if(j(""),i){var e;null===(e=V.current)||void 0===e||e.focus()}},[null==i?void 0:i.commentId]);let $=p.palette.text.weak,J=!!b.length||f;return(0,n.tZ)(_,{style:{marginBottom:S.$?q:0,paddingBottom:S.$?0:f?12:v},children:(0,n.BX)(E,{children:[J?null:(0,n.tZ)(A,{children:(0,n.tZ)(P,{source:{uri:c||""}})}),(0,n.BX)(x,{children:[i?(0,n.tZ)(MobileCommentInputBanner,{content:"".concat(g("collections.comments.labels.entering-reply",{nickname:null!==(t=null==K?void 0:K.nickname)&&void 0!==t?t:""})),onCancel:r}):null,(0,n.tZ)(X,{ref:V,multiline:!0,style:[{includeFontPadding:!1,textAlignVertical:"center"},Q],maxLength:R.S5,value:b,onChangeText:j,onContentSizeChange:W,onFocus:N,onBlur:U,placeholder:"".concat(g("collections.comments.input.placeholder")),placeholderTextColor:$,editable:F}),D?(0,n.tZ)(k.Z,{style:a.Z.absoluteFill,onPress:N}):null]}),J?(0,n.tZ)(m.Xd,{onPress:O,disabled:!Z,style:H.sendButton,children:(0,n.tZ)(M,{disabled:!Z,children:L?(0,n.tZ)(y.Z,{size:"small",color:p.palette.text.strongInverse}):(0,n.tZ)(h.a2Z,{fill:I.Hk.opacity.white["100"],height:20})})}):null]})})},F=o(97674),D=o(69500),N=o(52295),U=o(83833);let G=(0,m.zo)(m.X2)(()=>({position:"relative",alignItems:"center",justifyContent:"space-between",paddingVertical:14,height:50})),O=(0,m.zo)(m.ZT)({flex:1,textAlign:"center"}),V=(0,m.zo)(m.hU)({width:40,height:40,position:"absolute",top:5,left
1:4,zIndex:1}),j=a.Z.create({wrapper:{flex:1},dialogContent:{flex:1,marginTop:0,paddingHorizontal:0},dialogContentWeb:{minHeight:0,overflow:"scroll"},contentContainer:{flexGrow:1,paddingVertical:16,paddingBottom:16}});function Content(e){var t;let{bookCollectionId:o,commentCount:r,onClose:a,onCommentAuthorPress:b}=e,f=(0,u.I0)(),Z=(0,U.Z)(U.x.WRITE_COMMENTS),[k,y]=(0,C.T_)(["page-dependent-ui","one-dialog"]),w=(0,N.Z)(),[I,B]=(0,l.useState)(void 0),z=(0,l.useRef)(null),{commentCount:S,onCommentSubmit:T,onCommentDelete:R,api:x,commentListItems:_,handleEndReached:E,fetchReplies:X,fetchMoreReplies:M,collectionOwnerId:A,collectionTitle:P,isLoading:L}=(0,D.Z)({bookCollectionId:o,initialCommentCount:r}),H=(0,l.useCallback)(e=>{var t,n;let l=e.parentId?"reply":"comment",i=g.ml.onClickCollectionSubmitComment(o,l,null!==(t=e.parentId)&&void 0!==t?t:"root");f(p.default.Actions.fireAnalyticsEvent({_analytics:i})),T(e),e.parentId||null===(n=z.current)||void 0===n||n.scrollTo({y:0,animated:!0})},[o,T]),W=k(1===S?"collections.comments-list.singular-title":"collections.comments-list.title",{count:S}),Q=(0,l.useCallback)((e,t)=>{let n=g.ml.onClickCollectionDetailProfile({role:"comment_author",clickId:Number(t),clickName:e,collectionId:o,collectionTitle:null!=P?P:""});f(p.default.Actions.fireAnalyticsEvent({_analytics:n})),b(e)},[o,P,b]),K=(0,l.useCallback)(e=>{B(e)},[]),q=(0,l.useCallback)(()=>{B(void 0)},[]);return(0,n.BX)(c.Z,{behavior:"ios"===s.Z.OS?"padding":void 0,style:j.wrapper,children:[(0,n.BX)(G,{children:[(0,n.tZ)(V,{iconSize:"large",onPress:a,children:(0,n.tZ)(h.x8P,{})}),(0,n.tZ)(O,{variant:"header3",weight:"semiBold",color:"strong",children:W})]}),(0,n.tZ)(d.Z,{ref:z,style:[j.dialogContent,"web"===s.Z.OS&&j.dialogContentWeb],contentContainerStyle:j.contentContainer,showsVerticalScrollIndicator:!1,children:L?(0,n.tZ)(F.Z,{full:!0,overlay:!1}):(0,n.tZ)(v.Z,{api:x,commentListItems:_,handleEndReached:E,fetchReplies:X,fetchMoreReplies:M,onReplyPress:K,activeCommentId:null!==(t=null==I?void 0:I.commentId)&&void 0!==t?t:null,collectionOwnerId:A,onCommentAuthorPress:Q,onDeleteComment:R,ListEmptyComponent:(0,n.tZ)(m.HY,{title:y("collections.comments.empty-state.title"),description:y("collections.comments.empty-state.sub-title")})})}),(0,n.tZ)(MobileCommentInput,{collectionId:o,replyTo:I,onCancelReply:q,avatarUrl:null!=w?w:"",onSubmit:H,onRestricted:()=>f(i.kX.openDialog("BookCollectionCommentRestriction",{restrictedUntil:null==Z?void 0:Z.endsAt}))})]})}var W=o(26704);let Q=a.Z.create({centerAvatar:{marginHorizontal:-20,zIndex:9999},cta:{marginVertical:8}}),K="https://static.tappytoon.com/assets/images/my-collections",q=[{uri:"".concat(K,"/jem_pofile_03.png"),size:110},{uri:"https://static.tappytoon.com/assets/images/default-user-profiles/Profile_Default03.png",size:130},{uri:"".concat(K,"/jem_pofile_01.png"),size:110}],Y=(0,m.zo)(m.Ee)(e=>{let{size:t,theme:o}=e;return{width:t,height:t,borderRadius:o.shape.radius.full,borderWidth:5,borderColor:o.palette.background.base}}),$=(0,m.zo)(m.zx)(e=>{let{isBottomSheet:t}=e;return{marginBottom:t?12:8}}),J=(0,m.zo)(m.L8)({paddingTop:2,paddingBottom:0}),ee=(0,m.zo)(m.vX)({marginTop:25}),et=(0,m.zo)(m.cZ)({paddingTop:26,paddingBottom:25,marginVertical:0}),eo=(0,m.zo)(m.X2)({alignItems:"center",justifyContent:"center"});function BookCollectionProfileGuideDialogContent(e){let{isBottomSheet:t,onConfirm:o}=e,[i]=(0,C.T_)("one-dialog"),r=(0,u.I0)();(0,l.useEffect)(()=>{let e=g.ml.onViewCreateProfileDialog("collections");r(p.default.Actions.fireAnalyticsEvent(p.default.assign({},e)))},[]);let a=p.default.useEventHandler(()=>(o(),g.ml.onClickCreateProfileDialogStart("collections")),[o]),c=i("collections.edit-profile-guide.title"),s=i("collections.edit-profile-guide.description"),d=i("collections.edit-profile-guide.buttons.get-started-title"),h=(0,n.tZ)(eo,{children:q.map((e,t)=>{let{uri:o,size:l}=e;return(0,n.tZ)(Y,{size:l,style:1===t?Q.centerAvatar:void 0,source:{uri:o},resizeMode:"cover"},o)})}),v=(0,n.BX)(m.sg,{alignItems:"center",children:[(0,n.tZ)(m.ZT,{children:c,color:"strong",variant:"header3",weight:"semiBold",align:"center"}),(0,n.tZ)(m.LZ,{size:2}),(0,n.tZ)(m.ZT,{children:s,color:"base",variant:"body3",weight:"regular",align:"center"}),(0,n.tZ)(m.LZ,{size:4}),h]}),b=(0,n.tZ)($,{isBottomSheet:t,children:d,color:"accent",onPress:a,variant:"solid",size:"medium"});return t?(0,n.BX)(l.Fragment,{children:[(0,n.tZ)(J,{children:v}),(0,n.tZ)(ee,{children:b})]}):(0,n.BX)(l.Fragment,{children:[(0,n.tZ)(et,{children:v}),(0,n.tZ)(m.kX,{children:b})]})}var en=o(97178),el=o(15638);let ei={HARASSMENT:"Harassment or Personal Attacks",HATE_SPEECH:"Hate Speech or Discrimination",HARMFUL_CONTENT:"Sexual, Violent, or Illegal Content",DISRUPTING_EXPERIENCE:"Disrupting Experience",PRIVACY_OR_SAFETY:"Privacy Violation or Safety Threats"},er=[{stringKey:"book-collection.report-reason.options.harassment",reason:ei.HARASSMENT},{stringKey:"book-collection.report-reason.options.hate_speech",reason:ei.HATE_SPEECH},{stringKey:"book-collection.report-reason.options.harmful_content",reason:ei.HARMFUL_CONTENT},{stringKey:"book-collection.report-reason.options.disrupting_experience",reason:ei.DISRUPTING_EXPERIENCE},{stringKey:"book-collection.report-reason.options.privacy_or_safety",reason:ei.PRIVACY_OR_SAFETY}];function BookCollectionReportReasonDialogContent(e){let{targetId:t,targetType:o,onClose:i}=e,r=(0,u.I0)(),[a]=(0,C.T_)("one-dialog"),c=(0,el.bK)(),[s,d]=(0,l.useState)(er[0].reason),reportReason=async e=>{try{await c.request(z._X.reportViolation({targetId:t,targetType:o,reason:e})),r(en.eX.showSnackbar({key:"one-toast:book-collection.report-submitted",status:"success"})),null==i||i()}catch(e){}};
1return(0,n.BX)(l.Fragment,{children:[(0,n.tZ)(m.$N,{children:a("book-collection.report-reason.title")}),(0,n.tZ)(m.cZ,{textAlign:"center",children:(0,n.tZ)(m.FX,{onChange:d,value:s,children:er.map(e=>(0,n.tZ)(m.Y8,{value:e.reason,children:a(e.stringKey)},e.reason))})}),(0,n.tZ)(m.kX,{children:(0,n.BX)(m.uV,{variant:"horizontal",color:"danger",children:[(0,n.tZ)(m.zx,{children:a("book-collection.report-reason.buttons.cancel"),onPress:i,size:"medium"},"cancel"),(0,n.tZ)(m.zx,{children:a("book-collection.report-reason.buttons.report"),onPress:()=>reportReason(s),size:"medium"},"confirm")]})})]})}var ea=o(2036),ec=o(59348),es=o(96315);let ed=(0,m.zo)(m.sg)({alignItems:"center",gap:16}),eu=(0,m.zo)(b.Z)(e=>{let{theme:t}=e;return{alignItems:"center",backgroundColor:t.palette.fill.weaker,borderRadius:8,justifyContent:"center",padding:8}}),em=(0,m.zo)(m.cZ)({marginTop:32});function BookCollectionCommentRestrictionDialogContent(e){let{onClose:t,restrictedUntil:o}=e,[i]=(0,C.T_)("one-dialog"),r=(0,l.useMemo)(()=>{if(!o)return"";let e=(0,es.Z)(o);return(0,ec.Z)(e)?(0,ea.Z)(e,"yyyy-MM-dd HH:mm"):""},[o]);return(0,n.BX)(l.Fragment,{children:[(0,n.tZ)(em,{children:(0,n.BX)(ed,{children:[(0,n.tZ)(eu,{children:(0,n.tZ)(h.Zdu,{color:"strong",height:24,width:24})}),(0,n.BX)(m.ZT,{align:"center",color:"base",variant:"body2",weight:"regular",children:[i("collections.comment.restriction-dialog.contents.prefix"),(0,n.tZ)(m.ZT,{color:"base",variant:"body2",weight:"semiBold",children:i("collections.comment.restriction-dialog.contents.period",{date:r})}),i("collections.comment.restriction-dialog.contents.suffix")]})]})}),(0,n.tZ)(m.kX,{children:(0,n.tZ)(m.zx,{children:i("collections.comment.restriction-dialog.buttons.confirm"),color:"accent",onPress:t,size:"medium",variant:"text"})})]})}var eh=o(28611),ep=o(39347),eg=o(28933),eC=o(4112),ev=o(4687);let CopyUrlListItem=e=>{let{title:t,icon:o,onClose:l,shareUrl:i}=e,[r]=(0,C.T_)("one-toast"),a=(0,ev.Z)(r("url-copied-to-clipboard"));return(0,n.tZ)(m.Y8,{startIcon:o,checkedIcon:(0,n.tZ)(m.LZ,{size:0}),children:t,onPress:()=>a(i).then(l).catch(eC.dG4)})};function ShareLinkDialogContent(e){let{isBottomSheet:t,link:o,onClose:i}=e,[r]=(0,C.T_)("one-dialog"),a=r("share-link.title"),c=r("share-link.buttons.copy-link");return(0,n.BX)(l.Fragment,{children:[t?(0,n.tZ)(m.J0,{children:a}):(0,n.tZ)(m.$N,{children:a}),t?(0,n.tZ)(m.L8,{children:(0,n.tZ)(CopyUrlListItem,{icon:(0,n.tZ)(h.CKM,{}),onClose:i,shareUrl:o,title:c})}):(0,n.BX)(m.cZ,{children:[(0,n.tZ)(CopyUrlListItem,{icon:(0,n.tZ)(h.CKM,{}),onClose:i,shareUrl:o,title:c}),(0,n.tZ)(m.LZ,{size:4}),(0,n.tZ)(m.zx,{children:r("share-link.buttons.close"),onPress:i,size:"medium",color:"accent",variant:"text"})]})]})}var eb=o(84168);let ef=(0,i.sm)("BookCollection",{...eb.Z,BookCollectionComments:function(e){let{bookCollectionId:t,commentCount:o,onClose:l,onCommentAuthorPress:i,onDialogClose:a,...c}=e,handleClose=()=>{null==l||l(),null==a||a()},s=(0,n.tZ)(Content,{bookCollectionId:t,commentCount:o,onClose:handleClose,onCommentAuthorPress:i});return(0,n.tZ)(r.Z,{children:s,onClose:handleClose,size:"full",style:{paddingBottom:0},...c})},BookCollectionAddSeries:W.Z,BookCollectionProfileGuide:function(e){let{visible:t,onClose:o,onConfirm:l,onDismiss:i}=e,a=(0,n.tZ)(BookCollectionProfileGuideDialogContent,{isBottomSheet:!1,onConfirm:()=>{l(),null==o||o()}});return(0,n.tZ)(r.Z,{children:a,visible:t,onClose:e=>{null==i||i(),null==o||o(e)}})},BookCollectionReportReason:function(e){let{visible:t,onClose:o,...l}=e;return(0,n.tZ)(r.Z,{visible:t,onClose:o,children:(0,n.tZ)(BookCollectionReportReasonDialogContent,{onClose:o,...l})})},BookCollectionCommentRestriction:function(e){let{onClose:t,restrictedUntil:o,...l}=e,i=(0,n.tZ)(BookCollectionCommentRestrictionDialogContent,{onClose:t,restrictedUntil:o});return(0,n.tZ)(r.Z,{children:i,onClose:t,style:{maxWidth:342},...l})},ShareLink:function(e){let{onClose:t,visible:o,link:l}=e,i=(0,ep.Z)(),a=(0,n.tZ)(ShareLinkDialogContent,{isBottomSheet:i,onClose:t,link:l});return i?(0,n.tZ)(eg.Z,{children:a,onClose:t,visible:o,style:{minHeight:188}}):(0,n.tZ)(r.Z,{children:a,onClose:t,visible:o})}});function dialogs_BookCollectionDialogContainer(){return(0,eh.Z)("BookCollection"),(0,n.tZ)(ef,{})}},4687:function(e,t,o){o.d(t,{Z:function(){return useCopyToClipboard}});var n=o(32735),l=o(19499),i=o(97178),r=o(4112);function useCopyToClipboard(e){let t=(0,l.I0)();return(0,n.useCallback)(async o=>{try{(0,r.DXL)(navigator)&&(0,r.DXL)(navigator.clipboard)&&(await navigator.clipboard.writeText(o),t(i.eX.showSnackbar({message:e,status:"success"})))}catch(e){}},[e])}}}]);
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.