45096.29af806bcbc7ffc8.js 32 KB

12
  1. (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[45096],{82497:function(e,n,t){"use strict";var r,o=t(67597);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},a.apply(null,arguments)}n.Z=function(e){return o.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-bookmark"},e),r||(r=o.createElement("path",{d:"m19 21-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})))}},39659:function(e,n,t){"use strict";var r,o,a=t(67597);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},s.apply(null,arguments)}n.Z=function(e){return a.createElement("svg",s({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=a.createElement("path",{d:"M10 13a5.001 5.001 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),o||(o=a.createElement("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))}},89034:function(e,n,t){"use strict";var r,o,a=t(67597);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},s.apply(null,arguments)}n.Z=function(e){return a.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-copy"},e),r||(r=a.createElement("rect",{x:9,y:9,width:13,height:13,rx:2,ry:2})),o||(o=a.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})))}},23246:function(e,n,t){"use strict";var r,o=t(67597);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},a.apply(null,arguments)}n.Z=function(e){return o.createElement("svg",a({width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=o.createElement("path",{d:"M3 2.5a.5.5 0 0 1 .5-.5h5.586a.5.5 0 0 1 .353.146l2.415 2.415a.5.5 0 0 1 .146.353V12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-10ZM3.5 1A1.5 1.5 0 0 0 2 2.5v10A1.5 1.5 0 0 0 3.5 14h8a1.5 1.5 0 0 0 1.5-1.5V4.914a1.5 1.5 0 0 0-.44-1.06l-2.414-2.415A1.5 1.5 0 0 0 9.086 1H3.5Zm1 3a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1h-3Zm0 3a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1h-6Zm0 3a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1h-6Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})))}},96370:function(e,n,t){"use strict";var r,o,a=t(67597);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},s.apply(null,arguments)}n.Z=function(e){return a.createElement("svg",s({viewBox:"1.928 0.875 11.023 13.01",width:11.023,height:13.01,xmlns:"http://www.w3.org/2000/svg"},e),r||(r=a.createElement("path",{d:"M3.451.875a1.5 1.5 0 0 0-1.5 1.5v10a1.5 1.5 0 0 0 1.5 1.5h8a1.5 1.5 0 0 0 1.5-1.5V4.789c0-.398-.158-.779-.439-1.061l-2.414-2.414A1.5 1.5 0 0 0 9.037.875H3.451Z",fill:"#00abff",fillRule:"evenodd",clipRule:"evenodd"})),o||(o=a.createElement("path",{d:"M2.928 2.385a.5.5 0 0 1 .5-.5h5.586a.5.5 0 0 1 .354.146l2.414 2.414a.5.5 0 0 1 .146.354v7.586a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-10Zm.5-1.5a1.5 1.5 0 0 0-1.5 1.5v10a1.5 1.5 0 0 0 1.5 1.5h8a1.5 1.5 0 0 0 1.5-1.5V4.799c0-.398-.158-.779-.439-1.061l-2.414-2.414A1.5 1.5 0 0 0 9.014.885H3.428Zm1 3a.5.5 0 0 0 0 1h3a.5.5 0 1 0 0-1h-3Zm0 3a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1h-6Zm0 3a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1h-6Z",fillRule:"evenodd",clipRule:"evenodd"})))}},90501:function(e,n,t){"use strict";var r,o=t(67597);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},a.apply(null,arguments)}n.Z=function(e){return o.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-bookmark"},e),r||(r=o.createElement("path",{d:"m19 21-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})))}},49127:function(e){function n(){return new DOMException("The request is not allowed","NotAllowedError")}e.exports=async function(e){try{await async function(e){if(!navigator.clipboard)throw n();return navigator.clipboard.writeText(e)}(e)}catch(t){try{await async function(e){const t=document.createElement("span");t.textContent=e,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const r=window.getSelection(),o=window.document.createRange();r.removeAllRanges(),o.selectNode(t),r.addRange(o);let a=!1;try{a=window.document.execCommand("copy")}finally{r.removeAllRanges(),window.document.body.removeChild(t)}if(!a)throw n()}(e)}catch(r){throw r||t||n()}}}},57094:function(e){e.exports=function(e){return e.split("")}},45534:function(e){e.exports=function(e,n,t){var r=-1,o=e.length;n<0&&(n=-n>o?0:o+n),(t=t>o?o:t)<0&&(t+=o),o=n>t?0:t-n>>>0,n>>>=0;for(var a=Array(o);++r<o;)a[r]=e[r+n];return a}},19257:function(e,n,t){var r=t(45534);e.exports=function(e,n,t){var o=e.length;return t=void 0===t?o:t,!n&&t>=o?e:r(e,n,t)}},46128:function(e,n,t){var r=t(19257),o=t(45245),a=t(85915),s=t(46235);e.exports=function(e){return function(n){n=s(n);var t=o(n)?a(n):void 0,i=t?t[0]:n.charAt(0),c=t?r(t,1).join(""):n.slice(1);return i[e]()+c}}},45245:function(e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},85915:function(e,n,t){var r=t(57094),o=t(45245),a=t(97549);e.exports=function(e){return o(e)?a(e):r(e)}},97549:function(e){var n="[\\ud800-\\udfff]",t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",i="(?:"+t+"|"+r+")"+"?",c="[\\ufe0e\\ufe0f]?",l=c+i+("(?:\\u200d(?:"+[o,a,s].join("|")+")"+c+i+")*"),u="(?:"+[o+t+"?",t,a,s,n].join("|")+")",d=RegExp(r+"(?="+r+")|"+u+l,"g");e.exports=function(e){return e.match(d)||[]}},14574:function(e,n,t){var r=t(46235),o=t(96676);e.exports=function(e){return o(r(e).toLowerCase())}},96676:function(e,n,t){var r=t(46128)("toUpperCase");e.exports=r},55604:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return an},onShareClicked:function(){return on}});var r,o,a=t(69976),s=t(57611),i=t(67597),c=t(49127),l=t.n(c),u=t(61395),d=t(648),f=t(1997),m=t(45361),h=t(57044),v=t(16946),p=t(51726),g=t(99968),_=t(62103),b=t(18356),w=t(82497),y=t(90501),x=t(10117),j=t(85609),C=t(63746),Z=t(5330),k=t(15721),N=t(9740),T=t(37572),S=t(19226),E=t(12195),V=t(41527),R=function(e){var n=e.verse,t=e.isTranslationView,r=e.onActionTriggered,o=e.bookmarksRangeUrl,a=(0,d.v9)(C.it,d.wU),c=(0,d.v9)(Z.Pt,d.wU),l=(0,k.$P)(c.quranFont,c.mushafLines).mushaf,R=(0,u.Z)("common").t,I=(0,d.I0)(),M=(0,j.useToast)(),A=(0,g.kY)(),O=A.cache,K=A.mutate,F=(0,_.Z)((0,S.jl)()?(0,T.Wn)(l,Number(n.chapterId),V.Z.Ayah,Number(n.verseNumber)):null,(0,f.Z)((function(){return(0,p.__generator)(this,(function(e){switch(e.label){case 0:return[4,(0,N.$l)(l,Number(n.chapterId),V.Z.Ayah,Number(n.verseNumber))];case 1:return[2,e.sent()]}}))}))),L=F.data,q=F.isValidating,B=F.mutate,P=(0,i.useMemo)((function(){var e=(0,S.jl)();return e&&L?L:!e&&!!a[n.verseKey]}),[a,L,n.verseKey]),W=function(e){if(o){var t=O.get(o),r=(0,v.Z)((0,h.Z)({},t),(0,m.Z)({},n.verseKey,e));K(o,r,{revalidate:!1})}},U=(0,s.jsx)(x.Z,{});return q||(U=P?(0,s.jsx)(w.Z,{}):(0,s.jsx)(y.Z,{})),(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(b.Z.Item,{onClick:function(){(0,E.MY)("".concat(t?"translation_view":"reading_view","_verse_actions_menu_").concat(P?"un_bookmark":"bookmark")),(0,S.jl)()?(P&&B((function(){return null}),{revalidate:!1}),O.delete((0,T.Ev)((0,k.$P)(c.quranFont,c.mushafLines).mushaf)),P?(0,N.ez)(L.id).then((function(){W(null),M(R("verse-bookmark-removed"),{status:j.ToastStatus.Success})})):(0,N.Rl)({key:Number(n.chapterId),mushafId:l,type:V.Z.Ayah,verseNumber:n.verseNumber}).then((function(e){B(),W(e),M(R("verse-bookmarked"),{status:j.ToastStatus.Success})})).catch((function(e){400!==e.status?M(R("error.general"),{status:j.ToastStatus.Error}):M(R("common:error.bookmark-sync"),{status:j.ToastStatus.Error})}))):I((0,C.b2)(n.verseKey)),r&&r()},icon:U,isDisabled:q,children:P?"".concat(R("bookmarked"),"!"):"".concat(R("bookmark"))})})},I=t(15129),M=t(58078),A=t(96913),O=t(23246),K=t(96370),F=t(84020),L=function(e){var n=e.verse,t=(0,A.Z)({from:n.verseKey,to:n.verseKey}).data,r=(0,i.useState)(!1),o=r[0],a=r[1],c=(0,u.Z)("common").t,l=(0,I.useRouter)(),d=t&&t[n.verseKey]>0;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.Z.Item,{onClick:function(){var e=(0,S.jl)();(0,E.MY)("note_menu_item",{isUserLoggedIn:e}),e?a(!0):l.push((0,F.gk)((0,F.P6)(n.verseKey)))},icon:d?(0,s.jsx)(K.Z,{}):(0,s.jsx)(O.Z,{}),children:c("notes.title")}),(0,s.jsx)(M.Z,{isOpen:o,onClose:function(){a(!1)},verseKey:n.verseKey})]})},q=t(8522),B=t(29700),P=t.n(B),W=t(47995),U=t(85494),Y=t(59807),z=t(41418),H=t(77107),D=t(12253),$=t(24277),G=function(e){var n=e.isOpen,t=e.collections,r=e.onCollectionToggled,o=e.onNewCollectionCreated,a=e.onClose,c=e.verseKey,l=(0,i.useState)(!1),d=l[0],f=l[1],m=(0,i.useState)(!1),h=m[0],v=m[1],p=(0,i.useRef)(),g=(0,u.Z)().t,_=(0,j.useToast)(),b=function(e){return function(n){var t={verseKey:c,collectionId:e.id};n?(0,E.Kz)("ayah_added_to_collection_checkbox",t):(0,E.Kz)("ayah_removed_from_collection_checkbox",t),r(e,n)}};return(0,s.jsxs)(Y.default,{innerRef:p,isOpen:n,header:(0,s.jsx)("p",{className:P().header,children:g("quran-reader:save-to")}),hasCloseButton:!0,onClose:a,onEscapeKeyDown:a,size:Y.ContentModalSize.SMALL,children:[(0,s.jsx)("div",{className:P().collectionList,children:t.map((function(e){return(0,s.jsx)("div",{className:P().collectionItem,children:(0,s.jsx)(z.Z,{id:e.name,defaultChecked:e.checked,label:e.name,onChange:b(e)})},e.id)}))}),(0,s.jsx)("div",{children:d?(0,s.jsx)("div",{className:P().newCollectionFormContainer,children:(0,s.jsx)(W.Z,{formFields:[{field:"name",placeholder:g("quran-reader:new-collection-name"),rules:[{type:D.S.Required,value:!0,errorMessage:"Required"}],type:$.E.Text}],actionText:g("common:submit"),isSubmitting:h,onSubmit:function(e){v(!0),(0,E.MY)("save_to_collection_modal_submit"),o(e.name).then((function(){return a(),_(g("quran-reader:saved-to",{collectionName:e.name}),{status:j.ToastStatus.Success}),f(!1)})).catch((function(){_(g("common:error.general"),{status:j.ToastStatus.Error})})).finally((function(){return v(!1)}))}})}):(0,s.jsx)(U.ZP,{variant:U.Wu.Ghost,prefix:(0,s.jsx)(H.Z,{}),onClick:function(){f(!0),(0,E.MY)("save_to_collection_add_new_collection")},children:g("quran-reader:add-collection")})})]})},Q=function(e){var n=e.verse,t=e.bookmarksRangeUrl,r=e.isTranslationView,o=(0,i.useState)(!1),a=o[0],c=o[1],l=(0,d.v9)(Z.Pt,d.wU),m=(0,k.$P)(l.quranFont,l.mushafLines).mushaf,h=(0,u.Z)().t,v=(0,g.ZP)((0,S.jl)()?(0,T.Tb)({}):null,(function(){return(0,N.fG)({})})),w=v.data,y=v.mutate,x=(0,g.kY)().mutate,C=(0,_.Z)((0,S.jl)()?(0,T.Jm)(m,Number(n.chapterId),V.Z.Ayah,Number(n.verseNumber)):null,(0,f.Z)((function(){return(0,p.__generator)(this,(function(e){switch(e.label){case 0:return[4,(0,N.uB)(m,Number(n.chapterId),V.Z.Ayah,Number(n.verseNumber))];case 1:return[2,e.sent()]}}))}))),R=C.data,I=C.mutate,M=(0,j.useToast)(),A=function(){(0,S.jl)()&&(x((0,T.Wn)(m,Number(n.chapterId),V.Z.Ayah,Number(n.verseNumber))),t&&x(t))},O=function(){return x((0,T.Ev)((0,k.$P)(l.quranFont,l.mushafLines).mushaf))},K=R&&w,F=K?w.data.map((function(e){return{id:e.id,name:e.name,checked:null===R||void 0===R?void 0:R.includes(e.id)}})):[];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.Z.Item,{onClick:function(){c(!0),r?(0,E.MY)("save_to_collection_menu_trans_view"):(0,E.MY)("save_to_collection_menu_reading_view")},icon:(0,s.jsx)(H.Z,{}),children:h("common:save-to-collection")}),K&&(0,s.jsx)(G,{isOpen:a,onCollectionToggled:function(e,t){!0===t?(0,N.qB)({key:Number(n.chapterId),mushaf:m,type:V.Z.Ayah,verseNumber:n.verseNumber,collectionId:e.id}).then((function(){M(h("quran-reader:saved-to",{collectionName:e.name}),{status:j.ToastStatus.Success}),A(),y(),I(),O()})).catch((function(e){400!==e.status?M(h("common:error.general"),{status:j.ToastStatus.Error}):M(h("common:error.bookmark-sync"),{status:j.ToastStatus.Error})})):(0,N.Ld)({key:Number(n.chapterId),mushaf:m,type:V.Z.Ayah,verseNumber:n.verseNumber,collectionId:e.id}).then((function(){M(h("quran-reader:removed-from",{collectionName:e.name}),{status:j.ToastStatus.Success}),A(),y(),I(),O()})).catch((function(e){400!==e.status?M(h("common:error.general"),{status:j.ToastStatus.Error}):M(h("common:error.bookmark-sync"),{status:j.ToastStatus.Error})}))},onNewCollectionCreated:function(e){return(0,N.Hc)(e).then((function(e){(0,N.qB)({collectionId:e.id,key:Number(n.chapterId),mushaf:m,type:V.Z.Ayah,verseNumber:n.verseNumber}).then((function(){A(),y(),I((0,q.Z)(R).concat([e.id])),O()})).catch((function(e){400!==e.status?M(h("common:error.general"),{status:j.ToastStatus.Error}):M(h("common:error.bookmark-sync"),{status:j.ToastStatus.Error})}))}))},onClose:function(){c(!1)},collections:F,verseKey:"".concat(n.chapterId,":").concat(n.verseNumber)})]})},J=t(37014),X=t.n(J),ee=t(83604),ne=t(63747),te=t(87739),re=function(e){var n=e.verseKey,t=e.showRangeOfVerses,r=e.rangeStartVerse,o=e.rangeEndVerse,a=e.translations,s=e.shouldCopyFootnotes,i=e.shouldIncludeTranslatorName,c=e.shouldCopyFont,l=n,u=n;t&&(l=r,u=o);var d=Object.keys(a).filter((function(e){return!0===a[e].shouldBeCopied}));return(0,te.KP)((0,h.Z)({raw:!0,from:l,to:u,footnote:s,translatorName:i},d.length>0&&{translations:d.join(", ")},c&&(0,h.Z)({},(0,k.$P)(c,ne.AN.SixteenLines)))).then((function(e){return e.result}))},oe=function(e){return new Blob([e],{type:"text/plain"})},ae=function(){var e=(0,f.Z)((function(e){var n;return(0,p.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,1,,5]),navigator.clipboard.write([new ClipboardItem({"text/plain":e})]),[3,5];case 1:return t.sent(),[4,e];case 2:return[4,t.sent().text()];case 3:return n=t.sent(),[4,l()(n)];case 4:return t.sent(),[3,5];case 5:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),se=ae,ie=function(){var e=(0,f.Z)((function(e){var n,t,r,o,a,s,i,c,l;return(0,p.__generator)(this,(function(u){return n=e.showRangeOfVerses,t=e.rangeEndVerse,r=e.rangeStartVerse,o=e.shouldCopyFootnotes,a=e.shouldIncludeTranslatorName,s=e.shouldCopyFont,i=e.translations,c=e.verseKey,l=re({rangeEndVerse:t,rangeStartVerse:r,shouldCopyFootnotes:o,shouldCopyFont:s,shouldIncludeTranslatorName:a,showRangeOfVerses:n,translations:i,verseKey:c}).then(oe),se(l),[2,l]}))}));return function(n){return e.apply(this,arguments)}}(),ce=ie,le=t(69640),ue=function(e,n){return e&&n?e===n?"Range start and end should be different.":(0,le.tR)(e)>(0,le.tR)(n)?"The starting verse has to be before the ending verse.":null:"Range start and end must have a value."},de=t(88228),fe=t.n(de),me=t(34135),he=t(80941),ve=t(38429),pe=t(3357),ge=t(57830),_e=t(48752),be=t(27967),we=t(1050),ye=t(43609),xe=t(9192),je="single",Ce="multiple",Ze=String(!0),ke=String(!1),Ne=[ne.fr.Uthmani,ne.fr.MadaniV1,ne.fr.MadaniV2,ne.fr.IndoPak],Te=function(e){var n=e.verse,t=e.children,r=(0,u.Z)("quran-reader"),o=r.lang,a=r.t,c=(0,i.useContext)(xe.Z),l=(0,d.v9)(_e.qw,we.Hj),f=(0,i.useState)(!1),p=f[0],g=f[1],b=(0,i.useState)([]),w=b[0],y=b[1],x=(0,i.useState)(null),j=x[0],C=x[1],Z=(0,i.useState)(null),k=Z[0],N=Z[1],T=(0,i.useState)(ne.fr.Uthmani),S=T[0],V=T[1],R=(0,i.useState)(!0),I=R[0],M=R[1],A=(0,i.useState)(!0),O=A[0],K=A[1],F=(0,i.useState)({}),L=F[0],B=F[1],P=(0,i.useState)(null),W=P[0],U=P[1],Y=(0,i.useState)(!1),H=Y[0],D=Y[1],$=(0,i.useState)(null),G=$[0],Q=$[1],J=(0,i.useState)(!1),re=J[0],oe=J[1];(0,i.useEffect)((function(){var e;return!0===H&&(e=setTimeout((function(){return D(!1)}),5e3)),function(){clearTimeout(e)}}),[H]);var ae,se=(0,_.Z)((0,be.c7)(o),(function(){return(0,te.yZ)(o).then((function(e){return function(e){if(500===e.status)throw new Error("internal server error")}(e),e}))})).data,ie=(0,i.useMemo)((function(){return null!==(ae=null===se||void 0===se?void 0:se.translations)&&void 0!==ae?ae:[]}),[se]);(0,i.useEffect)((function(){var e={};ie.filter((function(e){return l.includes(e.id)})).forEach((function(n){e[n.id]={shouldBeCopied:!0,name:n.translatedName.name}})),B(e)}),[o,l,ie]);var de=(0,i.useCallback)((function(e,n){U(null),n===ee.S.START?C(e):N(e)}),[]);return t({ayahSelectionComponent:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:fe().label,children:a("select-range")}),(0,s.jsx)(he.Z,{label:"verses_range",orientation:he.E.Horizontal,onChange:function(e){(0,E.Q8)("advanced_copy_modal_range_type",p?Ce:je,e),e===je?g(!1):function(){if(g(!0),!j||!k){var e=(0,le.qB)(c,n.chapterId);y(e.map((function(e){return{id:e,name:e,value:e,label:(0,ye.Tj)(e,o)}})));var t=(null===n||void 0===n?void 0:n.verseNumber)||1;C(e[t-1]),N(e[e.length-1])}}()},value:p?Ce:je,items:[{value:je,id:je,label:"".concat(a("current-verse")," ").concat((0,ye.Tj)(n.verseKey,o))},{value:Ce,id:Ce,label:a("verses-range")}]}),null!==j&&(0,s.jsx)(me.Z,{isVisible:p,dropdownItems:w,rangeStartVerse:(0,ye.Tj)(j,o),rangeEndVerse:(0,ye.Tj)(k,o),onChange:de}),0!==l.length&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:fe().label,children:[a("common:translations"),":"]}),l.map((function(e){return L[e]?(0,s.jsx)(z.Z,{onChange:function(){return function(e){B((function(n){var t=!n[e].shouldBeCopied;return(0,E.u8)("advanced_copy_modal_translation",e,t),(0,v.Z)((0,h.Z)({},n),(0,m.Z)({},e,(0,v.Z)((0,h.Z)({},n[e]),{shouldBeCopied:t})))}))}(e.toString())},checked:L[e].shouldBeCopied,id:e.toString(),label:L[e].name},e):(0,s.jsx)("div",{className:fe().emptyCheckbox},e)})),(0,s.jsx)("p",{className:fe().label,children:a("include-translator")}),(0,s.jsx)(he.Z,{label:"include_translator",value:O?Ze:ke,onChange:function(e){var n=e===Ze;(0,E.Kz)("advanced_copy_modal_include_translator_".concat(n?"selected":"unselected")),K(n)},items:[{value:Ze,id:Ze,label:a("common:yes")},{value:ke,id:ke,label:a("common:no")}]})]}),(0,s.jsxs)("div",{className:X()(fe().label,fe().fontLabelContainer),children:[(0,s.jsx)("p",{children:a("font")}),(0,s.jsx)(pe.Z,{children:a("font-tooltip")})]}),(0,s.jsx)(ve.Z,{id:"arabic-font-to-copy",name:"arabic-font-to-copy",placeholder:a("font-placeholder"),options:[{label:a("common:none"),value:""}].concat((0,q.Z)(Ne.map((function(e){return{label:a("common:fonts.".concat(e)),value:e}})))),value:S,onChange:function(e){return n=e,(0,E.u8)("advanced_copy_modal_font",n),void V(n);var n}}),(0,s.jsx)("p",{className:fe().label,children:a("copy-footnote-q")}),(0,s.jsx)(he.Z,{label:"copy_footnotes",value:I?Ze:ke,onChange:function(e){var n=e===Ze;(0,E.Kz)("advanced_copy_modal_copy_footnote_".concat(n?"selected":"unselected")),M(n)},items:[{value:Ze,id:Ze,label:a("common:yes")},{value:ke,id:ke,label:a("common:no")}]}),W&&(0,s.jsx)("div",{className:fe().customMessage,children:W}),G&&(0,s.jsxs)("p",{className:fe().customMessage,children:[a("copy-success")," ",(0,s.jsx)(ge.Z,{href:G,download:"quran.copy.txt",variant:ge.r.Highlight,onClick:function(){(0,E.MY)("advanced_copy_modal_download_file")},children:a("common:click-here")})," ",a("download-copy")]})]}),actionText:a(H?"common:copied-to-clipboard":"common:copy"),loading:re,onCopy:function(){if((0,E.MY)("advanced_copy_modal_copy"),oe(!0),p){var e=ue(j,k);if(e)return U(e),void oe(!1)}ce({showRangeOfVerses:p,rangeEndVerse:k,rangeStartVerse:j,shouldCopyFootnotes:I,shouldIncludeTranslatorName:O,shouldCopyFont:S,translations:L,verseKey:n.verseKey}).then((function(e){oe(!1),Q(window.URL.createObjectURL(e)),D(!0)})).catch((function(){oe(!1)}))}})},Se=t(56490),Ee=t.n(Se),Ve=t(45627),Re=t(94720);function Ie(){return Ie=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Ie.apply(null,arguments)}var Me,Ae=function(e){return i.createElement("svg",Ie({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-clipboard"},e),r||(r=i.createElement("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})),o||(o=i.createElement("rect",{x:8,y:2,width:8,height:4,rx:1,ry:1})))},Oe=function(e){var n=e.verse,t=e.isTranslationView,r=e.onActionTriggered,o=(0,u.Z)("quran-reader").t,a=(0,i.useState)(!1),c=a[0],l=a[1],d=(0,i.useRef)(),f=function(){(0,E.Kz)("".concat(t?"translation_view":"reading_view","_advanced_copy_modal_close")),l(!1),r&&setTimeout((function(){r()}),150)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.Z.Item,{icon:(0,s.jsx)(Ae,{}),onClick:function(){(0,E.Kz)("".concat(t?"translation_view":"reading_view","_advanced_copy_modal_open")),l(!0)},children:o("advanced-copy")}),(0,s.jsx)(Y.default,{innerRef:d,isOpen:c,header:(0,s.jsx)("p",{className:Ee().header,children:o("advanced-copy")}),hasCloseButton:!0,onClose:f,onEscapeKeyDown:f,contentClassName:Ee().contentWrapper,children:(0,s.jsx)(Te,{verse:n,children:function(e){var n=e.ayahSelectionComponent,t=e.actionText,r=e.onCopy,o=e.loading;return(0,s.jsxs)(s.Fragment,{children:[n,(0,s.jsx)("div",{className:Ee().footerContainer,children:(0,s.jsx)(Re.Z,{children:(0,s.jsx)(Ve.Z,{isDisabled:o,onClick:r,children:o?(0,s.jsx)(x.Z,{}):t})})})]})}})})]})},Ke=t(11155),Fe=t(50814),Le=t(5754),qe=function(e){var n=e.verseKey,t=e.isTranslationView,r=(0,u.Z)("common").t,o=(0,i.useState)(!1),a=o[0],c=o[1],l=(0,le.Tc)(n);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Fe.Z,{defaultRepetitionMode:Ke.m.Single,selectedVerseKey:n,chapterId:l.toString(),isOpen:a,onClose:function(){return c(!1)}}),(0,s.jsx)(b.Z.Item,{icon:(0,s.jsx)(Le.Z,{}),onClick:function(){t?(0,E.MY)("translation_view_verse_actions_menu_repeat"):(0,E.MY)("reading_view_verse_actions_menu_repeat"),c(!0)},children:r("audio.player.repeat-1-verse")})]})},Be=t(33770),Pe=t.n(Be),We=t(80305),Ue=t.n(We),Ye=function(e){var n=e.isTranslation,t=(0,u.Z)("common").t;return(0,s.jsx)("p",{className:Ue().heading,children:t("wbw-".concat(n?"translation":"transliteration"))})},ze=t(96691),He=t.n(ze),De=t(13147),$e=t(80665);function Ge(){return Ge=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Ge.apply(null,arguments)}var Qe=function(e){return i.createElement("svg",Ge({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Me||(Me=i.createElement("path",{d:"M14.458 11.764a4.288 4.288 0 1 0-1.179 1.179l2.851 2.85.077.066.01.007a.834.834 0 0 0 1.084-1.258l-2.844-2.845h.001Zm-3.564-5.007a2.621 2.621 0 1 1 0 5.242 2.621 2.621 0 0 1 0-5.242ZM4.88.484A2.879 2.879 0 0 0 2 3.364v17.272a2.879 2.879 0 0 0 2.879 2.879h15.257a.863.863 0 1 0 0-1.728H4.88a1.151 1.151 0 0 1-1.152-1.151h16.41a.863.863 0 0 0 .863-.864V3.363A2.88 2.88 0 0 0 18.121.484H4.88ZM19.273 18.91H3.727V3.363A1.152 1.152 0 0 1 4.88 2.212H18.12a1.152 1.152 0 0 1 1.152 1.151V18.91Z",fill:"currentColor"})))},Je=Pe()((function(){return Promise.resolve().then(t.bind(t,59807))}),{loadableGenerated:{webpack:function(){return[59807]}},ssr:!1}),Xe=function(e){var n=e.verse,t=e.onActionTriggered,r=(0,i.useState)(!1),o=r[0],a=r[1],c=(0,u.Z)("common").t,l=(0,i.useRef)(),d=function(){(0,E.Kz)("reading_view_wbw_modal_close"),a(!1),t&&setTimeout((function(){t()}),150)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b.Z.Item,{icon:(0,s.jsx)(Qe,{}),onClick:function(){(0,E.MY)("reading_view_verse_actions_menu_wbw"),a(!0)},children:c("wbw")}),(0,s.jsxs)(Je,{innerRef:l,isOpen:o,header:(0,s.jsx)("p",{className:He().header}),hasCloseButton:!0,onClose:d,onEscapeKeyDown:d,children:[(0,s.jsx)(Ye,{isTranslation:!0}),(0,s.jsx)(De.Z,{words:n.words,shouldShowWordByWordTranslation:!0}),(0,s.jsx)($e.Z,{className:He().separator}),(0,s.jsx)(Ye,{isTranslation:!1}),(0,s.jsx)(De.Z,{words:n.words,shouldShowWordByWordTransliteration:!0})]})]})},en=t(39659),nn=t(89034),tn=t(66634),rn=t(15028),on=function(e,n,t,r){(0,E.MY)("".concat(n?"translation_view":"reading_view","_verse_actions_menu_copy_link"));var o=(0,tn.Yj)(r),s=(0,a.Z)((0,le.bV)(e),2),i=s[0],c=s[1];o&&l()("".concat(o,"/").concat(i,"/").concat(c)).then(t)},an=function(e){var n=e.verse,t=e.isTranslationView,r=e.onActionTriggered,o=e.bookmarksRangeUrl,a=(0,u.Z)("common"),c=a.t,f=a.lang,m=(0,i.useState)(!1),h=m[0],v=m[1],p=(0,i.useState)(!1),g=p[0],_=p[1],w=(0,d.v9)(Z.Pt,d.wU),y=(0,j.useToast)();(0,i.useEffect)((function(){var e;return!0===h&&(e=setTimeout((function(){v(!1),r&&r()}),3e3)),function(){clearTimeout(e)}}),[h,r]),(0,i.useEffect)((function(){var e;return!0===g&&(e=setTimeout((function(){return _(!1)}),3e3)),function(){clearTimeout(e)}}),[g]);return(0,s.jsxs)("div",{children:[!t&&(0,s.jsx)(L,{verse:n}),(0,s.jsx)(b.Z.Item,{onClick:function(){(0,E.MY)("".concat(t?"translation_view":"reading_view","_verse_actions_menu_copy"));var e=n.words.map((function(e){return e[(0,rn.U)(w.quranFont)]})).join(" ");l()(e).then((function(){v(!0)}))},icon:(0,s.jsx)(nn.Z,{}),children:h?"".concat(c("copied"),"!"):"".concat(c("quran-reader:copy-verse"))}),(0,s.jsx)(b.Z.Item,{onClick:function(){on(n.verseKey,t,(function(){return y(c("shared"),{status:j.ToastStatus.Success})}),f),r&&r()},icon:(0,s.jsx)(en.Z,{}),children:c("quran-reader:cpy-link")}),(0,s.jsx)(Oe,{onActionTriggered:r,verse:n,isTranslationView:t}),!t&&(0,s.jsx)(Xe,{verse:n,onActionTriggered:r}),(0,s.jsx)(R,{verse:n,isTranslationView:t,onActionTriggered:r,bookmarksRangeUrl:o}),(0,S.jl)()&&(0,s.jsx)(Q,{verse:n,bookmarksRangeUrl:o,isTranslationView:t}),(0,s.jsx)(qe,{isTranslationView:t,verseKey:n.verseKey})]})}},80941:function(e,n,t){"use strict";t.d(n,{E:function(){return p.j},Z:function(){return _}});var r=t(45361),o=t(57044),a=t(16946),s=t(96151),i=t(57611),c=(t(67597),t(37014)),l=t.n(c),u=t(50664),d=t(25184),f=t.n(d),m=function(e){var n=e.className,t=e.indicatorClassName,r=(0,s.Z)(e,["className","indicatorClassName"]);return(0,i.jsx)(u.ck,(0,a.Z)((0,o.Z)({className:l()(f().radioItem,n)},r),{children:(0,i.jsx)(u.z$,{className:l()(f().indicator,t)})}))},h=t(30808),v=t.n(h),p=t(97204),g=function(e){var n=e.items,t=e.disabled,c=void 0!==t&&t,u=(0,s.Z)(e,["items","disabled"]);return(0,i.jsx)(p.Z,(0,a.Z)((0,o.Z)({},u),{children:n.map((function(e){var n=!0===c||!0===e.disabled;return(0,i.jsxs)("div",{className:v().radioItemContainer,children:[(0,i.jsx)(m,{value:e.value,id:e.id,disabled:n,required:e.required||!1}),(0,i.jsx)("label",{htmlFor:e.id,className:l()(v().label,(0,r.Z)({},v().disabled,n)),children:e.label})]},e.id)}))}))};g.Root=p.Z,g.Item=m;var _=g},97204:function(e,n,t){"use strict";t.d(n,{j:function(){return r}});var r,o=t(57044),a=t(16946),s=t(57611),i=(t(67597),t(50664)),c=t(37014),l=t.n(c),u=t(4811),d=t.n(u),f=t(22209);!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(r||(r={}));n.Z=function(e){var n=e.className,t=e.label,c=e.orientation,u=void 0===c?r.Vertical:c,m=e.onChange,h=e.defaultValue,v=e.value,p=e.name,g=e.required,_=e.children,b=(0,f.Z)();return(0,s.jsx)(i.fC,(0,a.Z)((0,o.Z)({className:l()(d().container,n),dir:b,"aria-label":t,orientation:u},m&&{onValueChange:m},h&&{defaultValue:h},v&&{value:v},p&&{name:p},g&&{required:g}),{children:_}))}},96913:function(e,n,t){"use strict";var r=t(1997),o=t(51726),a=t(62103),s=t(9740),i=t(19226);n.Z=function(e){var n=(0,a.Z)(e&&(0,i.jl)()?"countNotes/".concat(e.from,"-").concat(e.to):null,(0,r.Z)((function(){return(0,o.__generator)(this,(function(n){return[2,(0,s.jm)(e.from,e.to)]}))}))),t=n.data;return{data:t,isLoading:n.isValidating&&!t,error:n.error}}},15028:function(e,n,t){"use strict";t.d(n,{U:function(){return o}});var r=t(63747),o=(t(66158),function(e){return e===r.fr.IndoPak?"textIndopak":"textUthmani"})},29700:function(e){e.exports={header:"SaveToCollectionModal_header__5hcpQ",collectionList:"SaveToCollectionModal_collectionList__MdlrT",collectionItem:"SaveToCollectionModal_collectionItem__6Yau_",newCollectionFormContainer:"SaveToCollectionModal_newCollectionFormContainer__NPQSB"}},80305:function(e){e.exports={heading:"WordByWordHeading_heading__9nGyi"}},96691:function(e){e.exports={header:"WordByWordVerseAction_header__Q30MM",separator:"WordByWordVerseAction_separator__0M_OY"}},88228:function(e){e.exports={buttonContainer:"VerseAdvancedCopy_buttonContainer__oMXk8",customMessage:"VerseAdvancedCopy_customMessage__PZjXT",label:"VerseAdvancedCopy_label__n0Uin",fontLabelContainer:"VerseAdvancedCopy_fontLabelContainer__hietA",emptyCheckbox:"VerseAdvancedCopy_emptyCheckbox__zFHCy"}},56490:function(e){e.exports={header:"VerseActionAdvancedCopy_header__QY25i",footerContainer:"VerseActionAdvancedCopy_footerContainer__a44dp",contentWrapper:"VerseActionAdvancedCopy_contentWrapper__RjSEQ"}},25184:function(e){e.exports={indicator:"Item_indicator__x6BoJ",radioItem:"Item_radioItem__DEP6h"}},30808:function(e){e.exports={radioItemContainer:"RadioGroup_radioItemContainer__Zpb6v",label:"RadioGroup_label__h0v1C",disabled:"RadioGroup_disabled__aU243"}},4811:function(e){e.exports={container:"Root_container__FbYRt"}},64826:function(e,n,t){"use strict";t.d(n,{Fw:function(){return x},fC:function(){return Z},xz:function(){return k}});var r=t(57384),o=t(67597),a=t(90149),s=t(61544),i=t(82305),c=t(65672),l=t(71641),u=t(4300),d=t(8591),f=t(57458);const m="Collapsible",[h,v]=(0,s.b)(m),[p,g]=h(m),_=(0,o.forwardRef)(((e,n)=>{const{__scopeCollapsible:t,open:a,defaultOpen:s,disabled:c,onOpenChange:l,...d}=e,[m=!1,h]=(0,i.T)({prop:a,defaultProp:s,onChange:l});return(0,o.createElement)(p,{scope:t,disabled:c,contentId:(0,f.M)(),open:m,onOpenToggle:(0,o.useCallback)((()=>h((e=>!e))),[h])},(0,o.createElement)(u.WV.div,(0,r.Z)({"data-state":C(m),"data-disabled":c?"":void 0},d,{ref:n})))})),b="CollapsibleTrigger",w=(0,o.forwardRef)(((e,n)=>{const{__scopeCollapsible:t,...s}=e,i=g(b,t);return(0,o.createElement)(u.WV.button,(0,r.Z)({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":C(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},s,{ref:n,onClick:(0,a.M)(e.onClick,i.onOpenToggle)}))})),y="CollapsibleContent",x=(0,o.forwardRef)(((e,n)=>{const{forceMount:t,...a}=e,s=g(y,e.__scopeCollapsible);return(0,o.createElement)(d.z,{present:t||s.open},(({present:e})=>(0,o.createElement)(j,(0,r.Z)({},a,{ref:n,present:e}))))})),j=(0,o.forwardRef)(((e,n)=>{const{__scopeCollapsible:t,present:a,children:s,...i}=e,d=g(y,t),[f,m]=(0,o.useState)(a),h=(0,o.useRef)(null),v=(0,l.e)(n,h),p=(0,o.useRef)(0),_=p.current,b=(0,o.useRef)(0),w=b.current,x=d.open||f,j=(0,o.useRef)(x),Z=(0,o.useRef)();return(0,o.useEffect)((()=>{const e=requestAnimationFrame((()=>j.current=!1));return()=>cancelAnimationFrame(e)}),[]),(0,c.b)((()=>{const e=h.current;if(e){Z.current=Z.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const n=e.getBoundingClientRect();p.current=n.height,b.current=n.width,j.current||(e.style.transitionDuration=Z.current.transitionDuration,e.style.animationName=Z.current.animationName),m(a)}}),[d.open,a]),(0,o.createElement)(u.WV.div,(0,r.Z)({"data-state":C(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!x},i,{ref:v,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style}}),x&&s)}));function C(e){return e?"open":"closed"}const Z=_,k=w}}]);
  2. //# sourceMappingURL=45096.29af806bcbc7ffc8.js.map