@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
3 lines (2 loc) • 33.1 kB
JavaScript
!function(e){"function"==typeof define&&define.amd?define(["kendo.core.min"],e):e()}((function(){var e,t;kendo.ooxml=kendo.ooxml||{},kendo.ooxml.createZip=function(){if("undefined"==typeof JSZip)throw new Error("JSZip not found. Check http://docs.telerik.com/kendo-ui/framework/excel/introduction#requirements for more details.");return new JSZip},function(e){window.kendo.ooxml=window.kendo.ooxml||{};var t=kendo.ooxml,n=e.map,r=t.createZip,o={toString:function(e){return e}},i=kendo.Class.extend({});function s(e,t,n){return(1461*(e+4800+((t-13)/12|0))/4|0)+(367*(t-1-12*((t-13)/12|0))/12|0)-(3*((e+4900+((t-13)/12|0))/100|0)/4|0)+n-32075}i.register=function(e){o=e},i.toString=function(e,t){return o.toString(e,t)};var a=s(1900,0,-1);function l(e){var t,n,r,o,i=(t=e.getHours(),n=e.getMinutes(),r=e.getSeconds(),o=e.getMilliseconds(),(t+(n+(r+o/1e3)/60)/60)/24),l=function(e,t,n){return s(e,t,n)-a}(e.getFullYear(),e.getMonth(),e.getDate());return l<0?l-1+i:l+i}var m="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",c={compression:"DEFLATE",type:"base64"},d={compression:"DEFLATE",type:"blob"},f={compression:"DEFLATE",type:"arraybuffer"};function u(e){return"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+e}function p(e,t){return t.indexOf(e)}var h=JSON.parse.bind(JSON);function g(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\"/g,""").replace(/\'/g,"'")}function x(e,t){for(var n="",r=0;r<e;++r)n+=t(r);return n}function v(e,t){var n="";if(null!=e)if(Array.isArray(e))for(var r=0;r<e.length;++r)n+=t(e[r],r);else"object"==typeof e&&Object.keys(e).forEach((function(r,o){n+=t(e[r],r,o)}));return n}var y='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r',w=function(e){var t=e.frozenColumns,n=e.frozenRows,r=e.columns,o=e.defaults,i=e.data,s=e.index,a=e.mergeCells,l=e.autoFilter,m=e.filter,c=e.showGridLines,d=e.hyperlinks,f=e.validations,u=e.defaultCellStyleId,p=e.rtl,h=e.legacyDrawing,x=e.drawing,w=e.lastRow,b=e.lastCol;return y+'\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" mc:Ignorable="x14ac">\n '+(w&&b?'<dimension ref="A1:'+I(w-1,b-1)+'" />':"")+"\n\n <sheetViews>\n <sheetView "+(p?'rightToLeft="1"':"")+" "+(0===s?'tabSelected="1"':"")+' workbookViewId="0" '+(!1===c?'showGridLines="0"':"")+">\n "+(n||t?'\n <pane state="frozen"\n '+(t?'xSplit="'+t+'"':"")+"\n "+(n?'ySplit="'+n+'"':"")+'\n topLeftCell="'+(String.fromCharCode(65+(t||0))+((n||0)+1))+'"\n />':"")+'\n </sheetView>\n </sheetViews>\n\n <sheetFormatPr x14ac:dyDescent="0.25" '+(o.skipCustomHeight?"":'customHeight="1"')+' defaultRowHeight="'+(o.rowHeight?.75*o.rowHeight:15)+'"\n '+(o.columnWidth?'defaultColWidth="'+_(o.columnWidth)+'"':"")+" />\n\n "+(null!=u||r&&r.length>0?"\n <cols>\n "+(r&&r.length?"":'\n <col min="1" max="16384" style="'+u+'"\n '+(o.columnWidth?'width="'+_(o.columnWidth)+'"':"")+" /> ")+"\n "+v(r,(function(e,t){var n="number"==typeof e.index?e.index+1:t+1;return 0===e.width?"<col "+(null!=u?'style="'+u+'"':"")+'\n min="'+n+'" max="'+n+'" hidden="1" customWidth="1" />':"<col "+(null!=u?'style="'+u+'"':"")+'\n min="'+n+'" max="'+n+'" customWidth="1"\n '+(e.autoWidth?'width="'+(7*e.width+5)/7*256/256+'" bestFit="1"':'width="'+_(e.width)+'"')+" />"}))+"\n </cols>":"")+"\n\n <sheetData>\n "+v(i,(function(e,t){return'\n <row r="'+("number"==typeof e.index?e.index+1:t+1)+'" x14ac:dyDescent="0.25"\n '+(e.level?'outlineLevel="'+e.level+'"':"")+"\n "+(0===e.height?'hidden="1"':e.height?'ht="'+(.75*e.height+'" customHeight="1"'):"")+">\n "+v(e.data,(function(e){return'\n <c r="'+e.ref+'" '+(e.style?'s="'+e.style+'"':"")+" "+(e.type?'t="'+e.type+'"':"")+">\n "+(null!=e.formula?function(e){if("string"==typeof e)return"<f>"+g(e)+"</f>";return'<f t="array" ref="'+e.ref+'">'+g(e.src)+"</f>"}(e.formula):"")+"\n "+(null!=e.value?"<v>"+g(e.value)+"</v>":"")+"\n </c>"}))+"\n </row>\n "}))+"\n </sheetData>\n\n "+(l?'<autoFilter ref="'+l.from+":"+l.to+'"/>':m?$(m):"")+"\n\n "+(a.length?'\n <mergeCells count="'+a.length+'">\n '+v(a,(function(e){return'<mergeCell ref="'+e+'"/>'}))+"\n </mergeCells>":"")+"\n\n "+(f.length?"\n <dataValidations>\n "+v(f,(function(e){return'\n <dataValidation sqref="'+e.sqref.join(" ")+'"\n showErrorMessage="'+e.showErrorMessage+'"\n type="'+g(e.type)+'"\n '+("list"!==e.type?'operator="'+g(e.operator)+'"':"")+'\n allowBlank="'+e.allowBlank+'"\n showDropDown="'+e.showDropDown+'"\n '+(e.error?'error="'+g(e.error)+'"':"")+"\n "+(e.errorTitle?'errorTitle="'+g(e.errorTitle)+'"':"")+">\n "+(e.formula1?"<formula1>"+g(e.formula1)+"</formula1>":"")+"\n "+(e.formula2?"<formula2>"+g(e.formula2)+"</formula2>":"")+"\n </dataValidation>"}))+"\n </dataValidations>":"")+"\n\n "+(d.length?"\n <hyperlinks>\n "+v(d,(function(e){return'\n <hyperlink ref="'+e.ref+'" r:id="'+e.rId+'"/>'}))+"\n </hyperlinks>":"")+'\n\n <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" />\n '+(x?'<drawing r:id="'+x+'"/>':"")+"\n "+(h?'<legacyDrawing r:id="'+h+'"/>':"")+"\n</worksheet>"},b=function(e){return y+'\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n '+v(e,(function(e){return'\n <Relationship Id="'+e.rId+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="'+e.target+'"/>'}))+"\n</Relationships>"};function k(e){var t=Math.floor(e/26)-1;return(t>=0?k(t):"")+String.fromCharCode(65+e%26)}function I(e,t){return k(t)+(e+1)}function T(e,t){return"$"+k(t)+"$"+(e+1)}function S(e){return(e.frozenRows||(e.freezePane||{}).rowSplit||1)-1}function _(e){return e/7-Math.floor(128/7)/256}var C=kendo.Class.extend({init:function(t,n,r,o){this.options=t,this._strings=n,this._styles=r,this._borders=o,this._validations={},this._comments=[],this._drawings=t.drawings||[],this._hyperlinks=(this.options.hyperlinks||[]).map((function(t,n){return e.extend({},t,{rId:"link"+n})}))},relsToXML:function(){var e=this._hyperlinks,t=this._comments,n=this._drawings;if(e.length||t.length||n.length)return function(e){var t=e.hyperlinks,n=e.comments,r=e.sheetIndex,o=e.drawings;return y+'\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n '+v(t,(function(e){return'\n <Relationship Id="'+e.rId+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" Target="'+g(e.target)+'" TargetMode="External" />'}))+"\n "+(n.length?'\n <Relationship Id="comment'+r+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" Target="../comments'+r+'.xml"/>\n <Relationship Id="vml'+r+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing" Target="../drawings/vmlDrawing'+r+'.vml"/>':"")+"\n "+(o.length?'\n <Relationship Id="drw'+r+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" Target="../drawings/drawing'+r+'.xml"/>':"")+"\n</Relationships>"}({hyperlinks:e,comments:t,sheetIndex:this.options.sheetIndex,drawings:n})},toXML:function(e){var t=this.options.mergedCells||[],n=function(e,t){var n=[],r=[];!function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r){var o=r.index;"number"!=typeof o&&(o=n),t(r,o)}}}(e,(function(e,t){var o={_source:e,index:t,height:e.height,level:e.level,cells:[]};n.push(o),r[t]=o}));for(var o=N(n).slice(0),i={rowData:n,rowsByIndex:r,mergedCells:t},s=0;s<o.length;s++)j(o[s],i),delete o[s]._source;return N(n)}(this.options.rows||[],t);this._readCells(n);var r,o=this.options.filter;o&&"number"==typeof o.from&&"number"==typeof o.to?o={from:I(S(this.options),o.from),to:I(S(this.options),o.to)}:o&&o.ref&&o.columns&&(r=o,o=null);var i=[];for(var s in this._validations)Object.prototype.hasOwnProperty.call(this._validations,s)&&i.push(this._validations[s]);var a=null;this.options.defaultCellStyle&&(a=this._lookupStyle(this.options.defaultCellStyle));var l=this.options.freezePane||{},m=this.options.defaults||{},c=this.options.rows?this._getLastRow():1,d=this.options.rows?this._getLastCol():1;return w({frozenColumns:this.options.frozenColumns||l.colSplit,frozenRows:this.options.frozenRows||l.rowSplit,columns:this.options.columns,defaults:m,data:n,index:e,mergeCells:t,autoFilter:o,filter:r,showGridLines:this.options.showGridLines,hyperlinks:this._hyperlinks,validations:i,defaultCellStyleId:a,rtl:void 0!==this.options.rtl?this.options.rtl:m.rtl,legacyDrawing:this._comments.length?"vml"+this.options.sheetIndex:null,drawing:this._drawings.length?"drw"+this.options.sheetIndex:null,lastRow:c,lastCol:d})},commentsXML:function(){if(this._comments.length)return function(e){var t=e.comments;return y+'\n<comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">\n <authors>\n <author></author>\n </authors>\n <commentList>\n '+v(t,(function(e){return'\n <comment ref="'+e.ref+'" authorId="0">\n <text>\n <r>\n <rPr>\n <sz val="8"/>\n <color indexed="81"/>\n <rFont val="Tahoma"/>\n <charset val="1"/>\n </rPr>\n <t>'+g(e.text)+"</t>\n </r>\n </text>\n </comment>"}))+"\n </commentList>\n</comments>"}({comments:this._comments})},drawingsXML:function(e){if(this._drawings.length){var t={},n=this._drawings.map((function(n){var r=z(n.topLeftCell),o=t[n.image];return o||(o=t[n.image]={rId:"img"+n.image,target:e[n.image].target}),{col:r.col,colOffset:B(n.offsetX),row:r.row,rowOffset:B(n.offsetY),width:B(n.width),height:B(n.height),imageId:o.rId}}));return{main:(r=n,y+'\n<xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"\n xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"\n xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">\n '+v(r,(function(e,t){return'\n <xdr:oneCellAnchor editAs="oneCell">\n <xdr:from>\n <xdr:col>'+e.col+"</xdr:col>\n <xdr:colOff>"+e.colOffset+"</xdr:colOff>\n <xdr:row>"+e.row+"</xdr:row>\n <xdr:rowOff>"+e.rowOffset+'</xdr:rowOff>\n </xdr:from>\n <xdr:ext cx="'+e.width+'" cy="'+e.height+'" />\n <xdr:pic>\n <xdr:nvPicPr>\n <xdr:cNvPr id="'+(t+1)+'" name="Picture '+(t+1)+'"/>\n <xdr:cNvPicPr/>\n </xdr:nvPicPr>\n <xdr:blipFill>\n <a:blip r:embed="'+e.imageId+'"/>\n <a:stretch>\n <a:fillRect/>\n </a:stretch>\n </xdr:blipFill>\n <xdr:spPr>\n <a:prstGeom prst="rect">\n <a:avLst/>\n </a:prstGeom>\n </xdr:spPr>\n </xdr:pic>\n <xdr:clientData/>\n </xdr:oneCellAnchor>'}))+"\n</xdr:wsDr>"),rels:b(t)}}var r},legacyDrawing:function(){if(this._comments.length)return function(e){return'<xml xmlns:v="urn:schemas-microsoft-com:vml"\n xmlns:o="urn:schemas-microsoft-com:office:office"\n xmlns:x="urn:schemas-microsoft-com:office:excel">\n <v:shapetype coordsize="21600,21600" id="_x0000_t202" path="m,l,21600r21600,l21600,xe">\n <v:stroke joinstyle="miter"/>\n <v:path gradientshapeok="t" o:connecttype="rect"/>\n </v:shapetype>\n '+v(e.comments,(function(e){return'\n <v:shape type="#_x0000_t202" style="visibility: hidden" fillcolor="#ffffe1" o:insetmode="auto">\n <v:shadow on="t" color="black" obscured="t"/>\n <x:ClientData ObjectType="Note">\n <x:MoveWithCells/>\n <x:SizeWithCells/>\n <x:Anchor>'+e.anchor+"</x:Anchor>\n <x:AutoFill>False</x:AutoFill>\n <x:Row>"+e.row+"</x:Row>\n <x:Column>"+e.col+"</x:Column>\n </x:ClientData>\n </v:shape>"}))+"\n</xml>"}({comments:this._comments})},_lookupString:function(e){var t,n="$"+e,r=this._strings.indexes[n];return void 0!==r?t=r:(t=this._strings.indexes[n]=this._strings.uniqueCount,this._strings.uniqueCount++),this._strings.count++,t},_lookupStyle:function(e){var t=JSON.stringify(e);if("{}"===t)return 0;var n=p(t,this._styles);return n<0&&(n=this._styles.push(t)-1),n+1},_lookupBorder:function(e){var t=JSON.stringify(e);if("{}"!==t){var n=p(t,this._borders);return n<0&&(n=this._borders.push(t)-1),n+1}},_readCells:function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.cells;n.data=[];for(var o=0;o<r.length;o++){var i=this._cell(r[o],n.index,o);i&&n.data.push(i)}}},_cell:function(e,t,n){if(!e||e===E)return null;var r=e.value,o={};e.borderLeft&&(o.left=e.borderLeft),e.borderRight&&(o.right=e.borderRight),e.borderTop&&(o.top=e.borderTop),e.borderBottom&&(o.bottom=e.borderBottom),e.dBorders&&(o.diagonal=e.dBorders),o=this._lookupBorder(o);var s,a=this.options.defaultCellStyle||{},m={borderId:o};(s=function(t,n){var r=e[t];if(void 0===r&&(r=a[t]),void 0!==r)return m[n||t]=r,!0})("color"),s("background"),s("bold"),s("italic"),s("underline"),s("fontFamily")||s("fontName","fontFamily"),s("fontSize"),s("format"),s("textAlign")||s("hAlign","textAlign"),s("verticalAlign")||s("vAlign","verticalAlign"),s("wrap"),s("indent");var c=(this.options.columns||[])[n],d=typeof r;if(c&&c.autoWidth&&(!e.colSpan||1===e.colSpan)){var f=r;"number"===d&&(f=i.toString(r,e.format)),c.width=Math.max(c.width||0,String(f).length)}"string"===d?(r=function(e){return String(e).replace(/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,"").replace(/\r?\n/g,"\r\n")}(r),r=this._lookupString(r),d="s"):"number"===d?d="n":"boolean"===d?(d="b",r=Number(r)):r&&r.getTime?(d=null,r=l(r),m.format||(m.format="mm-dd-yy")):(d=null,r=null),m=this._lookupStyle(m);var u=I(t,n);if(e.validation&&this._addValidation(e.validation,u),e.comment){var p=[n+1,15,t,10,n+3,15,t+3,4];this._comments.push({ref:u,text:e.comment,row:t,col:n,anchor:p.join(", ")})}return{value:r,formula:e.formula,type:d,style:m,ref:u}},_addValidation:function(e,t){var n={showErrorMessage:"reject"===e.type?1:0,formula1:e.from,formula2:e.to,type:P[e.dataType]||e.dataType,operator:F[e.comparerType]||e.comparerType,allowBlank:e.allowNulls?1:0,showDropDown:e.showButton?0:1,error:e.messageTemplate,errorTitle:e.titleTemplate},r=JSON.stringify(n);this._validations[r]||(this._validations[r]=n,n.sqref=[]),this._validations[r].sqref.push(t)},_getLastRow:function(){return D(this.options.rows)},_getLastCol:function(){var e=0;return this.options.rows.forEach((function(t){t.cells&&(e=Math.max(e,D(t.cells)))})),e}});function D(e){var t=e.length;return e.forEach((function(e){e.index&&e.index>=t&&(t=e.index+1)})),t}var F={greaterThanOrEqualTo:"greaterThanOrEqual",lessThanOrEqualTo:"lessThanOrEqual"},P={number:"decimal"},L={General:0,0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49,"[$-404]e/m/d":27,"m/d/yy":30,t0:59,"t0.00":60,"t#,##0":61,"t#,##0.00":62,"t0%":67,"t0.00%":68,"t# ?/?":69,"t# ??/??":70};function M(e){var t=function(e){function t(e){var t=parseInt(e,10).toString(16);return t.length<2?"0"+t:t}var n=/^rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([0-9.]+)\s*)?\)/i.exec(e.trim());return n?"#"+t(255*(n[4]?parseFloat(n[4]):1)|0)+t(n[1])+t(n[2])+t(n[3]):e}(e);return t.length<6&&(t=t.replace(/(\w)/g,(function(e,t){return t+t}))),(t=t.substring(1).toUpperCase()).length<8&&(t="FF"+t),t}var A=kendo.Class.extend({init:function(e){var t=this;this.options=e||{},this._strings={indexes:{},count:0,uniqueCount:0},this._styles=[],this._borders=[],this._images=this.options.images,this._imgId=0,this._sheets=n(this.options.sheets||[],(function(e,n){return e.defaults=t.options,e.sheetIndex=n+1,new C(e,t._strings,t._styles,t._borders)}))},imageFilename:function(e){var t=++this._imgId;switch(e){case"image/jpg":case"image/jpeg":return"image"+t+".jpg";case"image/png":return"image"+t+".png";case"image/gif":return"image"+t+".gif";default:return"image"+t+".bin"}},toZIP:function(){var e=this,t=r(),o=t.folder("docProps");o.file("core.xml",function(e){var t=e.creator,n=e.lastModifiedBy,r=e.created,o=e.modified;return y+'\n <cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"\n xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"\n xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\n <dc:creator>'+g(t)+"</dc:creator>\n <cp:lastModifiedBy>"+g(n)+'</cp:lastModifiedBy>\n <dcterms:created xsi:type="dcterms:W3CDTF">'+g(r)+'</dcterms:created>\n <dcterms:modified xsi:type="dcterms:W3CDTF">'+g(o)+"</dcterms:modified>\n</cp:coreProperties>"}({creator:this.options.creator||"Kendo UI",lastModifiedBy:this.options.creator||"Kendo UI",created:this.options.date||(new Date).toJSON(),modified:this.options.date||(new Date).toJSON()}));var i=this._sheets.length;o.file("app.xml",function(e){var t=e.sheets;return y+'\n<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">\n <Application>Microsoft Excel</Application>\n <DocSecurity>0</DocSecurity>\n <ScaleCrop>false</ScaleCrop>\n <HeadingPairs>\n <vt:vector size="2" baseType="variant">\n <vt:variant>\n <vt:lpstr>Worksheets</vt:lpstr>\n </vt:variant>\n <vt:variant>\n <vt:i4>'+t.length+'</vt:i4>\n </vt:variant>\n </vt:vector>\n </HeadingPairs>\n <TitlesOfParts>\n <vt:vector size="'+t.length+'" baseType="lpstr">'+v(t,(function(e,t){return e.options.title?"<vt:lpstr>"+g(e.options.title)+"</vt:lpstr>":"<vt:lpstr>Sheet"+(t+1)+"</vt:lpstr>"}))+"</vt:vector>\n </TitlesOfParts>\n <LinksUpToDate>false</LinksUpToDate>\n <SharedDoc>false</SharedDoc>\n <HyperlinksChanged>false</HyperlinksChanged>\n <AppVersion>14.0300</AppVersion>\n</Properties>"}({sheets:this._sheets})),t.folder("_rels").file(".rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>\n <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>\n <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>\n </Relationships>');var s=t.folder("xl");if(s.folder("_rels").file("workbook.xml.rels",function(e){var t=e.count;return y+'\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">\n '+x(t,(function(e){return'\n <Relationship Id="rId'+(e+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+(e+1)+'.xml" />'}))+'\n <Relationship Id="rId'+(t+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml" />\n <Relationship Id="rId'+(t+2)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml" />\n</Relationships>'}({count:i})),this._images){var a=s.folder("media");Object.keys(this._images).forEach((function(t){var n=e._images[t],r=e.imageFilename(n.type);a.file(r,n.data),n.target="../media/"+r}))}var l={};s.file("workbook.xml",function(e){var t=e.sheets,n=e.filterNames,r=e.userNames;return y+'\n<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">\n <fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303" />\n <workbookPr defaultThemeVersion="124226" />\n <bookViews>\n <workbookView xWindow="240" yWindow="45" windowWidth="18195" windowHeight="7995" />\n </bookViews>\n <sheets>\n '+v(t,(function(e,t){var n=e.options;return'<sheet name="'+g(n.name||n.title||"Sheet"+(t+1))+'" sheetId="'+(t+1)+'" r:id="rId'+(t+1)+'" />'}))+"\n </sheets>\n "+(n.length||r.length?"\n <definedNames>\n "+v(n,(function(e){return'\n <definedName name="_xlnm._FilterDatabase" hidden="1" localSheetId="'+e.localSheetId+'">'+g(function(e){return/^\'/.test(e)||/^[a-z_][a-z0-9_]*$/i.test(e)?e:"'"+e.replace(/\x27/g,"\\'")+"'"}(e.name))+"!"+g(e.from)+":"+g(e.to)+"</definedName>"}))+"\n "+v(r,(function(e){return'\n <definedName name="'+e.name+'" hidden="'+(e.hidden?1:0)+'" '+(null!=e.localSheetId?'localSheetId="'+e.localSheetId+'"':"")+">"+g(e.value)+"</definedName>"}))+"\n </definedNames>":"")+'\n <calcPr fullCalcOnLoad="1" calcId="145621" />\n</workbook>'}({sheets:this._sheets,filterNames:n(this._sheets,(function(e,t){var n=e.options,r=n.name||n.title||"Sheet"+(t+1);l[r.toLowerCase()]=t;var o=n.filter;if(o){if(o.ref){var i=o.ref.split(":"),s=z(i[0]),a=z(i[1]);return{localSheetId:t,name:r,from:T(s.row,s.col),to:T(a.row,a.col)}}if(void 0!==o.from&&void 0!==o.to)return{localSheetId:t,name:r,from:T(S(n),o.from),to:T(S(n),o.to)}}})),userNames:n(this.options.names||[],(function(e){return{name:e.localName,localSheetId:e.sheet?l[e.sheet.toLowerCase()]:null,value:e.value,hidden:e.hidden}}))}));for(var m=s.folder("worksheets"),c=s.folder("drawings"),d=c.folder("_rels"),f=m.folder("_rels"),u=[],w=[],b=0;b<i;b++){var k=e._sheets[b],I="sheet"+(b+1)+".xml",_=k.toXML(b),C=k.relsToXML(),D=k.commentsXML(),F=k.legacyDrawing(),P=k.drawingsXML(e._images);if(C&&f.file(I+".rels",C),D){var A="comments"+k.options.sheetIndex+".xml";s.file(A,D),u.push(A)}if(F&&c.file("vmlDrawing"+k.options.sheetIndex+".vml",F),P){var R="drawing"+k.options.sheetIndex+".xml";c.file(R,P.main),d.file(R+".rels",P.rels),w.push(R)}m.file(I,_)}var E=n(this._borders,h),N=n(this._styles,h),q=function(e){return e.underline||e.bold||e.italic||e.color||e.fontFamily||e.fontSize},B=n(N,(function(e){var t,n,r;if(e.fontSize&&(e.fontSize=(t=e.fontSize,(r=Number(t))&&(n=3*r/4),n)),e.color&&(e.color=M(e.color)),q(e))return e})),j=n(N,(function(e){if(e.format&&void 0===L[e.format])return e})),V=n(N,(function(e){if(e.background)return e.background=M(e.background),e}));return s.file("styles.xml",function(e){var t=e.formats,n=e.fonts,r=e.fills,o=e.borders,i=e.styles;return y+'\n<styleSheet\n xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"\n xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"\n mc:Ignorable="x14ac"\n xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">\n <numFmts count="'+t.length+'">\n '+v(t,(function(e,t){return'\n <numFmt formatCode="'+g(e.format)+'" numFmtId="'+(165+t)+'" />'}))+'\n </numFmts>\n <fonts count="'+(n.length+1)+'" x14ac:knownFonts="1">\n <font>\n <sz val="11" />\n <color theme="1" />\n <name val="Calibri" />\n <family val="2" />\n <scheme val="minor" />\n </font>\n '+v(n,(function(e){return"\n <font>\n "+(e.bold?"<b/>":"")+"\n "+(e.italic?"<i/>":"")+"\n "+(e.underline?"<u/>":"")+'\n <sz val="'+(e.fontSize||11)+'" />\n '+(e.color?'<color rgb="'+g(e.color)+'" />':'<color theme="1" />')+"\n "+(e.fontFamily?'\n <name val="'+g(e.fontFamily)+'" />\n <family val="2" />\n ':'\n <name val="Calibri" />\n <family val="2" />\n <scheme val="minor" />\n ')+"\n </font>"}))+'\n </fonts>\n <fills count="'+(r.length+2)+'">\n <fill><patternFill patternType="none"/></fill>\n <fill><patternFill patternType="gray125"/></fill>\n '+v(r,(function(e){return"\n "+(e.background?'\n <fill>\n <patternFill patternType="solid">\n <fgColor rgb="'+g(e.background)+'"/>\n </patternFill>\n </fill>\n ':"")}))+'\n </fills>\n <borders count="'+(o.length+1)+'">\n <border><left/><right/><top/><bottom/><diagonal/></border>\n '+v(o,O)+'\n </borders>\n <cellStyleXfs count="1">\n <xf borderId="0" fillId="0" fontId="0" />\n </cellStyleXfs>\n <cellXfs count="'+(i.length+1)+'">\n <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />\n '+v(i,(function(e){return'\n <xf xfId="0"\n '+(e.fontId?'fontId="'+e.fontId+'" applyFont="1"':"")+"\n "+(e.fillId?'fillId="'+e.fillId+'" applyFill="1"':"")+"\n "+(e.numFmtId?'numFmtId="'+e.numFmtId+'" applyNumberFormat="1"':"")+"\n "+(e.textAlign||e.verticalAlign||e.wrap?'applyAlignment="1"':"")+"\n "+(e.borderId?'borderId="'+e.borderId+'" applyBorder="1"':"")+">\n "+(e.textAlign||e.verticalAlign||e.wrap?"\n <alignment\n "+(e.textAlign?'horizontal="'+g(e.textAlign)+'"':"")+"\n "+(e.verticalAlign?'vertical="'+g(e.verticalAlign)+'"':"")+"\n "+(e.indent?'indent="'+g(e.indent)+'"':"")+"\n "+(e.wrap?'wrapText="1"':"")+" />\n ":"")+"\n </xf>\n "}))+'\n </cellXfs>\n <cellStyles count="1">\n <cellStyle name="Normal" xfId="0" builtinId="0"/>\n </cellStyles>\n <dxfs count="0" />\n <tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleMedium9" />\n</styleSheet>'}({fonts:B,fills:V,formats:j,borders:E,styles:n(N,(function(e){var t={};return q(e)&&(t.fontId=p(e,B)+1),e.background&&(t.fillId=p(e,V)+2),t.textAlign=e.textAlign,t.indent=e.indent,t.verticalAlign=e.verticalAlign,t.wrap=e.wrap,t.borderId=e.borderId,e.format&&(void 0!==L[e.format]?t.numFmtId=L[e.format]:t.numFmtId=165+p(e,j)),t}))})),s.file("sharedStrings.xml",function(e){var t=e.count,n=e.uniqueCount,r=e.indexes;return y+'\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="'+t+'" uniqueCount="'+n+'">\n '+v(Object.keys(r),(function(e){return'\n <si><t xml:space="preserve">'+g(e.substring(1))+"</t></si>"}))+"\n</sst>"}(this._strings)),t.file("[Content_Types].xml",function(e){var t=e.sheetCount,n=e.commentFiles,r=e.drawingFiles;return y+'\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">\n <Default Extension="png" ContentType="image/png"/>\n <Default Extension="gif" ContentType="image/gif"/>\n <Default Extension="jpg" ContentType="image/jpeg"/>\n <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />\n <Default Extension="xml" ContentType="application/xml" />\n <Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing"/>\n <Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" />\n <Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>\n <Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>\n '+x(t,(function(e){return'<Override PartName="/xl/worksheets/sheet'+(e+1)+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />'}))+"\n "+v(n,(function(e){return'<Override PartName="/xl/'+e+'" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"/>'}))+"\n "+v(r,(function(e){return'<Override PartName="/xl/drawings/'+e+'" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml"/>'}))+'\n <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />\n <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" />\n</Types>'}({sheetCount:i,commentFiles:u,drawingFiles:w})),t},toDataURL:function(){var e=this.toZIP();return e.generateAsync?e.generateAsync(c).then(u):u(e.generate(c))},toBlob:function(){var e=this.toZIP();return e.generateAsync?e.generateAsync(d):new Blob([e.generate(f)],{type:m})}});function R(e,t){var n,r,o="";return t&&(o+="<"+e+' style="'+(n=t.size,r="thin",2===n?r="medium":3===n&&(r="thick"),r+'">'),t.color&&(o+='<color rgb="'+M(t.color)+'"/>'),o+="</"+e+">"),o}function O(e){var t=e.diagonal?e.diagonal.type:0;return"<border "+(2&t?'diagonalUp="true"':"")+" "+(1&t?'diagonalDown="true"':"")+">\n "+R("left",e.left)+"\n "+R("right",e.right)+"\n "+R("top",e.top)+"\n "+R("bottom",e.bottom)+"\n "+R("diagonal",e.diagonal)+"\n </border>"}var E={};function N(e){return e.sort((function(e,t){return e.index-t.index}))}function q(e,t){for(var n=0;n<e.length;++n){var r=e[n].split(":"),o=r[0];if(o===t){var i=r[1];return o=z(o),{rowSpan:(i=z(i)).row-o.row+1,colSpan:i.col-o.col+1}}}}function z(e){var t,n=/^([a-z]+)(\d+)$/i.exec(e);return{row:(t=n[2],parseInt(t,10)-1),col:function(e){for(var t=e.toUpperCase(),n=0,r=0;r<t.length;++r)n=26*n+t.charCodeAt(r)-64;return n-1}(n[1])}}function B(e){return Math.round(9525*e)}function j(e,t){var n,r,o=e._source,i=e.index,s=o.cells,a=e.cells;if(s)for(var l=0;l<s.length;l++){var m=s[l]||E,c=m.rowSpan||1,d=m.colSpan||1,f=V(a,m),u=I(i,f);if(1===c&&1===d){var p=q(t.mergedCells,u);p&&(d=p.colSpan,c=p.rowSpan)}if(U(m,a,f,d),(c>1||d>1)&&(n=t.mergedCells,r=u+":"+I(i+c-1,f+d-1),n.indexOf(r)<0&&n.push(r)),c>1)for(var h=i+1;h<i+c;h++){var g=t.rowsByIndex[h];g||(g=t.rowsByIndex[h]={index:h,cells:[]},t.rowData.push(g)),U(m,g.cells,f-1,d+1)}}}function V(e,t){var n;return"number"==typeof t.index?(n=t.index,W(e,t,t.index)):n=function(e,t){for(var n=e.length,r=0;r<e.length+1;r++)if(!e[r]){e[r]=t,n=r;break}return n}(e,t),n}function W(e,t,n){e[n]=t}function U(e,t,n,r){for(var o=1;o<r;o++){W(t,{borderTop:e.borderTop,borderRight:e.borderRight,borderBottom:e.borderBottom,borderLeft:e.borderLeft},n+o)}}var X=function(e){return"\n<customFilters "+("and"===e.logic?'and="1"':"")+">\n"+v(e.criteria,(function(e){var t=$.customOperator(e);return"<customFilter "+(t?'operator="'+t+'"':"")+' val="'+$.customValue(e)+'"/>'}))+"\n</customFilters>"},H=function(e){var t=e.type;return'<dynamicFilter type="'+$.dynamicFilterType(t)+'" />'},J=function(e){var t=e.type,n=e.value;return'<top10 percent="'+(/percent$/i.test(t)?1:0)+'"\n top="'+(/^top/i.test(t)?1:0)+'"\n val="'+n+'" />'},Z=function(e){return"<filters "+(e.blanks?'blank="1"':"")+">\n "+v(e.values,(function(e){return'\n <filter val="'+e+'" />'}))+"\n </filters>"};function $(e){return function(e){var t=e.ref,n=e.columns,r=e.generators;return'\n<autoFilter ref="'+t+'">\n '+v(n,(function(e){return'\n <filterColumn colId="'+e.index+'">\n '+r[e.filter](e)+"\n </filterColumn>\n "}))+"\n</autoFilter>"}({ref:e.ref,columns:e.columns,generators:{custom:X,dynamic:H,top:J,value:Z}})}$.customOperator=function(e){return{eq:"equal",gt:"greaterThan",gte:"greaterThanOrEqual",lt:"lessThan",lte:"lessThanOrEqual",ne:"notEqual",doesnotstartwith:"notEqual",doesnotendwith:"notEqual",doesnotcontain:"notEqual",doesnotmatch:"notEqual"}[e.operator.toLowerCase()]},$.customValue=function(e){function t(e){return e.replace(/([*?])/g,"~$1")}switch(e.operator.toLowerCase()){case"startswith":case"doesnotstartwith":return t(e.value)+"*";case"endswith":case"doesnotendwith":return"*"+t(e.value);case"contains":case"doesnotcontain":return"*"+t(e.value)+"*";default:return e.value}},$.dynamicFilterType=function(e){return{quarter1:"Q1",quarter2:"Q2",quarter3:"Q3",quarter4:"Q4",january:"M1",february:"M2",march:"M3",april:"M4",may:"M5",june:"M6",july:"M7",august:"M8",september:"M9",october:"M10",november:"M11",december:"M12"}[e.toLowerCase()]||e},kendo.deepExtend(kendo.ooxml,{IntlService:i,Workbook:A,Worksheet:C})}(window.kendo.jQuery),e=window.kendo.jQuery,t=kendo.ooxml.Workbook,kendo.ooxml.IntlService.register({toString:kendo.toString}),kendo.ooxml.Workbook=t.extend({toDataURL:function(){var e=t.fn.toDataURL.call(this);if("string"!=typeof e)throw new Error("The toDataURL method can be used only with jsZip 2. Either include jsZip 2 or use the toDataURLAsync method.");return e},toDataURLAsync:function(){var n=e.Deferred(),r=t.fn.toDataURL.call(this);return"string"==typeof r?r=n.resolve(r):r&&r.then&&r.then((function(e){n.resolve(e)}),(function(){n.reject()})),n.promise()}})}));
//# sourceMappingURL=kendo.ooxml.min.js.map