-
Notifications
You must be signed in to change notification settings - Fork 0
/
component---src-pages-feedback-jsx-a3d525e2d8080ce2914e.js
3 lines (3 loc) · 15.5 KB
/
component---src-pages-feedback-jsx-a3d525e2d8080ce2914e.js
1
2
3
/*! For license information please see component---src-pages-feedback-jsx-a3d525e2d8080ce2914e.js.LICENSE.txt */
(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{"4Ikp":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=s(n("q1tI")),i=s(n("TSYQ")),o=s(n("17x9"));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){return l(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"render",value:function(){var e=this.props,t=e.changeRating,n=e.hoverOverStar,a=e.unHoverOverStar,i=e.svgIconViewBox,o=e.svgIconPath;return r.default.createElement("div",{className:"star-container",style:this.starContainerStyle,onMouseEnter:n,onMouseLeave:a,onClick:t},r.default.createElement("svg",{viewBox:i,className:this.starClasses,style:this.starSvgStyle},r.default.createElement("path",{className:"star",style:this.pathStyle,d:o})))}},{key:"starContainerStyle",get:function(){var e=this.props,t=e.changeRating,n=e.starSpacing,a=e.isFirstStar,r=e.isLastStar;return e.ignoreInlineStyles?{}:{position:"relative",display:"inline-block",verticalAlign:"middle",paddingLeft:a?void 0:n,paddingRight:r?void 0:n,cursor:t?"pointer":void 0}}},{key:"starSvgStyle",get:function(){var e=this.props,t=e.ignoreInlineStyles,n=e.isCurrentHoveredStar,a=e.starDimension;return t?{}:{width:a,height:a,transition:"transform .2s ease-in-out",transform:n?"scale(1.1)":void 0}}},{key:"pathStyle",get:function(){var e=this.props,t=e.isStarred,n=e.isPartiallyFullStar,a=e.isHovered,r=e.hoverMode,i=e.starEmptyColor,o=e.starRatedColor,s=e.starHoverColor,l=e.gradientPathName,u=e.fillId,d=void 0;return d=r?a?s:i:n?"url('"+l+"#"+u+"')":t?o:i,e.ignoreInlineStyles?{}:{fill:d,transition:"fill .2s ease-in-out"}}},{key:"starClasses",get:function(){var e=this.props,t=e.isSelected,n=e.isPartiallyFullStar,a=e.isHovered,r=e.isCurrentHoveredStar,o=e.ignoreInlineStyles,s=(0,i.default)({"widget-svg":!0,"widget-selected":t,"multi-widget-selected":n,hovered:a,"current-hovered":r});return o?{}:s}}]),t}(r.default.Component);d.propTypes={fillId:o.default.string.isRequired,changeRating:o.default.func,hoverOverStar:o.default.func,unHoverOverStar:o.default.func,isStarred:o.default.bool.isRequired,isPartiallyFullStar:o.default.bool.isRequired,isHovered:o.default.bool.isRequired,hoverMode:o.default.bool.isRequired,isCurrentHoveredStar:o.default.bool.isRequired,isFirstStar:o.default.bool.isRequired,isLastStar:o.default.bool.isRequired,starDimension:o.default.string.isRequired,starSpacing:o.default.string.isRequired,starHoverColor:o.default.string.isRequired,starRatedColor:o.default.string.isRequired,starEmptyColor:o.default.string.isRequired,gradientPathName:o.default.string.isRequired,ignoreInlineStyles:o.default.bool.isRequired,svgIconPath:o.default.string.isRequired,svgIconViewBox:o.default.string.isRequired},t.default=d},"6Egq":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=s(n("q1tI")),i=s(n("17x9")),o=s(n("4Ikp"));function s(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){var e,n,a;l(this,t);for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=a=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),a.state={highestStarHovered:-1/0},a.fillId="starGrad"+Math.random().toFixed(15).slice(2),a.hoverOverStar=function(e){return function(){a.setState({highestStarHovered:e})}},a.unHoverOverStar=function(){a.setState({highestStarHovered:-1/0})},u(a,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"stopColorStyle",value:function(e){var t={stopColor:e,stopOpacity:"1"};return this.props.ignoreInlineStyles?{}:t}},{key:"render",value:function(){var e=this.props,t=e.starRatedColor,n=e.starEmptyColor;return r.default.createElement("div",{className:"star-ratings",title:this.titleText,style:this.starRatingsStyle},r.default.createElement("svg",{className:"star-grad",style:this.starGradientStyle},r.default.createElement("defs",null,r.default.createElement("linearGradient",{id:this.fillId,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},r.default.createElement("stop",{offset:"0%",className:"stop-color-first",style:this.stopColorStyle(t)}),r.default.createElement("stop",{offset:this.offsetValue,className:"stop-color-first",style:this.stopColorStyle(t)}),r.default.createElement("stop",{offset:this.offsetValue,className:"stop-color-final",style:this.stopColorStyle(n)}),r.default.createElement("stop",{offset:"100%",className:"stop-color-final",style:this.stopColorStyle(n)})))),this.renderStars)}},{key:"starRatingsStyle",get:function(){return this.props.ignoreInlineStyles?{}:{position:"relative",boxSizing:"border-box",display:"inline-block"}}},{key:"starGradientStyle",get:function(){return this.props.ignoreInlineStyles?{}:{position:"absolute",zIndex:"0",width:"0",height:"0",visibility:"hidden"}}},{key:"titleText",get:function(){var e=this.props,t=e.typeOfWidget,n=e.rating,a=this.state.highestStarHovered,r=a>0?a:n,i=parseFloat(r.toFixed(2)).toString();Number.isInteger(r)&&(i=String(r));var o=t+"s";return"1"===i&&(o=t),i+" "+o}},{key:"offsetValue",get:function(){var e=this.props.rating,t="0%";Number.isInteger(e)||(t=e.toFixed(2).split(".")[1].slice(0,2)+"%");return t}},{key:"renderStars",get:function(){var e=this,t=this.props,n=t.changeRating,a=t.rating,i=t.numberOfStars,s=t.starDimension,l=t.starSpacing,u=t.starRatedColor,d=t.starEmptyColor,c=t.starHoverColor,f=t.gradientPathName,p=t.ignoreInlineStyles,h=t.svgIconPath,m=t.svgIconViewBox,g=t.name,y=this.state.highestStarHovered;return Array.apply(null,Array(i)).map((function(t,v){var b=v+1,S=b<=a,E=y>0,C=b<=y,q=b===y,R=b>a&&b-1<a,w=1===b,O=b===i;return r.default.createElement(o.default,{key:b,fillId:e.fillId,changeRating:n?function(){return n(b,g)}:null,hoverOverStar:n?e.hoverOverStar(b):null,unHoverOverStar:n?e.unHoverOverStar:null,isStarred:S,isPartiallyFullStar:R,isHovered:C,hoverMode:E,isCurrentHoveredStar:q,isFirstStar:w,isLastStar:O,starDimension:s,starSpacing:l,starHoverColor:c,starRatedColor:u,starEmptyColor:d,gradientPathName:f,ignoreInlineStyles:p,svgIconPath:h,svgIconViewBox:m})}))}}]),t}(r.default.Component);d.propTypes={rating:i.default.number.isRequired,numberOfStars:i.default.number.isRequired,changeRating:i.default.func,starHoverColor:i.default.string.isRequired,starRatedColor:i.default.string.isRequired,starEmptyColor:i.default.string.isRequired,starDimension:i.default.string.isRequired,starSpacing:i.default.string.isRequired,gradientPathName:i.default.string.isRequired,ignoreInlineStyles:i.default.bool.isRequired,svgIconPath:i.default.string.isRequired,svgIconViewBox:i.default.string.isRequired,name:i.default.string},d.defaultProps={rating:0,typeOfWidget:"Star",numberOfStars:5,changeRating:null,starHoverColor:"rgb(230, 67, 47)",starRatedColor:"rgb(109, 122, 130)",starEmptyColor:"rgb(203, 211, 227)",starDimension:"50px",starSpacing:"7px",gradientPathName:"",ignoreInlineStyles:!1,svgIconPath:"m25,1 6,17h18l-14,11 5,17-15-10-15,10 5-17-14-11h18z",svgIconViewBox:"0 0 51 48"},t.default=d},DDnO:function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return o}));var a=n("dI71"),r=n("q1tI");const i=t=>e.createElement("input",{className:"mucapp",onChange:e=>t.onChange(e.target),autoComplete:"off",name:t.name,type:t.type,min:t.min,max:t.max,value:t.value,readOnly:t.disabled,placeholder:t.placeholder,css:{...t.styles}});let o=function(t){function n(){for(var e,n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return(e=t.call.apply(t,[this].concat(a))||this).state={value:""},e}Object(a.a)(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){this.setState({value:e.children})},r.render=function(){let t=this.props;return e.createElement("textarea",{className:"mucapp",onChange:e=>t.onChange(e.target),autoComplete:"off",name:t.name,type:t.type,placeholder:t.placeholder,css:{...t.styles},value:this.state.value})},n}(n.n(r).a.Component);const s=t=>e.createElement("button",{css:{...t.styles,margin:2},className:"mucapp",onClick:t.onClick,disabled:!!t.disabled&&"disabled"},t.children)}).call(this,n("iMUK"))},HWVD:function(e,t,n){},JX7q:function(e,t,n){"use strict";function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return a}))},LmXM:function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"default",(function(){return d}));var a=n("JX7q"),r=n("dI71"),i=n("q1tI"),o=n.n(i),s=n("oOSY"),l=n.n(s),u=n("DDnO");n("mWtZ"),n("HWVD");let d=function(t){function n(n){var r;return(r=t.call(this,n)||this).BUTTON_NORMAL="Submit",r.BUTTON_CLICKED="Submitting...",r.state={submitted:!1,button:r.BUTTON_NORMAL},r.handleSubmit=async e=>{e.preventDefault(),await r.setState({button:r.BUTTON_CLICKED}),"undefined"!=typeof window&&window.fetch("https://usebasin.com/f/71436ab3ce6c.json",{method:"POST",body:JSON.stringify({"Which elements of Utsav 2019 did you like the most?":r.state.question1,"How useful was Utsav Android App?":r.state.question2,"How were the quality of events?":r.state.question3,"How would you rate the organization of Utsav?":r.state.question4,"Is there anything that would have made experience of Utsav better?":r.state.question5,"How likely are you to recommend Utsav to your friends/acquaintances?":r.state.question6,"Are you a male or female?":r.state.question7,"Are you a student or staff?":r.state.question8}),headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(()=>{r.setState({submitted:!0})})},r.render=()=>!1===r.state.submitted?e.createElement("div",{style:{padding:20},className:"feedback"},e.createElement("h1",{className:"mucapp"}," Feedback for Utsav ",(new Date).getFullYear()),e.createElement("form",{onSubmit:r.handleSubmit,css:{display:"flex",flexDirection:"column"}},e.createElement("div",{css:{display:"flex",flexDirection:"column",padding:20}},e.createElement("label",{htmlFor:"question1"},"Which elements of Utsav 2022 did you like the most?"),e.createElement("textarea",{id:"question1",rows:"4",name:"question1",onChange:r.handleChange,placeholder:"Feedback",required:!0})),e.createElement("div",{css:{display:"flex",flexDirection:"column",padding:20}},e.createElement("label",{htmlFor:"question2"},"How useful was Utsav Android App?"),e.createElement(l.a,{rating:r.state.question2,starRatedColor:"gold",changeRating:e=>r.handleRating("question2",e),numberOfStars:5})),e.createElement("div",{css:{display:"flex",flexDirection:"column",padding:20}},e.createElement("label",{htmlFor:"android-app"},"How were the quality of events?"),e.createElement(l.a,{rating:r.state.question3,starRatedColor:"gold",changeRating:e=>r.handleRating("question3",e),numberOfStars:5})," "),e.createElement("div",{css:{display:"flex",flexDirection:"column",padding:20}},e.createElement("label",{htmlFor:"android-app"},"How would you rate the organization of Utsav?"),e.createElement(l.a,{rating:r.state.question4,starRatedColor:"gold",changeRating:e=>r.handleRating("question4",e),numberOfStars:5})),e.createElement("div",{css:{display:"flex",flexDirection:"column",padding:20}},e.createElement("label",{htmlFor:"elements"},"Is there anything that would have made experience of Utsav better?"),e.createElement("textarea",{id:"elements",rows:"4",name:"question5",value:r.state.question5,onChange:r.handleChange,placeholder:"Feedback",required:!0})),e.createElement("div",{css:{display:"flex",flexDirection:"column",padding:20}},e.createElement("label",{htmlFor:"android-app"},"How likely are you to recommend Utsav to your friends/acquaintances?"),e.createElement(l.a,{rating:r.state.question6,starRatedColor:"gold",changeRating:e=>r.handleRating("question6",e),numberOfStars:5})),e.createElement("div",{css:{padding:20}},e.createElement("label",{htmlFor:"android-app"},"Are you a: "),e.createElement("input",{type:"radio",name:"question7",onChange:r.handleChange,value:"male",id:"male"}),e.createElement("label",{htmlFor:"male"},"Male"),e.createElement("input",{type:"radio",name:"question7",onChange:r.handleChange,value:"female",id:"female"}),e.createElement("label",{htmlFor:"female"},"Female")),e.createElement("div",{css:{display:"flex",flexDirection:"column",padding:20}},e.createElement("label",{htmlFor:"android-app"},"You are a "),e.createElement("select",{name:"question8",onBlur:r.handleChange,value:r.state.question8},e.createElement("option",null,"Student"),e.createElement("option",null,"Staff"),e.createElement("option",null,"None of above"))),e.createElement("input",{type:"hidden",id:"gotcha",name:"_gotcha"}),e.createElement("div",{css:{display:"flex",flexDirection:"column",padding:20}},e.createElement(u.a,{styles:{padding:40},type:"submit"},r.state.button)))):e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},e.createElement("h1",{className:"mucapp"}," Thank you for your valuable feedback :)")),r.handleRating=r.handleRating.bind(Object(a.a)(r)),r.handleChange=r.handleChange.bind(Object(a.a)(r)),r}Object(r.a)(n,t);var i=n.prototype;return i.handleChange=function(e){this.setState({[e.target.name]:e.target.value})},i.handleRating=function(e,t){this.setState({[e]:t})},n}(o.a.PureComponent)}.call(this,n("iMUK"))},TSYQ:function(e,t,n){var a;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var i=typeof a;if("string"===i||"number"===i)e.push(a);else if(Array.isArray(a)){if(a.length){var o=r.apply(null,a);o&&e.push(o)}}else if("object"===i)if(a.toString===Object.prototype.toString)for(var s in a)n.call(a,s)&&a[s]&&e.push(s);else e.push(a.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(a=function(){return r}.apply(t,[]))||(e.exports=a)}()},mWtZ:function(e,t,n){},oOSY:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,r=n("6Egq"),i=(a=r)&&a.__esModule?a:{default:a};Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.default=i.default}}]);
//# sourceMappingURL=component---src-pages-feedback-jsx-a3d525e2d8080ce2914e.js.map