/**handles:um_raty**/
!function(i){"use strict";var r={init:function(t){return this.each(function(){this.self=i(this),r.destroy.call(this.self),this.opt=i.extend(!0,{},i.fn.um_raty.defaults,t),r._adjustCallback.call(this),r._adjustNumber.call(this),"img"!==this.opt.starType&amp;&amp;r._adjustStarType.call(this),r._adjustPath.call(this),r._createStars.call(this),this.opt.cancel&amp;&amp;r._createCancel.call(this),this.opt.precision&amp;&amp;r._adjustPrecision.call(this),r._createScore.call(this),r._apply.call(this,this.opt.score),r._target.call(this,this.opt.score),(this.opt.readOnly?r._lock:(this.style.cursor="pointer",r._binds)).call(this),this.self.data("options",this.opt)})},_adjustCallback:function(){for(var t=["number","readOnly","score","scoreName","target"],e=0;e&lt;t.length;e++)&quot;function&quot;==typeof this.opt[t[e]]&amp;&amp;(this.opt[t[e]]=this.opt[t[e]].call(this))},_adjustNumber:function(){this.opt.number=r._between(this.opt.number,1,this.opt.numberMax)},_adjustPath:function(){this.opt.path=this.opt.path||&quot;&quot;,this.opt.path&amp;&amp;&quot;/&quot;!==this.opt.path.charAt(this.opt.path.length-1)&amp;&amp;(this.opt.path+=&quot;/&quot;)},_adjustPrecision:function(){this.opt.half=!0,this.opt.targetType=&quot;score&quot;},_adjustStarType:function(){this.opt.path=&quot;&quot;;for(var t=[&quot;cancelOff&quot;,&quot;cancelOn&quot;,&quot;starHalf&quot;,&quot;starOff&quot;,&quot;starOn&quot;],e=0;e&lt;t.length;e++)this.opt[t[e]]=this.opt[t[e]].replace(&quot;.&quot;,&quot;-&quot;)},_apply:function(t){r._fill.call(this,t),t&amp;&amp;(0&lt;t&amp;&amp;this.score.val(r._between(t,0,this.opt.number)),r._roundStars.call(this,t))},_between:function(t,e,a){return Math.min(Math.max(parseFloat(t),e),a)},_binds:function(){this.cancel&amp;&amp;(r._bindOverCancel.call(this),r._bindClickCancel.call(this),r._bindOutCancel.call(this)),r._bindOver.call(this),r._bindClick.call(this),r._bindOut.call(this)},_bindClick:function(){var a=this;a.stars.on(&quot;click.um_raty&quot;,function(t){var e=i(this);a.score.val(a.opt.half||a.opt.precision?a.self.data(&quot;score&quot;):this.alt||e.data(&quot;alt&quot;)),a.opt.click&amp;&amp;a.opt.click.call(a,+a.score.val(),t)})},_bindClickCancel:function(){var e=this;e.cancel.on(&quot;click.um_raty&quot;,function(t){e.score.removeAttr(&quot;value&quot;),e.opt.click&amp;&amp;e.opt.click.call(e,null,t)})},_bindOut:function(){var a=this;a.self.on(&quot;mouseleave.um_raty&quot;,function(t){var e=+a.score.val()||void 0;r._apply.call(a,e),r._target.call(a,e,t),a.opt.mouseout&amp;&amp;a.opt.mouseout.call(a,e,t)})},_bindOutCancel:function(){var a=this;a.cancel.on(&quot;mouseleave.um_raty&quot;,function(t){var e=a.opt.cancelOff;&quot;img&quot;!==a.opt.starType&amp;&amp;(e=a.opt.cancelClass+&quot; &quot;+e),r._setIcon.call(a,this,e),a.opt.mouseout&amp;&amp;(e=+a.score.val()||void 0,a.opt.mouseout.call(a,e,t))})},_bindOver:function(){var a=this,t=a.opt.half?&quot;mousemove.um_raty&quot;:&quot;mouseover.um_raty&quot;;a.stars.on(t,function(t){var e=r._getScoreByPosition.call(a,t,this);r._fill.call(a,e),a.opt.half&amp;&amp;(r._roundStars.call(a,e),a.self.data(&quot;score&quot;,e)),r._target.call(a,e,t),a.opt.mouseover&amp;&amp;a.opt.mouseover.call(a,e,t)})},_bindOverCancel:function(){var s=this;s.cancel.on(&quot;mouseover.um_raty&quot;,function(t){var e=s.opt.path+s.opt.starOff,a=s.opt.cancelOn;&quot;img&quot;===s.opt.starType?s.stars.attr(&quot;src&quot;,e):(a=s.opt.cancelClass+&quot; &quot;+a,s.stars.attr(&quot;class&quot;,e)),r._setIcon.call(s,this,a),r._target.call(s,null,t),s.opt.mouseover&amp;&amp;s.opt.mouseover.call(s,null)})},_buildScoreField:function(){return i(&quot;",{name:this.opt.scoreName,type:"hidden"}).appendTo(this)},_createCancel:function(){var t=this.opt.path+this.opt.cancelOff,e=i("",{title:this.opt.cancelHint,class:this.opt.cancelClass});"img"===this.opt.starType?e.attr({src:t,alt:"x"}):e.attr("data-alt","x").addClass(t),"left"===this.opt.cancelPlace?this.self.prepend("&#160;").prepend(e):this.self.append("&#160;").append(e),this.cancel=e},_createScore:function(){var t=i(this.opt.targetScore);this.score=t.length?t:r._buildScoreField.call(this)},_createStars:function(){for(var t=1;t&lt;=this.opt.number;t++){var e=r._nameForIndex.call(this,t),e={alt:t,src:this.opt.path+this.opt[e]};(e=&quot;img&quot;!==this.opt.starType?{&quot;data-alt&quot;:t,class:e.src}:e).title=r._getHint.call(this,t),i(&quot;",e).appendTo(this),this.opt.space&amp;&amp;this.self.append(t&lt;this.opt.number?&quot;&#160;&quot;:&quot;&quot;)}this.stars=this.self.children(this.opt.starType)},_error:function(t){i(this).text(t),i.error(t)},_fill:function(t){for(var e=0,a=1;ae?(s=this.opt.iconRange[e],i=r._getRangeIcon.call(this,s,n),a&lt;=s.range&amp;&amp;r._setIcon.call(this,o,i),a===s.range&amp;&amp;e++):(i=this.opt[n?&quot;starOn&quot;:&quot;starOff&quot;],r._setIcon.call(this,o,i))}},_getRangeIcon:function(t,e){return e?t.on||this.opt.starOn:t.off||this.opt.starOff},_getScoreByPosition:function(t,e){var a,s=parseInt(e.alt||e.getAttribute(&quot;data-alt&quot;),10);return this.opt.half&amp;&amp;(a=r._getSize.call(this),t=parseFloat((t.pageX-i(e).offset().left)/a),s=this.opt.precision?s-1+t:s-1+(.5&lt;t?1:.5)),s},_getSize:function(){var t=&quot;img&quot;===this.opt.starType?this.stars[0].width:parseFloat(this.stars.eq(0).css(&quot;font-size&quot;));return t||r._error.call(this,&quot;Could not be possible get the icon size!&quot;),t},_turnOn:function(t,e){return this.opt.single?t===e:t=t?"starOn":"starOff"},_roundStars:function(t){var e,a=(t%1).toFixed(2);a&gt;this.opt.round.down&amp;&amp;(e="starOn",this.opt.halfShow&amp;&amp;a&lt;this.opt.round.up?e=&quot;starHalf&quot;:a&lt;this.opt.round.full&amp;&amp;(e=&quot;starOff&quot;),a=this.opt[e],e=this.stars[Math.ceil(t)-1],r._setIcon.call(this,e,a))},_setIcon:function(t,e){t[&quot;img&quot;===this.opt.starType?&quot;src&quot;:&quot;className&quot;]=this.opt.path+e},_setTarget:function(t,e){e=e&amp;&amp;this.opt.targetFormat.toString().replace(&quot;{score}&quot;,e),t.is(&quot;:input&quot;)?t.val(e):t.html(e)},_target:function(t,e){var a,s;this.opt.target&amp;&amp;((a=i(this.opt.target)).length||r._error.call(this,&quot;Target selector invalid or missing!&quot;),s=e&amp;&amp;&quot;mouseover&quot;===e.type,void 0===t?t=this.opt.targetText:null===t?t=s?this.opt.cancelHint:this.opt.targetText:(&quot;hint&quot;===this.opt.targetType?t=r._getHint.call(this,Math.ceil(t)):this.opt.precision&amp;&amp;(t=parseFloat(t).toFixed(1)),e=e&amp;&amp;&quot;mousemove&quot;===e.type,s||e||this.opt.targetKeep||(t=this.opt.targetText)),r._setTarget.call(this,a,t))},_unlock:function(){this.style.cursor=&quot;pointer&quot;,this.removeAttribute(&quot;title&quot;),this.score.removeAttr(&quot;readonly&quot;),this.self.data(&quot;readonly&quot;,!1);for(var t=0;t&lt;this.opt.number;t++)this.stars[t].title=r._getHint.call(this,t+1);this.cancel&amp;&amp;this.cancel.css(&quot;display&quot;,&quot;&quot;)},cancel:function(e){return this.each(function(){var t=i(this);!0!==t.data(&quot;readonly&quot;)&amp;&amp;(r[e?&quot;click&quot;:&quot;score&quot;].call(t,null),this.score.removeAttr(&quot;value&quot;))})},click:function(t){return this.each(function(){!0!==i(this).data(&quot;readonly&quot;)&amp;&amp;(r._apply.call(this,t),this.opt.click&amp;&amp;this.opt.click.call(this,t,i.Event(&quot;click&quot;)),r._target.call(this,t))})},destroy:function(){return this.each(function(){var t=i(this),e=t.data(&quot;raw&quot;);e?t.off(&quot;.um_raty&quot;).empty().css({cursor:e.style.cursor}).removeData(&quot;readonly&quot;):t.data(&quot;raw&quot;,t.clone()[0])})},getScore:function(){var t,e=[];return this.each(function(){t=this.score.val(),e.push(t?+t:void 0)}),1=e.number&amp;&amp;(t=e.number-1,a=10);e=r._getSize.call(this)/10,t=i(this.stars[t]),e=t.offset().left+e*parseInt(a,10),a=i.Event("mousemove",{pageX:e});t.trigger(a)})},readOnly:function(e){return this.each(function(){var t=i(this);t.data("readonly")!==e&amp;&amp;((e?(t.off(".um_raty").children("img").off(".um_raty"),r._lock):(r._binds.call(this),r._unlock)).call(this),t.data("readonly",e))})},reload:function(){return r.set.call(this,{})},score:function(){var t=i(this);return arguments.length?r.setScore.apply(t,arguments):r.getScore.call(t)},set:function(a){return this.each(function(){var t=i(this),e=t.data("options"),e=i.extend({},e,a);t.um_raty(e)})},setScore:function(t){return this.each(function(){!0!==i(this).data("readonly")&amp;&amp;(r._apply.call(this,t),r._target.call(this,t))})}};i.fn.um_raty=function(t){return r[t]?r[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&amp;&amp;t?void i.error("Method "+t+" does not exist!"):r.init.apply(this,arguments)},i.fn.um_raty.defaults={cancel:!1,cancelClass:"raty-cancel",cancelHint:wp.i18n.__("Cancel this rating!","ultimate-member"),cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:void 0,half:!1,halfShow:!0,hints:["bad","poor","regular","good","gorgeous"],iconRange:void 0,mouseout:void 0,mouseover:void 0,noRatedMsg:wp.i18n.__("Not rated yet!","ultimate-member"),number:5,numberMax:20,path:void 0,precision:!1,readOnly:!1,round:{down:.25,full:.6,up:.76},score:void 0,scoreName:"score",single:!1,space:!0,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",starType:"img",target:void 0,targetFormat:"{score}",targetKeep:!1,targetScore:void 0,targetText:"",targetType:"hint"}}(jQuery);