/*! jquery-awesome-cursor - v0.0.4 - 2014-11-29
* https://jwarby.github.io/jquery-awesome-cursor
* Copyright (c) 2014 James Warwood; Licensed MIT */
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b("object"==typeof exports?require("jquery"):a.jQuery)}(this,function(a){"use strict";function b(b,c){-1===a.inArray(c,["horizontal","vertical","both"])&&a.error("Flip value must be one of horizontal, vertical or both");var d,e=a("")[0];return e.width=b.width,e.height=b.height,d=e.getContext("2d"),("horizontal"===c||"both"===c)&&(d.translate(b.width,0),d.scale(-1,1)),("vertical"===c||"both"===c)&&(d.translate(0,b.height),d.scale(1,-1)),d.drawImage(b,0,0,b.width,b.height),e}var c=function(b,c){var d=0,e=0;return"string"!=typeof b&&a.error("Hotspot value is not a string and could not be parsed"),"number"!=typeof c&&a.error("Cursor size must be a number"),b.split(" ").forEach(function(a){switch(a){case"center":d=c/2,e=c/2;break;case"top":e=0;break;case"bottom":e=c-1;break;case"left":d=0;break;case"right":d=c-1}}),[d,e]};a.fn.extend({awesomeCursor:function(d,e){e=a.extend({},a.fn.awesomeCursor.defaults,e),"string"==typeof d&&d||a.error("First parameter must be the icon name, e.g. 'pencil'"),e.size="string"==typeof e.size?parseInt(e.size,10):e.size,"string"==typeof e.hotspot&&(e.hotspot=c(e.hotspot,e.size)),e.hotspot=a.map(e.hotspot,function(a){return Math.min(e.size-1,Math.max(0,a))});var f,g,h,i,j=a("",{"class":"fa fa-"+d,style:"position: absolute; left: -9999px; top: -9999px;"}),k=a("")[0],l=e.size;return a("body").append(j),g=window.getComputedStyle(j[0],":before").getPropertyValue("content"),j.remove(),e.rotate?(l=Math.ceil(Math.sqrt(Math.pow(e.size,2)+Math.pow(e.size,2))),f=(l-e.size)/2,k.width=l,k.height=l,i=k.getContext("2d"),i.translate(k.width/2,k.height/2),i.rotate(e.rotate*Math.PI/180),i.translate(-k.width/2,-k.height/2),e.hotspot[0]+=e.hotspot[0]!==k.width/2?f:0,e.hotspot[1]+=e.hotspot[1]!==k.height/2?f:0):(k.height=e.size,k.width=e.size,i=k.getContext("2d")),i.fillStyle=e.color,i.font=e.size+"px FontAwesome",i.textAlign="center",i.textBaseline="middle",i.fillText(g,l/2,l/2),e.flip&&(k=b(k,e.flip)),h=k.toDataURL("image/png"),a(this).css("cursor",["url("+h+")",e.hotspot[0],e.hotspot[1],",","auto"].join(" ")),this}}),a.fn.awesomeCursor.defaults={color:"#000000",size:18,hotspot:[0,0],flip:"",rotate:0}});