1(this["webpackJsonpclo-web"]=this["webpackJsonpclo-web"]||[]).push([[0],{281:function(e){e.exports=JSON.parse('{"name":"clo-web","version":"2.0.1","private":true,"dependencies":{"@fortawesome/fontawesome-svg-core":"^1.2.35","@fortawesome/free-solid-svg-icons":"^5.15.3","@fortawesome/react-fontawesome":"^0.1.14","@sentry/react":"^6.2.5","@sentry/tracing":"^6.2.5","@testing-library/jest-dom":"^5.11.10","@testing-library/react":"^11.2.6","@testing-library/user-event":"^12.8.3","gamekitjs":"^1.0.1","jquery":"^3.6.0","react":"^17.0.2","react-device-detect":"^1.17.0","react-dom":"^17.0.2","react-native-responsive-screen":"^1.4.2","react-native-web":"^0.15.5","react-router-dom":"^5.2.0","react-scripts":"^4.0.3","sweetalert2":"^10.16.0","sweetalert2-react-content":"^3.3.1","web-vitals":"^1.1.1"},"devDependencies":{"@babel/plugin-proposal-class-properties":"^7.13.0","@babel/preset-env":"^7.13.15","@babel/preset-react":"^7.13.13","@babel/preset-typescript":"^7.12.1","babel-loader":"^8.1.0"},"scripts":{"start":"react-scripts start","build":"react-scripts build","test":"react-scripts test","eject":"react-scripts eject"},"engines":{"node":"14.x","npm":"6.x"},"eslintConfig":{"extends":["react-app","react-app/jest"]},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}')},292:function(e,t,n){},316:function(e,t){},318:function(e,t){},331:function(e,t){},333:function(e,t){},364:function(e,t){},366:function(e,t){},394:function(e,t){},396:function(e,t){},397:function(e,t){},402:function(e,t){},404:function(e,t){},423:function(e,t){},435:function(e,t){},438:function(e,t){},479:function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),i=n(97),o=n.n(i),c=(n(292),n(11)),s=n(13),l=n(284),d=n(277),u=n(490),f=n(485),h=n(12),b=n(103),g=n(69),j=n.n(g),m=n(28),p=n.n(m),x=n(46),y=n(285),O=n(261),w=n.n(O),v=n.p+"static/media/clo_logo_long.7de9fe52.png",k=n.p+"static/media/clo_logo_long_white.21be440e.png",C=n(1);function S(e){var t=e.text,n=e.type,r=e.scale,a=void 0===r?1:r,i=e.margin,o=void 0===i?10:i,c=e.borderColor,u=void 0===c?"#000":c,f="black"===n?"#000":"#fff",h="black"===n?"#fff":"#000",b=200*a,g=.75*b,j="black"===n?12*a:14*a,m=20*a,p="black"===n?k:v,x=18*a,y=110*a,O="#000"!==u?4:2;return Object(C.jsxs)(s.a,{style:[P.container,{backgroundColor:f,borderColor:u,borderWidth:O,height:b,width:g,marginHorizontal:o}],children:[Object(C.jsx)(d.a,{style:[P.text,{fontSize:j,color:h,lineHeight:m}],children:t}),Object(C.jsx)(l.a,{source:p,style:[P.logo,{height:x,width:y}]})]})}function T(e){var t=e.text,n=e.type,r=e.onPress,a=e.scale,i=e.disabled;return Object(C.jsx)(u.a,{onPress:function(){return r(t)},disabled:i,style:{opacity:i&&.6},children:Object(C.jsx)(S,{text:t,type:n,scale:a,borderColor:"#000"})})}function I(e){var t=e.children,n=e.scale,r=void 0===n?1:n,a=e.margin,i=void 0===a?10:a,o=200*r,c=.75*o;return Object(C.jsx)(s.a,{style:[P.container,{alignItems:"center",justifyContent:"center",height:o,width:c,marginHorizontal:i}],children:t})}var P=h.a.create({container:{display:"flex",padding:12.5,margin:15,height:200,width:150,backgroundColor:"#fff",borderColor:"#000",shadowOffset:{width:3,height:3},shadowColor:"grey",shadowRadius:5,borderWidth:2,borderRadius:20,justifyContent:"space-between"},text:{color:"#000",fontWeight:"600",lineHeight:20},logo:{resizeMode:"contain",height:16,width:95}}),z=n(17),D=n(27),W=z.isMobile?50:70;function V(e){var t=e.logoPressable,n=void 0===t||t,r=Object(D.g)();return Object(C.jsx)(s.a,{style:E.container,children:Object(C.jsx)(u.a,{onPress:function(){return r.push("/")},disabled:!n,children:Object(C.jsx)(l.a,{source:k,style:E.logo})})})}var E=h.a.create({container:{position:"fixed",top:0,left:0,right:0,flexDirection:"row",padding:5,backgroundColor:"#000",justifyContent:"center",alignItems:"center",height:W,zIndex:99},logo:{resizeMode:"contain",justifyContent:"center",height:W-15,width:270,margin:20}}),L=z.isMobile?50:70;function H(e){var t=e.children,n=e.logoPressable;return Object(C.jsxs)(s.a,{style:A.container,children:[Object(C.jsx)(V,{logoPressable:n}),Object(C.jsx)(s.a,{style:A.content,children:t})]})}var A=h.a.create({container:{flex:1,backgroundColor:"#fff"},content:{flex:1,marginTop:L}});function B(e){var t=e.cards,n=e.onCardPress,r=e.selectedCards,a=e.disabled;return Object(C.jsx)(s.a,{style:R.container,children:t.map((function(e,t){var i=r&&r.find((function(t){return t.text===e.text}));return Object(C.jsx)(T,{text:e.text,type:"white",onPress:n,scale:z.isMobile?.8:.95,disabled:a||i},"playercard-".concat(t))}))})}var R=h.a.create({container:{position:"fixed",bottom:0,left:0,right:0,flexDirection:"row",padding:5,overflow:"scroll",borderColor:"#000",borderTopWidth:2,backgroundColor:"#fff"}}),M=n(489),N=n(57),F=n(58);function G(e){var t=e.backgroundColor,n=e.checked,r=e.size,i=e.onPress,o=e.isRadio,s=a.a.useState(!1),l=Object(c.a)(s,2),d=l[0],f=l[1],h=a.a.useRef(new M.a.Value(0)).current,b=h.interpolate({inputRange:[0,1],outputRange:["rgba(0, 0, 0, 0)",t]});return a.a.useEffect((function(){f(n)}),[n]),a.a.useEffect((function(){M.a.spring(h,{toValue:d?1:0,speed:25,useNativeDriver:!1}).start()}),[d]),Object(C.jsx)(u.a,{delayPressIn:0,onPress:function(){o&&d||(f(!d),i(d))},children:Object(C.jsx)(M.a.View,{style:[J.container,{backgroundColor:b,height:r,width:r,borderRadius:r,borderColor:t}],children:d&&Object(C.jsx)(N.a,{icon:F.b,size:r/2,color:"#fff",style:{paddingTop:1,paddingLeft:1}})})})}function _(e){var t=e.title,n=e.value,r=e.checked,i=e.onPress,o=e.isRadio,s=a.a.useState(!1),l=Object(c.a)(s,2),f=l[0],h=l[1];function b(){o&&f||(h(!f),i(n))}return a.a.useEffect((function(){h(r)}),[r]),Object(C.jsxs)(u.a,{style:J.rowContainer,onPress:b,children:[Object(C.jsx)(G,{backgroundColor:"#000",size:25,checked:f,onPress:b,isRadio:o}),Object(C.jsx)(d.a,{style:J.rowText,children:t})]})}var J=h.a.create({container:{alignItems:"center",justifyContent:"center",borderWidth:1},rowContainer:{flexDirection:"row",marginVertical:5,alignItems:"center"},rowText:{fontSize:22,fontWeight:"500",marginVertical:5,marginHorizontal:15}}),Y=n(120),K=n.n(Y);function q(e){var t=e.textVisible,n=void 0===t||t,r=e.color,a=void 0===r?"#fff":r;return Object(C.jsxs)(s.a,{style:U.container,children:[Object(C.jsx)(N.a,{icon:F.d,size:20,color:a,spin:!0}),n&&Object(C.jsx)(d.a,{style:[U.text,{color:a}],children:"Loading"})]})}var U=h.a.create({container:{flexDirection:"row",alignItems:"center"},text:{fontSize:18,fontWeight:"600",color:"#fff",marginLeft:10}}),Z=w()(j.a);function Q(e){var t=e.socket,n=e.roomData;var r=n.code,i=a.a.useState("Joining room..."),o=Object(c.a)(i,2),l=o[0],f=o[1],h=a.a.useState(!1),b=Object(c.a)(h,2),g=b[0],j=b[1],m=a.a.useState(!1),O=Object(c.a)(m,2),w=O[0],v=O[1],k=a.a.useState("Default"),T=Object(c.a)(k,2),P=T[0],D=T[1],W=a.a.useState([]),V=Object(c.a)(W,2),E=V[0],L=V[1],A=a.a.useState([]),R=Object(c.a)(A,2),M=R[0],N=R[1],F=a.a.useState(n.host&&n.host.socketID===t.id),G=Object(c.a)(F,2),J=G[0],Y=G[1],U=a.a.useReducer((function(e,t){var n=Array.from(e),r=t.player;switch(t.type){case"add":return n.push(r),n;case"update":for(var a=0;a<n.length;a++)n[a].socketID===r.socketID&&(n[a]=r);return n;case"remove":var i=n.findIndex((function(e){return e.displayName===r.displayName}));return i>-1&&n.splice(i,1),n;default:throw new Error}}),n.players||[]),Q=Object(c.a)(U,2),re=Q[0],ae=Q[1],ie=a.a.useState(n.isInProgress),oe=Object(c.a)(ie,2),ce=oe[0],se=oe[1],le=a.a.useState(n.isSelectionStageActive),de=Object(c.a)(le,2),ue=de[0],fe=de[1],he=a.a.useState(n.currentBlackCard&&n.currentBlackCard.text),be=Object(c.a)(he,2),ge=be[0],je=be[1],me=a.a.useState(n.cardCzar),pe=Object(c.a)(me,2),xe=pe[0],ye=pe[1],Oe=a.a.useState([]),we=Object(c.a)(Oe,2),ve=we[0],ke=we[1],Ce=a.a.useState([]),Se=Object(c.a)(Ce,2),Te=Se[0],Ie=Se[1],Pe=a.a.useState([]),ze=Object(c.a)(Pe,2),De=ze[0],We=ze[1],Ve=a.a.useState(n.roundWinner),Ee=Object(c.a)(Ve,2),Le=Ee[0],He=Ee[1],Ae=a.a.useState(n.gameWinner),Be=Object(c.a)(Ae,2),Re=Be[0],Me=Be[1],Ne=a.a.useState(!1),Fe=Object(c.a)(Ne,2),Ge=(Fe[0],Fe[1],a.a.useState(!1)),_e=Object(c.a)(Ge,2),Je=_e[0],Ye=_e[1],Ke=a.a.useState(!1),qe=Object(c.a)(Ke,2),Ue=qe[0],Ze=qe[1];function Qe(e){Ye(!1),Z.fire("Error",e,"error")}function Xe(e){return $e.apply(this,arguments)}function $e(){return($e=Object(x.a)(p.a.mark((function e(n){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){t.emit("get players",r,(function(t){t.find((function(e){return e.displayName===n}))&&a("Player already exists with that nickname. Choose another one."),e()}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function et(){return(et=Object(x.a)(p.a.mark((function e(){var n,a;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z.fire({title:"Hi there!",input:"text",text:"Type in a
1nickname to get started!",allowOutsideClick:!1,allowEscapeKey:!1,confirmButtonText:"Let's Go!",showLoaderOnConfirm:!0,inputValidator:function(){var e=Object(x.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",Promise.resolve("You must write something!"));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),preConfirm:function(){var e=Object(x.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Xe(t).catch((function(e){Z.showValidationMessage(e)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 2:(n=e.sent).isConfirmed&&(a=n.value,t.emit("add player",r,a,nt),j(!0),tt());case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tt(){Z.fire({titleText:"Room ".concat(r),icon:"info",html:Object(C.jsx)($,{url:"https://cardslackingoriginality.com/join/".concat(r)}),customClass:{content:"modalContent"},confirmButtonText:"Got it!"})}function nt(e,t){ae({type:"add",player:e}),at(t)}function rt(e,t){ae({type:"remove",player:e}),at(t)}function at(e){var n=e.players.find((function(e){return e.socketID===t.id}));je(e.currentBlackCard&&e.currentBlackCard.text),ke(n.cards),ye(e.cardCzar),D(e.gameType||"Default"),fe(e.isSelectionStageActive),He(e.roundWinner),Me(e.gameWinner),We(e.submissions),Y(e.host&&n.socketID===e.host.socketID)}function it(){Ye(!0),t.emit("start new round",r)}function ot(){se(!1)}function ct(){return(ct=Object(x.a)(p.a.mark((function e(n){var a,i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Nothing But Blanks"!==P){e.next=7;break}return e.next=3,Z.fire({title:"Blank Card",input:"text",text:"Enter your unfunny joke here:",allowOutsideClick:!1,allowEscapeKey:!1,confirmButtonText:"Submit",showLoaderOnConfirm:!0,inputValidator:function(){var e=Object(x.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",Promise.resolve("You must write something!"));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 3:(i=e.sent).isConfirmed&&(a={text:i.value}),e.next=8;break;case 7:a=ve.find((function(e){return e.text===n}));case 8:t.emit("make submission",r,a,(function(e){Ie(e)}));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function st(e){t.emit("pick winning submission",r,e)}function lt(){return dt.apply(this,arguments)}function dt(){return(dt=Object(x.a)(p.a.mark((function e(){var t,n;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Ze(!0),e.next=4,K.a.ajax({type:"GET",url:"".concat("https://clo-server-gzoer.ondigitalocean.app","/api/packs/get")});case 4:if((t=e.sent).success){e.next=7;break}throw Error(t.message);case 7:return n=t.packs,Ze(!1),e.abrupt("return",Promise.resolve(n));case 12:return e.prev=12,e.t0=e.catch(0),Ze(!1),e.abrupt("return",Promise.reject(e.t0.message));case 16:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}function ut(e){var t=Array.from(M),n=t.findIndex((function(t){return t===e}));-1===n?t.push(e):t.splice(n,1),N(t)}function ft(e){var n=e.player,r=e.cards,a=e.onPress,i={player:n,cards:r},o=re.find((function(e){return e.socketID===n.socketID})),c=xe.socketID!==t.id,l=Le&&Le.socketID===o.socketID,f=r.map((function(e,t){return Object(C.jsx)(s.a,{style:te.cardContainer,children:Object(C.jsx)(S,{text:e.text,type:"white",scale:z.isMobile?.9:.95,borderColor:l?"#00FF00":"#000"},"card-".concat(t))})}));return Object(C.jsxs)(u.a,{style:{alignItems:"center",opacity:c&&.6},onPress:function(){return a(i)},disabled:c||Le,children:[Object(C.jsx)(s.a,{style:te.cardsContainer,children:f}),(Le||Re)&&Object(C.jsx)(d.a,{style:te.displayNameText,children:"".concat(o.displayName,": ").concat(o.points," points")})]})}function ht(){var e=De.map((function(e,t){return Object(C.jsx)(ft,{player:e.player,cards:e.cards,onPress:st},"submission-".concat(t))})),n=xe.socketID===t.id;return Object(C.jsxs)(s.a,{style:te.container,children:[Object(C.jsx)(S,{text:ge,type:"black",scale:z.isMobile?1.15:1.8,margin:0}),Object(C.jsx)(s.a,{style:te.content,children:e}),Le&&n&&Object(C.jsx)(X,{title:"Next Round",onPress:it}),Re&&J&&Object(C.jsx)(X,{title:"New Game",onPress:ot})]})}return a.a.useEffect((function(){return document.title="Room ".concat(r," | Cards Lacking Originality"),window.history.replaceState(null,document.title,"/join/".concat(r)),t.on("game started",(function(){return se(!0)})),t.on("round started",(function(e){Z.close(),Ie([]),at(e)})),t.on("player added",nt),t.on("player left",rt),t.on("player made submission",We),t.on("selection stage started",(function(e){fe(!0),We(e)})),t.on("round ended",(function(e){He(e),ae({type:"update",player:e}),f("".concat(e.displayName," has won the round!"))})),t.on("game ended",(function(e){Me(e),ae({type:"update",player:e}),f("".concat(e.displayName," has won the game!"))})),t.on("error",Qe),function(){t.removeAllListeners()}}),[]),a.a.useEffect((function(){if(!g)return function(){return et.apply(this,arguments)}();ce||f("Waiting for host to start the game...")}),[g,ce]),a.a.useEffect((function(){if(xe){var e=xe.socketID===t.id;
1f(e?"You are the Card Czar.":"".concat(xe.displayName," is the Card Czar."))}}),[xe]),a.a.useEffect((function(){t.emit("change room privacy",r,w)}),[w]),a.a.useEffect((function(){function e(){return(e=Object(x.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,lt();case 2:t=e.sent,L(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}0===E.length&&J&&function(){e.apply(this,arguments)}()}),[E,J]),Object(C.jsx)(H,{logoPressable:!1,children:Object(C.jsxs)(s.a,{style:ee.content,children:[Object(C.jsx)(d.a,{style:ee.statusText,children:l}),ce?Object(C.jsx)(s.a,{style:ee.gameContainer,children:ue?Object(C.jsx)(ht,{}):Object(C.jsxs)(C.Fragment,{children:[Object(C.jsxs)(s.a,{style:ee.gameContent,children:[Object(C.jsx)(S,{text:ge,type:"black",scale:z.isMobile?1.15:1.8,margin:0}),Object(C.jsx)(s.a,{style:ee.submissionsContainer,children:Object(C.jsxs)(I,{scale:z.isMobile?.8:.95,margin:30,children:[Object(C.jsx)(d.a,{style:te.counterText,children:"".concat(De.length,"/").concat(re.length-1)}),Object(C.jsx)(d.a,{style:te.subtitleText,children:"Players submitted"})]})})]}),Object(C.jsx)(B,{cards:ve,onCardPress:function(e){return ct.apply(this,arguments)},selectedCards:Te.cards,disabled:xe&&xe.socketID===t.id})]})}):Object(C.jsxs)(s.a,{style:ne.container,children:[Object(C.jsxs)(s.a,{style:ne.column,children:[Object(C.jsx)(y.a,{style:ne.listContainer,contentContainerStyle:ne.listContent,data:re,keyExtractor:function(e){return e.socketID},renderItem:function(e){var t=e.item;return Object(C.jsx)(d.a,{style:ne.listItemText,children:t.displayName})},ListHeaderComponent:Object(C.jsx)(d.a,{style:ne.listHeaderText,children:"Players: (".concat(re.length,"/").concat(n.maxPlayers,")")})}),J&&Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)(X,{title:"Start Game",onPress:function(){Ye(!0),t.emit("start game",r,P,M)},loading:Je}),re.length<n.minPlayers&&Object(C.jsx)(d.a,{children:"Game must have ".concat(n.minPlayers," or more players before starting.")})]})]}),J&&Object(C.jsxs)(s.a,{style:[ne.column,{flexGrow:3}],children:[Object(C.jsxs)(s.a,{style:{marginBottom:20},children:[Object(C.jsx)(d.a,{style:ne.listHeaderText,children:"Game Settings:"}),Object(C.jsx)(_,{title:"Public",checked:w,onPress:function(){return v(!w)}})]}),Object(C.jsxs)(s.a,{style:{marginBottom:20},children:[Object(C.jsx)(d.a,{style:ne.listHeaderText,children:"Game Mode:"}),Object(C.jsx)(_,{title:"Default",value:"Default",checked:"Default"===P,onPress:D,isRadio:!0}),Object(C.jsx)(_,{title:"Nothing But Blanks",value:"Nothing But Blanks",checked:"Nothing But Blanks"===P,onPress:D,isRadio:!0})]}),Object(C.jsxs)(s.a,{style:{marginBottom:20},children:[Object(C.jsx)(d.a,{style:ne.listHeaderText,children:"Card Packs:"}),Object(C.jsx)(y.a,{data:E,renderItem:function(e){var t=e.item;return Object(C.jsx)(_,{title:"".concat(t.name," (").concat(t.blackCardsCount,"B/").concat(t.whiteCardsCount,"W)"),value:t.id,checked:M.includes(t.id),onPress:ut})},ListHeaderComponent:Ue&&Object(C.jsx)(q,{color:"#000"})})]})]})]})]})})}function X(e){var t=e.title,n=e.onPress,r=e.loading,a=e.disabled;return Object(C.jsx)(u.a,{style:ee.button,onPress:n,disabled:a,children:r?Object(C.jsx)(q,{}):Object(C.jsx)(d.a,{style:ee.buttonText,children:t})})}function $(e){var t=e.url;return Object(C.jsxs)(s.a,{children:[Object(C.jsxs)(s.a,{style:re.container,children:[Object(C.jsx)(f.a,{style:re.inputField,value:t,editable:!1,selectTextOnFocus:!0}),Object(C.jsx)(u.a,{style:re.button,onPress:function(){return navigator.clipboard.writeText(t)},children:Object(C.jsx)(N.a,{icon:F.c,size:20,color:"#fff"})})]}),Object(C.jsx)(d.a,{style:re.subtitleText,children:"Share this link or code to play with your friends!"})]})}var ee=h.a.create({container:{flex:1},content:{flex:1,padding:20,paddingHorizontal:z.isMobile?20:30},gameContainer:{flex:1},gameContent:{flex:1,flexDirection:"row"},statusText:{fontSize:z.isMobile?26:28,fontWeight:"700",marginVertical:10},button:{flexDirection:"row",width:200,backgroundColor:"#000",alignItems:"center",justifyContent:"center",paddingVertical:15,paddingHorizontal:25,marginVertical:20},buttonText:{fontSize:18,fontWeight:"600",color:"#fff",marginLeft:10}}),te=h.a.create({container:{flex:1,alignItems:"center"},content:{alignItems:"center",flexDirection:"row",flexWrap:"wrap",marginHorizontal:20},counterText:{fontSize:26,fontWeight:"700",marginVertical:5,textAlign:"center"},subtitleText:{fontSize:18,fontWeight:"500",marginVertical:5,textAlign:"center"},cardsContainer:{flexDirection:"row",alignItems:"center"},cardContainer:{},displayNameText:{fontSize:18,fontWeight:"600",textAlign:"center"}}),ne=h.a.create({container:{flex:1,flexDirection:"row",flexWrap:"wrap"},column:{flex:2,minWidth:350,marginVertical:10,alignItems:"flex-start"},listContainer:{flexGrow:0,marginVertical:15},listContent:{},listHeaderText:{fontSize:26,fontWeight:"700",marginVertical:10},listItemText:{fontSize:22,fontWeight:"500",marginVertical:5},checkbox:{width:40,height:40}}),re=h.a.create({container:{flexDirection:"row",alignSelf:"center",alignItems:"stretch",marginVertical:15},inputField:{width:z.isMobile?300:350,padding:12,fontSize:16,borderColor:"#2778c4",borderWidth:2.5,fontWeight:"700",color:"#61acf3"},button:{backgroundColor:"#2778c4",width:50,alignItems:"center",justifyContent:"center"},subtitleText:{color:"#595959",fontSize:18,fontWeight:"500",marginVertical:5,textAlign:"center"}}),ae=n.p+"static/media/clo_logo.5464aa95.png",ie=n(281);function oe(e){var t=e.socket,n=Object(D.h)(),r=Object(D.g)(),i=a.a.useState(!0),o=Object(c.a)(i,2),f=o[0],h=o[1],b=a.a.useState(!1),g=Object(c.a)(b,2),m=g[0],p=g[1],x=a.a.useState(n.roomCode||""),y=Object(c.a)(x,2),O=y[0],w=y[1],v=a.a.useState(null),k=Object(c.a)(v,2),S=k[0],T=k[1];function I(e){return f?(p(!0),e?void t.emit("join room",e):P("Please enter a room code.")):P("C
1ould not connect to server. Try again later.")}function P(e){p(!1),j.a.fire("Error",e,"error")}return a.a.useEffect((function(){return document.title="Cards Lacking Originality",n.roomCode&&I(n.roomCode),t.on("join room",(function(e){return T(e)})),t.on("connect_error",(function(){return h(!1)})),t.on("server disconnected",(function(e){T(null),P(e.message)})),t.on("error",P),function(){t.removeAllListeners()}}),[]),a.a.useEffect((function(){!f&&S&&(T(null),P("Connection to server was lost."))}),[f,S]),S?Object(C.jsx)(Q,{socket:t,roomData:S}):Object(C.jsxs)(s.a,{style:le.container,children:[Object(C.jsxs)(s.a,{style:le.content,children:[Object(C.jsx)(l.a,{source:ae,style:le.logo}),Object(C.jsx)(se,{value:O,onChangeText:w,onSubmitEditing:function(){return I(O)},loading:m}),Object(C.jsx)(d.a,{style:le.headingText,children:"OR"}),Object(C.jsx)(ce,{title:"Host New Game",onPress:function(){if(!f)return P("Could not connect to server. Try again later.");p(!0),t.emit("create room",(function(e){T(e)}))},loading:m}),Object(C.jsx)(ce,{title:"Find A Game",onPress:function(){r.push("/rooms/find")}})]}),Object(C.jsxs)(s.a,{style:le.footer,children:[Object(C.jsx)(d.a,{style:le.footerText,children:"Version ".concat(ie.version)}),!z.isMobile&&Object(C.jsx)("a",{href:"https://www.producthunt.com/posts/cards-lacking-originality?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-cards-lacking-originality",target:"_blank",children:Object(C.jsx)("img",{src:"https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=178757&theme=light",alt:"Cards Lacking Originality - A simple and elegant online Cards Against Humanity clone | Product Hunt Embed",style:{width:"200px",height:"43.2px"}})}),Object(C.jsx)(u.a,{onPress:function(){j.a.fire({title:"Credit Attribution",icon:"info",html:"All credit for card content is attributed to <a href='https://cardsagainsthumanity.com/' style='color: #545454' target='_blank'>Cards Against Humanity LLC</a> and is licensed under <a href='https://creativecommons.org/licenses/by-nc-sa/4.0/' style='color: #545454' target='_blank'>CC BY-NC-SA 4.0</a>."})},children:Object(C.jsx)(d.a,{style:le.footerText,children:"Legal Stuff"})})]})]})}function ce(e){var t=e.title,n=e.onPress,r=e.loading;return Object(C.jsx)(u.a,{style:le.button,onPress:n,children:r?Object(C.jsx)(q,{}):Object(C.jsx)(d.a,{style:le.buttonText,children:t})})}function se(e){var t=e.value,n=e.onChangeText,r=e.onSubmitEditing,i=e.loading,o=a.a.useState(t),l=Object(c.a)(o,2),d=l[0],h=l[1];return a.a.useEffect((function(){n(d)}),[d,n]),Object(C.jsxs)(s.a,{style:de.container,children:[Object(C.jsx)(f.a,{style:de.inputField,placeholder:"Enter Room Code",value:d,onChangeText:function(e){return e.length<=4&&h(e.toUpperCase())},onSubmitEditing:r}),Object(C.jsx)(u.a,{style:de.button,onPress:r,children:i?Object(C.jsx)(N.a,{icon:F.d,fontSize:20,color:"#fff",spin:!0}):Object(C.jsx)(N.a,{icon:F.a,size:20,color:"#fff"})})]})}var le=h.a.create({container:{flex:1,alignItems:"center",maxHeight:b.a.get("window").height},content:{flex:1,alignItems:"center",paddingVertical:z.isMobile?0:20},logo:{resizeMode:"contain",justifyContent:"center",height:z.isMobile?175:250,width:z.isMobile?315:450,margin:20},headingText:{fontSize:30,fontWeight:"700",marginVertical:z.isMobile?10:25},subtitleText:{fontSize:18,fontWeight:"600",color:"#808080",marginVertical:10,textDecorationLine:"underline"},footer:{position:"fixed",bottom:0,left:0,right:0,flexDirection:"row",padding:30,alignSelf:"stretch",alignItems:"flex-end",justifyContent:"space-between"},footerText:{fontSize:16,fontWeight:"600",color:"#919191"},button:{flexDirection:"row",width:270,backgroundColor:"#000",alignItems:"center",justifyContent:"center",paddingVertical:15,paddingHorizontal:25,marginVertical:20},buttonText:{fontSize:18,fontWeight:"700",color:"#fff",marginLeft:10}}),de=h.a.create({container:{flexDirection:"row",alignItems:"stretch",marginVertical:15},inputField:{padding:12,width:220,fontSize:16,borderColor:"#000",borderWidth:2.5,fontWeight:"700"},button:{backgroundColor:"#000",width:50,alignItems:"center",justifyContent:"center"}}),ue=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,492)).then((function(t){var n=t.getCLS,r=t.getFID,a=t.getFCP,i=t.getLCP,o=t.getTTFB;n(e),r(e),a(e),i(e),o(e)}))},fe=n(115),he=n(96);function be(e){e.socket;return Object(C.jsx)(H,{children:Object(C.jsxs)(s.a,{style:ge.content,children:[Object(C.jsx)(d.a,{style:ge.headingText,children:"To Our Users"}
1),Object(C.jsx)(d.a,{style:ge.bodyText,children:"Hi there.\n\nYou might have noticed that this website looks a little different from normal, and that some features that used to be fan-favorites like community card packs have seemingly gone away. Rest assured, all of your accounts and card packs are fully intact and will be available for use in the coming months.\n\nA year and a half ago when I first developed this website, I had no experience whatsoever programming websites with React, and I used this project as a way to get acquainted with the language. As this website blew up in popularity during the COVID-19 pandemic, I revisited the code many times and tried to make improvements to keep the game fresh and optimize performance.\n\nThe biggest challenge I faced with this, as difficult as this is to admit, is that my code sucked. Like, it actually sucked balls. It was messy, unreadable, and barely utilized any of the features that React specifically developed to make web development easier. This unfortnuately prevented me from implementing a number of features that I had wanted from the very beginning.\n\nTherefore, I recently decided that the best course of action was to send the entire shitty codebase deep into the inferno of hell and start fresh. I rebuilt the entire Cards Lacking Originality website and backend server from the ground up, this time with an emphasis on efficiency and scaleability. The new and improved Cards Lacking Originality is infinitely more maintainable for me, as well as more stable and fun for you. I also redesigned the experience to be a fuck of a lot more mobile-friendly, since that is how many of our users (including myself) typically play. This new version of the game may be a little buggy at first so bear with me- I promise I'm working to address all issues as they appear.\n\nIn the coming weeks and months, I plan on rebuilding every component of the site this way, including the community marketplace, which to date has thousands of card packs and hundreds of thousands of cards. (I'm not kidding- you guys really did all that!)\n\nFor those of you who still continue to play this game, thank you. Your support is what keeps me going on this project- this site will continute to improve and maintain its place as the premier Cards game on the web."}),Object(C.jsx)(d.a,{style:ge.signiatureText,children:"- Zach S."})]})})}var ge=h.a.create({container:{alignItems:"center"},content:{alignSelf:"center",alignItems:"center",padding:30,width:z.isMobile?390:700},headingText:{fontSize:30,fontWeight:"700",textAlign:"center"},bodyText:{fontSize:17,textAlign:"center",lineHeight:30,marginVertical:30},signiatureText:{fontSize:40,fontWeight:"700",fontFamily:"Kaushan Script",textAlign:"center",marginBottom:15}}),je=n(488),me=n(283);function pe(e){var t=e.properties,n=e.onJoin,r=a.a.useState(!1),i=Object(c.a)(r,2),o=i[0],l=i[1];return Object(C.jsxs)(s.a,{style:ye.container,children:[Object(C.jsxs)(s.a,{style:ye.content,children:[Object(C.jsx)(d.a,{style:ye.headerText,children:"Room ".concat(t.code," (").concat(t.players.length,"/").concat(t.maxPlayers,")")}),Object(C.jsx)(d.a,{style:ye.subtitleText,children:"In Progress: ".concat(t.inProgress?"Yes":"No")})]}),Object(C.jsx)(xe,{title:"Join Room",loading:o,onPress:function(){l(!0),n(t.code)}})]})}function xe(e){var t=e.title,n=e.onPress,r=e.loading,a=e.disabled;return Object(C.jsx)(u.a,{style:ye.button,onPress:n,disabled:a,children:r?Object(C.jsx)(q,{}):Object(C.jsx)(d.a,{style:ye.buttonText,children:t})})}var ye=h.a.create({container:{padding:20,margin:15,marginVertical:z.isMobile&&15,marginLeft:5,width:z.isMobile?b.a.get("window").width-70:400,height:z.isMobile?.6*(b.a.get("window").width-70):240,shadowOffset:{width:2,height:2},shadowColor:"grey",shadowRadius:7},content:{flexGrow:1},headerText:{fontSize:25,fontWeight:"700"},subtitleText:{fontSize:16,fontWeight:"500",marginVertical:10},button:{flexDirection:"row",backgroundColor:"#000",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:25},buttonText:{fontSize:18,fontWeight:"600",color:"#fff",marginLeft:10}});function Oe(e){var t=e.socket,n=(Object(D.h)(),Object(D.g)()),r=a.a.useState(!0),i=Object(c.a)(r,2),o=i[0],l=i[1],u=a.a.useState(!0),f=Object(c.a)(u,2),h=f[0],b=f[1],g=a.a.useState([]),m=Object(c.a)(g,2),O=m[0],w=m[1];function v(e){return h?e?void t.emit("join room",e):S("Please enter a room code."):S("Could not connect to server. Try again later.")}function k(){return(k=Object(x.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,l(!0),e.next=4,K.a.aja
1x({type:"GET",url:"".concat("https://clo-server-gzoer.ondigitalocean.app","/api/rooms/get")});case 4:if((t=e.sent).success){e.next=7;break}throw Error(t.message||"Error connecting to server. Try again later.");case 7:l(!1),w(t.rooms),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(0),console.log(e.t0),l(!1),S(e.t0.message);case 16:case"end":return e.stop()}}),e,null,[[0,11]])})))).apply(this,arguments)}function S(e){l(!1),j.a.fire("Error",e,"error")}return a.a.useEffect((function(){return document.title="Find A Game | Cards Lacking Originality",t.on("join room",(function(e){return t=e.code,void n.push("/join/".concat(t));var t})),t.on("connect_error",(function(){return b(!1)})),t.on("error",S),function(){k.apply(this,arguments)}(),function(){t.removeAllListeners()}}),[]),Object(C.jsx)(H,{logoPressable:!0,children:Object(C.jsxs)(s.a,{style:we.container,children:[Object(C.jsx)(d.a,{style:we.headingText,children:"Find A Game"}),Object(C.jsx)(d.a,{style:we.subtitleText,children:"Discover currently joinable rooms in Cards Lacking Originality."}),Object(C.jsxs)(s.a,{style:we.content,children:[o&&Object(C.jsx)(q,{textVisible:!0,color:"#000"}),!o&&0===O.length&&Object(C.jsx)(d.a,{style:we.subtitleText,children:"No joinable rooms. Check back later!"}),Object(C.jsx)(y.a,{contentContainerStyle:we.listContent,data:O,renderItem:function(e){var t=e.item;return Object(C.jsx)(pe,{properties:t,onJoin:v})}})]})]})})}var we=h.a.create({container:{padding:30},content:{marginVertical:20},headingText:{fontSize:30,fontWeight:"700"},subtitleText:{fontSize:18,fontWeight:"500",marginVertical:10},listContent:{flexDirection:"row",flexWrap:"wrap"},button:{flexDirection:"row",width:270,backgroundColor:"#000",alignItems:"center",justifyContent:"center",paddingVertical:15,paddingHorizontal:25,marginVertical:20},buttonText:{fontSize:18,fontWeight:"700",color:"#fff",marginLeft:10}});je.a({dsn:"https://[email protected]/5722232",integrations:[new me.a.BrowserTracing],tracesSampleRate:.5});var ve=new fe.Client("https://clo-server-gzoer.ondigitalocean.app").socket;je.a({dsn:"https://[email protected]/0"});var ke=Object(C.jsx)(he.a,{children:Object(C.jsxs)(D.d,{children:[Object(C.jsx)(D.b,{exact:!0,path:"/join",children:Object(C.jsx)(D.a,{to:"/"})}),Object(C.jsx)(D.b,{exact:!0,path:"/join/:roomCode",render:function(e){var t=e.roomCode;return Object(C.jsx)(oe,{socket:ve,defaultRoomCode:t})}}),Object(C.jsx)(D.b,{exact:!0,path:"/to-our-users",children:Object(C.jsx)(be,{})}),Object(C.jsx)(D.b,{exact:!0,path:"/rooms/find",children:Object(C.jsx)(Oe,{socket:ve})}),Object(C.jsx)(D.b,{exact:!0,path:"/",children:Object(C.jsx)(oe,{socket:ve})}),Object(C.jsx)(D.b,{path:"/",children:Object(C.jsx)(D.a,{to:"/"})})]})});o.a.render(ke,document.getElementById("root")),ue()}},[[479,1,2]]]); 2//# sourceMappingURL=main.5424c412.chunk.js.map
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.