"use strict";(this.wpJsonpReactJs=this.wpJsonpReactJs||[]).push([[179],{"4u3d":(e,t,s)=>{var a=s("mXGw"),n=s.t(a,2),r=s("xARA"),i=s("re7x"),o=(s("xljp"),s("gNPN"),s("6Ydh")),c=s("29xR"),l=s("MM43"),u=s("8mQb"),d=s("bmIf"),h=(s("odoe"),s("Wsj4"),s("KXM2"),s("tAo+"),s("Xi5j"),s("Rmq7"),s("oYCi")),g=s("EFMV"),m=s.n(g),p=s("qIEf");function j(e,t,s){return t=(0,u.A)(t),(0,l.A)(e,f()?Reflect.construct(t,s||[],(0,u.A)(e).constructor):t.apply(e,s))}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var x=!1,v=function(e){function t(e){var s;return(0,o.A)(this,t),(s=j(this,t,[e])).state={QuizUrlId:e.QuizUrlId,DataCollections:e.InitialDataCollections,AdvertisementPageLink:e.InitialAdvertisementPageLink},s}return(0,d.A)(t,e),(0,c.A)(t,[{key:"DoSomething",value:function(){if(!0!==e){var e=!0,t=!0,s=null,a=p("div#collected_data_more_button");void 0!==this.state.DataCollections&&null!=this.state.DataCollections&&void 0!==this.state.DataCollections.slice(-1)[0]&&(s=this.state.DataCollections.slice(-1)[0].QuizAdvertDataCollectionId),p.ajax({url:"/Api/QuizAdvertCollectedData",data:{QuizUrlId:this.state.QuizUrlId,LastDataCollectionId:s},beforeSend:function(){a.find("div:first").html('Loading... ')},success:function(e){void 0!==e&&null!=e&&0!==e.length||(t=!1);var s=m()(this.state,{DataCollections:{$push:e}});this.setState(s)}.bind(this),error:function(){alert("Sorry there was an error loading the collected data. Please refresh and try again.")},complete:function(){e=!1;var s=!0===t?"Load more...":"No more collected data to load";a.find("div:first").html(s)}})}}},{key:"render",value:function(){var e=(0,h.jsxs)("div",Object.assign({className:"collected_data_no_data_yet"},{children:["There is no collected data to display yet. You will need to create a ",(0,h.jsx)("a",Object.assign({href:this.state.AdvertisementPageLink},{children:"quiz advertisement"}))," to collect email addresses."]}));return(x||void 0!==this.state.DataCollections&&null!=this.state.DataCollections&&0!==this.state.DataCollections.length)&&(x=!0,e=(0,h.jsx)(b,{DataCollections:this.state.DataCollections,QuizUrlId:this.state.QuizUrlId})),(0,h.jsxs)("div",{children:[e,(0,h.jsxs)("div",Object.assign({id:"collected_data_more_button"},{children:[(0,h.jsx)("a",Object.assign({onClick:this.DoSomething.bind(this)},{children:(0,h.jsx)("span",{})})),(0,h.jsx)("div",{children:"Load More..."})]}))]})}}]),t}(a.Component),b=function(e){function t(){return(0,o.A)(this,t),j(this,t,arguments)}return(0,d.A)(t,e),(0,c.A)(t,[{key:"render",value:function(){var e=this,t=this.props.DataCollections.map((function(t){var s=null!=t.TakerSessionId?t.TakerSessionId:t.TakerId;return(0,h.jsxs)("div",Object.assign({className:"row"},{children:[(0,h.jsxs)("div",Object.assign({className:"column"},{children:[(0,h.jsx)("div",Object.assign({className:"taker_name"},{children:t.TakerName})),(0,h.jsx)(_,{CollectedItems:t.CollectedData})]})),(0,h.jsx)("div",Object.assign({className:"column view_breakdown_button_column"},{children:(0,h.jsx)("a",Object.assign({href:"/QuizTakers/Watch/"+e.props.QuizUrlId+"/"+s,className:"view_breakdown_button"},{children:"Breakdown »"}))}))]}),t.QuizAdvertDataCollectionId)}));return(0,h.jsx)("div",Object.assign({className:"quiz_collected_data_table"},{children:t}))}}]),t}(a.Component),_=function(e){function t(){return(0,o.A)(this,t),j(this,t,arguments)}return(0,d.A)(t,e),(0,c.A)(t,[{key:"render",value:function(){var e;return e=this.props.CollectedItems.map((function(e){return(0,h.jsxs)("div",{children:[e.QuizAdvertFieldName,": ",e.CollectedValue]},e.QuizAdvertCollectedDataId)})),(0,h.jsx)("div",{children:e})}}]),t}(a.Component);const y=v;s("vGWr"),s("/ogT"),s("97W/"),s("aCo6"),s("0f7i"),s("0qvl");var z=function(e,t){var s=Object.getOwnPropertyDescriptor(e,"value").set,a=Object.getPrototypeOf(e),n=Object.getOwnPropertyDescriptor(a,"value").set;s&&s!==n?n.call(e,t):s.call(e,t)},T=s("zun1");function k(e,t){if(void 0!==e.responseText&&null!=e.responseText&&""!=e.responseText){var s=JSON.parse(e.responseText);if(void 0!==s.errors&&null!=(0,T.A)(s.errors)){var a="One or more validation errors occured:\r\n\r\n";for(var n in s.errors)for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:void 0,s=D();R(e,s)||(s.TakeLaterQuizzes.unshift({UrlId:e,DateAdded:Date.now()}),U(s),t&&t(s),gtag("event","added",{event_category:"take_later_list",event_label:e}))},B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,s=D();s.TakeLaterQuizzes=s.TakeLaterQuizzes.filter((function(t){return t.UrlId!=e})),U(s),t&&t(s),gtag("event","remove",{event_category:"take_later_list",event_label:e})},q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;if("undefined"==typeof window)return{TakeLaterQuizzes:[]};var s=localStorage.getItem(E);if(s){var a=JSON.parse(s);return a.TakeLaterQuizzes=a.TakeLaterQuizzes.sort((function(e,t){return t.DateAdded-e.DateAdded})).slice((e-1)*t,e*t),a}return{TakeLaterQuizzes:[]}},D=function(){if("undefined"==typeof window)return{TakeLaterQuizzes:[]};var e=localStorage.getItem(E);return e?JSON.parse(e):{TakeLaterQuizzes:[]}},H=function(){U({TakeLaterQuizzes:[]}),gtag("event","cleared",{event_category:"take_later_list"})},R=function(e,t){return t.TakeLaterQuizzes.some((function(t){return t.UrlId==e}))},U=function(e){localStorage.setItem(E,JSON.stringify(e))};function M(e,t,s){return t=(0,u.A)(t),(0,l.A)(e,V()?Reflect.construct(t,s||[],(0,u.A)(e).constructor):t.apply(e,s))}function V(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(V=function(){return!!e})()}const G=function(e){function t(e){var s;return(0,o.A)(this,t),(s=M(this,t,[e])).state={hasError:!1},s}return(0,d.A)(t,e),(0,c.A)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0})}},{key:"render",value:function(){return this.state.hasError?(0,h.jsx)("div",{children:(0,h.jsx)("p",{children:"There was an error"})}):this.props.children}}]),t}(a.Component),W=function(e){var t;return(0,h.jsx)("svg",Object.assign({className:e.className,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},{children:(0,h.jsx)("path",{fill:null!==(t=e.colour)&&void 0!==t?t:"#FFFFFF",d:"M313.6 304c-28.7 0-42.5 16-89.6 16-47.1 0-60.8-16-89.6-16C60.2 304 0 364.2 0 438.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-25.6c0-74.2-60.2-134.4-134.4-134.4zM400 464H48v-25.6c0-47.6 38.8-86.4 86.4-86.4 14.6 0 38.3 16 89.6 16 51.7 0 74.9-16 89.6-16 47.6 0 86.4 38.8 86.4 86.4V464zM224 288c79.5 0 144-64.5 144-144S303.5 0 224 0 80 64.5 80 144s64.5 144 144 144zm0-240c52.9 0 96 43.1 96 96s-43.1 96-96 96-96-43.1-96-96 43.1-96 96-96z"})}))},X=function(e){var t;return(0,h.jsx)("svg",Object.assign({className:e.className,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},{children:(0,h.jsx)("path",{fill:null!==(t=e.colour)&&void 0!==t?t:"#FFFFFF",d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"})}))};var J="https://img2.uquiz.com";const Z=function(e){var t,s=e.quiz,a=e.takeLaterList,n=e.addToTakeLaterList,r=e.removeFromTakeLaterList,i={backgroundColor:s.BackgroundColourHex},o=e.sideBarVariant,c=void 0!==o&&o,l={background:""},u="",d={},g={},m="#EBF5FB"===s.BackgroundColourHex;s.HasHalfAndHalfImage&&s.HalfAndHalfImageFileName?l=Object.assign(Object.assign({},l),{backgroundImage:"url('".concat(J).concat("/content/images/quiz_thumbnails/halfandhalf/").concat(s.UrlId,"/").concat(s.HalfAndHalfImageFileName,"')")}):s.HasBackgroundImage&&s.BackgroundImageFileName?l=Object.assign(Object.assign({},l),{backgroundImage:"url('".concat(J).concat("/content/images/quiz/").concat(s.BackgroundImageFileName,"')")}):u=m?"no_image_default_color":"no_image",c&&(d=Object.assign(Object.assign({},d),{backgroundColor:s.BackgroundColourHex}),g=Object.assign(Object.assign({},g),{color:s.TextColourHex}));var p=R(s.UrlId,a);return(0,h.jsx)(G,{children:(0,h.jsxs)("a",Object.assign({href:s.QuizLinkUrl,className:"quiz_item"},{children:[(0,h.jsxs)("div",Object.assign({className:"quiz_image ".concat(u),style:Object.assign(Object.assign({},l),i)},{children:[c&&(0,h.jsx)("span",{className:"overlay",style:d}),(0,h.jsxs)("div",Object.assign({className:"top"},{children:[0==p&&(0,h.jsx)("div",{children:(0,h.jsx)("button",Object.assign({className:"take_later",type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),n(s.UrlId)},suppressHydrationWarning:!0},{children:"Take later"}))}),p&&(0,h.jsx)("div",{children:(0,h.jsx)("button",Object.assign({className:"take_later",type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),r(s.UrlId)},suppressHydrationWarning:!0},{children:"Remove"}))})]})),(0,h.jsxs)("div",Object.assign({className:"bottom"},{children:[c&&(0,h.jsx)("div",Object.assign({className:"quiz_name",style:g},{children:s.QuizName})),(0,h.jsx)("div",Object.assign({className:"white"},{children:(0,h.jsxs)("div",Object.assign({className:"bottom_content"},{children:[(0,h.jsxs)("span",Object.assign({className:"taker_count"},{children:[(0,h.jsx)("i",{className:"far fa-arrow-alt-circle-up icon"})," ",(0,h.jsxs)("span",{children:[null!==(t=s.DisplayTakerCount)&&void 0!==t?t:s.TakerCount," Takers"]})]})),(0,h.jsxs)("span",Object.assign({className:"quiz_type"},{children:[s.QuizType==L.Personality&&(0,h.jsxs)("span",{children:[(0,h.jsx)(W,{className:"icon"}),(0,h.jsx)("span",Object.assign({className:"quiz_type_text"},{children:"Personality Quiz"}))]}),s.QuizType==L.Scored&&(0,h.jsxs)("span",{children:[(0,h.jsx)(X,{className:"icon"}),(0,h.jsx)("span",Object.assign({className:"quiz_type_text"},{children:"Scored Quiz"}))]})]}))]}))}))]}))]})),!c&&(0,h.jsx)("div",Object.assign({className:"quiz_name"},{children:s.QuizName}))]}))})},Y=function(e){var t=e.quizzes,s=e.getQuizItemCompact;return t&&t.map((function(e){return(0,h.jsx)("div",{children:e.QuizName},e.UrlId)})),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",Object.assign({className:"header_top"},{children:[(0,h.jsx)("div",Object.assign({className:"left"},{children:(null==t?void 0:t[0])&&s(t[0])})),(0,h.jsxs)("div",Object.assign({className:"right"},{children:[(0,h.jsxs)("div",Object.assign({className:"first"},{children:[(null==t?void 0:t[1])&&s(t[1]),(null==t?void 0:t[2])&&s(t[2])]})),(0,h.jsxs)("div",Object.assign({className:"second"},{children:[(null==t?void 0:t[3])&&s(t[3]),(null==t?void 0:t[4])&&s(t[4])]}))]}))]})),(0,h.jsxs)("div",Object.assign({className:"same_quizzes_again"},{children:[(null==t?void 0:t[3])&&s(t[3]),(null==t?void 0:t[4])&&s(t[4])]}))]})};function K(e,t,s){return t=(0,u.A)(t),(0,l.A)(e,$()?Reflect.construct(t,s||[],(0,u.A)(e).constructor):t.apply(e,s))}function $(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($=function(){return!!e})()}const ee=function(e){function t(e){var s;return(0,o.A)(this,t),(s=K(this,t,[e])).state={hasError:!1},s}return(0,d.A)(t,e),(0,c.A)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0})}},{key:"render",value:function(){return this.state.hasError?(0,h.jsx)(h.Fragment,{}):this.props.children}}]),t}(a.Component);function te(e,t,s){return t=(0,u.A)(t),(0,l.A)(e,se()?Reflect.construct(t,s||[],(0,u.A)(e).constructor):t.apply(e,s))}function se(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(se=function(){return!!e})()}s("tp68");const ae=function(e){function t(e){var s;return(0,o.A)(this,t),(s=te(this,t,[e])).state={publisherId:"ca-pub-9462180475920846"},s}return(0,d.A)(t,e),(0,c.A)(t,[{key:"componentDidMount",value:function(){(window.adsbygoogle=window.adsbygoogle||[]).push({})}},{key:"render",value:function(){var e;return!0===this.props.hideAdverts?null:(0,h.jsx)(ee,{children:(0,h.jsxs)("div",{children:[(0,h.jsx)("script",{async:!0,src:"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=".concat(this.state.publisherId)}),(0,h.jsx)("ins",{className:"adsbygoogle",style:{display:"block"},"data-ad-client":this.state.publisherId,"data-ad-slot":this.props.adSlotId,"data-ad-format":null!==(e=this.props.adFormat)&&void 0!==e?e:"auto","data-full-width-responsive":this.props.fullWidthResponsive})]})})}}]),t}(a.Component),ne=function(e){var t=e.text;return(0,h.jsx)("span",{dangerouslySetInnerHTML:{__html:"\x3c!-- ".concat(t," --\x3e")}})},re=function(e){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne,{text:e.commentText}),(0,h.jsx)("div",{"data-fuse":e.fuseId})]})};var ie;function oe(e,t,s){return t=(0,u.A)(t),(0,l.A)(e,ce()?Reflect.construct(t,s||[],(0,u.A)(e).constructor):t.apply(e,s))}function ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ce=function(){return!!e})()}!function(e){e[e.Adsense=0]="Adsense",e[e.Publift=1]="Publift"}(ie||(ie={}));const le=function(e){function t(){return(0,o.A)(this,t),oe(this,t,arguments)}return(0,d.A)(t,e),(0,c.A)(t,[{key:"render",value:function(){if(!0===this.props.hideAdverts)return null;var e;switch(this.props.advertisementProvider){case ie.Publift:e=(0,h.jsx)(re,{fuseId:22990951347,commentText:"GAM 71161633/UQUIZ_uquiz/incontent_1"});break;case ie.Adsense:default:e=(0,h.jsx)(ae,{hideAdverts:this.props.hideAdverts,adFormat:"auto",adSlotId:"2030602123",adSlotName:"Featured quizzes",fullWidthResponsive:"true"})}return(0,h.jsx)(ee,{children:(0,h.jsx)("div",Object.assign({style:this.props.style},{children:e}))})}}]),t}(a.Component),ue=function(e){var t=e.quizzes,s=(e.getQuizItem,e.getQuizItemCompact);return e.setQuizzes,e.filters,(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("div",Object.assign({className:"two_main_columns"},{children:(0,h.jsx)("div",Object.assign({className:"right_column"},{children:(0,h.jsx)("div",Object.assign({className:"quiz_grid"},{children:(0,h.jsx)("div",Object.assign({id:"featured_quizzes"},{children:t&&t.map((function(e){return s(e)}))}))}))}))}))})};var de,he,ge=s("qIEf");!function(e){e[e.Trending=0]="Trending",e[e.TopRated=1]="TopRated",e[e.New=2]="New",e[e.Random=3]="Random",e[e.Top=4]="Top",e[e.MostShared=5]="MostShared"}(de||(de={})),function(e){e[e.AllTime=0]="AllTime",e[e.Today=1]="Today",e[e.Week=7]="Week",e[e.Month=31]="Month"}(he||(he={}));var me="/content/images/discovery_icons/";const pe=function(e){var t=e.iconFileName,s=(e.selected,e.iconAltText);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("img",{src:"".concat(me).concat(t,".png"),alt:s,className:"icon dark"}),(0,h.jsx)("img",{src:"".concat(me).concat(t,"_white.png"),alt:s,className:"icon white"})]})};var je;!function(e){e[e.Idle=0]="Idle",e[e.Loading=1]="Loading",e[e.Error=2]="Error"}(je||(je={}));const fe=function(e){var t=e.setQuizzes,s=e.setMaxPageNumber,n=e.filters,r=e.filterType,i=(e.setFilterType,e.setIsLoading),o=e.filterTimePeriod,c=(e.setFilterTimePeriod,(0,a.useState)(!1)),l=(0,Q.A)(c,2),u=l[0],d=(l[1],e.locale),g=e.links,m=e.pageNumber,p=e.pageSize;!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=(0,a.useRef)(!0);(0,a.useEffect)((function(){if(!s.current)return e();s.current=!1}),t)}((function(){n||(i(je.Loading),function(e,a,n,r,o,c,l,u){var d="/Api/Discovery/Trending",h="&returnJson=true&locale=".concat(null!=r?r:"","&pageNumber=").concat(o);switch(e){case de.Trending:d="/Api/Discovery/Trending?timePeriodDays=".concat(a).concat(h);break;case de.TopRated:d="/Api/Discovery/TopRated?timePeriodDays=".concat(a).concat(h);break;case de.Top:d="/Api/Discovery/MostTaken?timePeriodDays=".concat(a).concat(h);break;case de.MostShared:d="/Api/Discovery/MostShared?timePeriodDays=".concat(a).concat(h);break;case de.Random:d="/Api/Discovery/Random?returnJson=true";break;case de.New:d="/Api/Discovery/RecentQuizzes"}ge.ajax({url:"".concat(d),data:{NumberToReturn:null!=c?c:45},beforeSend:function(){ge("#featured_quizzes_error").hide(),ge(".featured_quizzes").hide(),ge("#featured_quizzes_loading").show()},success:function(e){var a,n;a=e.Quizzes,n=e.MaxPageNumber,t(a),n&&s(n),i(je.Idle)},error:function(){i(je.Error)}})}(r,o,0,d,m,p),function(e,t){gtag("event",de[e],{event_category:"discovery_filter",event_label:he[t]})}(r,o))}),[r,o,u]);var j=r==de.Random,f=r==de.Top,x=r==de.TopRated,v=r==de.New,b=r==de.Trending,_=r==de.MostShared,y=(0,h.jsx)("a",Object.assign({className:"filter_type trending first ".concat(b&&"selected"),href:g.Trending},{children:(0,h.jsxs)("div",Object.assign({className:"button_content"},{children:[(0,h.jsx)(pe,{selected:b,iconAltText:"Trending quizzes icon",iconFileName:"trending_quizzes_icon_square"}),"Trending"]}))})),z=(0,h.jsx)("a",Object.assign({className:"filter_type trending first ".concat(_&&"selected"),href:g.MostShared},{children:(0,h.jsxs)("div",Object.assign({className:"button_content"},{children:[(0,h.jsx)(pe,{selected:_,iconAltText:"Most shared quizzes icon",iconFileName:"most_shared_icon_square"}),"Most Shared"]}))})),T=(0,h.jsx)("a",Object.assign({className:"filter_type first new_quizzes ".concat(v&&"selected"),href:g.New},{children:(0,h.jsxs)("div",Object.assign({className:"button_content"},{children:[(0,h.jsx)(pe,{selected:v,iconAltText:"New quizzes horn icon",iconFileName:"new_quizzes_horn_icon_square"}),"New"]}))})),k=(0,h.jsx)("a",Object.assign({className:"filter_type first top_rated ".concat(x&&"selected"),href:g.TopRated},{children:(0,h.jsxs)("div",Object.assign({className:"button_content"},{children:[(0,h.jsx)(pe,{selected:x,iconAltText:"Top rated start icon",iconFileName:"top_rated_star"}),"Top Rated"]}))})),N=(0,h.jsx)("a",Object.assign({className:"filter_type extra top ".concat(f&&"selected"),href:g.Top},{children:(0,h.jsxs)("div",Object.assign({className:"button_content"},{children:[(0,h.jsx)(pe,{selected:f,iconAltText:"Top quizzes icon",iconFileName:"trending_icon_square"}),"Top"]}))})),O=(0,h.jsx)("a",Object.assign({className:"filter_type extra random ".concat(j&&"selected"),href:g.Random},{children:(0,h.jsxs)("div",Object.assign({className:"button_content"},{children:[(0,h.jsx)(pe,{selected:j,iconAltText:"Random quizzes icon",iconFileName:"random_quizzes_icon_square"}),"Random"]}))})),w=[[de.Trending,y],[de.MostShared,z],[de.New,T],[de.TopRated,k],[de.Top,N],[de.Random,O]];return(0,h.jsxs)("div",Object.assign({className:"discover_filters"},{children:[(0,h.jsxs)("div",Object.assign({className:"filter_types"},{children:[w.filter((function(e){return e[0]==r})).map((function(e){return e[1]})),w.filter((function(e){return e[0]!=r})).map((function(e){return e[1]}))]})),r!=de.Random&&r!=de.New&&(0,h.jsxs)("div",Object.assign({className:"filter_time_periods"},{children:[(0,h.jsx)("a",Object.assign({className:"period_item today ".concat(o==he.Today&&"selected"),href:"?p=1&t=".concat(he.Today)},{children:"Today"})),(0,h.jsx)("a",Object.assign({className:"period_item week ".concat(o==he.Week&&"selected"),href:"?p=1&t=".concat(he.Week)},{children:"Week"})),(0,h.jsx)("a",Object.assign({className:"period_item month ".concat(o==he.Month&&"selected"),href:"?p=1&t=".concat(he.Month)},{children:"Month"}))]}))]}))};var xe="/content/images/discovery_icons/";const ve=function(e){var t=e.filters,s=e.filterType;return(0,h.jsxs)("div",Object.assign({className:"featured_main_title"},{children:[(null==t?void 0:t.Tag)?(0,h.jsxs)("h1",{children:[(0,h.jsx)("i",{className:"fas fa-tag"}),t.Tag," Quizzes"]}):(0,h.jsxs)("h1",{children:[s==de.Trending&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("i",{className:"fas fa-fire"}),"Trending"]}),s==de.MostShared&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("img",{src:"".concat(xe,"most_shared_icon_square_light_blue.png"),className:"icon",alt:"Top rated star"}),"Most Shared"]}),s==de.TopRated&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("img",{src:"".concat(xe,"top_rated_star_light_blue.png"),className:"icon",alt:"Top rated star"}),"Top Rated"]}),s==de.Random&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("img",{src:"".concat(xe,"random_quizzes_icon_square_light_blue.png"),className:"icon",alt:"Random icon"}),"Random"]}),s==de.New&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("img",{src:"".concat(xe,"new_quizzes_horn_icon_square_light_blue.png"),className:"icon",alt:"New horn icon"}),"New"]}),s==de.Top&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("img",{src:"".concat(xe,"trending_icon_square_light_blue.png"),className:"icon",alt:"Top icon"}),"Top"]})]}),(0,h.jsx)("div",Object.assign({className:"search_quizzes"},{children:(0,h.jsxs)("a",Object.assign({href:"#",id:"search_button"},{children:[(0,h.jsx)("i",{className:"fas fa-search"}),(0,h.jsx)("span",{children:"Search Quizzes"})]}))}))]}))};s("JNYA");var be=["submissive"];var _e=s("RQpj");const ye=s.p+"assets/3a7868f27d889d715842.svg",ze=s.p+"assets/0230ba6bd071616796b4.svg",Te=function(e){var t=e.rating;if(!t)return(0,h.jsx)(h.Fragment,{});var s=t?Math.floor(t):0,a=5-s;return(0,h.jsxs)(h.Fragment,{children:[(0,_e.A)(Array(s)).map((function(e,t){return(0,h.jsx)("span",{children:(0,h.jsx)("img",{src:"".concat(ze),className:"star_icon",alt:"blue star icon"})},"filled_".concat(t))})),(0,_e.A)(Array(a)).map((function(e,t){return(0,h.jsx)("span",{children:(0,h.jsx)("img",{src:"".concat(ye),className:"star_icon",alt:"grey star icon"})},"empty_".concat(t))}))]})},ke=function(e){var t;return(0,h.jsx)("svg",Object.assign({className:e.className,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},{children:(0,h.jsx)("path",{fill:null!==(t=e.colour)&&void 0!==t?t:"#FFFFFF",d:"M256 504c137 0 248-111 248-248S393 8 256 8 8 119 8 256s111 248 248 248zm0-448c110.5 0 200 89.5 200 200s-89.5 200-200 200S56 366.5 56 256 145.5 56 256 56zm20 328h-40c-6.6 0-12-5.4-12-12V256h-67c-10.7 0-16-12.9-8.5-20.5l99-99c4.7-4.7 12.3-4.7 17 0l99 99c7.6 7.6 2.2 20.5-8.5 20.5h-67v116c0 6.6-5.4 12-12 12z"})}))};var Ne="https://img2.uquiz.com";const Oe=function(e){var t=e.quiz,s=e.takeLaterList,a=e.addToTakeLaterList,n=e.removeFromTakeLaterList,r={backgroundColor:t.BackgroundColourHex},i={background:""},o="";t.HasHalfAndHalfImage&&t.HalfAndHalfImageFileName?i=Object.assign(Object.assign({},i),{backgroundImage:"url('".concat(Ne).concat("/content/images/quiz_thumbnails/halfandhalf/").concat(t.UrlId,"/").concat(t.HalfAndHalfImageFileName,"')")}):t.HasBackgroundImage&&t.BackgroundImageFileName?i=Object.assign(Object.assign({},i),{backgroundImage:"url('".concat(Ne).concat("/content/images/quiz/").concat(t.BackgroundImageFileName,"')")}):o="#EBF5FB"===t.BackgroundColourHex?"no_image_default_color":"no_image";var c=R(t.UrlId,s),l=null,u=null,d=t.DisplayTakerCount?t.DisplayTakerCount:t.TakerCount;return(t.DisplayTakerCount||t.TakerCount)&&(l=(0,h.jsxs)("div",Object.assign({className:"taker_count"},{children:[d," Takers"]}))),t.QuizRating&&(u=(0,h.jsx)("div",Object.assign({className:"star_rating"},{children:(0,h.jsx)(Te,{rating:t.QuizRating})}))),(0,h.jsx)(G,{children:(0,h.jsxs)("a",Object.assign({href:t.QuizLinkUrl,className:"quiz_item"},{children:[(0,h.jsxs)("div",Object.assign({className:"quiz_image ".concat(o),style:Object.assign(Object.assign({},i),r)},{children:[(0,h.jsxs)("div",Object.assign({className:"top"},{children:[0==c&&(0,h.jsx)("div",{children:(0,h.jsx)("button",Object.assign({className:"take_later",type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),a(t.UrlId)},suppressHydrationWarning:!0},{children:"Take later"}))}),c&&(0,h.jsx)("div",{children:(0,h.jsx)("button",Object.assign({className:"take_later",type:"button",onClick:function(e){e.preventDefault(),e.stopPropagation(),n(t.UrlId)},suppressHydrationWarning:!0},{children:"Remove"}))})]})),(0,h.jsx)("div",Object.assign({className:"bottom"},{children:(0,h.jsx)("div",Object.assign({className:"white"},{children:(0,h.jsxs)("div",Object.assign({className:"bottom_content"},{children:[(0,h.jsxs)("span",Object.assign({className:"taker_count"},{children:[(0,h.jsx)("span",{children:(0,h.jsx)(ke,{className:"icon"})})," ",(0,h.jsxs)("span",{children:[d," Takers"]})]})),(0,h.jsxs)("span",Object.assign({className:"quiz_type"},{children:[t.QuizType==L.Personality&&(0,h.jsxs)("span",Object.assign({title:"Personality Quiz"},{children:[(0,h.jsx)(W,{className:"icon"}),(0,h.jsx)("span",Object.assign({className:"quiz_type_text"},{children:"Personality Quiz"}))]})),t.QuizType==L.Scored&&(0,h.jsxs)("span",Object.assign({title:"Scored Quiz"},{children:[(0,h.jsx)(X,{className:"icon"}),(0,h.jsx)("span",Object.assign({className:"quiz_type_text"},{children:"Scored Quiz"}))]}))]}))]}))}))}))]})),(0,h.jsxs)("div",Object.assign({className:"right"},{children:[(0,h.jsxs)("div",Object.assign({className:"quiz_facts"},{children:[u,l]})),(0,h.jsx)("div",Object.assign({className:"quiz_name"},{children:t.QuizName}))]}))]}))})},we=function(e,t){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(a){return(0,h.jsx)(Z,{quiz:a,takeLaterList:e,addToTakeLaterList:function(e){return F(e,t)},removeFromTakeLaterList:function(e){return B(e,t)},sideBarVariant:s},a.UrlId)}};s("1qf0");var Ce=s("P36y");const Se=function(e){var t=e.userName,s=e.userQuizCount;return(0,h.jsxs)("div",Object.assign({id:"dashboard_your_quizzes_title_wrapper"},{children:[(0,h.jsx)("h3",Object.assign({id:"dashboard_your_quizzes_title"},{children:t})),(0,h.jsx)("div",Object.assign({className:"header_right"},{children:(0,h.jsxs)("div",Object.assign({className:"dashboard_quiz_count"},{children:[s," ",1==s?"Quiz":"Quizzes"]}))}))]}))},Ae=function(e){var t=e.errorMessage,s=e.successMessage,a=e.errorCode,n=e.emailVerificationInfo,r=e.antiForgeryToken,i=null,o=null;1==a&&(i=(0,h.jsx)("div",Object.assign({id:"dashboard_error_wrapper",className:"error_wrapper"},{children:(0,h.jsx)("span",{children:"Sorry, you do not have permission to this quiz, or it does not exist"})}))),t?o=(0,h.jsx)("div",Object.assign({id:"dashboard_error_wrapper",className:"error_wrapper"},{children:(0,h.jsx)("span",{children:t})})):s&&(o=(0,h.jsx)("div",Object.assign({id:"dashboard_error_wrapper",className:"success_wrapper"},{children:(0,h.jsx)("span",{children:s})})));var c=[];return!1===n.EmailVerified&&(n.EmailVerificationFailedRecently&&c.push((0,h.jsxs)("form",Object.assign({method:"POST",action:n.VerifyEmailFormPath,id:"email_verify_form"},{children:[(0,h.jsx)("input",{type:"hidden",name:"__RequestVerificationToken",value:r}),(0,h.jsx)("div",Object.assign({id:"dashboard_error_wrapper",className:"error_wrapper"},{children:(0,h.jsxs)("span",{children:["You didn't receive your verification email that we sent (Reason: ",n.EmailVerificationFailedRecentlyFailureReason,"). You'll need to ",(0,h.jsx)("a",Object.assign({href:n.UpdateEmailPath},{children:"update it here"}))," and then try again."]})}))]}))),c.push((0,h.jsxs)("form",Object.assign({method:"POST",action:n.VerifyEmailFormPath,id:"email_verify_form"},{children:[(0,h.jsx)("input",{type:"hidden",name:"__RequestVerificationToken",value:r}),(0,h.jsx)("div",Object.assign({id:"dashboard_error_wrapper",className:"error_wrapper"},{children:(0,h.jsxs)("span",{children:["Oh no! Your registered email address isn't verified. ",(0,h.jsx)("a",Object.assign({onClick:function(){var e;return null===(e=document.getElementById("email_verify_form"))||void 0===e?void 0:e.submit()}},{children:"Click here to send verification email"})),"."]})}))]})))),(0,h.jsxs)(h.Fragment,{children:[i,o,c]})},Ie=function(e){var t=e.userName,s=e.newQuizPath;return(0,h.jsxs)("div",Object.assign({className:"dashboard_no_quizzes"},{children:[(0,h.jsxs)("h3",{children:["Hey ",t,". Welcome to uQuiz",(0,h.jsx)("span",Object.assign({className:"reg"},{children:"®"})),"!",(0,h.jsx)("br",{}),(0,h.jsx)("br",{}),"Your own ",(0,h.jsx)("span",Object.assign({className:"pink_highlight"},{children:"beautiful"}))," quizzes with real time results",(0,h.jsx)("br",{})," are just moments away..."]}),(0,h.jsx)("a",Object.assign({href:s,className:"make_first_quiz"},{children:"Click here to Make Your First Quiz!"}))]}))};var Pe;!function(e){e.All="All",e.Drafts="Drafts",e.Published="Published"}(Pe||(Pe={}));var Le=s("StkD"),Qe=(s("JXEE"),s("qIEf"));var Ee;!function(e){e[e.Unpublished=0]="Unpublished",e[e.Published=1]="Published",e[e.UsersLockedOut=2]="UsersLockedOut"}(Ee||(Ee={}));const Fe=function(e){var t,s,a=e.quiz,n=e.antiForgeryToken,r=e.dispatch,i=e.filterList,o=a.QuizStatus==Ee.UsersLockedOut&&(0,h.jsxs)(h.Fragment,{children:[" - ",(0,h.jsx)("span",Object.assign({className:"inactive_highlight_red"},{children:"Takers locked out"}))]});return(0,h.jsxs)("div",Object.assign({className:"dashboard_quiz_item"},{children:[(0,h.jsxs)("ul",Object.assign({className:"dashboard_quiz_left"},{children:[(0,h.jsxs)("li",{children:[(0,h.jsxs)("a",Object.assign({href:a.QuizOverviewPath,className:"quiz_name_link ".concat(o?"inactive_highlight_red":"")},{children:[a.QuizName," "]})),a.QuizType==L.Personality&&(0,h.jsx)("img",{src:"/content/images/dashboard/personality_quiz.png",className:"dashboard_quiz_icon",alt:"This is a Personality Quiz",title:"This is a Personality Quiz"}),a.PasswordRequiredToTakeQuiz&&(0,h.jsx)("img",{src:"/content/images/dashboard/passwords_icon.png",className:"dashboard_quiz_icon",alt:"This Quiz has Passwords Set",title:"This Quiz has Passwords Set"})]}),(0,h.jsxs)("li",Object.assign({className:"dashboard_quiz_question_excerpt"},{children:["Question excerpt: ",(0,h.jsxs)("span",Object.assign({title:a.QuestionExcerpt},{children:['"',null===(t=a.QuestionExcerpt)||void 0===t?void 0:t.substring(0,100),'"']}))]})),(0,h.jsxs)("li",Object.assign({className:"dashboard_quiz_info"},{children:["Created ",(0,h.jsx)(Le.A,{title:a.CreatedLocalisedDateTimeDisplay,datetime:a.CreatedUnixDateTime,locale:"en"})," - ",a.QuestionCount.toLocaleString()," Questions"]})),(0,h.jsxs)("li",{children:[(0,h.jsx)("a",Object.assign({href:a.EditQuizPath,className:"quiz_action_link"},{children:"Edit Quiz"})),(0,h.jsx)("a",Object.assign({href:a.QuizOverviewPath,className:"quiz_action_link"},{children:"Share"})),(0,h.jsx)("a",Object.assign({href:a.PreviewPath,className:"quiz_action_link"},{children:"Preview"})),(0,h.jsx)("input",{name:"__RequestVerificationToken",type:"hidden",value:n}),(0,h.jsx)("a",Object.assign({className:"quiz_action_link quiz_action_delete",onClick:function(e){return function(e,t,s,a,n){e.preventDefault(),function(e,t){return new Promise((function(s,a){confirm("Are you sure you want to delete this quiz?")?Qe.ajax({type:"DELETE",dataType:"json",url:"/Api/Quiz",data:{UrlId:t},headers:{RequestVerificationToken:e},success:function(e){s(e)},error:function(e,t,s){console.log(s),a("There was an error deleting the quiz. Please refresh and try again.")}}):s(!1)}))}(s,t).then((function(e){!0===e&&a(function(e,t){return{type:"REMOVE_DASHBOARD_QUIZ",QuizUrlId:e,FilterList:t}}(t,n))})).catch((function(e){alert("There was an error trying to delete your quiz. Please refresh and try again.")}))}(e,a.UrlId,n,r,i)}},{children:"Delete"}))]})]})),(0,h.jsxs)("div",Object.assign({className:"quiz_info_right"},{children:[(0,h.jsxs)("div",Object.assign({className:"quiz_info_activity"},{children:[(0,h.jsx)("span",{children:a.Published?"Published":"Draft"}),o," - ",L[a.QuizType]," Quiz"]})),(0,h.jsxs)("div",{children:[(0,h.jsxs)("div",Object.assign({className:"quiz_info_box first_box"},{children:[(0,h.jsxs)("div",Object.assign({className:"first_box_popup"},{children:[(0,h.jsx)("div",Object.assign({className:"first_popup_headline"},{children:a.CompletionListStatusTagLine})),(0,h.jsx)("ul",{children:null===(s=a.CompletionLinks)||void 0===s?void 0:s.map((function(e){return(0,h.jsx)("li",{children:(0,h.jsx)("a",Object.assign({href:e.LinkPath,className:e.HighLightClass},{children:e.LinkText}))},e.LinkText)}))})]})),(0,h.jsx)("div",{className:"quiz_complete_scale",style:{backgroundPosition:"0 ".concat(a.SmallProgressBarBackgroundOffset)}})]})),(0,h.jsx)("div",Object.assign({className:"quiz_info_box second_box",title:"".concat(a.TotalTakersCount.toLocaleString()," Quiz Takers so far")},{children:a.TotalTakersCount.toLocaleString()}))]})]}))]}))};var Be;!function(e){e[e.Idle=0]="Idle",e[e.Loading=1]="Loading",e[e.Error=2]="Error",e[e.NoMore=3]="NoMore"}(Be||(Be={}));var qe=s("qIEf");const De=function(e,t,s,a,n){e.preventDefault(),a(Be.Loading),function(e,t){return new Promise((function(s,a){qe.ajax({type:"GET",url:"/Api/DashboardQuizzes",data:{LastQuizId:e,filter:Pe[t]},dataType:"json",success:function(e){s(e)},error:function(e,t,s){a(s)}})}))}(s,n).then((function(e){e&&0!==(null==e?void 0:e.length)?(t(function(e,t){return{type:"ADD_DASHBOARD_QUIZ",DashboardQuizzes:e,FilterList:t}}(e,n)),a(Be.Idle)):a(Be.NoMore)})).catch((function(){return a(Be.Error)}))},He=function(e){var t,s=e.antiForgeryToken,n=e.quizzes,r=e.filterList,i=e.dispatch,o=e.listTitle,c=(0,a.useState)(Be.Idle),l=(0,Q.A)(c,2),u=l[0],d=l[1];switch(u){case Be.Loading:t=(0,h.jsxs)(h.Fragment,{children:["Loading... ",(0,h.jsx)("img",{alt:"Loading icon",src:"/content/images/dashboard/dashboard_loader.gif"})]});break;case Be.Error:t=(0,h.jsx)(h.Fragment,{children:"Error loading. Please refresh and try again."});break;case Be.NoMore:t="There are no more quizzes to show, why not create another?";break;default:t="Load More..."}return(0,h.jsxs)("div",Object.assign({className:"dashboard_quizzes_filter_col"},{children:[(0,h.jsx)("div",Object.assign({className:"filter_list_header"},{children:(0,h.jsx)("h4",{children:o})})),n.map((function(e){return(0,h.jsx)(Fe,{quiz:e,antiForgeryToken:s,dispatch:i,filterList:r},e.UrlId)})),(0,h.jsx)("a",Object.assign({href:"#",id:"dashboard_more_quizzes_button",className:"dashboard_more_button",onClick:function(e){var t;return De(e,i,null===(t=n[n.length-1])||void 0===t?void 0:t.QuizId,d,r)}},{children:(0,h.jsx)("div",{children:t})}))]}))},Re=function(e){var t=e.draftQuizzes,s=e.publishedQuizzes,a=(e.newQuizPath,e.userName),n=e.antiForgeryToken,r=e.dispatch;return(0,h.jsx)(h.Fragment,{children:(t||s)&&(t.length>0||s.length>0)?(0,h.jsxs)("div",Object.assign({className:"dashboard_split"},{children:[(0,h.jsx)(He,{dispatch:r,filterList:Pe.Drafts,antiForgeryToken:n,quizzes:t,listTitle:"Draft Quizzes"}),(0,h.jsx)(He,{dispatch:r,filterList:Pe.Published,antiForgeryToken:n,quizzes:s,listTitle:"Published Quizzes"})]})):(0,h.jsx)(Ie,{userName:a,newQuizPath:e.newQuizPath})})};var Ue=s("p7wu");const Me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_DASHBOARD_QUIZ":return(0,Ue.Ay)(e,(function(e){var s,a;switch(t.FilterList){case Pe.Published:(s=e.PublishedQuizzes).push.apply(s,(0,_e.A)(t.DashboardQuizzes));break;case Pe.Drafts:(a=e.DraftQuizzes).push.apply(a,(0,_e.A)(t.DashboardQuizzes))}}));case"SET_DASHBOARD_QUIZZES":return(0,Ue.Ay)(e,(function(e){switch(t.FilterList){case Pe.Published:e.PublishedQuizzes=t.DashboardQuizzes;break;case Pe.Drafts:e.DraftQuizzes=t.DashboardQuizzes}}));case"REMOVE_DASHBOARD_QUIZ":return(0,Ue.Ay)(e,(function(e){switch(t.FilterList){case Pe.Published:e.PublishedQuizzes=e.PublishedQuizzes.filter((function(e){return e.UrlId!=t.QuizUrlId}));break;case Pe.Drafts:e.DraftQuizzes=e.DraftQuizzes.filter((function(e){return e.UrlId!=t.QuizUrlId}))}e.UserQuizCount=e.UserQuizCount-1}))}return e};var Ve=s("zMKM"),Ge=s("qIEf");var We;!function(e){e[e.Hidden=0]="Hidden",e[e.Loading=1]="Loading",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e[e.ShowResults=4]="ShowResults"}(We||(We={}));const Xe=We,Je=function(e,t,s,a){a(Xe.Loading),function(e,t){var s={UrlId:t,SearchTerm:e};return Ge("#quiz_suggestions_side .quiz_items_container").scrollTop(0),new Promise((function(e,t){Ge.ajax({url:"/Api/Discovery/Search",data:s,success:function(t){e(t)},error:function(){t("Error occurred")}})}))}(e,t).then((function(e){var t;(null==e?void 0:e.Quizzes)&&(null===(t=e.Quizzes)||void 0===t?void 0:t.length)>0?(s(e.Quizzes),a(Xe.ShowResults)):(s([]),a(Xe.NoResults))})).catch((function(){a(Xe.Error)}))};var Ze=function(e,t,s,a,n){!t||t.length<2||e!=Xe.Loading&&Je(t,s,a,n)};const Ye=function(e){var t=e.searchTerm,s=e.setSearchTerm,n=e.quizUrlId,r=e.setSearchResults,i=e.searchStatus,o=e.setSearchStatus;return e.tempSearchTerm,e.setTempSearchTerm,(0,a.useEffect)((function(){Ze(i,t,n,r,o)}),[t]),(0,h.jsx)("div",Object.assign({className:"search_bar"},{children:(0,h.jsx)("form",Object.assign({onSubmit:function(e){e.preventDefault(),Ze(i,t,n,r,o)}},{children:(0,h.jsxs)("div",Object.assign({className:"search_flex"},{children:[(0,h.jsx)("div",Object.assign({className:"textbox_wrapper"},{children:(0,h.jsx)(Ve.DebounceInput,{name:t,debounceTimeout:2e3,minLength:2,id:"quiz_search_box",placeholder:"Search quizzes",autoComplete:"off",onChange:function(e){return s(e.target.value)}})})),(0,h.jsx)("div",Object.assign({className:"search_button"},{children:(0,h.jsx)("button",Object.assign({id:"suggestion_bar_search_button"},{children:(0,h.jsx)("img",{src:"/content/images/quiztaking/search_magnifying_glass.png",alt:"Search"})}))}))]}))}))}))};var Ke=s("qIEf");function $e(e,t,s){return t=(0,u.A)(t),(0,l.A)(e,et()?Reflect.construct(t,s||[],(0,u.A)(e).constructor):t.apply(e,s))}function et(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(et=function(){return!!e})()}const tt=function(e){function t(e){return(0,o.A)(this,t),$e(this,t,[e])}return(0,d.A)(t,e),(0,c.A)(t,[{key:"showHideMore",value:function(){this.setState({ShowingMore:!this.state.ShowingMore})}},{key:"componentDidMount",value:function(){var e,t=this;this.setState({ShowingMore:!1}),e=function(e){t.setState({QuizTags:e})},Ke.ajax({url:"".concat("/Api/Discovery/QuizTags"),data:{NumberToReturn:40},success:function(t){e(t)}})}},{key:"render",value:function(){var e,t,s=this;return(null===(e=this.state)||void 0===e?void 0:e.QuizTags)?(0,h.jsxs)("section",Object.assign({className:"tags"},{children:[(0,h.jsx)("div",Object.assign({className:"tag_icon"},{children:(0,h.jsx)("i",{className:"fas fa-tag"})})),(null===(t=this.state)||void 0===t?void 0:t.QuizTags)&&this.state.QuizTags.map((function(e,t){var a=t>5?"initiallyHidden":"",n={"--tag-number":t};return(0,h.jsx)("a",Object.assign({href:"/Discovery/tag/".concat(encodeURIComponent(e.TagName)),className:"tag ".concat(a," ").concat(s.state.ShowingMore&&"show"),style:n},{children:e.TagName}),e.TagName)})),(0,h.jsx)("div",Object.assign({className:"more_button"},{children:(0,h.jsx)("button",Object.assign({onClick:function(){return s.showHideMore()}},{children:this.state.ShowingMore?"show less":"show more tags"}))}))]})):null}}]),t}(a.Component),st=function(e){var t=e.quizzes,s=e.takeLaterList,a=e.setTakeLaterList,n=we(s,a,!0);return(0,h.jsx)(h.Fragment,{children:t&&t.map((function(e){return n(e)}))})},at=function(){return(0,h.jsxs)("div",Object.assign({className:"loading"},{children:[(0,h.jsxs)("div",Object.assign({className:"spinner"},{children:[(0,h.jsx)("div",{className:"bounce1"}),(0,h.jsx)("div",{className:"bounce2"}),(0,h.jsx)("div",{className:"bounce3"})]})),(0,h.jsx)("div",Object.assign({className:"loading_message"},{children:"Loading..."}))]}))};var nt;!function(e){e[e.Loading=0]="Loading",e[e.NoResults=1]="NoResults",e[e.Error=2]="Error",e[e.ShowResults=3]="ShowResults"}(nt||(nt={}));const rt=nt;var it=s("qIEf");const ot=function(e){var t=e.urlId,s=e.takeLaterList,n=e.setTakeLaterList,r=e.sideBarOpen,i=(0,a.useState)([]),o=(0,Q.A)(i,2),c=o[0],l=o[1],u=(0,a.useState)(rt.Loading),d=(0,Q.A)(u,2),g=d[0],m=d[1];return(0,a.useEffect)((function(){r&&function(e){return new Promise((function(t,s){it.ajax({url:"/Api/Discovery/Suggestions",data:{UrlId:e},success:function(e){t(e.Quizzes)},error:function(){s("Failed to load suggestions")},complete:function(){gtag("event","loaded",{event_category:"quizsuggestions",event_label:e})}})}))}(t).then((function(e){l(e),m(rt.ShowResults)})).catch((function(e){l([]),m(rt.Error)}))}),[r]),(0,h.jsxs)("div",Object.assign({className:"suggestions"},{children:[(0,h.jsx)("h4",{children:"Popular Quizzes"}),g==rt.Loading&&(0,h.jsx)(at,{}),g==rt.NoResults&&(0,h.jsx)("div",Object.assign({className:"no_search_results"},{children:"Sorry, there are no suggested quizzes :("})),g==rt.Error&&(0,h.jsx)("div",Object.assign({className:"no_search_results"},{children:"There was an error loading suggestions. Please reload and try again."})),c&&(null==c?void 0:c.length)>0&&(0,h.jsx)(st,{quizzes:c,takeLaterList:s,setTakeLaterList:n})]}))},ct=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_BACKGROUND_COLOUR_HEX":return(0,Ue.Ay)(e,(function(e){e.BackgroundColourHex=t.BackgroundColourHex}));case"UPDATE_BACKGROUND_ALIGNMENT":return(0,Ue.Ay)(e,(function(e){e.BackgroundAlignment=t.BackgroundAlignment}));case"UPDATE_BACKGROUND_IMAGE_FILENAME":return(0,Ue.Ay)(e,(function(e){e.BackgroundImageFilename=t.BackgroundImageFilename,e.HasBackgroundImage=t.HasBackgroundImage,e.BackgroundImageId=t.BackgroundImageId}));case"REMOVE_BACKGROUND_IMAGE_FILENAME":return(0,Ue.Ay)(e,(function(e){e.BackgroundImageFilename="",e.HasBackgroundImage=!1,e.BackgroundImageId=null}));case"UPDATE_BUTTON_COLOUR_HEX":return(0,Ue.Ay)(e,(function(e){e.ButtonColourHex=t.ButtonColourHex}));case"UPDATE_BUTTON_TEXT_COLOUR_HEX":return(0,Ue.Ay)(e,(function(e){e.ButtonTextColourHex=t.ButtonTextColourHex}));case"UPDATE_TEXT_COLOUR_HEX":return(0,Ue.Ay)(e,(function(e){e.TextColourHex=t.TextColourHex}));case"UPDATE_ALL_THEME_COLOURS":return(0,Ue.Ay)(e,(function(e){e.ButtonColourHex=t.ButtonColourHex,e.ButtonTextColourHex=t.ButtonTextColourHex,e.TextColourHex=t.TextColourHex,e.BackgroundColourHex=t.BackgroundColourHex}));case"SET_ENTIRE_STATE":return t.EntireState;default:return e}};s("xNVH"),s("6zfc");var lt=s("qIEf");const ut=function(){lt("div#quiz_background_preview_overlay").css("display","block"),lt("body").css("overflow","hidden")},dt=function(){lt("div#quiz_background_preview_overlay").css("display","none"),lt("body").css("overflow","initial")};var ht;!function(e){e[e.Top=0]="Top",e[e.Centered=1]="Centered",e[e.Bottom=2]="Bottom"}(ht||(ht={}));const gt=ht,mt=function(e){var t=e.state;return e.dispatch,(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("h2",Object.assign({className:"large_spacing"},{children:"Quiz Style"})),(0,h.jsxs)("div",Object.assign({className:"main_section"},{children:[(0,h.jsx)("div",Object.assign({className:"image_assets_padded"},{children:(0,h.jsx)("p",Object.assign({className:"padded"},{children:"Adding a background to your quiz can make your quiz look great and stand out."}))})),(0,h.jsx)("div",Object.assign({className:"sub_section quiz_setting_section_wrapper"},{children:(0,h.jsxs)("div",Object.assign({id:"uploaded_image_asset",className:"inventory_item_wrapper"},{children:[(0,h.jsx)("div",Object.assign({id:"background_preview",className:"uploaded_image_left",style:{display:t.HasBackgroundImage?"":"none"}},{children:(0,h.jsx)("a",Object.assign({href:"#",id:"current_background_image"},{children:(0,h.jsx)("img",{id:"background_image_preview",className:"image_preview",src:"".concat(t.ImageLocation,"/content/images/quiz/").concat(t.BackgroundImageFilename),alt:"Background image preview"})}))})),(0,h.jsx)("div",Object.assign({className:"uploaded_image_right image_asset_form"},{children:(0,h.jsxs)("ul",{children:[(0,h.jsxs)("li",Object.assign({style:{display:t.HasBackgroundImage?"":"none"},className:"background_description_has_image"},{children:[(0,h.jsx)("b",{children:"Background Alignment:"}),(0,h.jsx)("span",Object.assign({id:"background_position_desc"},{children:gt[t.BackgroundAlignment].toString()}))]})),(0,h.jsxs)("li",{children:[(0,h.jsx)("b",{children:"Background Color:"}),(0,h.jsxs)("span",Object.assign({className:"style_item_info",id:"background_color_desc"},{children:[(0,h.jsx)("div",{className:"colour_preview_swatch",style:{backgroundColor:t.BackgroundColourHex}}),t.BackgroundColourHex.toUpperCase()]}))]}),(0,h.jsxs)("li",{children:[(0,h.jsx)("b",{children:"Text Color:"}),(0,h.jsxs)("span",Object.assign({className:"style_item_info",id:"text_color_desc"},{children:[(0,h.jsx)("div",{className:"colour_preview_swatch",style:{backgroundColor:t.TextColourHex}})," ",t.TextColourHex.toUpperCase()]}))]}),(0,h.jsxs)("li",{children:[(0,h.jsx)("b",{children:"Button Color:"}),(0,h.jsxs)("span",Object.assign({className:"style_item_info",id:"button_color_desc"},{children:[(0,h.jsx)("div",{className:"colour_preview_swatch",style:{backgroundColor:t.ButtonColourHex}})," ",t.ButtonColourHex.toUpperCase()]}))]}),(0,h.jsxs)("li",{children:[(0,h.jsx)("b",{children:"Button Text Color:"}),(0,h.jsxs)("span",Object.assign({className:"style_item_info",id:"button_text_color_desc"},{children:[(0,h.jsx)("div",{className:"colour_preview_swatch",style:{backgroundColor:t.ButtonTextColourHex}})," ",t.ButtonTextColourHex.toUpperCase()]}))]}),(0,h.jsx)("li",{children:(0,h.jsx)("input",{type:"button",value:"Preview and Edit",className:"show_background_dialog",onClick:function(){return ut()}})})]})}))]}))}))]}))]})},pt=function(e,t,s,a,n){var r={};switch(s&&(r=Object.assign(Object.assign({},r),{backgroundImage:"url('".concat(e).concat(t).concat(s,"')")})),r=Object.assign(Object.assign({},r),{backgroundColor:n}),a){case gt.Top:r=Object.assign(Object.assign({},r),{backgroundPosition:"center top"});break;case gt.Centered:r=Object.assign(Object.assign({},r),{backgroundPosition:"center center"});break;case gt.Bottom:r=Object.assign(Object.assign({},r),{backgroundPosition:"center bottom"})}return r=Object.assign(Object.assign({},r),{backgroundSize:"cover","-webkit-background-size":"cover","-moz-background-size":"cover","-o-background-size":"cover"}),Object.assign(Object.assign({},r),{backgroundAttachment:"fixed"})};var jt=s("PAG5");var ft=s("tkfv"),xt=s("ivXU");function vt(e,t,s){return t=(0,u.A)(t),(0,l.A)(e,bt()?Reflect.construct(t,s||[],(0,u.A)(e).constructor):t.apply(e,s))}function bt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bt=function(){return!!e})()}const _t=function(e){function t(e){var s;return(0,o.A)(this,t),(s=vt(this,t,[e])).handleClick=function(){s.setState({DisplayColourPicker:!s.state.DisplayColourPicker})},s.handleClose=function(){s.setState({DisplayColourPicker:!1})},s.handleChange=function(e){s.setState({ColourHex:e.hex}),s.props.OnChange(e.hex)},s.componentWillReceiveProps=function(e){s.setState({ColourHex:e.ColourHex})},s.state={DisplayColourPicker:!1,ColourHex:e.ColourHex},s}return(0,d.A)(t,e),(0,c.A)(t,[{key:"render",value:function(){var e=new jt.GB(this.state.ColourHex).RGBAObject,t=(0,ft.Ay)({default:{colour:{width:"36px",height:"24px",borderRadius:"2px",border:"1px solid #000",background:"rgba(".concat(e.r,", ").concat(e.g,", ").concat(e.b,", ").concat(e.a,")")},swatch:{padding:"5px",background:"#fff",borderRadius:"1px",boxShadow:"0 0 0 1px rgba(0,0,0,.1)",display:"inline-block",cursor:"pointer"},popover:{position:"absolute",zIndex:"2"},cover:{position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}}});return(0,h.jsxs)("div",{children:[(0,h.jsx)("div",Object.assign({style:t.swatch,onClick:this.handleClick},{children:(0,h.jsx)("div",{style:t.colour})})),this.state.DisplayColourPicker?(0,h.jsxs)("div",Object.assign({style:t.popover},{children:[(0,h.jsx)("div",{style:t.cover,onClick:this.handleClose}),(0,h.jsx)(xt.xk,{color:this.state.ColourHex,onChange:this.handleChange,disableAlpha:!0})]})):null]})}}]),t}(a.Component);var yt=function(e){return{type:"SET_ENTIRE_STATE",EntireState:e}},zt=function(e){return{type:"UPDATE_BACKGROUND_ALIGNMENT",BackgroundAlignment:e}},Tt=s("qIEf");var kt;!function(e){e[e.QuizShareImage=0]="QuizShareImage",e[e.QuizBackgroundImage=1]="QuizBackgroundImage",e[e.PersonalityShareImage=2]="PersonalityShareImage",e[e.PersonalityResultImage=3]="PersonalityResultImage",e[e.PossibleAnswerMediaImage=4]="PossibleAnswerMediaImage",e[e.QuizQuestionMedia=5]="QuizQuestionMedia",e[e.UserProfileImage=6]="UserProfileImage",e[e.FeaturedHalfAndHalfImage=7]="FeaturedHalfAndHalfImage"}(kt||(kt={}));const Nt=kt;s("AtVY"),s("LZbz");var Ot=s("qIEf");var wt=s("qIEf");const Ct=function(e,t,s){return new Promise((function(a,n){if(0==e.length)n("There was no file selected");else{var r=e[0];(function(e,t,s){return new Promise((function(a,n){wt.ajax({url:"/api/ImageUploadUrl/GetUrl",type:"GET",headers:{RequestVerificationToken:s},data:{ImageType:e,ContentType:t},success:function(e){return a(e)},error:function(e,t){n({Error:!0,ErrorStatusCode:e.status})}})}))})(s,r.type,t).then((function(e){var t,s,i;(t=e,s=r,i=new FormData,Object.keys(t.ImageUploadFields).forEach((function(e){return i.append(e,t.ImageUploadFields[e])})),i.append("Content-Type",s.type),i.append("file",s),new Promise((function(e,s){Ot.ajax({url:t.ImageUploadUrl,type:"POST",data:i,processData:!1,contentType:!1,dataType:"xml",success:function(t){return e("Success uploading to presigned url")},error:function(e,t){var a=Ot(e.responseXML),n={ErrorCode:a.find("Code").text(),ErrorMessage:a.find("Message").text(),FullResponseXml:e.responseText};return s(n)}})}))).then((function(t){return a(e)})).catch((function(e){switch(e.ErrorCode){case"EntityTooLarge":n("Upload failed because the image was too large. Please choose another file and try again.");break;case"AccessDenied":n("Upload failed because it wasn't a valid image. Please choose another file and try again.");break;default:n("Upload failed. Please try again. Message: ".concat(e.ErrorCode))}}))})).catch((function(e){429===e.ErrorStatusCode?n("Upload failed because you've uploaded too many images too quickly. Please wait and try again."):n("Upload failed. Please try again. Error code: ".concat(e.ErrorStatusCode))}))}}))};var St=s("qIEf");const At=function(e,t,s){e.preventDefault(),function(e,t,s,a){var n=e.prop("files");""!==e.val()&&0!==n.length&&Ct(n,s,t).then(a).catch((function(e){return alert(null!=e?e:"Error uploading personality result image. Please try again.")}))}(St(e.target),Nt.QuizBackgroundImage,t.AntiForgeryToken,(function(e){(function(e,t){return new Promise((function(s,a){St.ajax({dataType:"json",url:t.BackgroundImageUploadPath,type:"POST",beforeSend:function(){},data:{UrlId:t.UrlId,UploadedImageLocation:e.Location},headers:{RequestVerificationToken:t.AntiForgeryToken},success:function(e){!0===e.UploadSuccess?s(e):void 0!==e.ErrorMessage&&null!=e.ErrorMessage?alert(e.ErrorMessage):alert("There was an error attempting to upload your background image. Please refresh and try again.")},error:function(){alert("There was an error attempting to upload your background image. Please refresh and try again."),a()}})}))})(e,t).then((function(e){s(e)})).catch()})),St("input#background_image_file").val("")};var It;function Pt(e,t,s){if("number"!=typeof e||e<-1||e>1||"string"!=typeof t||"r"!=t[0]&&"#"!=t[0]||"string"!=typeof s&&void 0!==s)return null;It||(It=function(e){var t=e.length,s=new Object;if(t>9){if((e=e.split(",")).length<3||e.length>4)return null;s[0]=a(e[0].slice(4)),s[1]=a(e[1]),s[2]=a(e[2]),s[3]=e[3]?parseFloat(e[3]):-1}else{if(8==t||6==t||t<4)return null;t<6&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?e[4]+""+e[4]:"")),e=a(e.slice(1),16),s[0]=e>>16&255,s[1]=e>>8&255,s[2]=255&e,s[3]=9==t||5==t?n((e>>24&255)/255*1e4)/1e4:-1}return s});var a=parseInt,n=Math.round,r=t.length>9,i=(r="string"==typeof s?s.length>9||"c"==s&&!r:r,e<0),o=(e=i?-1*e:e,s=s&&"c"!=s?s:i?"#000000":"#FFFFFF",It(t)),c=It(s);return o&&c?r?"rgb("+n((c[0]-o[0])*e+o[0])+","+n((c[1]-o[1])*e+o[1])+","+n((c[2]-o[2])*e+o[2])+(o[3]<0&&c[3]<0?")":","+(o[3]>-1&&c[3]>-1?n(1e4*((c[3]-o[3])*e+o[3]))/1e4:c[3]<0?o[3]:c[3])+")"):"#"+(4294967296+16777216*(o[3]>-1&&c[3]>-1?n(255*((c[3]-o[3])*e+o[3])):c[3]>-1?n(255*c[3]):o[3]>-1?n(255*o[3]):255)+65536*n((c[0]-o[0])*e+o[0])+256*n((c[1]-o[1])*e+o[1])+n((c[2]-o[2])*e+o[2])).toString(16).slice(o[3]>-1||c[3]>-1?1:3):null}s("9rix"),s("e7ca");s("O+6j"),s("G1MM");var Lt=function(){return"#"+Math.floor(16777215*Math.random()).toString(16).padStart(6,"0")};const Qt=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return new Promise((function(s){s(function(e){var t,s,a,n,r=new jt.GB(Lt()),i=new jt.GB(Lt());return e=null!=e?e:Math.random()<.5,{ButtonTextColour:Pt("dark"==(t=r.HEX,t.match(/^rgb/)?(s=(t=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/))[1],a=t[2],n=t[3]):(s=(t=+("0x"+t.slice(1).replace(t.length<5&&/./g,"$&$&")))>>16,a=t>>8&255,n=255&t),Math.sqrt(s*s*.299+a*a*.587+n*n*.114)>127.5?"light":"dark")?.9:-.7,r.HEX),ButtonColour:Pt(e?-.2:.2,r.HEX),BackgroundColour:Pt(e?-.5:.5,i.HEX),TextColour:Pt(e?.7:-.7,i.HEX)}}(e)),function(e){try{gtag("event","random_theme_generated",{event_category:"quizstyle",event_label:"Quiz ".concat(e)})}catch(e){}}(t)}))},Et=function(e){var t,s,n,r,i,o,c=e.summaryState,l=e.summaryDispatch,u=(0,a.useReducer)(ct,c),d=(0,Q.A)(u,2),g=d[0],m=d[1],p=(0,a.useState)(!1),j=(0,Q.A)(p,2),f=j[0],x=j[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)("div",Object.assign({id:"quiz_background_preview_overlay"},{children:[(0,h.jsx)("div",{className:"quiz_image_preview",style:pt(g.ImageLocation,"/content/images/quiz/",g.BackgroundImageFilename,g.BackgroundAlignment,g.BackgroundColourHex)}),(0,h.jsx)("div",Object.assign({className:"dark_cover",style:(n=g.BackgroundColourHex,r=g.HasBackgroundImage,i=new jt.GB(n),o=r?.7:1,i.setA(o),{backgroundColor:i.RGBA})},{children:(0,h.jsxs)("div",Object.assign({className:"table"},{children:[(0,h.jsxs)("div",Object.assign({id:"background_dialog",className:"cell"},{children:[(0,h.jsx)("h4",Object.assign({className:"edit_password_title"},{children:"Quiz Style Settings"})),(0,h.jsx)("div",Object.assign({className:"background_options_wrapper"},{children:(0,h.jsxs)("div",Object.assign({className:"uploaded_image_left"},{children:[(0,h.jsx)("label",Object.assign({className:"main_label"},{children:"Background Image:"})),!g.HasBackgroundImage&&(0,h.jsxs)("div",Object.assign({id:"no_background_image"},{children:[(0,h.jsx)("div",{children:(0,h.jsx)("input",{type:"file",name:"BackgroundImage",id:"background_image_file",onChange:function(e){return At(e,g,(function(e){return m((t=e.FileName,{type:"UPDATE_BACKGROUND_IMAGE_FILENAME",BackgroundImageId:e.ImageId,BackgroundImageFilename:t,HasBackgroundImage:!0}));var t}))}})}),(0,h.jsx)("div",{children:(0,h.jsx)("div",Object.assign({className:"size_type_hint"},{children:"Max Size ".concat(g.MaxFileSizeMiB,"MiB. JPG, PNG, GIF, WEBP, or BMP")}))}),(0,h.jsx)("form",{id:"upload_background_image_form",method:"post",action:g.BackgroundImageUploadPath,name:"background_upload_form",encType:"multipart/form-data"})]})),g.HasBackgroundImage&&(0,h.jsxs)("div",Object.assign({id:"has_background_image"},{children:[(0,h.jsxs)("div",Object.assign({className:"background_preview"},{children:[(0,h.jsx)("div",{children:(0,h.jsx)("img",{src:"".concat(g.ImageLocation,"/content/images/quiz/").concat(g.BackgroundImageFilename),id:"background_thumbnail_preview",alt:"Background image thumbnail preview"})}),(0,h.jsx)("div",{children:(0,h.jsx)("a",Object.assign({href:"#",id:"image_background_delete",onClick:function(){return m({type:"REMOVE_BACKGROUND_IMAGE_FILENAME"})}},{children:"Remove Image"}))})]})),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",Object.assign({className:"main_label"},{children:"Background Alignment:"})),(0,h.jsxs)("ul",{children:[(0,h.jsxs)("li",{children:[(0,h.jsx)("input",{type:"radio",name:"BackgroundAlignment",value:gt.Top,checked:g.BackgroundAlignment==gt.Top,onChange:function(e){return m(zt(gt.Top))},className:"theme_radio_option",id:"background_position_left"}),(0,h.jsx)("label",Object.assign({htmlFor:"background_position_left",className:"theme_radio_label"},{children:"Top"}))]}),(0,h.jsxs)("li",{children:[(0,h.jsx)("input",{type:"radio",name:"BackgroundAlignment",value:gt.Centered,checked:g.BackgroundAlignment==gt.Centered,onChange:function(e){return m(zt(gt.Centered))},className:"theme_radio_option",id:"background_position_center"}),(0,h.jsx)("label",Object.assign({htmlFor:"background_position_center",className:"theme_radio_label"},{children:"Centered"}))]}),(0,h.jsxs)("li",{children:[(0,h.jsx)("input",{type:"radio",name:"BackgroundAlignment",value:gt.Bottom,checked:g.BackgroundAlignment==gt.Bottom,onChange:function(e){return m(zt(gt.Bottom))},className:"theme_radio_option",id:"background_position_right"}),(0,h.jsx)("label",Object.assign({htmlFor:"background_position_right",className:"theme_radio_label"},{children:"Bottom"}))]})]})]})]})),(0,h.jsx)("label",Object.assign({className:"main_label"},{children:"Generate Theme:"})),(0,h.jsxs)("ul",{children:[(0,h.jsxs)("li",{children:[(0,h.jsx)("input",{type:"radio",name:"GenerateLightOrDark",value:"light",checked:!f,onChange:function(e){return x(!1)},className:"theme_radio_option",id:"generate_light_theme"}),(0,h.jsx)("label",Object.assign({htmlFor:"generate_light_theme",className:"theme_radio_label"},{children:"Light"}))]}),(0,h.jsxs)("li",{children:[(0,h.jsx)("input",{type:"radio",name:"GenerateLightOrDark",value:"dark",checked:f,onChange:function(e){return x(!0)},className:"theme_radio_option",id:"generate_dark_theme"}),(0,h.jsx)("label",Object.assign({htmlFor:"generate_dark_theme",className:"theme_radio_label"},{children:"Dark"}))]})]}),(0,h.jsx)("div",Object.assign({className:"random_theme"},{children:(0,h.jsx)("button",Object.assign({onClick:function(){return Qt(f,g.UrlId).then((function(e){return m({type:"UPDATE_ALL_THEME_COLOURS",ButtonColourHex:(t=e).ButtonColour,ButtonTextColourHex:t.ButtonTextColour,TextColourHex:t.TextColour,BackgroundColourHex:t.BackgroundColour});var t}))}},{children:"Generate Random Theme"}))})),(0,h.jsx)("label",Object.assign({className:"main_label"},{children:"Background Color:"})),(0,h.jsx)("div",{children:(0,h.jsxs)("div",Object.assign({className:"colourpicker_wrapper extra_padding"},{children:[" ",(0,h.jsx)(_t,{ColourHex:g.BackgroundColourHex,OnChange:function(e){return m({type:"UPDATE_BACKGROUND_COLOUR_HEX",BackgroundColourHex:e})}})]}))}),(0,h.jsx)("label",Object.assign({className:"main_label"},{children:"Text Color:"})),(0,h.jsx)("div",{children:(0,h.jsx)("div",Object.assign({className:"colourpicker_wrapper extra_padding"},{children:(0,h.jsx)(_t,{ColourHex:g.TextColourHex,OnChange:function(e){return m({type:"UPDATE_TEXT_COLOUR_HEX",TextColourHex:e})}})}))}),(0,h.jsx)("label",Object.assign({className:"main_label"},{children:"Button Color:"})),(0,h.jsx)("div",{children:(0,h.jsx)("div",Object.assign({className:"colourpicker_wrapper extra_padding"},{children:(0,h.jsx)(_t,{ColourHex:g.ButtonColourHex,OnChange:function(e){return m({type:"UPDATE_BUTTON_COLOUR_HEX",ButtonColourHex:e})}})}))}),(0,h.jsx)("label",Object.assign({className:"main_label"},{children:"Button Text Color:"})),(0,h.jsx)("div",{children:(0,h.jsx)("div",Object.assign({className:"colourpicker_wrapper"},{children:(0,h.jsx)(_t,{ColourHex:g.ButtonTextColourHex,OnChange:function(e){return m({type:"UPDATE_BUTTON_TEXT_COLOUR_HEX",ButtonTextColourHex:e})}})}))})]}))})),(0,h.jsxs)("div",Object.assign({id:"background_dialog_button_wrapper"},{children:[(0,h.jsx)("div",{children:(0,h.jsx)("a",Object.assign({href:"#",id:"background_dialog_cancel",onClick:function(){dt(),m(yt(c))}},{children:"Cancel"}))}),(0,h.jsx)("div",Object.assign({className:"right"},{children:(0,h.jsx)("input",{type:"button",id:"background_dialog_save",value:"Save Quiz Style",onClick:function(){return(e=g,new Promise((function(t){Tt.ajax({type:"PUT",url:"/Api/QuizStyle",data:{UrlId:e.UrlId,BackgroundAlign:e.BackgroundAlignment,BackgroundColour:e.BackgroundColourHex,BackgroundId:e.BackgroundImageId,TextColour:e.TextColourHex,ButtonColour:e.ButtonColourHex,ButtonTextColour:e.ButtonTextColourHex},dataType:"json",success:function(e){!0===e.Success?(alert("Background updated successfully."),t()):"false"===e.update_success&&alert(e.error_message)},error:function(e,t,s){k(e,"Sorry, there was a problem updating the background. Please try again.")}})}))).then((function(){l(yt(g)),dt()}));var e}})}))]}))]})),(0,h.jsxs)("div",Object.assign({id:"background_sample_text",className:"cell",style:{color:g.TextColourHex}},{children:[(0,h.jsx)("div",{children:"Here's how your quiz text will look"}),(0,h.jsxs)("div",{children:["Make sure that this text is ",(0,h.jsxs)("span",Object.assign({className:"bold"},{children:["clearly ",(0,h.jsx)("br",{}),"visible"]}))," over the top of your background!"]}),(0,h.jsx)("div",Object.assign({className:"button_sample_wrapper"},{children:(0,h.jsx)("a",Object.assign({href:"#",id:"button_sample",className:"start_next_button",style:{backgroundColor:g.ButtonColourHex,color:g.ButtonTextColourHex,borderColor:(t=g.ButtonBorderPercentageDarken,s=g.ButtonColourHex,Pt(-t,s))}},{children:"Next Button »"}))}))]}))]}))}))]}))})},Ft=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SUGGESTED_QUIZZES"===t.type?(0,Ue.Ay)(e,(function(e){e.SuggestedQuizzes=t.SuggestedQuizzes})):e},Bt=function(e){var t=e.DiscoveryQuizzes,s=(0,a.useState)(q()),n=(0,Q.A)(s,2),r=n[0],i=n[1];return(0,h.jsx)(a.StrictMode,{children:(0,h.jsx)("div",Object.assign({className:"quiz_grid"},{children:(0,h.jsx)("div",Object.assign({id:"featured_quizzes"},{children:null==t?void 0:t.map((function(e){return(0,h.jsx)(Oe,{quiz:e,takeLaterList:r,addToTakeLaterList:function(e){return F(e,i)},removeFromTakeLaterList:function(e){return B(e,i)}},e.UrlId)}))}))}))})};var qt=s("G0y3"),Dt={margin:"0 0 12px 0",padding:"10px 10px 18px 50px",minHeight:"34px",fontSize:"1.0rem",color:"#FFFFFF",fontWeight:"bold"},Ht={display:"block",marginBottom:"17px",top:"8px",left:"6px"},Rt={background:"#0C6101 url('/content/images/quizmaker/tick_background_image.png') no-repeat 10px 10px"},Ut={background:"#7B1010 url('/content/images/welcome/login_error_background.png') no-repeat 10px 10px"};const Mt=function(e){var t=null,s=e.errorMessages,a=e.successMessages,n=e.idName,r=void 0===n?"":n;return s?t=(0,h.jsx)("div",Object.assign({id:r,className:"error_wrapper",style:Object.assign(Object.assign({},Dt),Ut)},{children:(0,h.jsx)("span",Object.assign({style:Ht},{children:s.map((function(e){return(0,h.jsx)("p",{children:e})}))}))})):a&&(t=(0,h.jsx)("div",Object.assign({id:r,className:"quizmaker_success success_wrapper",style:Object.assign(Object.assign({},Dt),Rt)},{children:(0,h.jsx)("span",Object.assign({style:Ht},{children:a.map((function(e){return(0,h.jsx)("p",{children:e})}))}))}))),t};s("vpQ+"),s("wEdE");var Vt=s("qIEf");var Gt=s("egaP"),Wt=s("q6Cd"),Xt=s("Wk0m"),Jt=s("3wg+");s.n(Jt)()(Xt);var Zt=function(e,t,s){return Xt.string().label(e).required("Please enter a ".concat(e)).password().min(t).max(s).minLowercase(1).minUppercase(1).minNumbers(1).minSymbols(1)};s("ACdA");const Yt=function(e){var t;return(0,h.jsx)("svg",Object.assign({className:e.className,viewBox:"0 0 82 82",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:(0,h.jsx)("path",{d:"M63.6111 49.2222H69.7778C74.3189 49.2222 78 45.5411 78 41V12.2222C78 7.68121 74.3189 4 69.7778 4H41C36.4589 4 32.7778 7.68121 32.7778 12.2222V18.3889M12.2222 32.7778H41C45.5411 32.7778 49.2222 36.4589 49.2222 41V69.7778C49.2222 74.3189 45.5411 78 41 78H12.2222C7.68121 78 4 74.3189 4 69.7778V41C4 36.4589 7.68121 32.7778 12.2222 32.7778Z",stroke:null!==(t=e.colour)&&void 0!==t?t:"#FFFFFF",strokeWidth:"7",strokeLinecap:"round",strokeLinejoin:"round"})}))},Kt=function(e){var t,s;return(0,h.jsxs)("svg",Object.assign({className:e.className,viewBox:"0 0 23 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:[(0,h.jsx)("g",Object.assign({clipPath:"url(#clip0_21_17)"},{children:(0,h.jsx)("path",{d:"M3.12935 7.6474L3.12829 7.65838L3.12776 7.6694L3.11852 7.86256L3.118 7.87352V7.88449V18.5814C3.118 19.8652 4.10323 20.9155 5.3578 21.0346L5.36865 21.0357L5.37952 21.0362L5.57395 21.0454L5.58476 21.0459H5.59559H16.3624C17.648 21.0459 18.7082 20.071 18.8287 18.8185L18.8297 18.8075L18.8302 18.7965L18.8395 18.6033L18.84 18.5924V18.5814V17.2443C18.84 17.1313 18.9331 17.0345 19.0541 17.0345C19.1555 17.0345 19.2385 17.1033 19.2617 17.1921L19.2682 17.2649V18.5814C19.2682 20.1053 18.0757 21.3574 16.5612 21.4587L16.355 21.4654H5.59559C4.05498 21.4654 2.79807 20.2766 2.69643 18.7785L2.68977 18.5739V7.88449C2.68977 6.36061 3.88234 5.10848 5.39677 5.00715L5.60296 5.00052H9.63315C9.75422 5.00052 9.84727 5.09724 9.84727 5.21026C9.84727 5.30559 9.78105 5.38968 9.68723 5.41337L9.61277 5.42H5.59559C4.31001 5.42 3.24981 6.39487 3.12935 7.6474ZM9.10454 9.78565C10.3427 8.40486 12.0469 7.57369 14.2398 7.33492L14.5862 7.30251L14.8824 7.28271L15.3106 7.25409V6.82492V3.9772C15.3106 3.73417 15.5502 3.60738 15.7255 3.68773L15.7778 3.72055L15.8236 3.75972L21.8651 9.66058L21.8651 9.6606C21.9623 9.7555 21.9865 9.9041 21.9302 10.0252L21.8944 10.0819L21.8528 10.1292L15.8127 16.0305C15.6586 16.1811 15.3986 16.1203 15.3281 15.9132L15.3147 15.8498L15.3106 15.7875V13.0004V12.4987L14.811 12.5434L14.4641 12.5744L14.4641 12.5744L14.4566 12.5752C14.1067 12.6123 13.759 12.6665 13.4134 12.7377L13.4133 12.7377C11.255 13.1827 9.19346 14.2891 7.2192 16.0405L7.21916 16.0405C7.02828 16.2099 6.69277 16.0682 6.73027 15.7626C7.04991 13.1581 7.85983 11.1738 9.10454 9.78565Z",stroke:null!==(t=e.colour)&&void 0!==t?t:"#FFFFFF",strokeWidth:"0.917627"})})),(0,h.jsx)("defs",{children:(0,h.jsx)("clipPath",Object.assign({id:"clip0_21_17"},{children:(0,h.jsx)("rect",{width:"22.023",height:"22.023",fill:null!==(s=e.colour)&&void 0!==s?s:"#FFFFFF",transform:"translate(0.762695 0.635254)"})}))})]}))};var $t;!function(e){e[e.Initial=0]="Initial",e[e.Copied=1]="Copied",e[e.Error=2]="Error"}($t||($t={}));s("niGr");var es,ts,ss=s("qIEf");!function(e){e[e.QuizShare=0]="QuizShare"}(es||(es={})),function(e){e[e.X=0]="X",e[e.Facebook=1]="Facebook",e[e.Tumblr=2]="Tumblr",e[e.Reddit=3]="Reddit",e[e.Pinterest=4]="Pinterest",e[e.FacebookMessenger=5]="FacebookMessenger",e[e.WhatsApp=6]="WhatsApp",e[e.CopyQuizLink=7]="CopyQuizLink",e[e.NativeShare=8]="NativeShare"}(ts||(ts={}));var as=s("qIEf"),ns=function(e){if(""===e)return null;var t=Number(e);return isNaN(t)?e:t};const rs=function(e){try{var t=document.getElementById("quiz_wrapper"),s=t.getAttribute("data-quiz-url-id"),a=t.getAttribute("data-personality-id"),n=t.getAttribute("data-result-percentage");gtag("event",ts[e],{event_category:"shared",event_label:as("div#quiz_wrapper").attr("data-quiz-url-id")}),function(e,t,s,a){var n=ss(document).find('input[name="__RequestVerificationToken"]').val();return new Promise((function(r,i){ss.ajax({type:"POST",url:"/Api/QuizEvent/RecordEvent",data:JSON.stringify({UrlId:t,PersonalityResultId:s,PercentageResult:a,EventContext:ts[e]}),processData:!1,contentType:"application/json",headers:{RequestVerificationToken:n},dataType:"json",success:function(){r()},error:function(e,t,s){i()}})}))}(e,s,ns(a),ns(n)).then((function(){}))}catch(e){console.log(e)}};s.g.React=n,s.g.ReactDOM=r,s.g.ReactDOMServer=i,s.g.CollectedDataList=y,s.g.CustomTweets=P,s.g.RecentQuizView=function(e){var t=(0,a.useState)(e.RecentQuizzes),s=(0,Q.A)(t,2),n=s[0],r=(s[1],(0,a.useState)(q())),i=(0,Q.A)(r,2),o=i[0],c=i[1];return(0,h.jsxs)(a.StrictMode,{children:[(0,h.jsx)("div",Object.assign({className:"quiz_grid"},{children:(0,h.jsx)("div",Object.assign({id:"featured_quizzes"},{children:null==n?void 0:n.map((function(e){return(0,h.jsx)(Z,{quiz:e,takeLaterList:o,addToTakeLaterList:function(e){return F(e,c)},removeFromTakeLaterList:function(e){return B(e,c)}},e.UrlId)}))}))})),(0,h.jsx)("div",{children:(0,h.jsx)("button",{type:"button",onClick:function(){return H()}})})]})},s.g.FeaturedQuizzes=function(e){var t,s,n,r=(0,a.useState)(e.Quizzes),i=(0,Q.A)(r,2),o=i[0],c=i[1],l=(0,a.useState)(q()),u=(0,Q.A)(l,2),d=u[0],g=u[1],m=(0,a.useState)(e.FilterType),p=(0,Q.A)(m,2),j=p[0],f=p[1],x=(0,a.useState)(e.MaxPageNumber),v=(0,Q.A)(x,2),b=v[0],_=v[1],y=(0,a.useState)(e.PageNumber),z=(0,Q.A)(y,2),T=z[0],k=z[1],N=(0,a.useState)(e.TimePeriod),O=(0,Q.A)(N,2),w=O[0],C=O[1],S=(0,a.useState)(je.Idle),A=(0,Q.A)(S,2),I=A[0],P=A[1],L=we(d,g),E=function(e,t){return function(s){return(0,h.jsx)(Oe,{quiz:s,takeLaterList:e,addToTakeLaterList:function(e){return F(e,t)},removeFromTakeLaterList:function(e){return B(e,t)}},s.UrlId)}}(d,g),D=(0,h.jsx)(h.Fragment,{});switch(I){case je.Idle:D=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Y,{quizzes:o,getQuizItemCompact:E}),(t=e.Filters,(!(null==t?void 0:t.Tag)||(s=be,n=null==t?void 0:t.Tag,!s.some((function(e){return-1!==n.toLowerCase().search(e.toLowerCase())}))))&&(0,h.jsx)(le,{hideAdverts:e.HideAdverts,advertisementProvider:e.AdvertisementProvider,style:{marginBottom:"2.0rem"}})),(0,h.jsx)(ue,{quizzes:o.slice(5),getQuizItem:L,getQuizItemCompact:E,setQuizzes:c,filters:e.Filters})]});break;case je.Loading:D=(0,h.jsxs)("div",Object.assign({className:"loader"},{children:["Loading...",(0,h.jsx)("span",{className:"spinner"})]}));break;case je.Error:D=(0,h.jsx)("div",Object.assign({className:"loader"},{children:"Error Loading"}))}return(0,h.jsxs)(h.Fragment,{children:[!e.Filters&&(0,h.jsx)(fe,{setQuizzes:c,setPageNumber:k,filters:e.Filters,filterType:j,setFilterType:f,setIsLoading:P,locale:e.Locale,links:e.Links,pageNumber:T,pageSize:e.PageSize,setMaxPageNumber:_,filterTimePeriod:w,setFilterTimePeriod:C}),(0,h.jsx)(ve,{filters:e.Filters,filterType:j}),D,(0,h.jsx)("div",Object.assign({className:"pagination"},{children:(0,h.jsxs)("div",Object.assign({className:"buttons"},{children:[T>1&&(0,h.jsx)("div",{children:(0,h.jsx)(Ce.$,Object.assign({className:"back_button",onClick:function(e){return window.location.href="?p=".concat(T-1,"&t=").concat(w)},onTouchStart:function(e){return window.location.href="?p=".concat(T-1,"&t=").concat(w)}},{children:"« Back"}))}),T0&&(0,h.jsx)(st,{quizzes:f,takeLaterList:_,setTakeLaterList:y})]})),(0,h.jsx)(ot,{urlId:r,takeLaterList:_,setTakeLaterList:y,sideBarOpen:c})]}))}))]}))})},s.g.QuizStyle=function(e){var t=(0,a.useReducer)(ct,e),s=(0,Q.A)(t,2),n=s[0],r=s[1];return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(mt,{state:n,dispatch:r}),(0,h.jsx)(Et,{summaryState:n,summaryDispatch:r})]})},s.g.QuizStartMoreQuizzes=function(e){var t=(0,a.useReducer)(Ft,e),s=(0,Q.A)(t,2),n=s[0];return s[1],(0,h.jsx)(a.StrictMode,{children:(0,h.jsx)(Bt,{DiscoveryQuizzes:n.SuggestedQuizzes})})},s.g.YourAccountChangePassword=function(e){var t,s,n=e.AntiForgeryToken,r=e.MaxLength,i=e.MinLength,o=(e.PasswordRegex,(0,a.useState)(null)),c=(0,Q.A)(o,2),l=c[0],u=c[1],d=(0,a.useState)(null),g=(0,Q.A)(d,2),m=g[0],p=g[1],j=function(){u(null),p(null)},f=(t=i,s=r,Xt.object().shape({CurrentPassword:Xt.string().label("Current Password").required(),NewPassword:Zt("New Password",t,s),NewPasswordConfirm:Zt("New Password Confirmation",t,s).oneOf([Xt.ref("NewPassword"),null],"New password and New Password Confirmation must match")})),x=(0,Gt.mN)({resolver:(0,Wt.t)(f)}),v=x.control,b=x.handleSubmit,_=x.formState.errors,y=x.reset,z=x.setError;return(0,h.jsxs)(a.StrictMode,{children:[(0,h.jsx)(Mt,{successMessages:l,errorMessages:m,idName:"quiz_settings_validation_error"}),(0,h.jsxs)("div",Object.assign({className:"change_password_wrapper"},{children:[(0,h.jsx)("p",{children:"Here you can change the password that you use to log in to uQuiz."}),(0,h.jsxs)("p",{children:["Passwords must be between ",i," and ",r," characters in length and have at least one non alphanumeric character, at least one digit ('0'-'9') and must have at least one uppercase ('A'-'Z')."]}),(0,h.jsx)("div",Object.assign({className:"form"},{children:(0,h.jsxs)("form",Object.assign({onSubmit:b((function(e){return function(e,t,s,a,n,r,i,o,c){return i(),new Promise((function(s){Vt.ajax({type:"POST",url:"/Api/ChangePassword",data:JSON.stringify(e),processData:!1,contentType:"application/json",headers:{RequestVerificationToken:t},dataType:"json",success:function(e){!0===e.Success?(r(["Password was changed successfully!"]),o(),s()):!1===e.Success&&(n(["Password was not saved. Please try again"]),s())},error:function(e,t,a){for(var r=JSON.parse(e.responseText),i=Object.keys(r),o=[],l=0;l{e.O(0,[96],(()=>("4u3d",e(e.s="4u3d")))),e.O()}]);