38454-28d290b145b8d4c4.js 13 KB

12
  1. (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[38454],{75183:function(e,n,t){"use strict";var o,i=t(67597);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},r.apply(null,arguments)}n.Z=function(e){return i.createElement("svg",r({width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),o||(o=i.createElement("path",{d:"M3.135 6.158a.5.5 0 0 1 .707-.023L7.5 9.565l3.658-3.43a.5.5 0 0 1 .684.73l-4 3.75a.5.5 0 0 1-.684 0l-4-3.75a.5.5 0 0 1-.023-.707Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})))}},54988:function(e,n,t){"use strict";var o,i=t(67597);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},r.apply(null,arguments)}n.Z=function(e){return i.createElement("svg",r({width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),o||(o=i.createElement("path",{d:"M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM19 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))}},38454:function(e,n,t){"use strict";t.d(n,{Z:function(){return q}});var o=t(57611),i=t(37014),r=t.n(i),l=t(15129),c=t(61395),a=t(15033),s=t(86719),u=t.n(s),d=t(85748),f=t.n(d),h=t(21648),_=t(10117),m=t(85609),C=t(21899),v=t(12195),x=t(43609),p=t(84020),g=t(48842),j=t(1997),k=t(51726),b=t(67597),Z=t(89578),y=t(80924),N=t.n(y),I=t(59027),w=t(78033),D=t(85483),O=t(75183),T=t(54988),K=t(22582),S=t(66634),L=t(69640),M=t(85494),P=t(23266),E=t(18356),R=t(9192),z=t(99891),A=function(e){var n=e.id,t=e.title,i=e.bookmarks,r=e.sortBy,l=e.onSortByChange,a=e.onItemDeleted,s=e.isOwner,u=(0,b.useState)(!1),d=u[0],f=u[1],h=(0,c.Z)(),_=h.t,m=h.lang,C=(0,D.N)(),g=[{id:z.l.RecentlyAdded,label:_("collection:recently-added")},{id:z.l.VerseKey,label:_("collection:verse-key")}],y=(0,b.useContext)(R.Z),A=0===i.length,B=function(e){return(0,j.Z)((function(){var o,i,r;return(0,k.__generator)(this,(function(l){switch(l.label){case 0:return(0,v.MY)("collection_detail_delete_menu"),o=q(e),[4,C({confirmText:_("common:delete"),cancelText:_("common:cancel"),title:_("collection:delete-bookmark.title"),subtitle:_("collection:delete-bookmark.subtitle",{bookmarkName:o,collectionName:t})})];case 1:return i=l.sent(),r={verseKey:(0,L.u)(e.key,e.verseNumber),collectionId:n},i?((0,v.MY)("bookmark_delete_confirm",r),a(e.id)):(0,v.MY)("bookmark_delete_confirm_cancel",r),[2]}}))}))},F=function(e){return function(){var t=(0,L.u)(e.key,e.verseNumber);(0,v.MY)("collection_detail_go_to_ayah_menu",{verseKey:(0,L.u)(e.key,e.verseNumber),collectionId:n}),(0,S.R)((0,p.qs)(t))}},q=function(e){var n=(0,K.dy)(y,e.key.toString()),t=(0,L.u)(e.key,e.verseNumber);return"".concat(n.transliteratedName," ").concat((0,x.Tj)(t,m))};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:N().container,children:[(0,o.jsxs)("div",{className:N().header,children:[(0,o.jsx)("div",{className:N().title,children:t}),s&&(0,o.jsx)(Z.Z,{selectedOptionId:r,onChange:l,options:g,isSingleCollection:!0,collectionId:n})]}),(0,o.jsx)(M.ZP,{variant:M.Wu.Ghost,onClick:function(){f((function(e){return e?(0,v.MY)("collection_collapse_all",{collectionId:n}):(0,v.MY)("collection_expand_all",{collectionId:n}),!e}))},children:_(d?"collection:collapse-all":"collection:expand-all")}),(0,o.jsx)("div",{className:N().collectionItemsContainer,children:A?(0,o.jsxs)("div",{className:N().emptyCollectionContainer,children:[(0,o.jsx)("span",{children:_("collection:empty")}),(0,o.jsx)("div",{className:N().backToCollectionButtonContainer,children:(0,o.jsx)(M.ZP,{onClick:function(){(0,v.MY)("back_to_collections_button",{collectionId:n})},href:"/profile",children:_("collection:back-to-collection-list")})})]}):i.map((function(e){var t=q(e);return(0,o.jsx)(P.Z,{onOpenChange:function(t){return function(e,t){var o={verseKey:t,collectionId:n};e?(0,v.Kz)("collection_bookmark_collapse_opened",o):(0,v.Kz)("collection_bookmark_collapse_closed",o)}(t,(0,L.u)(e.key,e.verseNumber))},shouldOpen:d,title:t,prefix:(0,o.jsx)(O.Z,{}),shouldRotatePrefixOnToggle:!0,suffix:(0,o.jsxs)(E.Z,{trigger:(0,o.jsx)(M.ZP,{variant:M.Wu.Ghost,children:(0,o.jsx)(T.Z,{})}),onOpenChange:function(t){return function(e,t){var o={verseKey:(0,L.u)(t.key,t.verseNumber),collectionId:n};e?(0,v.Kz)("collection_bookmark_popover_menu_opened",o):(0,v.Kz)("collection_bookmark_popover_menu_closed",o)}(t,e)},children:[s&&(0,o.jsx)(E.Z.Item,{onClick:B(e),children:_("common:delete")}),(0,o.jsx)(E.Z.Item,{onClick:F(e),shouldCloseMenuAfterClick:!0,children:_("collection:go-to-ayah")})]}),children:function(n){if(!n.isOpen)return null;var t=e.key;return(0,o.jsx)(I.Z,{chapterId:t,verseNumber:e.verseNumber})}},e.id)}))})]}),(0,o.jsx)(w.Z,{})]})},B=t(50148),F=t(9740),q=function(e){var n,t,i=e.title,s=e.getSWRKey,d=e.onSortByChange,j=e.sortBy,k=e.shouldDeleteBookmark,b=(0,c.Z)(),Z=b.t,y=b.lang,N=(0,l.useRouter)().query.collectionId,I=(0,m.useToast)(),w=(0,a.ZP)(s,F.UK),D=w.data,O=w.size,T=w.setSize,K=w.mutate,S=w.isValidating;if(w.error)return(0,o.jsx)(B.default,{statusCode:403});if(!D)return(0,o.jsx)("div",{className:r()(f().container,f().loadingContainer),children:(0,o.jsx)(_.Z,{shouldDelayVisibility:!0,size:_.E.Large})});var L=function(){K()},P=D[D.length-1].pagination.hasNextPage,E=D.map((function(e){return e.data.bookmarks})).flat(),R=i||D[0].data.collection.name,z=null===(n=D[0])||void 0===n||null===(t=n.data)||void 0===t?void 0:t.isOwner,q=(0,p.pg)(N),Y=(null===E||void 0===E?void 0:E.length)>0&&O>1&&S;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(h.Z,{title:R,canonical:(0,p.Z2)(y,q),languageAlternates:(0,x.qc)(q),nofollow:!0,noindex:!0}),(0,o.jsx)("div",{className:u().pageContainer,children:(0,o.jsx)("div",{className:u().flow,children:(0,o.jsx)("div",{className:u().flowItem,children:(0,o.jsxs)("div",{className:f().container,children:[(0,o.jsx)(M.ZP,{href:(0,p.kJ)(),variant:M.Wu.Ghost,hasSidePadding:!1,children:(0,o.jsx)(C.Z,{})}),(0,o.jsx)(A,{id:(0,g.Nl)(N),title:R,bookmarks:E,sortBy:j,onSortByChange:d,onItemDeleted:function(e){k?(0,F.ez)(e).then((function(){L()})).catch((function(){I(Z("common:error.general"),{status:m.ToastStatus.Error})})):(0,F.Qd)(N,e).then((function(){L()})).catch((function(){I(Z("common:error.general"),{status:m.ToastStatus.Error})}))},isOwner:z}),Y&&(0,o.jsx)(_.Z,{size:_.E.Large}),P&&(0,o.jsx)("div",{className:f().loadMoreContainer,children:(0,o.jsx)(M.ZP,{onClick:function(){T(O+1),(0,v.MY)("collection_detail_page_load_more",{collectionId:(0,g.Nl)(N),page:O+1})},children:Z("collection:load-more")})})]})})})})]})}},89578:function(e,n,t){"use strict";var o=t(57611),i=t(35295),r=t.n(i),l=t(75183),c=t(12195),a=t(18356);n.Z=function(e){var n=e.options,t=e.selectedOptionId,i=e.onChange,s=e.isSingleCollection,u=e.collectionId,d=void 0===u?null:u,f=n.find((function(e){return e.id===t}));return(0,o.jsx)("div",{className:r().sorter,children:(0,o.jsx)(a.Z,{trigger:(0,o.jsxs)("span",{className:r().sortTrigger,children:[f.label,(0,o.jsx)("span",{className:r().itemIcon,children:(0,o.jsx)(l.Z,{})})]}),onOpenChange:function(e){var n={collectionId:d};s?e?(0,c.Kz)("collection_sorter_opened",n):(0,c.Kz)("collection_sorter_closed",n):e?(0,c.Kz)("collections_sorter_opened",n):(0,c.Kz)("collections_sorter_closed",n)},children:n.map((function(e){return(0,o.jsx)(a.Z.Item,{shouldCloseMenuAfterClick:!0,onClick:function(){return i(e.id)},children:e.label},e.id)}))})})}},59027:function(e,n,t){"use strict";var o=t(57044),i=t(16946),r=t(57611),l=(t(67597),t(61395)),c=t(648),a=t(14068),s=t.n(a),u=t(87739),d=t(73756),f=t(4424),h=t(43550),_=t(5330),m=t(48752),C=t(15721),v=t(27967),x=t(1050);n.Z=function(e){var n=e.chapterId,t=e.verseNumber,a=e.fontScale,p=(0,c.v9)(_.Pt,c.wU),g=p.quranFont,j=p.mushafLines,k=(0,C.$P)(g,j).mushaf,b=(0,c.v9)(m.qw,x.Hj),Z=(0,l.Z)().lang,y=(0,i.Z)((0,o.Z)({words:!0,perPage:1,translations:b.join(","),page:t},(0,C.hD)(p.quranFont)),{mushaf:k});return(0,r.jsx)(d.Z,{queryKey:"embeddable-verse-".concat(n,":").concat(t),fetcher:function(){return(0,u._i)((0,v.ML)(n.toString(),Z,y))},render:function(e){var n,t;if(!e)return null;var o=null===(n=e.verses)||void 0===n?void 0:n[0];return(0,r.jsxs)("div",{className:s().verseContainer,children:[(0,r.jsx)(h.Z,{verses:e.verses,fontScale:a}),(0,r.jsx)("div",{children:null===(t=o.translations)||void 0===t?void 0:t.map((function(e){return(0,r.jsx)(f.Z,{translationFontScale:p.translationFontScale,text:e.text,languageId:e.languageId,resourceName:e.resourceName},e.id)}))})]})}})}},23266:function(e,n,t){"use strict";t.d(n,{a:function(){return o}});var o,i=t(45361),r=t(57611),l=t(67597),c=t(64826),a=t(37014),s=t.n(a),u=t(55340),d=t.n(u);!function(e){e.Left="left",e.Right="right"}(o||(o={}));n.Z=function(e){var n=e.isDefaultOpen,t=void 0!==n&&n,a=e.prefix,u=e.title,f=e.suffix,h=e.children,_=e.shouldRotatePrefixOnToggle,m=e.shouldOpen,C=e.onOpenChange,v=e.direction,x=void 0===v?o.Left:v,p=(0,l.useState)(t),g=p[0],j=p[1];(0,l.useEffect)((function(){j(m)}),[m]);return(0,r.jsxs)(c.fC,{onOpenChange:C,open:g,children:[(0,r.jsx)(c.xz,{asChild:!0,children:(0,r.jsx)("div",{className:d().header,onClick:function(){return j((function(e){return!e}))},children:x===o.Left?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:d().headerLeft,children:[(0,r.jsx)("div",{className:s()(d().prefixContainer,(0,i.Z)({},d().prefixRotated,_&&g)),children:a}),u]}),(0,r.jsx)("div",{className:d().suffixContainer,onClick:function(e){e.preventDefault(),e.stopPropagation()},children:f})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:d().headerLeft,children:u}),(0,r.jsx)("div",{className:s()(d().prefixContainer,(0,i.Z)({},d().prefixRotated,_&&g)),children:a})]})})}),(0,r.jsx)(c.Fw,{children:g&&h({isOpen:g})})]})}},78033:function(e,n,t){"use strict";var o=t(57611),i=t(67597),r=t(85483),l=t(3463);n.Z=function(){var e=(0,r.t)(),n=e.onCancel,t=e.onConfirm,c=e.state,a=(0,i.useMemo)((function(){var e=[];return c.confirmText&&t&&e.push({label:c.confirmText,onClick:t}),c.cancelText&&n&&e.push({label:c.cancelText,onClick:n,isCloseAction:!0}),e}),[n,t,c.cancelText,c.confirmText]),s=function(){n&&n()};return(0,o.jsxs)(l.Z,{isOpen:!!c.open,onClickOutside:s,onEscapeKeyDown:s,children:[(0,o.jsxs)(l.Z.Body,{children:[(0,o.jsxs)(l.Z.Header,{children:[(0,o.jsx)(l.Z.Title,{children:c.title}),(0,o.jsx)(l.Z.Subtitle,{children:c.subtitle})]}),(0,o.jsx)("p",{children:c.description})]}),(0,o.jsx)(l.Z.Footer,{children:a.map((function(e,n){var t=e.onClick,i=e.label;return e.isCloseAction?(0,o.jsx)(l.Z.CloseAction,{onClick:t,children:i},n):(0,o.jsx)(l.Z.Action,{onClick:t,children:i},n)}))})]})}},85483:function(e,n,t){"use strict";t.d(n,{N:function(){return d},t:function(){return u}});var o,i=t(57044),r=t(16946),l=t(67597),c={open:!1},a=function(e){c=e,s.forEach((function(e){return e(c)}))},s=[],u=function(){var e=(0,l.useState)(c),n=e[0],t=e[1];(0,l.useEffect)((function(){return s.push(t),function(){var e=s.indexOf(t);e>-1&&s.splice(e,1)}}),[n]);var u=function(){a((0,r.Z)((0,i.Z)({},n),{open:!1}))};return{state:n,onCancel:function(){u(),o(!1)},onConfirm:function(){u(),o(!0)}}},d=function(){return function(e){return a((0,r.Z)((0,i.Z)({},e),{open:!0})),new Promise((function(e){o=e}))}}},99891:function(e,n,t){"use strict";var o,i;t.d(n,{l:function(){return o},r:function(){return i}}),function(e){e.RecentlyAdded="recentlyAdded",e.VerseKey="verseKey"}(o||(o={})),function(e){e.RecentlyUpdated="recentlyUpdated",e.Alphabetical="alphabetical"}(i||(i={}))},80924:function(e){e.exports={header:"CollectionDetail_header__mLL6m",title:"CollectionDetail_title__QN2uH",sorter:"CollectionDetail_sorter__TDDjt",sorterIcon:"CollectionDetail_sorterIcon__RYGFI",collectionItemsContainer:"CollectionDetail_collectionItemsContainer__PQkgK",verseContainer:"CollectionDetail_verseContainer__ImQEQ",emptyCollectionContainer:"CollectionDetail_emptyCollectionContainer__fmU40",backToCollectionButtonContainer:"CollectionDetail_backToCollectionButtonContainer__G_Qmt",bookmarkLink:"CollectionDetail_bookmarkLink__0Q4jb",linkContainer:"CollectionDetail_linkContainer__eTUAG"}},85748:function(e){e.exports={container:"CollectionDetailContainer_container__ZDXCw",loadMoreContainer:"CollectionDetailContainer_loadMoreContainer__z09WI",loadingContainer:"CollectionDetailContainer_loadingContainer__2i3JF",emptyContainer:"CollectionDetailContainer_emptyContainer__qygbi"}},35295:function(e){e.exports={sorter:"CollectionSorter_sorter__FUf1K",sortTrigger:"CollectionSorter_sortTrigger__C17Do",itemIcon:"CollectionSorter_itemIcon___37wK"}},14068:function(e){e.exports={verseContainer:"EmbeddableVerseCell_verseContainer__GCj_d"}},55340:function(e){e.exports={header:"Collapsible_header__CmhJq",headerLeft:"Collapsible_headerLeft__Xh00n",prefixContainer:"Collapsible_prefixContainer__AVHUT",prefixRotated:"Collapsible_prefixRotated__bjKLn",suffixContainer:"Collapsible_suffixContainer__uZ1IW"}}}]);
  2. //# sourceMappingURL=38454-28d290b145b8d4c4.js.map