@articles-media/articles-dev-box 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Ad.cjs +1 -1
- package/dist/Ad.js +139 -133
- package/dist/{GlobalBody-BbM8X_Jk.cjs → GlobalBody-BQ2qC81K.cjs} +2 -2
- package/dist/{GlobalBody-Dw17Ik2b.js → GlobalBody-tmIC_GWn.js} +33 -33
- package/dist/GlobalBody.cjs +1 -1
- package/dist/GlobalBody.js +1 -1
- package/dist/{StatusModal-BdAmgekT.cjs → StatusModal-BlwaI-2B.cjs} +1 -1
- package/dist/{StatusModal-C757TssZ.js → StatusModal-CAVxWCUq.js} +1 -1
- package/dist/articles-dev-box.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/useUserToken.cjs +1 -1
- package/dist/useUserToken.js +7 -7
- package/package.json +1 -1
package/dist/Ad.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),c=require("react"),v=require("./numberWithCommas-CRgrb58X.cjs"),E=require("./index-Ddv_TnxK.cjs"),H=require("./Button-0ZK0NKiK.cjs"),J=require("./index-BlP2-uOi.cjs");function Q(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:()=>s[i]})}}return t.default=s,Object.freeze(t)}const _=Q(c);var C=new Map,S=new WeakMap,q=0,Y;function Z(s){return s?(S.has(s)||(q+=1,S.set(s,q.toString())),S.get(s)):"0"}function ee(s){return Object.keys(s).sort().filter(t=>s[t]!==void 0).map(t=>`${t}_${t==="root"?Z(s.root):s[t]}`).toString()}function se(s){const t=ee(s);let i=C.get(t);if(!i){const r=new Map;let o;const x=new IntersectionObserver(p=>{p.forEach(a=>{var u;const R=a.isIntersecting&&o.some(j=>a.intersectionRatio>=j);s.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=R),(u=r.get(a.target))==null||u.forEach(j=>{j(R,a)})})},s);o=x.thresholds||(Array.isArray(s.threshold)?s.threshold:[s.threshold||0]),i={id:t,observer:x,elements:r},C.set(t,i)}return i}function te(s,t,i={},r=Y){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const u=s.getBoundingClientRect();return t(r,{isIntersecting:r,target:s,intersectionRatio:typeof i.threshold=="number"?i.threshold:0,time:0,boundingClientRect:u,intersectionRect:u,rootBounds:u}),()=>{}}const{id:o,observer:x,elements:p}=se(i),a=p.get(s)||[];return p.has(s)||p.set(s,a),a.push(t),x.observe(s),function(){a.splice(a.indexOf(t),1),a.length===0&&(p.delete(s),x.unobserve(s)),p.size===0&&(x.disconnect(),C.delete(o))}}function ne({threshold:s,delay:t,trackVisibility:i,rootMargin:r,root:o,triggerOnce:x,skip:p,initialInView:a,fallbackInView:u,onChange:R}={}){var j;const[n,d]=_.useState(null),k=_.useRef(R),N=_.useRef(a),[y,I]=_.useState({inView:!!a,entry:void 0});k.current=R,_.useEffect(()=>{if(N.current===void 0&&(N.current=a),p||!n)return;let f;return f=te(n,(w,A)=>{const D=N.current;N.current=w,!(D===void 0&&!w)&&(I({inView:w,entry:A}),k.current&&k.current(w,A),A.isIntersecting&&x&&f&&(f(),f=void 0))},{root:o,rootMargin:r,threshold:s,trackVisibility:i,delay:t},u),()=>{f&&f()}},[Array.isArray(s)?s.toString():s,n,o,r,x,p,i,u,t]);const g=(j=y.entry)==null?void 0:j.target,M=_.useRef(void 0);!n&&g&&!x&&!p&&M.current!==g&&(M.current=g,I({inView:!!a,entry:void 0}),N.current=a);const m=[d,y.inView,y.entry];return m.ref=m[0],m.inView=m[1],m.entry=m[2],m}const re=async s=>{if(process.env.NODE_ENV==="development")try{return(await E.axios.get(`http://localhost:3001/api/ads/${s.ad_id}`,{params:{ad_id:s.ad_id,user_ad_token:s.user_ad_token}})).data.result}catch{}return E.axios.get(s.url,{params:{ad_id:s.ad_id}}).then(t=>t.data.result)},ie=60,oe={dedupingInterval:1e3*60*ie},ae=(s,t)=>{const{data:i,error:r,isLoading:o,mutate:x}=E.useSWR(s?{url:`https://articles.media/api/ads/${s}`,ad_id:s,user_ad_token:t}:null,re,oe);return{data:i,error:r,isLoading:o,mutate:x}};function ce(s){return t=>{const r=(s?Math[s]:Math.trunc)(t);return r===0?0:r}}function le(s,t){return+v.toDate(s)-+v.toDate(t)}function B(s,t,i){const r=le(s,t)/v.millisecondsInMinute;return ce(i?.roundingMethod)(r)}function W(s){return Math.trunc(s*v.millisecondsInMinute)}const de=async s=>{if(process.env.NODE_ENV==="development")try{return(await E.axios.get("http://localhost:3001/api/ads",{params:{}})).data}catch{}return E.axios.get(s.url,{params:{}}).then(t=>t.data)},z=60,ue={dedupingInterval:W(z),focusThrottleInterval:W(z)},xe=s=>{const{data:t,error:i,isLoading:r,mutate:o}=E.useSWR(s?.loading||s?.disabled?null:{url:"https://articles.media/api/ads"},de,ue);return{data:t,error:i,isLoading:r,mutate:o}},me=c.lazy(()=>Promise.resolve().then(()=>require("./AdDetailsModal-k840vrS2.cjs"))),pe=c.lazy(()=>Promise.resolve().then(()=>require("./AdConfirmExitModal-CcSxmXKT.cjs")));function je(s,t){return Math.floor(Math.random()*(t-s+1))+s}function fe(s){let{previewMode:t,darkMode:i,user_ad_token:r,userDetails:o,userDetailsLoading:x}=s;const p=!1,a=[],[u,R]=c.useState(null),{data:j}=xe({loading:x,disabled:o?.articles_membership?.status=="Active"}),{data:n}=ae(u,r);let d=s.previewData||{};const[k,N]=c.useState(null),[y,I]=c.useState(null),[g,M]=c.useState(null),[m,f]=c.useState(0),[w,A]=c.useState(!1),[D,P]=c.useState(!1),[U,$]=c.useState(!1),[ve,ge]=c.useState(new Date),[O,X]=c.useState([]);c.useEffect(()=>{j&&j?.length>0&&!u&&(console.log("Ad Mounted or reduxAds changed"),R(s.ad_id||j[je(0,j?.length-1)]?._id))},[j]),c.useEffect(()=>{},[n]),c.useEffect(()=>{n?.populated_promos&&m>=0&&M(n?.populated_promos[m])},[m,n]);function K(){P(!D)}const{ref:F,inView:b}=ne({threshold:0,triggerOnce:!0});function L(l){if(t&&console.log("Preventing this event from being logged as this ad is being shown in preview mode."),O.find(h=>h==l)){console.log("Already logged this event");return}E.axios.get("/api/ads/event",{params:{ad_id:n?._id,event:l}}).then(function(h){X([...O,l]),console.log(h.data)}).catch(function(h){console.log(h)})}c.useEffect(()=>{if(!t&&(console.log("inView",b),b&&u)){let l=[{ad_id:u,date:new Date().toString()},...a.filter(h=>{if(console.log(B(new Date,new Date(h.date))),B(new Date,new Date(h.date))>5){console.log("adsViewed - Remove Old Ad View Object");return}else return console.log("adsViewed - Keep Ad View Object"),h})];console.log("unexpiredRecentViews",l)}},[b,u]);const[V,G]=c.useState(null);function T(){console.log("logAdAvoided called",r),E.axios.get(process.env.NODE_ENV==="development"?"http://localhost:3001/api/user/advertising/avoided":"https://articles.media/api/user/advertising/avoided",{params:{user_id:o?._id},headers:{"x-articles-api-key":r}}).then(function(l){G(l.data.avoided_count),console.log(l.data)}).catch(function(l){console.log(l)})}return c.useEffect(()=>{t||(console.log("inView",b),o?.articles_membership?.status=="Active"&&b&&T())},[b,o]),x?null:e.jsxRuntimeExports.jsxs("div",{ref:F,className:J.classNames("ad-wrap",{"active-member":o?.articles_membership?.status=="Active"}),style:{"--articles-ad-background-color":d.background_color||n?.background_color,"--articles-ad-font-color":d.font_color||n?.font_color,"--articles-ad-border-color":d.border_color||n?.border_color},children:[D&&e.jsxRuntimeExports.jsx(me,{setModalShow:P,ad:n,previewData:d}),U&&e.jsxRuntimeExports.jsx(pe,{setModalShow:$,ad:n,previewData:d}),e.jsxRuntimeExports.jsxs("div",{className:"ad",children:[o?.articles_membership?.status!=="Active"&&e.jsxRuntimeExports.jsxs("div",{className:"main-panel",children:[e.jsxRuntimeExports.jsx("div",{className:"ad-warning flex-header",children:e.jsxRuntimeExports.jsxs("div",{className:"",children:[n?.city&&"Local"," Advertisement"]})}),e.jsxRuntimeExports.jsxs("div",{className:"content-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"photo-banner",children:[e.jsxRuntimeExports.jsx("div",{className:"logo",children:(d.logo?.location||n?.logo?.location)&&e.jsxRuntimeExports.jsx("img",{src:d?.logo?.key?`${process.env.NEXT_PUBLIC_CDN}${d?.logo?.key}`:`${process.env.NEXT_PUBLIC_CDN}${n?.logo?.key}`,alt:""})}),e.jsxRuntimeExports.jsx("div",{className:"icon d-none",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-mug-hot"})}),e.jsxRuntimeExports.jsx("img",{className:"photo",src:d?.background?.key?`${process.env.NEXT_PUBLIC_CDN}${d.background?.key}`:`${process.env.NEXT_PUBLIC_CDN}${n?.background?.key}`,alt:""})]}),e.jsxRuntimeExports.jsxs("div",{className:"details-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"detail-title",children:[e.jsxRuntimeExports.jsx("div",{className:"detail",children:e.jsxRuntimeExports.jsx("span",{className:"h4",children:d?.business||n?.business})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-column d-none",children:[e.jsxRuntimeExports.jsxs("div",{className:"detail",children:[e.jsxRuntimeExports.jsx("span",{className:"icon",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-search-location"})}),e.jsxRuntimeExports.jsxs("span",{children:[n?.city,", ",n?.state]})]}),e.jsxRuntimeExports.jsxs("div",{className:"detail",children:[e.jsxRuntimeExports.jsx("span",{className:"icon",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-clock me-2"})}),e.jsxRuntimeExports.jsx("span",{children:"6:30AM–8PM"})]})]})]}),n?.city&&e.jsxRuntimeExports.jsx("div",{className:"details mb-3 d-none"}),e.jsxRuntimeExports.jsx("div",{className:"short-description",children:d?.description||n?.description})]})]}),p?.roles?.isDev&&n?.populated_promos?.length>0&&e.jsxRuntimeExports.jsxs("div",{children:[g&&e.jsxRuntimeExports.jsx("div",{className:"promos-wrap",children:g&&e.jsxRuntimeExports.jsxs("div",{className:"promo-wrap d-flex justify-content-between align-items-center mx-2 p-1 px-2 border border-2 border-light mb-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"",children:[e.jsxRuntimeExports.jsx("div",{children:g.title}),e.jsxRuntimeExports.jsx("div",{className:"small",children:e.jsxRuntimeExports.jsx("div",{className:"small",children:g.details})})]}),e.jsxRuntimeExports.jsx(H.ArticlesButton,{className:"px-3",small:!0,onClick:()=>{console.log("Load Save Modal"),A(!0)},children:"Save"})]},g._id)}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsxRuntimeExports.jsxs("div",{className:"px-2",children:[n?.populated_promos?.length," Promos Active"]}),e.jsxRuntimeExports.jsxs("div",{className:"controls",children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-arrow-circle-left",type:"button",onClick:()=>{m==0?f(n?.populated_promos?.length-1):f(l=>l-1)}}),n?.populated_promos?.map((l,h)=>e.jsxRuntimeExports.jsx("i",{className:`fa-square ${h==m?"fad":"fas"}`},l._id)),e.jsxRuntimeExports.jsx("i",{className:"fad fa-arrow-circle-right",type:"button",onClick:()=>{m==n?.populated_promos?.length-1?f(0):f(l=>l+1)}})]})]})]}),e.jsxRuntimeExports.jsx("hr",{style:{borderColor:"white"},className:"mt-auto mb-0"}),e.jsxRuntimeExports.jsxs("div",{className:"action-wrap d-flex justify-content-lg-between px-3 py-2",children:[e.jsxRuntimeExports.jsx("div",{onClick:()=>{K(),L("Details")},className:"action flex-grow-1 flex-shrink-0",children:"Details"}),e.jsxRuntimeExports.jsx("span",{className:"px-4"}),e.jsxRuntimeExports.jsx("a",{className:"action flex-grow-1 flex-shrink-0",href:n?.website,target:"_blank",rel:"noreferrer",onClick:l=>{l.preventDefault(),$(!0),L("Confirm Exit Modal Opened")},children:e.jsxRuntimeExports.jsx("div",{children:"Website"})})]})]}),o?.articles_membership?.status=="Active"&&e.jsxRuntimeExports.jsx("div",{className:"main-panel",children:e.jsxRuntimeExports.jsxs("div",{className:"content-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"photo-banner",children:[e.jsxRuntimeExports.jsx("div",{className:"logo"}),e.jsxRuntimeExports.jsxs("div",{className:"splash",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-broadcast-tower"}),e.jsxRuntimeExports.jsxs("div",{className:"text",children:[e.jsxRuntimeExports.jsx("div",{className:"count",children:V?v.numberWithCommas(V):0}),e.jsxRuntimeExports.jsx("div",{className:"label",children:"ads avoided."})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"member-since",children:["Member since: ",e.jsxRuntimeExports.jsx(v.ArticlesDate,{format:"PP",date:o?.articles_membership?.membership_started})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"details-wrap",children:[e.jsxRuntimeExports.jsx("div",{className:"detail-title",children:e.jsxRuntimeExports.jsx("div",{className:"detail",children:e.jsxRuntimeExports.jsx("span",{className:"h4",children:"Thanks for the support!"})})}),e.jsxRuntimeExports.jsxs("div",{className:"short-description",children:[e.jsxRuntimeExports.jsx("div",{className:"mb-2",children:"Without support from users like you, we wouldn't be here."}),e.jsxRuntimeExports.jsxs("div",{className:"links-list",children:[e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/messages",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-comments-alt"}),"0 unread messages."]}),e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/settings/notifications",onClick:()=>{T()},children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-bell"}),"0 notifications."]}),e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/settings/account",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-cog"}),"Manage account settings."]})]})]})]})]})})]}),!t&&e.jsxRuntimeExports.jsx("div",{className:"advertise-with-us p-1",style:{backgroundColor:d.background_color||n?.background_color,color:d.font_color||n?.font_color,borderColor:d.border_color||n?.border_color},children:e.jsxRuntimeExports.jsxs(v.Link,{className:"small d-block w-100 text-center",href:"https://articles.media/advertising",newPage:!0,children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-share me-1"}),"Advertise with Articles Media!"]})})]})}const he=c.memo(fe);module.exports=he;
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),o=require("react"),v=require("./numberWithCommas-CRgrb58X.cjs"),E=require("./index-Ddv_TnxK.cjs"),Q=require("./Button-0ZK0NKiK.cjs"),Y=require("./index-BlP2-uOi.cjs");function Z(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:()=>s[i]})}}return t.default=s,Object.freeze(t)}const _=Z(o);var P=new Map,S=new WeakMap,B=0,ee;function se(s){return s?(S.has(s)||(B+=1,S.set(s,B.toString())),S.get(s)):"0"}function te(s){return Object.keys(s).sort().filter(t=>s[t]!==void 0).map(t=>`${t}_${t==="root"?se(s.root):s[t]}`).toString()}function ne(s){const t=te(s);let i=P.get(t);if(!i){const r=new Map;let a;const x=new IntersectionObserver(p=>{p.forEach(c=>{var u;const R=c.isIntersecting&&a.some(f=>c.intersectionRatio>=f);s.trackVisibility&&typeof c.isVisible>"u"&&(c.isVisible=R),(u=r.get(c.target))==null||u.forEach(f=>{f(R,c)})})},s);a=x.thresholds||(Array.isArray(s.threshold)?s.threshold:[s.threshold||0]),i={id:t,observer:x,elements:r},P.set(t,i)}return i}function re(s,t,i={},r=ee){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const u=s.getBoundingClientRect();return t(r,{isIntersecting:r,target:s,intersectionRatio:typeof i.threshold=="number"?i.threshold:0,time:0,boundingClientRect:u,intersectionRect:u,rootBounds:u}),()=>{}}const{id:a,observer:x,elements:p}=ne(i),c=p.get(s)||[];return p.has(s)||p.set(s,c),c.push(t),x.observe(s),function(){c.splice(c.indexOf(t),1),c.length===0&&(p.delete(s),x.unobserve(s)),p.size===0&&(x.disconnect(),P.delete(a))}}function ie({threshold:s,delay:t,trackVisibility:i,rootMargin:r,root:a,triggerOnce:x,skip:p,initialInView:c,fallbackInView:u,onChange:R}={}){var f;const[n,d]=_.useState(null),k=_.useRef(R),N=_.useRef(c),[y,I]=_.useState({inView:!!c,entry:void 0});k.current=R,_.useEffect(()=>{if(N.current===void 0&&(N.current=c),p||!n)return;let j;return j=re(n,(w,A)=>{const D=N.current;N.current=w,!(D===void 0&&!w)&&(I({inView:w,entry:A}),k.current&&k.current(w,A),A.isIntersecting&&x&&j&&(j(),j=void 0))},{root:a,rootMargin:r,threshold:s,trackVisibility:i,delay:t},u),()=>{j&&j()}},[Array.isArray(s)?s.toString():s,n,a,r,x,p,i,u,t]);const g=(f=y.entry)==null?void 0:f.target,M=_.useRef(void 0);!n&&g&&!x&&!p&&M.current!==g&&(M.current=g,I({inView:!!c,entry:void 0}),N.current=c);const m=[d,y.inView,y.entry];return m.ref=m[0],m.inView=m[1],m.entry=m[2],m}const oe=async s=>{if(process.env.NODE_ENV==="development")try{return(await E.axios.get(`http://localhost:3001/api/ads/${s.ad_id}`,{params:{ad_id:s.ad_id,user_ad_token:s.user_ad_token}})).data.result}catch{}return E.axios.get(s.url,{params:{ad_id:s.ad_id}}).then(t=>t.data.result)},ae=60,ce={dedupingInterval:1e3*60*ae},le=(s,t)=>{const{data:i,error:r,isLoading:a,mutate:x}=E.useSWR(s?{url:`https://articles.media/api/ads/${s}`,ad_id:s,user_ad_token:t}:null,oe,ce);return{data:i,error:r,isLoading:a,mutate:x}};function de(s){return t=>{const r=(s?Math[s]:Math.trunc)(t);return r===0?0:r}}function ue(s,t){return+v.toDate(s)-+v.toDate(t)}function W(s,t,i){const r=ue(s,t)/v.millisecondsInMinute;return de(i?.roundingMethod)(r)}function z(s){return Math.trunc(s*v.millisecondsInMinute)}const xe=async s=>{if(process.env.NODE_ENV==="development")try{return(await E.axios.get("http://localhost:3001/api/ads",{params:{}})).data}catch{}return E.axios.get(s.url,{params:{}}).then(t=>t.data)},U=60,me={dedupingInterval:z(U),focusThrottleInterval:z(U)},pe=s=>{const{data:t,error:i,isLoading:r,mutate:a}=E.useSWR(s?.loading||s?.disabled?null:{url:"https://articles.media/api/ads"},xe,me);return{data:t,error:i,isLoading:r,mutate:a}},fe=o.lazy(()=>Promise.resolve().then(()=>require("./AdDetailsModal-k840vrS2.cjs"))),je=o.lazy(()=>Promise.resolve().then(()=>require("./AdConfirmExitModal-CcSxmXKT.cjs")));function he(s,t){return Math.floor(Math.random()*(t-s+1))+s}function ve(s){let{previewMode:t,darkMode:i,user_ad_token:r,userDetails:a,userDetailsLoading:x}=s;const p=!1,c=[],[u,R]=o.useState(null),{data:f}=pe({loading:x,disabled:a?.articles_membership?.status=="Active"}),{data:n}=le(u,r);let d=s.previewData||{};const[k,N]=o.useState(null),[y,I]=o.useState(null),[g,M]=o.useState(null),[m,j]=o.useState(0),[w,A]=o.useState(!1),[D,$]=o.useState(!1),[X,L]=o.useState(!1),[Ee,Re]=o.useState(new Date),[O,K]=o.useState([]);o.useEffect(()=>{f&&f?.length>0&&!u&&(console.log("Ad Mounted or reduxAds changed"),R(s.ad_id||f[he(0,f?.length-1)]?._id))},[f]),o.useEffect(()=>{},[n]),o.useEffect(()=>{n?.populated_promos&&m>=0&&M(n?.populated_promos[m])},[m,n]);function F(){$(!D)}const{ref:G,inView:b}=ie({threshold:0,triggerOnce:!0});function V(l){if(t&&console.log("Preventing this event from being logged as this ad is being shown in preview mode."),O.find(h=>h==l)){console.log("Already logged this event");return}E.axios.get("/api/ads/event",{params:{ad_id:n?._id,event:l}}).then(function(h){K([...O,l]),console.log(h.data)}).catch(function(h){console.log(h)})}o.useEffect(()=>{if(!t&&(console.log("inView",b),b&&u)){let l=[{ad_id:u,date:new Date().toString()},...c.filter(h=>{if(console.log(W(new Date,new Date(h.date))),W(new Date,new Date(h.date))>5){console.log("adsViewed - Remove Old Ad View Object");return}else return console.log("adsViewed - Keep Ad View Object"),h})];console.log("unexpiredRecentViews",l)}},[b,u]);const[T,H]=o.useState(null),[J,C]=o.useState(!1);function q(){C(!0),console.log("logAdAvoided called",r),E.axios.get(process.env.NODE_ENV==="development"?"http://localhost:3001/api/user/advertising/avoided":"https://articles.media/api/user/advertising/avoided",{params:{user_id:a?._id},headers:{"x-articles-api-key":r}}).then(function(l){C(!1),H(l.data.avoided_count),console.log(l.data)}).catch(function(l){console.log(l),C(!1)})}return o.useEffect(()=>{t||(console.log("inView",b),a?.articles_membership?.status=="Active"&&b&&q())},[b,a]),x?null:e.jsxRuntimeExports.jsxs("div",{ref:G,className:Y.classNames("ad-wrap",{"active-member":a?.articles_membership?.status=="Active"}),style:{"--articles-ad-background-color":d.background_color||n?.background_color,"--articles-ad-font-color":d.font_color||n?.font_color,"--articles-ad-border-color":d.border_color||n?.border_color},children:[D&&e.jsxRuntimeExports.jsx(fe,{setModalShow:$,ad:n,previewData:d}),X&&e.jsxRuntimeExports.jsx(je,{setModalShow:L,ad:n,previewData:d}),e.jsxRuntimeExports.jsxs("div",{className:"ad",children:[a?.articles_membership?.status!=="Active"&&e.jsxRuntimeExports.jsxs("div",{className:"main-panel",children:[e.jsxRuntimeExports.jsx("div",{className:"ad-warning flex-header",children:e.jsxRuntimeExports.jsxs("div",{className:"",children:[n?.city&&"Local"," Advertisement"]})}),e.jsxRuntimeExports.jsxs("div",{className:"content-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"photo-banner",children:[e.jsxRuntimeExports.jsx("div",{className:"logo",children:(d.logo?.location||n?.logo?.location)&&e.jsxRuntimeExports.jsx("img",{src:d?.logo?.key?`${process.env.NEXT_PUBLIC_CDN}${d?.logo?.key}`:`${process.env.NEXT_PUBLIC_CDN}${n?.logo?.key}`,alt:""})}),e.jsxRuntimeExports.jsx("div",{className:"icon d-none",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-mug-hot"})}),e.jsxRuntimeExports.jsx("img",{className:"photo",src:d?.background?.key?`${process.env.NEXT_PUBLIC_CDN}${d.background?.key}`:`${process.env.NEXT_PUBLIC_CDN}${n?.background?.key}`,alt:""})]}),e.jsxRuntimeExports.jsxs("div",{className:"details-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"detail-title",children:[e.jsxRuntimeExports.jsx("div",{className:"detail",children:e.jsxRuntimeExports.jsx("span",{className:"h4",children:d?.business||n?.business})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-column d-none",children:[e.jsxRuntimeExports.jsxs("div",{className:"detail",children:[e.jsxRuntimeExports.jsx("span",{className:"icon",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-search-location"})}),e.jsxRuntimeExports.jsxs("span",{children:[n?.city,", ",n?.state]})]}),e.jsxRuntimeExports.jsxs("div",{className:"detail",children:[e.jsxRuntimeExports.jsx("span",{className:"icon",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-clock me-2"})}),e.jsxRuntimeExports.jsx("span",{children:"6:30AM–8PM"})]})]})]}),n?.city&&e.jsxRuntimeExports.jsx("div",{className:"details mb-3 d-none"}),e.jsxRuntimeExports.jsx("div",{className:"short-description",children:d?.description||n?.description})]})]}),p?.roles?.isDev&&n?.populated_promos?.length>0&&e.jsxRuntimeExports.jsxs("div",{children:[g&&e.jsxRuntimeExports.jsx("div",{className:"promos-wrap",children:g&&e.jsxRuntimeExports.jsxs("div",{className:"promo-wrap d-flex justify-content-between align-items-center mx-2 p-1 px-2 border border-2 border-light mb-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"",children:[e.jsxRuntimeExports.jsx("div",{children:g.title}),e.jsxRuntimeExports.jsx("div",{className:"small",children:e.jsxRuntimeExports.jsx("div",{className:"small",children:g.details})})]}),e.jsxRuntimeExports.jsx(Q.ArticlesButton,{className:"px-3",small:!0,onClick:()=>{console.log("Load Save Modal"),A(!0)},children:"Save"})]},g._id)}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsxRuntimeExports.jsxs("div",{className:"px-2",children:[n?.populated_promos?.length," Promos Active"]}),e.jsxRuntimeExports.jsxs("div",{className:"controls",children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-arrow-circle-left",type:"button",onClick:()=>{m==0?j(n?.populated_promos?.length-1):j(l=>l-1)}}),n?.populated_promos?.map((l,h)=>e.jsxRuntimeExports.jsx("i",{className:`fa-square ${h==m?"fad":"fas"}`},l._id)),e.jsxRuntimeExports.jsx("i",{className:"fad fa-arrow-circle-right",type:"button",onClick:()=>{m==n?.populated_promos?.length-1?j(0):j(l=>l+1)}})]})]})]}),e.jsxRuntimeExports.jsx("hr",{style:{borderColor:"white"},className:"mt-auto mb-0"}),e.jsxRuntimeExports.jsxs("div",{className:"action-wrap d-flex justify-content-lg-between px-3 py-2",children:[e.jsxRuntimeExports.jsx("div",{onClick:()=>{F(),V("Details")},className:"action flex-grow-1 flex-shrink-0",children:"Details"}),e.jsxRuntimeExports.jsx("span",{className:"px-4"}),e.jsxRuntimeExports.jsx("a",{className:"action flex-grow-1 flex-shrink-0",href:n?.website,target:"_blank",rel:"noreferrer",onClick:l=>{l.preventDefault(),L(!0),V("Confirm Exit Modal Opened")},children:e.jsxRuntimeExports.jsx("div",{children:"Website"})})]})]}),a?.articles_membership?.status=="Active"&&e.jsxRuntimeExports.jsx("div",{className:"main-panel",children:e.jsxRuntimeExports.jsxs("div",{className:"content-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"photo-banner",children:[e.jsxRuntimeExports.jsx("div",{className:"logo"}),e.jsxRuntimeExports.jsxs("div",{className:"splash",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-broadcast-tower"}),e.jsxRuntimeExports.jsxs("div",{className:"text",children:[e.jsxRuntimeExports.jsx("div",{className:"count",children:J?e.jsxRuntimeExports.jsx("i",{className:"fas fa-spinner fa-spin me-0"}):T?v.numberWithCommas(T):0}),e.jsxRuntimeExports.jsx("div",{className:"label",children:"ads avoided."})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"member-since",children:["Member since: ",e.jsxRuntimeExports.jsx(v.ArticlesDate,{format:"PP",date:a?.articles_membership?.membership_started})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"details-wrap",children:[e.jsxRuntimeExports.jsx("div",{className:"detail-title",children:e.jsxRuntimeExports.jsx("div",{className:"detail",children:e.jsxRuntimeExports.jsx("span",{className:"h4",children:"Thanks for the support!"})})}),e.jsxRuntimeExports.jsxs("div",{className:"short-description",children:[e.jsxRuntimeExports.jsx("div",{className:"mb-2",children:"Without support from users like you, we wouldn't be here."}),e.jsxRuntimeExports.jsxs("div",{className:"links-list",children:[e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/messages",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-comments-alt"}),"0 unread messages."]}),e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/settings/notifications",onClick:()=>{q()},children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-bell"}),"0 notifications."]}),e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/settings/account",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-cog"}),"Manage account settings."]})]})]})]})]})})]}),!t&&e.jsxRuntimeExports.jsx("div",{className:"advertise-with-us p-1",style:{backgroundColor:d.background_color||n?.background_color,color:d.font_color||n?.font_color,borderColor:d.border_color||n?.border_color},children:e.jsxRuntimeExports.jsxs(v.Link,{className:"small d-block w-100 text-center",href:"https://articles.media/advertising",newPage:!0,children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-share me-1"}),"Advertise with Articles Media!"]})})]})}const ge=o.memo(ve);module.exports=ge;
|
package/dist/Ad.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-tc70JA_2.js";
|
|
2
2
|
import * as _ from "react";
|
|
3
|
-
import { lazy as
|
|
4
|
-
import { t as
|
|
5
|
-
import { u as
|
|
6
|
-
import { A as
|
|
7
|
-
import { c as
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
return s ? (R.has(s) || (
|
|
3
|
+
import { lazy as F, memo as te, useState as p, useEffect as y } from "react";
|
|
4
|
+
import { t as U, m as G, n as ae, A as re, L as C } from "./numberWithCommas-DnAkiOFL.js";
|
|
5
|
+
import { u as H, a as w } from "./index-DLYx67wi.js";
|
|
6
|
+
import { A as ne } from "./Button-_Quon8UV.js";
|
|
7
|
+
import { c as ie } from "./index-YnD2EP-S.js";
|
|
8
|
+
var $ = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new WeakMap(), X = 0, oe;
|
|
9
|
+
function le(s) {
|
|
10
|
+
return s ? (R.has(s) || (X += 1, R.set(s, X.toString())), R.get(s)) : "0";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function de(s) {
|
|
13
13
|
return Object.keys(s).sort().filter(
|
|
14
14
|
(t) => s[t] !== void 0
|
|
15
|
-
).map((t) => `${t}_${t === "root" ?
|
|
15
|
+
).map((t) => `${t}_${t === "root" ? le(s.root) : s[t]}`).toString();
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const t =
|
|
19
|
-
let o =
|
|
17
|
+
function ce(s) {
|
|
18
|
+
const t = de(s);
|
|
19
|
+
let o = $.get(t);
|
|
20
20
|
if (!o) {
|
|
21
21
|
const r = /* @__PURE__ */ new Map();
|
|
22
22
|
let n;
|
|
23
|
-
const u = new IntersectionObserver((
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
const j = i.isIntersecting && n.some((
|
|
27
|
-
s.trackVisibility && typeof i.isVisible > "u" && (i.isVisible = j), (
|
|
28
|
-
|
|
23
|
+
const u = new IntersectionObserver((f) => {
|
|
24
|
+
f.forEach((i) => {
|
|
25
|
+
var c;
|
|
26
|
+
const j = i.isIntersecting && n.some((h) => i.intersectionRatio >= h);
|
|
27
|
+
s.trackVisibility && typeof i.isVisible > "u" && (i.isVisible = j), (c = r.get(i.target)) == null || c.forEach((h) => {
|
|
28
|
+
h(j, i);
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
31
|
}, s);
|
|
@@ -33,58 +33,58 @@ function le(s) {
|
|
|
33
33
|
id: t,
|
|
34
34
|
observer: u,
|
|
35
35
|
elements: r
|
|
36
|
-
},
|
|
36
|
+
}, $.set(t, o);
|
|
37
37
|
}
|
|
38
38
|
return o;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ue(s, t, o = {}, r = oe) {
|
|
41
41
|
if (typeof window.IntersectionObserver > "u" && r !== void 0) {
|
|
42
|
-
const
|
|
42
|
+
const c = s.getBoundingClientRect();
|
|
43
43
|
return t(r, {
|
|
44
44
|
isIntersecting: r,
|
|
45
45
|
target: s,
|
|
46
46
|
intersectionRatio: typeof o.threshold == "number" ? o.threshold : 0,
|
|
47
47
|
time: 0,
|
|
48
|
-
boundingClientRect:
|
|
49
|
-
intersectionRect:
|
|
50
|
-
rootBounds:
|
|
48
|
+
boundingClientRect: c,
|
|
49
|
+
intersectionRect: c,
|
|
50
|
+
rootBounds: c
|
|
51
51
|
}), () => {
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
const { id: n, observer: u, elements:
|
|
55
|
-
return
|
|
56
|
-
i.splice(i.indexOf(t), 1), i.length === 0 && (
|
|
54
|
+
const { id: n, observer: u, elements: f } = ce(o), i = f.get(s) || [];
|
|
55
|
+
return f.has(s) || f.set(s, i), i.push(t), u.observe(s), function() {
|
|
56
|
+
i.splice(i.indexOf(t), 1), i.length === 0 && (f.delete(s), u.unobserve(s)), f.size === 0 && (u.disconnect(), $.delete(n));
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function me({
|
|
60
60
|
threshold: s,
|
|
61
61
|
delay: t,
|
|
62
62
|
trackVisibility: o,
|
|
63
63
|
rootMargin: r,
|
|
64
64
|
root: n,
|
|
65
65
|
triggerOnce: u,
|
|
66
|
-
skip:
|
|
66
|
+
skip: f,
|
|
67
67
|
initialInView: i,
|
|
68
|
-
fallbackInView:
|
|
68
|
+
fallbackInView: c,
|
|
69
69
|
onChange: j
|
|
70
70
|
} = {}) {
|
|
71
|
-
var
|
|
72
|
-
const [a,
|
|
71
|
+
var h;
|
|
72
|
+
const [a, d] = _.useState(null), M = _.useRef(j), N = _.useRef(i), [D, P] = _.useState({
|
|
73
73
|
inView: !!i,
|
|
74
74
|
entry: void 0
|
|
75
75
|
});
|
|
76
76
|
M.current = j, _.useEffect(
|
|
77
77
|
() => {
|
|
78
|
-
if (N.current === void 0 && (N.current = i),
|
|
79
|
-
let
|
|
80
|
-
return
|
|
78
|
+
if (N.current === void 0 && (N.current = i), f || !a) return;
|
|
79
|
+
let v;
|
|
80
|
+
return v = ue(
|
|
81
81
|
a,
|
|
82
82
|
(A, k) => {
|
|
83
83
|
const I = N.current;
|
|
84
84
|
N.current = A, !(I === void 0 && !A) && (P({
|
|
85
85
|
inView: A,
|
|
86
86
|
entry: k
|
|
87
|
-
}), M.current && M.current(A, k), k.isIntersecting && u &&
|
|
87
|
+
}), M.current && M.current(A, k), k.isIntersecting && u && v && (v(), v = void 0));
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
root: n,
|
|
@@ -94,9 +94,9 @@ function de({
|
|
|
94
94
|
trackVisibility: o,
|
|
95
95
|
delay: t
|
|
96
96
|
},
|
|
97
|
-
|
|
97
|
+
c
|
|
98
98
|
), () => {
|
|
99
|
-
|
|
99
|
+
v && v();
|
|
100
100
|
};
|
|
101
101
|
},
|
|
102
102
|
// We break the rule here, because we aren't including the actual `threshold` variable
|
|
@@ -108,21 +108,21 @@ function de({
|
|
|
108
108
|
n,
|
|
109
109
|
r,
|
|
110
110
|
u,
|
|
111
|
-
|
|
111
|
+
f,
|
|
112
112
|
o,
|
|
113
|
-
|
|
113
|
+
c,
|
|
114
114
|
t
|
|
115
115
|
]
|
|
116
116
|
);
|
|
117
|
-
const x = (
|
|
118
|
-
!a && x && !u && !
|
|
117
|
+
const x = (h = D.entry) == null ? void 0 : h.target, E = _.useRef(void 0);
|
|
118
|
+
!a && x && !u && !f && E.current !== x && (E.current = x, P({
|
|
119
119
|
inView: !!i,
|
|
120
120
|
entry: void 0
|
|
121
121
|
}), N.current = i);
|
|
122
|
-
const m = [
|
|
122
|
+
const m = [d, D.inView, D.entry];
|
|
123
123
|
return m.ref = m[0], m.inView = m[1], m.entry = m[2], m;
|
|
124
124
|
}
|
|
125
|
-
const
|
|
125
|
+
const fe = async (s) => {
|
|
126
126
|
if (process.env.NODE_ENV === "development")
|
|
127
127
|
try {
|
|
128
128
|
return (await w.get(`http://localhost:3001/api/ads/${s.ad_id}`, {
|
|
@@ -138,19 +138,19 @@ const ue = async (s) => {
|
|
|
138
138
|
ad_id: s.ad_id
|
|
139
139
|
}
|
|
140
140
|
}).then((t) => t.data.result);
|
|
141
|
-
},
|
|
142
|
-
dedupingInterval: 1e3 * 60 *
|
|
141
|
+
}, he = 60, pe = {
|
|
142
|
+
dedupingInterval: 1e3 * 60 * he
|
|
143
143
|
// keepPreviousData: true,
|
|
144
144
|
// fallbackData: []
|
|
145
|
-
},
|
|
146
|
-
const { data: o, error: r, isLoading: n, mutate: u } =
|
|
145
|
+
}, ve = (s, t) => {
|
|
146
|
+
const { data: o, error: r, isLoading: n, mutate: u } = H(
|
|
147
147
|
s ? {
|
|
148
148
|
url: `https://articles.media/api/ads/${s}`,
|
|
149
149
|
ad_id: s,
|
|
150
150
|
user_ad_token: t
|
|
151
151
|
} : null,
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
fe,
|
|
153
|
+
pe
|
|
154
154
|
);
|
|
155
155
|
return {
|
|
156
156
|
data: o,
|
|
@@ -159,23 +159,23 @@ const ue = async (s) => {
|
|
|
159
159
|
mutate: u
|
|
160
160
|
};
|
|
161
161
|
};
|
|
162
|
-
function
|
|
162
|
+
function ge(s) {
|
|
163
163
|
return (t) => {
|
|
164
164
|
const r = (s ? Math[s] : Math.trunc)(t);
|
|
165
165
|
return r === 0 ? 0 : r;
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
return +
|
|
168
|
+
function xe(s, t) {
|
|
169
|
+
return +U(s) - +U(t);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
const r =
|
|
173
|
-
return
|
|
171
|
+
function z(s, t, o) {
|
|
172
|
+
const r = xe(s, t) / G;
|
|
173
|
+
return ge(o?.roundingMethod)(r);
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
return Math.trunc(s *
|
|
175
|
+
function q(s) {
|
|
176
|
+
return Math.trunc(s * G);
|
|
177
177
|
}
|
|
178
|
-
const
|
|
178
|
+
const je = async (s) => {
|
|
179
179
|
if (process.env.NODE_ENV === "development")
|
|
180
180
|
try {
|
|
181
181
|
return (await w.get("http://localhost:3001/api/ads", {
|
|
@@ -190,19 +190,19 @@ const ge = async (s) => {
|
|
|
190
190
|
// ad_id: data.ad_id
|
|
191
191
|
}
|
|
192
192
|
}).then((t) => t.data);
|
|
193
|
-
},
|
|
194
|
-
dedupingInterval:
|
|
195
|
-
focusThrottleInterval:
|
|
193
|
+
}, K = 60, Ne = {
|
|
194
|
+
dedupingInterval: q(K),
|
|
195
|
+
focusThrottleInterval: q(K)
|
|
196
196
|
// keepPreviousData: true,
|
|
197
197
|
// fallbackData: []
|
|
198
|
-
},
|
|
199
|
-
const { data: t, error: o, isLoading: r, mutate: n } =
|
|
198
|
+
}, be = (s) => {
|
|
199
|
+
const { data: t, error: o, isLoading: r, mutate: n } = H(
|
|
200
200
|
s?.loading || s?.disabled ? null : {
|
|
201
201
|
url: "https://articles.media/api/ads"
|
|
202
202
|
// ad_id
|
|
203
203
|
},
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
je,
|
|
205
|
+
Ne
|
|
206
206
|
);
|
|
207
207
|
return {
|
|
208
208
|
data: t,
|
|
@@ -210,11 +210,11 @@ const ge = async (s) => {
|
|
|
210
210
|
isLoading: r,
|
|
211
211
|
mutate: n
|
|
212
212
|
};
|
|
213
|
-
},
|
|
214
|
-
function
|
|
213
|
+
}, _e = F(() => import("./AdDetailsModal-Bp5hZm9N.js")), we = F(() => import("./AdConfirmExitModal-CKkMAvBK.js"));
|
|
214
|
+
function Ae(s, t) {
|
|
215
215
|
return Math.floor(Math.random() * (t - s + 1)) + s;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function ke(s) {
|
|
218
218
|
let {
|
|
219
219
|
previewMode: t,
|
|
220
220
|
darkMode: o,
|
|
@@ -222,32 +222,32 @@ function we(s) {
|
|
|
222
222
|
userDetails: n,
|
|
223
223
|
userDetailsLoading: u
|
|
224
224
|
} = s;
|
|
225
|
-
const
|
|
226
|
-
data:
|
|
227
|
-
} =
|
|
225
|
+
const f = !1, i = [], [c, j] = p(null), {
|
|
226
|
+
data: h
|
|
227
|
+
} = be(
|
|
228
228
|
{
|
|
229
229
|
loading: u,
|
|
230
230
|
disabled: n?.articles_membership?.status == "Active"
|
|
231
231
|
}
|
|
232
|
-
), { data: a } =
|
|
233
|
-
let
|
|
234
|
-
const [M, N] =
|
|
232
|
+
), { data: a } = ve(c, r);
|
|
233
|
+
let d = s.previewData || {};
|
|
234
|
+
const [M, N] = p(null), [D, P] = p(null), [x, E] = p(null), [m, v] = p(0), [A, k] = p(!1), [I, L] = p(!1), [J, V] = p(!1), [ye, Me] = p(/* @__PURE__ */ new Date()), [O, Q] = p([]);
|
|
235
235
|
y(() => {
|
|
236
|
-
|
|
237
|
-
}, [
|
|
236
|
+
h && h?.length > 0 && !c && (console.log("Ad Mounted or reduxAds changed"), j(s.ad_id || h[Ae(0, h?.length - 1)]?._id));
|
|
237
|
+
}, [h]), y(() => {
|
|
238
238
|
}, [a]), y(() => {
|
|
239
239
|
a?.populated_promos && m >= 0 && E(a?.populated_promos[m]);
|
|
240
240
|
}, [m, a]);
|
|
241
|
-
function
|
|
242
|
-
|
|
241
|
+
function Y() {
|
|
242
|
+
L(!I);
|
|
243
243
|
}
|
|
244
|
-
const { ref:
|
|
244
|
+
const { ref: Z, inView: b } = me({
|
|
245
245
|
/* Optional options */
|
|
246
246
|
threshold: 0,
|
|
247
247
|
triggerOnce: !0
|
|
248
248
|
});
|
|
249
|
-
function
|
|
250
|
-
if (t && console.log("Preventing this event from being logged as this ad is being shown in preview mode."),
|
|
249
|
+
function T(l) {
|
|
250
|
+
if (t && console.log("Preventing this event from being logged as this ad is being shown in preview mode."), O.find((g) => g == l)) {
|
|
251
251
|
console.log("Already logged this event");
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
@@ -256,35 +256,35 @@ function we(s) {
|
|
|
256
256
|
ad_id: a?._id,
|
|
257
257
|
event: l
|
|
258
258
|
}
|
|
259
|
-
}).then(function(
|
|
260
|
-
|
|
261
|
-
}).catch(function(
|
|
262
|
-
console.log(
|
|
259
|
+
}).then(function(g) {
|
|
260
|
+
Q([...O, l]), console.log(g.data);
|
|
261
|
+
}).catch(function(g) {
|
|
262
|
+
console.log(g);
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
265
|
y(() => {
|
|
266
|
-
if (!t && (console.log("inView", b), b &&
|
|
266
|
+
if (!t && (console.log("inView", b), b && c)) {
|
|
267
267
|
let l = [
|
|
268
268
|
{
|
|
269
|
-
ad_id:
|
|
269
|
+
ad_id: c,
|
|
270
270
|
date: (/* @__PURE__ */ new Date()).toString()
|
|
271
271
|
},
|
|
272
|
-
...i.filter((
|
|
272
|
+
...i.filter((g) => {
|
|
273
273
|
if (console.log(
|
|
274
|
-
|
|
275
|
-
),
|
|
274
|
+
z(/* @__PURE__ */ new Date(), new Date(g.date))
|
|
275
|
+
), z(/* @__PURE__ */ new Date(), new Date(g.date)) > 5) {
|
|
276
276
|
console.log("adsViewed - Remove Old Ad View Object");
|
|
277
277
|
return;
|
|
278
278
|
} else
|
|
279
|
-
return console.log("adsViewed - Keep Ad View Object"),
|
|
279
|
+
return console.log("adsViewed - Keep Ad View Object"), g;
|
|
280
280
|
})
|
|
281
281
|
];
|
|
282
282
|
console.log("unexpiredRecentViews", l);
|
|
283
283
|
}
|
|
284
|
-
}, [b,
|
|
285
|
-
const [
|
|
286
|
-
function
|
|
287
|
-
console.log("logAdAvoided called", r), w.get(
|
|
284
|
+
}, [b, c]);
|
|
285
|
+
const [B, ee] = p(null), [se, S] = p(!1);
|
|
286
|
+
function W() {
|
|
287
|
+
S(!0), console.log("logAdAvoided called", r), w.get(
|
|
288
288
|
process.env.NODE_ENV === "development" ? "http://localhost:3001/api/user/advertising/avoided" : "https://articles.media/api/user/advertising/avoided",
|
|
289
289
|
{
|
|
290
290
|
params: {
|
|
@@ -295,43 +295,43 @@ function we(s) {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
).then(function(l) {
|
|
298
|
-
|
|
298
|
+
S(!1), ee(l.data.avoided_count), console.log(l.data);
|
|
299
299
|
}).catch(function(l) {
|
|
300
|
-
console.log(l);
|
|
300
|
+
console.log(l), S(!1);
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
return y(() => {
|
|
304
|
-
t || (console.log("inView", b), n?.articles_membership?.status == "Active" && b &&
|
|
304
|
+
t || (console.log("inView", b), n?.articles_membership?.status == "Active" && b && W());
|
|
305
305
|
}, [b, n]), u ? null : /* @__PURE__ */ e.jsxs(
|
|
306
306
|
"div",
|
|
307
307
|
{
|
|
308
|
-
ref:
|
|
309
|
-
className:
|
|
308
|
+
ref: Z,
|
|
309
|
+
className: ie(
|
|
310
310
|
"ad-wrap",
|
|
311
311
|
{
|
|
312
312
|
"active-member": n?.articles_membership?.status == "Active"
|
|
313
313
|
}
|
|
314
314
|
),
|
|
315
315
|
style: {
|
|
316
|
-
"--articles-ad-background-color":
|
|
317
|
-
"--articles-ad-font-color":
|
|
318
|
-
"--articles-ad-border-color":
|
|
316
|
+
"--articles-ad-background-color": d.background_color || a?.background_color,
|
|
317
|
+
"--articles-ad-font-color": d.font_color || a?.font_color,
|
|
318
|
+
"--articles-ad-border-color": d.border_color || a?.border_color
|
|
319
319
|
},
|
|
320
320
|
children: [
|
|
321
321
|
I && /* @__PURE__ */ e.jsx(
|
|
322
|
-
|
|
322
|
+
_e,
|
|
323
323
|
{
|
|
324
|
-
setModalShow:
|
|
324
|
+
setModalShow: L,
|
|
325
325
|
ad: a,
|
|
326
|
-
previewData:
|
|
326
|
+
previewData: d
|
|
327
327
|
}
|
|
328
328
|
),
|
|
329
|
-
|
|
330
|
-
|
|
329
|
+
J && /* @__PURE__ */ e.jsx(
|
|
330
|
+
we,
|
|
331
331
|
{
|
|
332
|
-
setModalShow:
|
|
332
|
+
setModalShow: V,
|
|
333
333
|
ad: a,
|
|
334
|
-
previewData:
|
|
334
|
+
previewData: d
|
|
335
335
|
}
|
|
336
336
|
),
|
|
337
337
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -350,10 +350,10 @@ function we(s) {
|
|
|
350
350
|
] }) }),
|
|
351
351
|
/* @__PURE__ */ e.jsxs("div", { className: "content-wrap", children: [
|
|
352
352
|
/* @__PURE__ */ e.jsxs("div", { className: "photo-banner", children: [
|
|
353
|
-
/* @__PURE__ */ e.jsx("div", { className: "logo", children: (
|
|
353
|
+
/* @__PURE__ */ e.jsx("div", { className: "logo", children: (d.logo?.location || a?.logo?.location) && /* @__PURE__ */ e.jsx(
|
|
354
354
|
"img",
|
|
355
355
|
{
|
|
356
|
-
src:
|
|
356
|
+
src: d?.logo?.key ? `${process.env.NEXT_PUBLIC_CDN}${d?.logo?.key}` : `${process.env.NEXT_PUBLIC_CDN}${a?.logo?.key}`,
|
|
357
357
|
alt: ""
|
|
358
358
|
}
|
|
359
359
|
) }),
|
|
@@ -362,14 +362,14 @@ function we(s) {
|
|
|
362
362
|
"img",
|
|
363
363
|
{
|
|
364
364
|
className: "photo",
|
|
365
|
-
src:
|
|
365
|
+
src: d?.background?.key ? `${process.env.NEXT_PUBLIC_CDN}${d.background?.key}` : `${process.env.NEXT_PUBLIC_CDN}${a?.background?.key}`,
|
|
366
366
|
alt: ""
|
|
367
367
|
}
|
|
368
368
|
)
|
|
369
369
|
] }),
|
|
370
370
|
/* @__PURE__ */ e.jsxs("div", { className: "details-wrap", children: [
|
|
371
371
|
/* @__PURE__ */ e.jsxs("div", { className: "detail-title", children: [
|
|
372
|
-
/* @__PURE__ */ e.jsx("div", { className: "detail", children: /* @__PURE__ */ e.jsx("span", { className: "h4", children:
|
|
372
|
+
/* @__PURE__ */ e.jsx("div", { className: "detail", children: /* @__PURE__ */ e.jsx("span", { className: "h4", children: d?.business || a?.business }) }),
|
|
373
373
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-column d-none", children: [
|
|
374
374
|
/* @__PURE__ */ e.jsxs("div", { className: "detail", children: [
|
|
375
375
|
/* @__PURE__ */ e.jsx("span", { className: "icon", children: /* @__PURE__ */ e.jsx("i", { className: "fas fa-search-location" }) }),
|
|
@@ -386,10 +386,10 @@ function we(s) {
|
|
|
386
386
|
] })
|
|
387
387
|
] }),
|
|
388
388
|
a?.city && /* @__PURE__ */ e.jsx("div", { className: "details mb-3 d-none" }),
|
|
389
|
-
/* @__PURE__ */ e.jsx("div", { className: "short-description", children:
|
|
389
|
+
/* @__PURE__ */ e.jsx("div", { className: "short-description", children: d?.description || a?.description })
|
|
390
390
|
] })
|
|
391
391
|
] }),
|
|
392
|
-
|
|
392
|
+
f?.roles?.isDev && a?.populated_promos?.length > 0 && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
393
393
|
x && /* @__PURE__ */ e.jsx("div", { className: "promos-wrap", children: x && /* @__PURE__ */ e.jsxs(
|
|
394
394
|
"div",
|
|
395
395
|
{
|
|
@@ -400,7 +400,7 @@ function we(s) {
|
|
|
400
400
|
/* @__PURE__ */ e.jsx("div", { className: "small", children: /* @__PURE__ */ e.jsx("div", { className: "small", children: x.details }) })
|
|
401
401
|
] }),
|
|
402
402
|
/* @__PURE__ */ e.jsx(
|
|
403
|
-
|
|
403
|
+
ne,
|
|
404
404
|
{
|
|
405
405
|
className: "px-3",
|
|
406
406
|
small: !0,
|
|
@@ -426,15 +426,15 @@ function we(s) {
|
|
|
426
426
|
className: "fad fa-arrow-circle-left",
|
|
427
427
|
type: "button",
|
|
428
428
|
onClick: () => {
|
|
429
|
-
m == 0 ?
|
|
429
|
+
m == 0 ? v(a?.populated_promos?.length - 1) : v((l) => l - 1);
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
),
|
|
433
433
|
a?.populated_promos?.map(
|
|
434
|
-
(l,
|
|
434
|
+
(l, g) => /* @__PURE__ */ e.jsx(
|
|
435
435
|
"i",
|
|
436
436
|
{
|
|
437
|
-
className: `fa-square ${
|
|
437
|
+
className: `fa-square ${g == m ? "fad" : "fas"}`
|
|
438
438
|
},
|
|
439
439
|
l._id
|
|
440
440
|
)
|
|
@@ -445,7 +445,7 @@ function we(s) {
|
|
|
445
445
|
className: "fad fa-arrow-circle-right",
|
|
446
446
|
type: "button",
|
|
447
447
|
onClick: () => {
|
|
448
|
-
m == a?.populated_promos?.length - 1 ?
|
|
448
|
+
m == a?.populated_promos?.length - 1 ? v(0) : v((l) => l + 1);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
)
|
|
@@ -458,7 +458,7 @@ function we(s) {
|
|
|
458
458
|
"div",
|
|
459
459
|
{
|
|
460
460
|
onClick: () => {
|
|
461
|
-
|
|
461
|
+
Y(), T("Details");
|
|
462
462
|
},
|
|
463
463
|
className: "action flex-grow-1 flex-shrink-0",
|
|
464
464
|
children: "Details"
|
|
@@ -473,7 +473,7 @@ function we(s) {
|
|
|
473
473
|
target: "_blank",
|
|
474
474
|
rel: "noreferrer",
|
|
475
475
|
onClick: (l) => {
|
|
476
|
-
l.preventDefault(),
|
|
476
|
+
l.preventDefault(), V(!0), T("Confirm Exit Modal Opened");
|
|
477
477
|
},
|
|
478
478
|
children: /* @__PURE__ */ e.jsx("div", { children: "Website" })
|
|
479
479
|
}
|
|
@@ -492,7 +492,13 @@ function we(s) {
|
|
|
492
492
|
/* @__PURE__ */ e.jsxs("div", { className: "splash", children: [
|
|
493
493
|
/* @__PURE__ */ e.jsx("i", { className: "fas fa-broadcast-tower" }),
|
|
494
494
|
/* @__PURE__ */ e.jsxs("div", { className: "text", children: [
|
|
495
|
-
/* @__PURE__ */ e.jsx(
|
|
495
|
+
/* @__PURE__ */ e.jsx(
|
|
496
|
+
"div",
|
|
497
|
+
{
|
|
498
|
+
className: "count",
|
|
499
|
+
children: se ? /* @__PURE__ */ e.jsx("i", { className: "fas fa-spinner fa-spin me-0" }) : B ? ae(B) : 0
|
|
500
|
+
}
|
|
501
|
+
),
|
|
496
502
|
/* @__PURE__ */ e.jsx("div", { className: "label", children: "ads avoided." })
|
|
497
503
|
] })
|
|
498
504
|
] }),
|
|
@@ -502,7 +508,7 @@ function we(s) {
|
|
|
502
508
|
className: "member-since",
|
|
503
509
|
children: [
|
|
504
510
|
"Member since: ",
|
|
505
|
-
/* @__PURE__ */ e.jsx(
|
|
511
|
+
/* @__PURE__ */ e.jsx(re, { format: "PP", date: n?.articles_membership?.membership_started })
|
|
506
512
|
]
|
|
507
513
|
}
|
|
508
514
|
)
|
|
@@ -531,7 +537,7 @@ function we(s) {
|
|
|
531
537
|
className: "link-item",
|
|
532
538
|
href: "https://articles.media/settings/notifications",
|
|
533
539
|
onClick: () => {
|
|
534
|
-
|
|
540
|
+
W();
|
|
535
541
|
},
|
|
536
542
|
children: [
|
|
537
543
|
/* @__PURE__ */ e.jsx("i", { className: "fas fa-bell" }),
|
|
@@ -566,9 +572,9 @@ function we(s) {
|
|
|
566
572
|
className: "advertise-with-us p-1",
|
|
567
573
|
style: {
|
|
568
574
|
// ...(props.previewData ? props.previewData.background_color : ad?.background_color),
|
|
569
|
-
backgroundColor:
|
|
570
|
-
color:
|
|
571
|
-
borderColor:
|
|
575
|
+
backgroundColor: d.background_color || a?.background_color,
|
|
576
|
+
color: d.font_color || a?.font_color,
|
|
577
|
+
borderColor: d.border_color || a?.border_color
|
|
572
578
|
},
|
|
573
579
|
children: /* @__PURE__ */ e.jsxs(
|
|
574
580
|
C,
|
|
@@ -588,7 +594,7 @@ function we(s) {
|
|
|
588
594
|
}
|
|
589
595
|
);
|
|
590
596
|
}
|
|
591
|
-
const
|
|
597
|
+
const Se = te(ke);
|
|
592
598
|
export {
|
|
593
|
-
|
|
599
|
+
Se as default
|
|
594
600
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),l=require("./index-Ddv_TnxK.cjs"),u=require("./index-BlP2-uOi.cjs"),r=require("react"),d=s=>l.axios.get(s).then(t=>t.data),i=s=>{const{data:t,error:n,isLoading:a,mutate:o}=l.useSWR(process.env.NODE_ENV==="development"&&!s?.disable?"http://localhost:3001/api/config":null,d,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:n,isLoading:a,mutate:o}},m=s=>l.axios.get(s).then(t=>t.data),c=s=>{const{data:t,error:n,isLoading:a,mutate:o}=l.useSWR(process.env.NODE_ENV==="development"&&!s?.disable?"http://localhost:3012/api/status":null,m,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:n,isLoading:a,mutate:o}},p=r.lazy(()=>Promise.resolve().then(()=>require("./StatusModal-
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),l=require("./index-Ddv_TnxK.cjs"),u=require("./index-BlP2-uOi.cjs"),r=require("react"),d=s=>l.axios.get(s).then(t=>t.data),i=s=>{const{data:t,error:n,isLoading:a,mutate:o}=l.useSWR(process.env.NODE_ENV==="development"&&!s?.disable?"http://localhost:3001/api/config":null,d,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:n,isLoading:a,mutate:o}},m=s=>l.axios.get(s).then(t=>t.data),c=s=>{const{data:t,error:n,isLoading:a,mutate:o}=l.useSWR(process.env.NODE_ENV==="development"&&!s?.disable?"http://localhost:3012/api/status":null,m,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:n,isLoading:a,mutate:o}},p=r.lazy(()=>Promise.resolve().then(()=>require("./StatusModal-BlwaI-2B.cjs")));function x(s){const[t,n]=r.useState(!1),{data:a}=i({disable:process.env.NODE_ENV!=="development"}),{data:o}=c({disable:process.env.NODE_ENV!=="development"});return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("link",{rel:"stylesheet",href:"https://cdn.articles.media/fonts/fontawesome/css/all.min.css"}),process.env.NODE_ENV==="development"&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("style",{children:`
|
|
2
2
|
@keyframes grow-shrink {
|
|
3
3
|
0% { transform: translateY(-50px); }
|
|
4
4
|
50% { transform: translateY(0px); }
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
.articles-global-body.auth-connected {
|
|
31
31
|
border-color: blue;
|
|
32
32
|
}
|
|
33
|
-
`}),e.jsxRuntimeExports.
|
|
33
|
+
`}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{n(!0)},className:u.classNames("articles-global-body",{"main-connected":a,"auth-connected":o}),children:e.jsxRuntimeExports.jsx("div",{className:"content",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-thumbs-up"})})}),t&&e.jsxRuntimeExports.jsx(r.Suspense,{children:e.jsxRuntimeExports.jsx(p,{show:t,setShow:n})})]})]})}const h=r.memo(x);exports.GlobalBody_default=h;exports.useAuthSiteStatus=c;exports.useMainSiteStatus=i;
|
|
@@ -36,7 +36,7 @@ const p = (s) => l.get(s).then((t) => t.data), f = (s) => {
|
|
|
36
36
|
isLoading: o,
|
|
37
37
|
mutate: n
|
|
38
38
|
};
|
|
39
|
-
}, x = c(() => import("./StatusModal-
|
|
39
|
+
}, x = c(() => import("./StatusModal-CAVxWCUq.js"));
|
|
40
40
|
function g(s) {
|
|
41
41
|
const [t, a] = u(!1), {
|
|
42
42
|
data: o
|
|
@@ -47,8 +47,16 @@ function g(s) {
|
|
|
47
47
|
} = b({
|
|
48
48
|
disable: process.env.NODE_ENV !== "development"
|
|
49
49
|
});
|
|
50
|
-
return /* @__PURE__ */ e.
|
|
51
|
-
/* @__PURE__ */ e.jsx(
|
|
50
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
51
|
+
/* @__PURE__ */ e.jsx(
|
|
52
|
+
"link",
|
|
53
|
+
{
|
|
54
|
+
rel: "stylesheet",
|
|
55
|
+
href: "https://cdn.articles.media/fonts/fontawesome/css/all.min.css"
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
process.env.NODE_ENV === "development" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
59
|
+
/* @__PURE__ */ e.jsx("style", { children: `
|
|
52
60
|
@keyframes grow-shrink {
|
|
53
61
|
0% { transform: translateY(-50px); }
|
|
54
62
|
50% { transform: translateY(0px); }
|
|
@@ -81,39 +89,31 @@ function g(s) {
|
|
|
81
89
|
border-color: blue;
|
|
82
90
|
}
|
|
83
91
|
` }),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
"main-connected": o,
|
|
94
|
-
"auth-connected": n
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ e.jsx(
|
|
99
|
-
"link",
|
|
92
|
+
/* @__PURE__ */ e.jsx(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
onClick: () => {
|
|
96
|
+
a(!0);
|
|
97
|
+
},
|
|
98
|
+
className: i(
|
|
99
|
+
"articles-global-body",
|
|
100
100
|
{
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
"main-connected": o,
|
|
102
|
+
"auth-connected": n
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
|
-
/* @__PURE__ */ e.jsx("div", { className: "content", children: /* @__PURE__ */ e.jsx("i", { className: "fas fa-thumbs-up" }) })
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
] })
|
|
105
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "content", children: /* @__PURE__ */ e.jsx("i", { className: "fas fa-thumbs-up" }) })
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
t && /* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx(
|
|
109
|
+
x,
|
|
110
|
+
{
|
|
111
|
+
show: t,
|
|
112
|
+
setShow: a
|
|
113
|
+
}
|
|
114
|
+
) })
|
|
115
|
+
] })
|
|
116
|
+
] });
|
|
117
117
|
}
|
|
118
118
|
const E = d(g);
|
|
119
119
|
export {
|
package/dist/GlobalBody.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./jsx-runtime-nZSsnGb7.cjs");const e=require("./GlobalBody-
|
|
1
|
+
"use strict";require("./jsx-runtime-nZSsnGb7.cjs");const e=require("./GlobalBody-BQ2qC81K.cjs");require("./index-BlP2-uOi.cjs");require("react");module.exports=e.GlobalBody_default;
|
package/dist/GlobalBody.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-nZSsnGb7.cjs"),j=require("react"),l=require("./Button-0ZK0NKiK.cjs"),S=require("./GlobalBody-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-nZSsnGb7.cjs"),j=require("react"),l=require("./Button-0ZK0NKiK.cjs"),S=require("./GlobalBody-BQ2qC81K.cjs"),t=require("./Modal-Wmqy9fOm.cjs");function g({show:h,setShow:u}){const[s,p]=j.useState(!1),[i,E]=j.useState(!1),c=(R,m,f)=>f?"...":m?m.response?.status||"Error":R?"200":"-",{data:r,error:n,isLoading:d}=S.useMainSiteStatus({disable:process.env.NODE_ENV!=="development"}),{data:a,error:o,isLoading:x}=S.useAuthSiteStatus({disable:process.env.NODE_ENV!=="development"});return e.jsxRuntimeExports.jsxs(t.Modal,{show:h,size:"md",className:"articles-modal",centered:!0,onHide:()=>u(!1),children:[e.jsxRuntimeExports.jsx(t.Modal.Header,{children:e.jsxRuntimeExports.jsx(t.Modal.Title,{children:"Status Details"})}),e.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center mb-2",children:[e.jsxRuntimeExports.jsxs("h5",{className:"mb-0 me-2",children:["Main Site Status: ",c(r,n,d)]}),e.jsxRuntimeExports.jsxs(l.ArticlesButton,{variant:"link",size:"sm",className:"p-0",onClick:()=>p(!s),children:[s?"Hide":"View"," More"]})]}),s&&e.jsxRuntimeExports.jsxs("pre",{children:[d&&"Loading...",n&&`Error: ${n.message}`,r&&JSON.stringify(r,null,2)]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center mb-2",children:[e.jsxRuntimeExports.jsxs("h5",{className:"mb-0 me-2",children:["Auth Site Status: ",c(a,o,x)]}),e.jsxRuntimeExports.jsxs(l.ArticlesButton,{variant:"link",size:"sm",className:"p-0",onClick:()=>E(!i),children:[i?"Hide":"View"," More"]})]}),i&&e.jsxRuntimeExports.jsxs("pre",{children:[x&&"Loading...",o&&`Error: ${o.message}`,a&&JSON.stringify(a,null,2)]})]}),e.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"justify-content-between",children:e.jsxRuntimeExports.jsx(l.ArticlesButton,{variant:"articles",onClick:()=>{u(!1)},children:"Close"})})]})}exports.default=g;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-tc70JA_2.js";
|
|
2
2
|
import { useState as h } from "react";
|
|
3
3
|
import { A as o } from "./Button-_Quon8UV.js";
|
|
4
|
-
import { u as g, a as E } from "./GlobalBody-
|
|
4
|
+
import { u as g, a as E } from "./GlobalBody-tmIC_GWn.js";
|
|
5
5
|
import { M as s } from "./Modal-C9oYRgI1.js";
|
|
6
6
|
function A({
|
|
7
7
|
show: f,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ad-wrap{z-index:1;margin:0 auto;margin-bottom:1rem;max-width:312px;width:100%;--card-background: #f9edcd}.ad-wrap.active-member .ad .main-panel{height:310px}.ad-wrap .ad{position:relative;align-self:flex-start;width:100%;z-index:2;font-family:brandon-grotesque,sans-serif;box-shadow:0 0 0 1px #00000040,0 2px 3px #0003;font-size:14px}@media(max-width:768px){.ad-wrap .ad{font-size:16px;width:100%}}.ad-wrap .ad .main-panel{background-color:var(--articles-ad-background-color, var(--card-background));color:var(--articles-ad-font-color, var(--bs-body-color));height:400px;display:flex;flex-direction:column}.ad-wrap .ad .main-panel .ad-warning{padding:.1rem .75rem;font-family:brandon-grotesque,sans-serif;font-weight:900;font-size:1rem;border-bottom:1px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .ad .main-panel .content-wrap{display:flex;flex-direction:column;align-items:center}@media(min-width:992px){.ad-wrap .ad .main-panel .content-wrap{flex-direction:column}}.ad-wrap .ad .main-panel .photo-banner{position:relative;height:100px;width:100px;flex-shrink:0;display:flex;align-items:center;padding-left:1rem;margin-left:.75rem;margin-left:0rem;height:125px;width:100%;border-bottom:1px solid black}.ad-wrap .ad .main-panel .photo-banner .logo{object-fit:cover;z-index:1}.ad-wrap .ad .main-panel .photo-banner .logo img{width:75px;height:75px;object-fit:contain}.ad-wrap .ad .main-panel .photo-banner .splash{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%) translateY(-50%);width:100%;display:flex;align-items:center;justify-content:center;color:#000}.ad-wrap .ad .main-panel .photo-banner .splash i{font-size:3rem;margin-right:1rem}.ad-wrap .ad .main-panel .photo-banner .splash .text{display:flex;flex-direction:column;line-height:1;align-items:start}.ad-wrap .ad .main-panel .photo-banner .splash .text .label{font-size:1.5rem}.ad-wrap .ad .main-panel .photo-banner .splash .text .count{font-weight:700;font-size:2rem}.ad-wrap .ad .main-panel .photo-banner .member-since{position:absolute;bottom:0;left:0;padding:.25rem .5rem;background-color:#00000080;color:#fff;font-size:.75rem;border-top-right-radius:5px}.ad-wrap .ad .main-panel .photo-banner .photo{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}.ad-wrap .ad .main-panel .details-wrap{width:100%}.ad-wrap .ad .main-panel .links-list{display:flex;flex-direction:column}.ad-wrap .ad .main-panel .links-list .link-item{color:#000}.ad-wrap .ad .main-panel .links-list .link-item:hover{text-decoration:underline;text-decoration-color:red}.ad-wrap .ad .main-panel .details,.ad-wrap .ad .main-panel .detail-title{padding:.75rem .75rem 0rem;display:grid;grid-gap:5px 5px;grid-template-columns:repeat(2,1fr)}.ad-wrap .ad .main-panel .details .detail .icon,.ad-wrap .ad .main-panel .detail-title .detail .icon{display:inline-block;width:1.5rem}.ad-wrap .ad .main-panel .details .detail .icon i,.ad-wrap .ad .main-panel .detail-title .detail .icon i{justify-content:flex-start;display:flex}.ad-wrap .ad .main-panel .short-description{padding:.25rem .75rem 0rem;min-height:50px;overflow-y:auto;max-height:125px}.ad-wrap .ad .main-panel .detail-title{display:flex;justify-content:space-between;align-items:center}.ad-wrap .ad .main-panel .action-wrap{border-top:1px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .ad .main-panel .action-wrap .action{padding:.25rem;display:flex;justify-content:center;align-items:center;border:1px solid var(--articles-ad-border-color, var(--card-background));color:var(--articles-ad-font-color, var(--bs-body-color));border-radius:10px;margin-left:auto;margin-right:auto;cursor:pointer;transition-duration:.2s}.ad-wrap .ad .main-panel .action-wrap .action:hover{background-color:#fff;color:#000}.ad-wrap .ad .main-panel .action-wrap .action:active{background-color:gray}.ad-wrap .advertise-with-us{background-color:var(--articles-ad-background-color, var(--card-background));border-top:2px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .advertise-with-us a{color:var(--articles-ad-font-color, var(--bs-body-color))!important}.view-user-modal-badge-wrap{display:flex;align-items:stretch;cursor:pointer}.view-user-modal-badge-wrap.large .view-user-modal-badge{position:relative;height:30px}.view-user-modal-badge-wrap.large .view-user-modal-badge .membership-badge{font-size:1rem!important}.view-user-modal-badge-wrap.large .view-user-modal-badge .profile-photo-wrap{height:22px!important;width:22px!important;margin-right:.5rem}.view-user-modal-badge-wrap.large .view-user-modal-badge img{margin-right:.5rem}.view-user-modal-badge-wrap .badge-membership{position:relative}.view-user-modal-badge-wrap .verification-user-badge{display:flex;align-items:center}.profile-photo-wrap{position:relative}.profile-photo-wrap .online-status{position:absolute;width:10px;height:10px;background-color:gray;bottom:1px;right:1px;border:2px solid #000;z-index:1}.profile-photo-wrap .online-status.status-online{background-color:green;border:2px solid #009b22}:root{--articles-theme-primary: #f9edcd}.bg-articles{background-color:var(--articles-theme-primary);color:#000!important}.shadow-articles{box-shadow:0 0 0 1px #0000004d,0 2px 3px #0003;box-shadow:0 0 0 1px #00000040,0 2px 3px #0003}.text-center{text-align:center}.d-flex{display:flex}.flex-header{display:flex;justify-content:space-between;align-items:center}.scoreboard{margin-top:1rem;max-width:300px;width:100%;margin-bottom:1rem}@media(min-width:992px){.scoreboard{margin-top:0rem;margin-bottom:0rem;display:block;position:absolute;left:1rem;top:50%;transform:translateY(-50%)}}.articles-game-scoreboard{border:1px solid rgb(206,212,218);border-radius:8px;box-shadow:#00000012 0 2px 8px;color:#222;width:100%;max-width:350px;margin:0px 1rem;overflow:hidden;display:flex;flex-direction:column;z-index:1;position:fixed;bottom:50%;transform:translateY(50%);left:8px}
|
|
1
|
+
.ad-wrap{z-index:1;margin:0 auto;margin-bottom:1rem;max-width:312px;width:100%;--card-background: #f9edcd}.ad-wrap.active-member .ad .main-panel{height:310px}.ad-wrap .ad{position:relative;align-self:flex-start;width:100%;z-index:2;font-family:brandon-grotesque,sans-serif;box-shadow:0 0 0 1px #00000040,0 2px 3px #0003;font-size:14px}@media(max-width:768px){.ad-wrap .ad{font-size:16px;width:100%}}.ad-wrap .ad .main-panel{background-color:var(--articles-ad-background-color, var(--card-background));color:var(--articles-ad-font-color, var(--bs-body-color));height:400px;display:flex;flex-direction:column}.ad-wrap .ad .main-panel .ad-warning{padding:.1rem .75rem;font-family:brandon-grotesque,sans-serif;font-weight:900;font-size:1rem;border-bottom:1px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .ad .main-panel .content-wrap{display:flex;flex-direction:column;align-items:center}@media(min-width:992px){.ad-wrap .ad .main-panel .content-wrap{flex-direction:column}}.ad-wrap .ad .main-panel .photo-banner{position:relative;height:100px;width:100px;flex-shrink:0;display:flex;align-items:center;padding-left:1rem;margin-left:.75rem;margin-left:0rem;height:125px;width:100%;border-bottom:1px solid black}.ad-wrap .ad .main-panel .photo-banner .logo{object-fit:cover;z-index:1}.ad-wrap .ad .main-panel .photo-banner .logo img{width:75px;height:75px;object-fit:contain}.ad-wrap .ad .main-panel .photo-banner .splash{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%) translateY(-50%);width:100%;display:flex;align-items:center;justify-content:center;color:#000}.ad-wrap .ad .main-panel .photo-banner .splash i{font-size:3rem;margin-right:1rem}.ad-wrap .ad .main-panel .photo-banner .splash .text{display:flex;flex-direction:column;line-height:1;align-items:start}.ad-wrap .ad .main-panel .photo-banner .splash .text .label{font-size:1.5rem}.ad-wrap .ad .main-panel .photo-banner .splash .text .count{font-weight:700;font-size:2rem}.ad-wrap .ad .main-panel .photo-banner .splash .text .count .fa-spinner{font-size:1.5rem}.ad-wrap .ad .main-panel .photo-banner .member-since{position:absolute;bottom:0;left:0;padding:.25rem .5rem;background-color:#00000080;color:#fff;font-size:.75rem;border-top-right-radius:5px}.ad-wrap .ad .main-panel .photo-banner .photo{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}.ad-wrap .ad .main-panel .details-wrap{width:100%}.ad-wrap .ad .main-panel .links-list{display:flex;flex-direction:column}.ad-wrap .ad .main-panel .links-list .link-item{color:#000}.ad-wrap .ad .main-panel .links-list .link-item:hover{text-decoration:underline;text-decoration-color:red}.ad-wrap .ad .main-panel .details,.ad-wrap .ad .main-panel .detail-title{padding:.75rem .75rem 0rem;display:grid;grid-gap:5px 5px;grid-template-columns:repeat(2,1fr)}.ad-wrap .ad .main-panel .details .detail .icon,.ad-wrap .ad .main-panel .detail-title .detail .icon{display:inline-block;width:1.5rem}.ad-wrap .ad .main-panel .details .detail .icon i,.ad-wrap .ad .main-panel .detail-title .detail .icon i{justify-content:flex-start;display:flex}.ad-wrap .ad .main-panel .short-description{padding:.25rem .75rem 0rem;min-height:50px;overflow-y:auto;max-height:125px}.ad-wrap .ad .main-panel .detail-title{display:flex;justify-content:space-between;align-items:center}.ad-wrap .ad .main-panel .action-wrap{border-top:1px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .ad .main-panel .action-wrap .action{padding:.25rem;display:flex;justify-content:center;align-items:center;border:1px solid var(--articles-ad-border-color, var(--card-background));color:var(--articles-ad-font-color, var(--bs-body-color));border-radius:10px;margin-left:auto;margin-right:auto;cursor:pointer;transition-duration:.2s}.ad-wrap .ad .main-panel .action-wrap .action:hover{background-color:#fff;color:#000}.ad-wrap .ad .main-panel .action-wrap .action:active{background-color:gray}.ad-wrap .advertise-with-us{background-color:var(--articles-ad-background-color, var(--card-background));border-top:2px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .advertise-with-us a{color:var(--articles-ad-font-color, var(--bs-body-color))!important}.view-user-modal-badge-wrap{display:flex;align-items:stretch;cursor:pointer}.view-user-modal-badge-wrap.large .view-user-modal-badge{position:relative;height:30px}.view-user-modal-badge-wrap.large .view-user-modal-badge .membership-badge{font-size:1rem!important}.view-user-modal-badge-wrap.large .view-user-modal-badge .profile-photo-wrap{height:22px!important;width:22px!important;margin-right:.5rem}.view-user-modal-badge-wrap.large .view-user-modal-badge img{margin-right:.5rem}.view-user-modal-badge-wrap .badge-membership{position:relative}.view-user-modal-badge-wrap .verification-user-badge{display:flex;align-items:center}.profile-photo-wrap{position:relative}.profile-photo-wrap .online-status{position:absolute;width:10px;height:10px;background-color:gray;bottom:1px;right:1px;border:2px solid #000;z-index:1}.profile-photo-wrap .online-status.status-online{background-color:green;border:2px solid #009b22}:root{--articles-theme-primary: #f9edcd}.bg-articles{background-color:var(--articles-theme-primary);color:#000!important}.shadow-articles{box-shadow:0 0 0 1px #0000004d,0 2px 3px #0003;box-shadow:0 0 0 1px #00000040,0 2px 3px #0003}.text-center{text-align:center}.d-flex{display:flex}.flex-header{display:flex;justify-content:space-between;align-items:center}.scoreboard{margin-top:1rem;max-width:300px;width:100%;margin-bottom:1rem}@media(min-width:992px){.scoreboard{margin-top:0rem;margin-bottom:0rem;display:block;position:absolute;left:1rem;top:50%;transform:translateY(-50%)}}.articles-game-scoreboard{border:1px solid rgb(206,212,218);border-radius:8px;box-shadow:#00000012 0 2px 8px;color:#222;width:100%;max-width:350px;margin:0px 1rem;overflow:hidden;display:flex;flex-direction:column;z-index:1;position:fixed;bottom:50%;transform:translateY(50%);left:8px}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ReturnToLauncherButton.cjs"),r=require("./ArticlesAd.cjs"),o=require("./Ad.cjs"),t=require("./GameScoreboard.cjs"),s=require("./GlobalHead.cjs"),u=require("./GlobalBody-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ReturnToLauncherButton.cjs"),r=require("./ArticlesAd.cjs"),o=require("./Ad.cjs"),t=require("./GameScoreboard.cjs"),s=require("./GlobalHead.cjs"),u=require("./GlobalBody-BQ2qC81K.cjs"),a=require("./ViewUserModal.cjs"),l=require("./useUserDetails.cjs"),n=require("./useUserToken.cjs");exports.ReturnToLauncherButton=e;exports.ArticlesAd=r;exports.Ad=o;exports.GameScoreboard=t;exports.GlobalHead=s;exports.GlobalBody=u.GlobalBody_default;exports.ViewUserModal=a;exports.useUserDetails=l;exports.useUserToken=n;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { default as t } from "./ArticlesAd.js";
|
|
|
3
3
|
import { default as s } from "./Ad.js";
|
|
4
4
|
import { default as d } from "./GameScoreboard.js";
|
|
5
5
|
import { default as m } from "./GlobalHead.js";
|
|
6
|
-
import { G as x } from "./GlobalBody-
|
|
6
|
+
import { G as x } from "./GlobalBody-tmIC_GWn.js";
|
|
7
7
|
import { default as G } from "./ViewUserModal.js";
|
|
8
8
|
import { default as c } from "./useUserDetails.js";
|
|
9
9
|
import { default as A } from "./useUserToken.js";
|
package/dist/useUserToken.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./index-Ddv_TnxK.cjs"),
|
|
1
|
+
"use strict";const s=require("./index-Ddv_TnxK.cjs"),a=e=>s.axios.get(e).then(t=>t.data),c=e=>{const{data:t,error:o,isLoading:n,mutate:r}=s.useSWR(process.env.NODE_ENV==="development"?`http://localhost:${e}/api/token`:"/api/token",a,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:o,isLoading:n,mutate:r}};module.exports=c;
|
package/dist/useUserToken.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { u as r, a as n } from "./index-DLYx67wi.js";
|
|
2
|
-
const
|
|
3
|
-
const { data: t, error: a, isLoading:
|
|
2
|
+
const l = (e) => n.get(e).then((t) => t.data), d = (e) => {
|
|
3
|
+
const { data: t, error: a, isLoading: o, mutate: s } = r(
|
|
4
4
|
// "http://localhost:3012/api/auth/session",
|
|
5
|
-
process.env.NODE_ENV === "development" ? `http://localhost:${e}/api/token` : "
|
|
6
|
-
|
|
5
|
+
process.env.NODE_ENV === "development" ? `http://localhost:${e}/api/token` : "/api/token",
|
|
6
|
+
l,
|
|
7
7
|
{
|
|
8
8
|
revalidateOnFocus: !1,
|
|
9
9
|
revalidateOnReconnect: !1,
|
|
@@ -13,10 +13,10 @@ const c = (e) => n.get(e).then((t) => t.data), i = (e) => {
|
|
|
13
13
|
return {
|
|
14
14
|
data: t,
|
|
15
15
|
error: a,
|
|
16
|
-
isLoading:
|
|
17
|
-
mutate:
|
|
16
|
+
isLoading: o,
|
|
17
|
+
mutate: s
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
d as default
|
|
22
22
|
};
|
package/package.json
CHANGED