var wijmo;define(["./wijmo.wijevcal","exportUtil"],function(){(function(e){(function(t){function r(r,i,s,o,u){var a,f,l={},c,h,p=this,d=p.options,v,m,g;a=i===undefined?"png":i,a=a.substr(0,1).toUpperCase()+a.substr(1),f=u===undefined?"Options":u,f=f.substr(0,1).toUpperCase()+f.substr(1),typeof s=="string"&&arguments.length===3?c=s:(c=o===undefined?"http://demos.componentone.com/ASPNET/ExportService/exportapi/EventsCalendar":o,l=s),$.isPlainObject(r)?g=r:g={serviceUrl:c,fileName:r===undefined?"export":r,pdf:l,method:t.ExportMethod[f],exportFileType:e.exporter.ExportFileType[a]},v=new n(g.serviceUrl,g.method),m={fileName:g.fileName,widget:p,type:g.exportFileType,pdfSetting:g.pdf,theme:d.theme?d.theme:g.theme},h=v.getExportData(m),t.exportFile(g,h)}var n=function(){function e(e,t){this.serviceUrl=e,this.method=t}return e.prototype.getExportData=function(e){var n;return this.options=e,this._handleExportOption(),n={fileName:e.fileName,width:e.width,height:e.height,type:e.type,pdfSettings:e.pdfSetting,styleString:e.styleString,linkList:e.linkList,theme:e.theme},this.method===0?n.content=e.HTMLContent:(n.options=e.widgetOptions,n.widgetName=e.widgetName),t.toJSON(n,function(e,t){if(e==="type")switch(t){case 6:return"bmp";case 7:return"gif";case 5:return"jpg";case 3:return"pdf";case 8:return"tiff";default:return"png"}return t})},e.prototype._handleExportOption=function(){var e=this.options,n,r=new Array;e.widget&&(this.method===0?e.HTMLContent=e.widget.element[0].outerHTML:(e.widgetName=this._getWidgetName(),e.widgetOptions=t.toJSON(e.widget.options,function(e,t){if(t!=null)return e==="webServiceUrl"?"":t})),$.each($("head").children(),function(e,t){t.tagName==="STYLE"?$(t).text()&&(n+=$(t).text()):t.tagName==="LINK"&&r.push({className:t.className,href:t.href,rel:t.rel,linkType:t.type})}),e.styleString=n,e.linkList=r,e.width=e.widget.element.width(),e.height=e.widget.element.height())},e.prototype._getWidgetName=function(){return this.options.widget?"wijevcal":""},e}();t.EventsCalendarExport=n,t.innerExportEventsCalendar=r,e.evcal&&e.evcal.wijevcal&&(e.evcal.wijevcal.prototype.exportEventsCalendar=r),$.wijmo.wijevcal&&($.wijmo.wijevcal.prototype.exportEventsCalendar=r)})(e.exporter||(e.exporter={}));var t=e.exporter})(wijmo||(wijmo={}))});