1"use strict";(function(fn){if(document.readyState!="loading"){return fn();} 2document.addEventListener("DOMContentLoaded",fn);})(function kkStarRatings(){var isBusy=false;function post(data,successCallback,errorCallback){if(isBusy){return;} 3isBusy=true;data=Object.assign({nonce:kk_star_ratings.nonce,action:kk_star_ratings.action,},data);var query=[];for(var key in data){query.push(encodeURIComponent(key)+"="+encodeURIComponent(data[key]));} 4var request=new XMLHttpRequest();request.open("POST",kk_star_ratings.endpoint,true);request.onload=function(){if(request.status>=200&&request.status<400){successCallback(request.responseText,request);}else{errorCallback(request.responseText,request);}};request.onloadend=function(){isBusy=false;};request.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8");request.send(query.join("&"));} 5function htmlToEl(html){var div=document.createElement("div");div.innerHTML=html.trim();return div.firstChild;} 6function apply($el){function vote($star){var data={rating:$star.getAttribute("data-star"),};var payload=JSON.parse($el.getAttribute("data-payload"));for(var key in payload){data["payload["+key+"]"]=payload[key];} 7post(data,function(html){var $newEl=htmlToEl(html);$el.parentNode.replaceChild($newEl,$el);unmount();$el=null;apply($newEl);},console.error);} 8function onClick(e){e.preventDefault();vote(e.currentTarget);} 9var $stars=$el.querySelectorAll("[data-star]");function unmount(){Array.prototype.forEach.call($stars,function($star){$star.removeEventListener("click",onClick);});} 10function mount(){Array.prototype.forEach.call($stars,function($star){$star.addEventListener("click",onClick);});} 11mount();} 12Array.prototype.forEach.call(document.querySelectorAll(".kk-star-ratings"),apply);});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.