1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dd984077-db86-4225-98e4-abf70b7edc4d",e._sentryDebugIdIdentifier="sentry-dbid-dd984077-db86-4225-98e4-abf70b7edc4d")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1030,8057],{48057:(e,t,n)=>{n.d(t,{A:()=>p});var r=n(66284),s=n(14232),a=n(17638),l=n(97114),i=n(95311),o=n(69158),c=n(52916),d=n(91113),u=n(37876);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let p=e=>{let{title:t,children:n,isOpen:r,modalClassName:h}=e,p=(0,s.useRef)(),{overlayProps:b}=(0,i.e)(e,p),{modalProps:y}=(0,i.hS)(),{dialogProps:f}=(0,a.s)(e,p);return(0,u.jsx)(o.N,{initial:!1,children:r&&(0,u.jsx)(i.Sf,{children:(0,u.jsx)("div",{className:"modal fixed h-full w-full inset-0 bg-black/75 flex justify-center items-center",style:{zIndex:d.M.DIALOG_BACKDROP},children:(0,u.jsx)(c.m.div,{initial:{opacity:0,y:50,scale:.3},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.5,transition:{duration:.2}},className:"relative",children:(0,u.jsx)("div",{className:"modal-container",children:(0,u.jsx)(l.n1,{contain:!0,restoreFocus:!0,children:(0,u.jsx)("div",m(m(m(m({},b),f),y),{},{ref:p,className:h,role:"dialog","aria-modal":"true","aria-labelledby":`modal-headline ${t}`,children:n}))})})})})})})}},59373:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(14232);let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2?arguments[2]:void 0,{0:s,1:a}=(0,r.useState)(""),l=(0,r.useRef)(0),i=(0,r.useRef)("");return(0,r.useEffect)(()=>{if(0===t){a(e),n&&n(e);return}let r=setInterval(()=>{l.current<e.length?(i.current+=e.charAt(l.current),a(()=>(n&&n(i.current),i.current)),l.current+=1):clearInterval(r)},t),s=()=>{"visible"===document.visibilityState&&l.current<e.length&&(l.current=e.length,i.current=e,a(e),n&&n(e),clearInterval(r))};return document.addEventListener("visibilitychange",s),()=>{clearInterval(r),document.removeEventListener("visibilitychange",s)}},[e,t,n]),s}},77657:(e,t,n)=>{n.d(t,{c:()=>E});var r=n(14232),s=n(36708),a=n(18125),l=n(51280),i=n(11511),o=n(18012),c=n(13826),d=n(77966),u=n(66284),h=n(97114),m=n(95311),p=n(14742),b=n(52916),y=n(69158),f=n(28823),g=n(69174),x=n(98866),v=n(4797),j=n(37876);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach(function(t){(0,u.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let O=e=>{let{state:t,url:n,title:s,logTitle:l,post:i,recommendationLocation:c,contentType:d,shareText:u}=e,p=e=>{(0,o.$s)(l,"share",`Share via ${e}: ${n} From Aqsa: true`),(0,x.wG)("Share content",{"Share content location":c,"Share method":e,"Content name":(null==i?void 0:i.title)||"unknown","Content id":null!=i&&i.id?i.id.toString():"unknown","Content type":d})},y=(0,r.useRef)(),{overlayProps:k}=(0,m.e)({onClose:()=>t.close(),shouldCloseOnBlur:!0,isOpen:t.isOpen,isDismissable:!0},y);return(0,j.jsx)(h.n1,{restoreFocus:!0,children:(0,j.jsx)(b.m.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"absolute z-50 top-12 right-0",children:(0,j.jsxs)("div",w(w({id:"post_share_overlay",ref:y},k),{},{children:[(0,j.jsx)(m.Rz,{onDismiss:()=>t.close()}),(0,j.jsx)(j.Fragment,{children:(0,j.jsx)("div",{className:"w-34 bg-white shadow-lg border rounded-md",children:(0,j.jsxs)("div",{className:"divide-y divide-grey-100",children:[(0,j.jsx)(f.Kz,{url:n,title:s,onClick:()=>p("WhatsApp"),className:"w-full text-left",children:(0,j.jsxs)("div",{className:"py-2 px-4 roun
1ded hover:bg-carrot-50 left",children:[(0,j.jsx)(a.g,{icon:["fab","whatsapp"],className:"h-4 w-4 font-black",fixedWidth:!0}),(0,j.jsx)(g.EY,{fontSize:"text-sm",color:"text-gray-700 hover:text-gray-900 font-black",lineHeight:"leading-5",className:"ml-2",children:"WhatsApp"})]})}),(0,j.jsx)(f.r6,{url:n,title:s,onClick:()=>p("Twitter"),className:"w-full text-left",children:(0,j.jsxs)("div",{className:"py-2 px-4 rounded hover:bg-carrot-50 left",children:[(0,j.jsx)(a.g,{icon:["fab","x-twitter"],className:"h-4 w-4 font-black",fixedWidth:!0}),(0,j.jsx)(g.EY,{fontSize:"text-sm",color:"text-gray-700 hover:text-gray-900 font-black",lineHeight:"leading-5",className:"ml-2",children:"Twitter"})]})}),(0,j.jsx)(f.uI,{url:n,title:s,onClick:()=>p("Facebook"),className:"w-full text-left",children:(0,j.jsxs)("div",{className:"py-2 px-4 rounded hover:bg-carrot-50 left",children:[(0,j.jsx)(a.g,{icon:["fab","facebook"],className:"h-4 w-4 font-black",fixedWidth:!0}),(0,j.jsx)(g.EY,{fontSize:"text-sm",color:"text-gray-700 hover:text-gray-900 font-black",lineHeight:"leading-5",className:"ml-2",children:"Facebook"})]})}),(0,j.jsx)(f.Ot,{url:n,subject:s,className:"w-full text-left",children:(0,j.jsxs)("div",{className:"py-2 px-4 rounded hover:bg-carrot-50 left",children:[(0,j.jsx)(a.g,{icon:["fas","envelope"],className:"h-4 w-4 font-black",fixedWidth:!0}),(0,j.jsx)(g.EY,{fontSize:"text-sm",color:"text-gray-700 hover:text-gray-900 font-black",lineHeight:"leading-5",className:"ml-2",children:"Email"})]})}),(0,j.jsx)(g.$n,{onPress:()=>{(0,v.lW)(u||n),p("Copy URL")},className:"w-full text-left border-t-0","aria-label":"Copy Link",children:(0,j.jsxs)("div",{className:"py-2 px-4 rounded hover:bg-carrot-50 left",children:[(0,j.jsx)(a.g,{icon:["far","link"],className:"h-4 w-4 font-black",fixedWidth:!0}),(0,j.jsx)(g.EY,{fontSize:"text-sm",color:"text-gray-700 hover:text-gray-900 font-black",lineHeight:"leading-5",className:"ml-2",children:"Copy link"})]})})]})})}),(0,j.jsx)(m.Rz,{onDismiss:()=>t.close()})]}))})})},N=e=>{let t=(0,p.T)({});return(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:"flex items-center h-full relative",children:[(0,j.jsx)(g.$n,{"aria-label":"Post share",onPress:()=>{t.isOpen?t.close():t.open()},className:"border border-gray-200 rounded p-1.5",children:(0,j.jsx)(a.g,{icon:"share"})}),(0,j.jsx)("div",{className:"relative left-24 -top-4",children:(0,j.jsx)(y.N,{children:t.isOpen&&(0,j.jsx)(O,w({state:t},e))})})]})})};var S=n(13484);let E=(e,t,n,r,s,a)=>{let l,i=new window.DOMParser().parseFromString(e,"text/html"),o=[],c=i.querySelectorAll(".dua-container"),d=[];c.forEach((e,t)=>{let n=e.querySelector(".dua-title"),r=e.querySelector(".dua-arabic"),s=e.querySelector(".dua-translation"),a=e.querySelector(".dua-source"),l=(null==r?void 0:r.getAttribute("data-dua-id"))||`dua-${t}`;d.push({title:(null==n?void 0:n.textContent)||"",arabic:(null==r?void 0:r.textContent)||"",translation:(null==s?void 0:s.textContent)||"",source:(null==a?void 0:a.textContent)||"",duaId:l});let i=document.createElement("span");i.setAttribute("data-dua-marker",t.toString()),i.textContent=`__DUA_MARKER_${t}__`,e.replaceWith(i)}),i.querySelectorAll("a").forEach(e=>{e.className="font-bold underline decoration-orange-500";let t=e.getAttribute("href");t&&e.setAttribute("href",t.replaceAll("amp;",""))}),i.querySelectorAll("ul").forEach(e=>{e.className="list-disc pl-5 my-1"}),i.querySelectorAll("ol").forEach(e=>{e.className="list-decimal pl-5 my-1"});let u=i.body.innerHTML.replace(/\s*(<\/?(?:ul|ol|li)(?:\s[^>]*)?\/?>)\s*/gi,"$1").replace(/<p(?:\s[^>]*)?>/gi,"").replace(/<\/p>/gi,"<br>").replace(/\n/g,"<br>").replace(/(<br\s*\/?\s*>[\s]*){2,}/gi,"<br>").replace(/^[\s]*(<br\s*\/?\s*>[\s]*)*/i,"").replace(/([\s]*<br\s*\/?\s*>[\s]*)*$/i,""),h=0,m=0,p=/__DUA_MARKER_(\d+)__/gi;for(;null!==(l=p.exec(u));){l.index>h&&o.push((0,j.jsx)("span",{dangerouslySetInnerHTML:{__html:u.slice(h,l.index)}},`text-${m}`));let e=d[parseInt(l[1],10)];e&&o.push((0,j.jsx)($,{title:e.title,arabic:e.arabic,translation:e.translation,source:e.source,duaId:e.duaId,idToken:n,handleNonAuthBookmarkItem:t},`dua-${m}-${e.duaId}`)),h=p.lastIndex,m++}return h<u.length&&o.push((0,j.jsx)("span",{dangerouslySetInnerHTML:{__html:u.slice(h)}},`text-${m}`)),d.length>0&&o.push((0,j.jsxs)("span",{className:"font-source-serif-pro text-sm text-gray-900 leading-5 tracking-normal font-medium whitespace-pre-line",children:[(0,j.jsx)("br",{})," ",(0,j.jsx)("br",{})," Find this du'a and many more on the Ameen app"," ",(0,j.jsx)(g.qh,{href:"https://yqn.io/ameen",target:"_blank",children:(0,j.jsx)(g.EY,{color:"text-blue-500 hover:text-blue-400",fontSize:"text-sm",weight:"font-bold",children:"https://yqn.io/ameen"})})]},"ameen-text")),o},$=e=>{let{title:t,arabic:n,translation:u,source:h,duaId:m,idToken:p,handleNonAuthBookmarkItem:b}=e,{0:y,1:f}=(0,r.useState)(!1),v=(0,d.sf)(),{saveLike:k,deleteLike:w}=(()=>{let{eventTracker:e}=(0,i.OF)();return{deleteLike:async(e,t,n)=>{console.debug(`Unliking ${e}`),(0,o.$s)("unlike","click",`item_name: ${t} item_type: ${n}`);let r=e;"number"==typeof e&&(r=e.toString());let s={bookmarks:[{postId:r,isTypeLike:!0}]};
1await (0,c.Ku)((0,l.wn)(),s,"DELETE").then(t=>{console.debug(`Like ${e} deleted`)}).catch(e=>{console.error(e)})},saveLike:async t=>{var n;console.debug(`Liking ${t.id}`),(0,o.$s)("like","click",`item_name: ${t.title} item_type: ${t.contentType[0].name}`);let r=null==(n=t.authors)?void 0:n.filter(e=>(null==e?void 0:e.id)&&(null==e?void 0:e.name)&&(null==e?void 0:e.slug)).map(e=>({id:e.id,name:e.name,slug:e.slug})),[s,a]=[t.topic,t.contentType].map(e=>e.map(e=>({id:e.id,name:e.name,slug:e.slug,parent:e.parent}))),i={bookmarks:[{postId:t.id.toString(),createDate:parseInt((Date.now()/1e3).toFixed(0)),title:t.title,slug:t.slug,thumbnail:t.thumbnail,authors:r,topic:s,contentType:a,isTypeLike:!0}]};await (0,c.Ku)((0,l.wn)(),i,"POST").then(()=>{console.debug(`Like ${t.id} added`),e("like",t.id.toString())})}}})(),O=m&&!m.startsWith("dua-"),E=async e=>{if(!O)return;let t={id:parseInt(m,10),title:u,slug:"",thumbnail:"",authors:[],topic:[],contentType:[{id:0,name:"Dua",slug:"dua",parent:0}]};if(!p)return void b(t,e,"https://yqn.io/ameen");try{"like"===e&&(y?(f(!1),await w(parseInt(m,10),u,"Dua")):(f(!0),(0,o.$s)("dua_like","chatbot",m,!1,{surface:S.K.Widget}),v.capture("chatbot_dua_like",{dua_id:m,surface:S.K.Widget,liked:!0}),(0,x.wG)("Like content",{"Like location":(0,x.Tq)(),"Content name":u,"Content id":m,"Content type":"Dua"}),await k(t)))}catch(e){console.error("Error toggling like:",e)}};return(0,r.useEffect)(()=>{O&&p&&(async()=>{try{let e=await fetch(`${(0,l.wn)()}/${m}`,{headers:{"Content-Type":"application/json",Authorization:p}}),t=await e.json();null!=t&&t.isLiked&&f(!0)}catch(e){console.error("Error checking if dua is liked:",e)}})()},[m,p,O]),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"dua-container dua-container--chat my-4",children:[t&&(0,j.jsx)("div",{className:"dua-title",children:t}),(0,j.jsx)("div",{className:"dua-arabic",children:n}),(0,j.jsx)("div",{className:"dua-translation",children:u}),(0,j.jsx)("div",{className:"dua-source",children:h})]}),(0,j.jsxs)("div",{className:"flex flex-row gap-1.5 mb-4",children:[O&&(0,j.jsx)(g.$n,{className:"border border-gray-200 rounded p-1.5",onPress:()=>E("like"),children:(0,j.jsx)(a.g,{icon:s.qcK,width:16,height:14,className:y?"text-[#E71740]":"text-gray-900"})}),(0,j.jsx)(N,{url:"https://yqn.io/ameen",title:`${n} 2 3${u} 4 5${h} 6 7Find this du'a and many more on the Ameen app https://yqn.io/ameen`,shareText:`${n} 8 9${u} 10 11${h} 12 13Find this du'a and many more on the Ameen app https://yqn.io/ameen`,logTitle:`Dua - ${m}`,post:null,recommendationLocation:(0,x.Tq)(),contentType:"Dua"})]})]})}},92850:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(66284);class s{constructor(e){(0,r.A)(this,"ws",null),(0,r.A)(this,"retryCount",0),this.url=e.url,this.maxRetries=e.maxRetries||5,this.retryInterval=e.retryInterval||1e3,this.callbacks={onOpen:e.onOpen,onClose:e.onClose,onMessage:e.onMessage,onError:e.onError,onFailedRetry:e.onFailedRetry},this.connect()}connect(){try{this.ws=new WebSocket(this.url),this.attachEventListeners()}catch(e){this.handleReconnect()}}attachEventListeners(){this.ws&&(this.ws.onopen=e=>{this.retryCount=0,this.callbacks.onOpen&&this.callbacks.onOpen(e)},this.ws.onclose=e=>{this.callbacks.onClose&&this.callbacks.onClose(e),"ReconnectingWebSocket closed"!==e.reason&&this.handleReconnect()},this.ws.onmessage=e=>{this.callbacks.onMessage&&this.callbacks.onMessage(e)},this.ws.onerror=e=>{this.callbacks.onError&&this.callbacks.onError(e)})}handleReconnect(){this.retryCount<this.maxRetries?(this.retryCount++,console.log(`WebSocket reconnection attempt ${this.retryCount} of ${this.maxRetries}`),setTimeout(()=>{this.connect()},this.retryInterval)):(console.warn("WebSocket unable to reconnect after maximum retry attempts"),this.callbacks.onFailedRetry&&this.callbacks.onFailedRetry())}send(e){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(e):console.warn("WebSocket is not connected")}close(e,t){this.ws&&this.ws.close(e,t)}closeAndDelete(){this.close(1e3,"ReconnectingWebSocket closed"),this.ws=null}readyState(){var e;return(null==(e=this.ws)?void 0:e.readyState)||WebSocket.CLOSED}}let a=s}}]);
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.