/*!
 * FullCalendar v2.2.3 Google Calendar Plugin
 * Docs & License: http://arshaw.com/fullcalendar/
 * (c) 2013 Adam Shaw
 */
(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}})(function(f){var e="https://www.googleapis.com/calendar/v3/calendars";var c=f.fullCalendar;var b=c.applyAll;c.sourceNormalizers.push(function(g){var j=g.googleCalendarId;var i=g.url;var h;if(!j&&i){if((h=/^[^\/]+@([^\/\.]+\.)*(google|googlemail|gmail)\.com$/.test(i))){j=i}else{if((h=/^https:\/\/www.googleapis.com\/calendar\/v3\/calendars\/([^\/]*)/.exec(i))||(h=/^https?:\/\/www.google.com\/calendar\/feeds\/([^\/]*)/.exec(i))){j=decodeURIComponent(h[1])}}if(j){g.googleCalendarId=j}}if(j){if(g.editable==null){g.editable=false}g.url=j}});c.sourceFetchers.push(function(h,j,g,i){if(h.googleCalendarId){return d(h,j,g,i,this)}});function d(o,i,j,n,l){var g=e+"/"+encodeURIComponent(o.googleCalendarId)+"/events?callback=?";var m=o.googleCalendarApiKey||l.options.googleCalendarApiKey;var p=o.success;var k;var h;function q(u,v){var s=v||[{message:u}];var r=window.console;var t=r?(r.warn||r.log):null;(o.googleCalendarError||f.noop).apply(l,s);(l.options.googleCalendarError||f.noop).apply(l,s);if(t){t.apply(r,[u].concat(v||[]))}}if(!m){q("Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/");return{}}if(!i.hasZone()){i=i.clone().utc().add(-1,"day")}if(!j.hasZone()){j=j.clone().utc().add(1,"day")}if(n&&n!="local"){h=n.replace(" ","_")}k=f.extend({},o.data||{},{key:m,timeMin:i.format(),timeMax:j.format(),timeZone:h,singleEvents:true,maxResults:9999});return f.extend({},o,{googleCalendarId:null,url:g,data:k,startParam:false,endParam:false,timezoneParam:false,success:function(u){var s=[];var r;var t;if(u.error){q("Google Calendar API: "+u.error.message,u.error.errors)}else{if(u.items){f.each(u.items,function(w,x){var v=x.htmlLink;if(h){v=a(v,"ctz="+h)}s.push({id:x.id,title:x.summary,start:x.start.dateTime||x.start.date,end:x.end.dateTime||x.end.date,url:v,location:x.location,description:x.description})});r=[s].concat(Array.prototype.slice.call(arguments,1));t=b(p,this,r);if(f.isArray(t)){return t}}}return s}})}function a(h,g){return h.replace(/(\?.*?)?(#|$)/,function(j,i,k){return(i?i+"&":"?")+g+k})}});
