Socket
Book a DemoSign in
Socket

@syncfusion/ej2-file-utils

Package Overview
Dependencies
Maintainers
3
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-file-utils - npm Package Compare versions

Comparing version
32.1.19
to
32.1.24
+9
-0
dist/ej2-file-utils.min.js

@@ -0,1 +1,10 @@

/*!
* filename: ej2-file-utils.min.js
* version : 32.1.24
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SyncfusionFileUtils=e():t.SyncfusionFileUtils=e()}(self,()=>(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Encoding:()=>a,Namespace:()=>r,Save:()=>n,StreamWriter:()=>h,XmlAttribute:()=>s,XmlElement:()=>o,XmlWriter:()=>i,validateNullOrUndefined:()=>c});var n=function(){function t(){}return t.save=function(t,e){if(null==t||""===t)throw new Error("ArgumentException: fileName cannot be undefined, null or empty");var n=t.substring(t.lastIndexOf(".")+1,t.length),i=this.getMimeType(n);if(""!==i&&(e=new Blob([e],{type:i})),this.isMicrosoftBrowser)navigator.msSaveBlob(e,t);else{var r=document.createElementNS("http://www.w3.org/1999/xhtml","a");this.saveInternal(t,n,e,r,"download"in r)}},t.saveInternal=function(t,e,n,i,r){if(r){i.download=t;var o=window.URL.createObjectURL(n);i.href=o;var s=document.createEvent("MouseEvent");s.initEvent("click",!0,!0),i.dispatchEvent(s),setTimeout(function(){window.URL.revokeObjectURL(o),o=void 0})}else if("docx"!==e&&"xlsx"!==e){var a=window.URL.createObjectURL(n);window.open(a,"_blank")||(window.location.href=a)}else{var c=new FileReader;c.onloadend=function(){window.open(c.result,"_blank")||(window.location.href=c.result)},c.readAsDataURL(n)}},t.getMimeType=function(t){var e="";switch(t){case"html":e="text/html";break;case"pdf":e="application/pdf";break;case"docx":e="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"xlsx":e="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"txt":e="text/plain"}return e},t}(),i=function(){function t(){this.contentPos=0,this.bufferText="",this.bufferBlob=new Blob([""],{type:"text/plain"}),this.currentState="Initial",this.namespaceStack=[],this.namespaceStack.push(new r),this.namespaceStack[0].set("xmlns","http://www.w3.org/2000/xmlns/","Special"),this.namespaceStack.push(new r),this.namespaceStack[1].set("xml","http://www.w3.org/XML/1998/namespace","Special"),this.namespaceStack.push(new r),this.namespaceStack[2].set("","","Implied"),this.elementStack=[],this.elementStack.push(new o),this.elementStack[0].set("","","",this.namespaceStack.length-1),this.attributeStack=[],n.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),t.prototype.writeProcessingInstruction=function(t,e){if(null==t||0===t.length)throw new Error("ArgumentException: name should not be undefined, null or empty");if(this.checkName(t),null==e&&(e=""),3===t.length&&"xml"===t&&"Initial"!==this.currentState)throw new Error("InvalidArgumentException: Cannot write XML declaration.WriteStartDocument method has already written it");if("Initial"!==this.currentState||void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");this.writeStartDocument(),this.writeProcessingInstructionInternal(t,e)},t.prototype.writeStartDocument=function(t){if("Initial"!==this.currentState||void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");this.currentState="StartDocument",this.rawText('<?xml version="1.0" encoding="utf-8'),null!=t&&(this.rawText('" standalone="'),this.rawText(t?"yes":"no")),this.rawText('"?>')},t.prototype.writeEndDocument=function(){for(;this.elementStack.length-1>0;)this.writeEndElement();this.currentState="EndDocument",this.flush()},t.prototype.writeStartElement=function(t,e,n){if(void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");if(null==e||0===e.length)throw new Error("ArgumentException: localName cannot be undefined, null or empty");if(this.checkName(e),"Initial"===this.currentState&&this.writeStartDocument(),"StartElement"===this.currentState&&this.startElementContent(),this.currentState="StartElement",null==t)null!=n&&(t=this.lookupPrefix(n)),null==t&&(t="");else if(t.length>0&&(null==n&&(n=this.lookupNamespace(t)),null==n||void 0!==n&&0===n.length))throw new Error("ArgumentException: Cannot use a prefix with an empty namespace");null==n&&(n=this.lookupNamespace(t)),this.writeStartElementInternal(t,e,n)},t.prototype.writeEndElement=function(){"StartElement"===this.currentState?(this.startElementContent(),this.currentState="ElementContent"):"ElementContent"===this.currentState&&(this.currentState="ElementContent"),this.currentState="EndElement";var t=this.elementStack.length-1;this.writeEndElementInternal(this.elementStack[t].prefix,this.elementStack[t].localName),this.namespaceStack.splice(this.elementStack[t].previousTop+1),this.elementStack.splice(t),this.bufferText.length>10240&&this.flush()},t.prototype.writeElementString=function(t,e,n,i){this.writeStartElement(t,e,n),null!=i&&0!==i.length&&this.writeString(i),this.writeEndElement()},t.prototype.writeAttributeString=function(t,e,n,i){this.writeStartAttribute(t,e,n,i),this.writeStringInternal(i,!0),this.writeEndAttribute()},t.prototype.writeString=function(t){this.writeInternal(t,!1)},t.prototype.writeRaw=function(t){this.writeInternal(t,!0)},t.prototype.writeInternal=function(t,e){if(null!=t){if("StartElement"!==this.currentState&&"ElementContent"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");"StartElement"===this.currentState&&this.startElementContent(),this.currentState="ElementContent",e?this.rawText(t):this.writeStringInternal(t,!1)}},t.prototype.save=function(t){for(;this.elementStack.length-1>0;)this.writeEndElement();""!==this.bufferText&&this.flush(),n.save(t,this.buffer)},t.prototype.destroy=function(){this.bufferBlob=void 0;for(var t=0,e=this.namespaceStack;t<e.length;t++){e[t].destroy()}this.namespaceStack=[];for(var n=0,i=this.elementStack;n<i.length;n++){i[n].destroy()}this.elementStack=[],this.bufferText="",this.contentPos=0},t.prototype.flush=function(){void 0!==this.bufferBlob&&(this.bufferBlob=new Blob([this.bufferBlob,this.bufferText],{type:"text/plain"}),this.bufferText="")},t.prototype.writeProcessingInstructionInternal=function(t,e){this.bufferText+="<?",this.rawText(t),e.length>0&&(this.bufferText+=" ",e=e.replace(/\?\>/g,"? >"),this.bufferText+=e),this.bufferText+="?",this.bufferText+=">"},t.prototype.writeStartAttribute=function(t,e,n,i){if(null==e||0===e.length){if("xmlns"!==t)throw new Error("ArgumentException: localName cannot be undefined, null or empty");e="xmlns",t=""}if("StartElement"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");this.checkName(e),this.writeStartAttributePrefixAndNameSpace(t,e,n,i)},t.prototype.writeStartAttributePrefixAndNameSpace=function(t,e,n,i){null==t&&(null!=n&&("xmlns"===e&&"http://www.w3.org/2000/xmlns/"===n||(t=this.lookupPrefix(n))),null==t&&(t="")),null==n&&(null!=t&&t.length>0&&(n=this.lookupNamespace(t)),null==n&&(n="")),this.writeStartAttributeSpecialAttribute(t,e,n,i)},t.prototype.writeStartAttributeSpecialAttribute=function(t,e,n,i){if(0===t.length){if("x"===e[0]&&"xmlns"===e)return this.skipPushAndWrite(t,e,n),void this.pushNamespaceExplicit("",i);n.length>0&&(t=this.lookupPrefix(n))}else{if("x"===t[0]){if("xmlns"===t)return this.skipPushAndWrite(t,e,n),void this.pushNamespaceExplicit(e,i);if("xml"===t&&("space"===e||"lang"===e))return void this.skipPushAndWrite(t,e,n)}0===n.length&&(t="")}null!=t&&0!==t.length&&this.pushNamespaceImplicit(t,n),this.skipPushAndWrite(t,e,n)},t.prototype.writeEndAttribute=function(){this.currentState="StartElement",this.bufferText+='"'},t.prototype.writeStartElementInternal=function(t,e,n){this.bufferText+="<",t.length>0&&(this.rawText(t),this.bufferText+=":"),this.rawText(e);var i=this.elementStack.length;this.elementStack.push(new o),this.elementStack[i].set(t,e,n,this.namespaceStack.length-1),this.pushNamespaceImplicit(t,n);for(var r=0,s=this.attributeStack;r<s.length;r++){s[r].destroy()}this.attributeStack=[]},t.prototype.writeEndElementInternal=function(t,e){this.contentPos!==this.bufferText.length+1?(this.bufferText+="</",null!=t&&0!==t.length&&(this.rawText(t),this.bufferText+=":"),this.rawText(e),this.bufferText+=">"):(this.bufferText=this.bufferText.substring(0,this.bufferText.length-1),this.bufferText+=" />")},t.prototype.writeStartAttributeInternal=function(t,e,n){this.bufferText+=" ",null!=t&&t.length>0&&(this.rawText(t),this.bufferText+=":"),this.rawText(e),this.bufferText+="=",this.bufferText+='"'},t.prototype.writeNamespaceDeclaration=function(t,e){this.writeStartNamespaceDeclaration(t),this.writeStringInternal(e,!0),this.bufferText+='"'},t.prototype.writeStartNamespaceDeclaration=function(t){null==t||0===t.length?this.rawText(' xmlns="'):(this.rawText(" xmlns:"),this.rawText(t),this.bufferText+="=",this.bufferText+='"')},t.prototype.writeStringInternal=function(t,e){null==t&&(t="");t=(t=(t=t.replace(/\&/g,"&amp;")).replace(/\</g,"&lt;")).replace(/\>/g,"&gt;"),e&&(t=t.replace(/\"/g,"&quot;")),this.bufferText+=t,e||(this.contentPos=0)},t.prototype.startElementContent=function(){for(var t=this.elementStack[this.elementStack.length-1].previousTop,e=this.namespaceStack.length-1;e>t;e--)"NeedToWrite"===this.namespaceStack[e].kind&&this.writeNamespaceDeclaration(this.namespaceStack[e].prefix,this.namespaceStack[e].namespaceUri);this.bufferText+=">",this.contentPos=this.bufferText.length+1},t.prototype.rawText=function(t){this.bufferText+=t},t.prototype.addNamespace=function(t,e,n){var i=this.namespaceStack.length;this.namespaceStack.push(new r),this.namespaceStack[i].set(t,e,n)},t.prototype.lookupPrefix=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].namespaceUri===t)return this.namespaceStack[e].prefix},t.prototype.lookupNamespace=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].prefix===t)return this.namespaceStack[e].namespaceUri},t.prototype.lookupNamespaceIndex=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].prefix===t)return e;return-1},t.prototype.pushNamespaceImplicit=function(t,e){var n,i=this.lookupNamespaceIndex(t);if(-1!==i){if(i>this.elementStack[this.elementStack.length-1].previousTop){if(this.namespaceStack[i].namespaceUri!==e)throw new Error("XmlException namespace Uri needs to be the same as the one that is already declared");return}if("Special"===this.namespaceStack[i].kind){if("xml"!==t)throw new Error('InvalidArgumentException: Prefix "xmlns" is reserved for use by XML.');if(e!==this.namespaceStack[i].namespaceUri)throw new Error("InvalidArgumentException: Xml String");n="Implied"}else n=this.namespaceStack[i].namespaceUri===e?"Implied":"NeedToWrite"}else{if("http://www.w3.org/XML/1998/namespace"===e&&"xml"!==t||"http://www.w3.org/2000/xmlns/"===e&&"xmlns"!==t)throw new Error("InvalidArgumentException");n="NeedToWrite"}this.addNamespace(t,e,n)},t.prototype.pushNamespaceExplicit=function(t,e){var n=this.lookupNamespaceIndex(t);-1!==n&&n>this.elementStack[this.elementStack.length-1].previousTop?this.namespaceStack[n].kind="Written":this.addNamespace(t,e,"Written")},t.prototype.addAttribute=function(t,e,n){var i=this.attributeStack.length;this.attributeStack.push(new s),this.attributeStack[i].set(t,e,n);for(var r=0;r<i;r++)if(this.attributeStack[r].isDuplicate(t,e,n))throw new Error("XmlException: duplicate attribute name")},t.prototype.skipPushAndWrite=function(t,e,n){this.addAttribute(t,e,n),this.writeStartAttributeInternal(t,e,n)},t.prototype.checkName=function(t){if(/[ !@#$%^&*()+\=\[\]{};':"\\|,<>\/?]/.test(t))throw new Error("InvalidArgumentException: invalid name character")},t}(),r=function(){function t(){}return t.prototype.set=function(t,e,n){this.prefix=t,this.namespaceUri=e,this.kind=n},t.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.kind=void 0},t}(),o=function(){function t(){}return t.prototype.set=function(t,e,n,i){this.previousTop=i,this.prefix=t,this.namespaceUri=n,this.localName=e},t.prototype.destroy=function(){this.previousTop=void 0,this.prefix=void 0,this.localName=void 0,this.namespaceUri=void 0},t}(),s=function(){function t(){}return t.prototype.set=function(t,e,n){this.prefix=t,this.namespaceUri=n,this.localName=e},t.prototype.isDuplicate=function(t,e,n){return this.localName===e&&(this.prefix===t||this.namespaceUri===n)},t.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.localName=void 0},t}(),a=function(){function t(t){this.emitBOM=!0,this.encodingType="Ansi",this.initBOM(t)}return Object.defineProperty(t.prototype,"includeBom",{get:function(){return this.emitBOM},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.encodingType},set:function(t){this.encodingType=t},enumerable:!0,configurable:!0}),t.prototype.initBOM=function(t){this.emitBOM=null==t||t},t.prototype.getByteCount=function(t){return c(t,"string"),""===t?this.utf8Len(t.charCodeAt(0)):(null!==this.type&&void 0!==this.type||(this.type="Ansi"),this.getByteCountInternal(t,0,t.length))},t.prototype.utf8Len=function(t){return t<=127?1:t<=2047?2:t<=65535?3:t<=2097151?4:0},t.prototype.isHighSurrogate=function(t){return t>=55296&&t<=56319},t.prototype.toCodepoint=function(t,e){return((t=(1023&t)<<10)|1023&e)+65536},t.prototype.getByteCountInternal=function(t,e,n){var i=0;if("Utf8"===this.encodingType||"Unicode"===this.encodingType){for(var r="Utf8"===this.encodingType,o=0;o<n;o++){var s=t.charCodeAt(r?e:e++);if(this.isHighSurrogate(s))if(r){var a=s,c=t.charCodeAt(++e);i+=this.utf8Len(this.toCodepoint(a,c))}else i+=4,++o;else i+=r?this.utf8Len(s):2;r&&e++}return i}return i=n},t.prototype.getBytes=function(t,e,n){if(c(t,"string"),c(e,"charIndex"),c(n,"charCount"),e<0||n<0)throw new RangeError("Argument Out Of Range Exception: charIndex or charCount is less than zero");if(t.length-e<n)throw new RangeError("Argument Out Of Range Exception: charIndex and charCount do not denote a valid range in string");if(""===t)return new ArrayBuffer(0);null!==this.type&&void 0!==this.type||(this.type="Ansi");var i=this.getByteCountInternal(t,e,n);switch(this.type){case"Utf8":return this.getBytesOfUtf8Encoding(i,t,e,n);case"Unicode":return this.getBytesOfUnicodeEncoding(i,t,e,n);default:return this.getBytesOfAnsiEncoding(i,t,e,n)}},t.prototype.getString=function(t,e,n){if(c(t,"bytes"),c(e,"index"),c(n,"count"),e<0||n<0)throw new RangeError("Argument Out Of Range Exception: index or count is less than zero");if(t.byteLength-e<n)throw new RangeError("Argument Out Of Range Exception: index and count do not denote a valid range in bytes");if(0===t.byteLength||0===n)return"";null!==this.type&&void 0!==this.type||(this.type="Ansi");var i="",r=new Uint8Array(t);switch(this.type){case"Utf8":return this.getStringOfUtf8Encoding(r,e,n);case"Unicode":var o=new Uint16Array(t);return i=this.getStringofUnicodeEncoding(o,e,n);default:for(var s=e,a=r,h=0;h<n;h++){var u=a[s];i+=String.fromCharCode(u),s++}return i}},t.prototype.getBytesOfAnsiEncoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint8Array(r),s=0,a=0;a<i;a++){var c=e.charCodeAt(n++);o[s]=c<2048?c:63,s++}return r},t.prototype.getBytesOfUtf8Encoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint8Array(r),s=n,a=0,c=0;c<i;c++){var h=e.charCodeAt(s);h<=127?o[a]=h:h<2048?(o[a]=192|h>>6,o[++a]=128|63&h):h<55296||h>=57344?(o[a]=224|h>>12,o[++a]=128|h>>6&63,o[++a]=128|63&h):(o[a]=239,o[++a]=191,o[++a]=189),++a,++s}return r},t.prototype.getBytesOfUnicodeEncoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint16Array(r),s=0;s<i;s++){var a=e.charCodeAt(s);o[s]=a}return r},t.prototype.getStringOfUtf8Encoding=function(t,e,n){for(var i=0,r=e,o="";i<n;i++){for(var s=t[r++];r>t.length;)return o;s>127&&(s>191&&s<224&&r<n?s=(31&s)<<6|63&t[r]:s>223&&s<240&&r<t.byteLength?s=(15&s)<<12|(63&t[r])<<6|63&t[++r]:s>239&&s<248&&r<t.byteLength&&(s=(7&s)<<18|(63&t[r])<<12|(63&t[++r])<<6|63&t[++r]),++r),o+=String.fromCharCode(s)}return o},t.prototype.getStringofUnicodeEncoding=function(t,e,n){if(n>t.length)throw new RangeError("ArgumentOutOfRange_Count");for(var i=new Uint16Array(n),r=0;r<n&&r<t.length;r++)i[r]=t[e++];return String.fromCharCode.apply(null,i)},t.prototype.destroy=function(){this.emitBOM=void 0,this.encodingType=void 0},t}();function c(t,e){if(null==t)throw new Error("ArgumentException: "+e+" cannot be null or undefined")}var h=function(){function t(t){this.bufferBlob=new Blob([""]),this.bufferText="",this.init(t),n.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"encoding",{get:function(){return this.enc},enumerable:!0,configurable:!0}),t.prototype.init=function(t){null==t?(this.enc=new a(!1),this.enc.type="Utf8"):(this.enc=t,this.setBomByte())},t.prototype.setBomByte=function(){if(this.encoding.includeBom)switch(this.encoding.type){case"Unicode":var t=new ArrayBuffer(2),e=new Uint8Array(t);e[0]=255,e[1]=254,this.bufferBlob=new Blob([t]);break;case"Utf8":var n=new ArrayBuffer(3),i=new Uint8Array(n);i[0]=239,i[1]=187,i[2]=191,this.bufferBlob=new Blob([n]);break;default:this.bufferBlob=new Blob([""])}},t.prototype.save=function(t){""!==this.bufferText&&this.flush(),n.save(t,this.buffer)},t.prototype.write=function(t){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");c(t,"string"),this.bufferText+=t,this.bufferText.length>=10240&&this.flush()},t.prototype.flush=function(){if(void 0!==this.bufferText&&null!==this.bufferText&&0!==this.bufferText.length){var t=this.encoding.getBytes(this.bufferText,0,this.bufferText.length);this.bufferText="",this.bufferBlob=new Blob([this.bufferBlob,t])}},t.prototype.writeLine=function(t){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");c(t,"string"),this.bufferText=this.bufferText+t+"\r\n",this.bufferText.length>=10240&&this.flush()},t.prototype.destroy=function(){this.bufferBlob=void 0,this.bufferText=void 0,this.enc instanceof a&&this.enc.destroy(),this.enc=void 0},t}();return e})());

@@ -0,2 +1,11 @@

/*!
* filename: ej2-file-utils.umd.min.js
* version : 32.1.24
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).ej={})}(this,function(t){"use strict";n.save=function(t,e){if(null==t||""===t)throw new Error("ArgumentException: fileName cannot be undefined, null or empty");var n=t.substring(t.lastIndexOf(".")+1,t.length),i=this.getMimeType(n);""!==i&&(e=new Blob([e],{type:i})),this.isMicrosoftBrowser?navigator.msSaveBlob(e,t):(i=document.createElementNS("http://www.w3.org/1999/xhtml","a"),this.saveInternal(t,n,e,i,"download"in i))},n.saveInternal=function(t,e,n,i,r){var o,s;r?(i.download=t,o=window.URL.createObjectURL(n),i.href=o,(r=document.createEvent("MouseEvent")).initEvent("click",!0,!0),i.dispatchEvent(r),setTimeout(function(){window.URL.revokeObjectURL(o),o=void 0})):"docx"!==e&&"xlsx"!==e?(t=window.URL.createObjectURL(n),window.open(t,"_blank")||(window.location.href=t)):((s=new FileReader).onloadend=function(){window.open(s.result,"_blank")||(window.location.href=s.result)},s.readAsDataURL(n))},n.getMimeType=function(t){var e="";switch(t){case"html":e="text/html";break;case"pdf":e="application/pdf";break;case"docx":e="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"xlsx":e="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"txt":e="text/plain"}return e};var e=n;function n(){}Object.defineProperty(r.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),r.prototype.writeProcessingInstruction=function(t,e){if(null==t||0===t.length)throw new Error("ArgumentException: name should not be undefined, null or empty");if(this.checkName(t),null==e&&(e=""),3===t.length&&"xml"===t&&"Initial"!==this.currentState)throw new Error("InvalidArgumentException: Cannot write XML declaration.WriteStartDocument method has already written it");if("Initial"!==this.currentState||void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");this.writeStartDocument(),this.writeProcessingInstructionInternal(t,e)},r.prototype.writeStartDocument=function(t){if("Initial"!==this.currentState||void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");this.currentState="StartDocument",this.rawText('<?xml version="1.0" encoding="utf-8'),null!=t&&(this.rawText('" standalone="'),this.rawText(t?"yes":"no")),this.rawText('"?>')},r.prototype.writeEndDocument=function(){for(;0<this.elementStack.length-1;)this.writeEndElement();this.currentState="EndDocument",this.flush()},r.prototype.writeStartElement=function(t,e,n){if(void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");if(null==e||0===e.length)throw new Error("ArgumentException: localName cannot be undefined, null or empty");if(this.checkName(e),"Initial"===this.currentState&&this.writeStartDocument(),"StartElement"===this.currentState&&this.startElementContent(),this.currentState="StartElement",null==t)null==(t=null!=n?this.lookupPrefix(n):t)&&(t="");else if(0<t.length&&(null==(n=null==n?this.lookupNamespace(t):n)||void 0!==n&&0===n.length))throw new Error("ArgumentException: Cannot use a prefix with an empty namespace");null==n&&(n=this.lookupNamespace(t)),this.writeStartElementInternal(t,e,n)},r.prototype.writeEndElement=function(){"StartElement"===this.currentState?(this.startElementContent(),this.currentState="ElementContent"):"ElementContent"===this.currentState&&(this.currentState="ElementContent"),this.currentState="EndElement";var t=this.elementStack.length-1;this.writeEndElementInternal(this.elementStack[t].prefix,this.elementStack[t].localName),this.namespaceStack.splice(this.elementStack[t].previousTop+1),this.elementStack.splice(t),10240<this.bufferText.length&&this.flush()},r.prototype.writeElementString=function(t,e,n,i){this.writeStartElement(t,e,n),null!=i&&0!==i.length&&this.writeString(i),this.writeEndElement()},r.prototype.writeAttributeString=function(t,e,n,i){this.writeStartAttribute(t,e,n,i),this.writeStringInternal(i,!0),this.writeEndAttribute()},r.prototype.writeString=function(t){this.writeInternal(t,!1)},r.prototype.writeRaw=function(t){this.writeInternal(t,!0)},r.prototype.writeInternal=function(t,e){if(null!=t){if("StartElement"!==this.currentState&&"ElementContent"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");"StartElement"===this.currentState&&this.startElementContent(),this.currentState="ElementContent",e?this.rawText(t):this.writeStringInternal(t,!1)}},r.prototype.save=function(t){for(;0<this.elementStack.length-1;)this.writeEndElement();""!==this.bufferText&&this.flush(),e.save(t,this.buffer)},r.prototype.destroy=function(){this.bufferBlob=void 0;for(var t=0,e=this.namespaceStack;t<e.length;t++)e[t].destroy();this.namespaceStack=[];for(var n=0,i=this.elementStack;n<i.length;n++)i[n].destroy();this.elementStack=[],this.bufferText="",this.contentPos=0},r.prototype.flush=function(){void 0!==this.bufferBlob&&(this.bufferBlob=new Blob([this.bufferBlob,this.bufferText],{type:"text/plain"}),this.bufferText="")},r.prototype.writeProcessingInstructionInternal=function(t,e){this.bufferText+="<?",this.rawText(t),0<e.length&&(this.bufferText+=" ",e=e.replace(/\?\>/g,"? >"),this.bufferText+=e),this.bufferText+="?",this.bufferText+=">"},r.prototype.writeStartAttribute=function(t,e,n,i){if(null==e||0===e.length){if("xmlns"!==t)throw new Error("ArgumentException: localName cannot be undefined, null or empty");e="xmlns",t=""}if("StartElement"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");this.checkName(e),this.writeStartAttributePrefixAndNameSpace(t,e,n,i)},r.prototype.writeStartAttributePrefixAndNameSpace=function(t,e,n,i){null==t&&null==(t=null==n||"xmlns"===e&&"http://www.w3.org/2000/xmlns/"===n?t:this.lookupPrefix(n))&&(t=""),null==n&&null==(n=null!=t&&0<t.length?this.lookupNamespace(t):n)&&(n=""),this.writeStartAttributeSpecialAttribute(t,e,n,i)},r.prototype.writeStartAttributeSpecialAttribute=function(t,e,n,i){if(0===t.length){if("x"===e[0]&&"xmlns"===e)return this.skipPushAndWrite(t,e,n),void this.pushNamespaceExplicit("",i);0<n.length&&(t=this.lookupPrefix(n))}else{if("x"===t[0]){if("xmlns"===t)return this.skipPushAndWrite(t,e,n),void this.pushNamespaceExplicit(e,i);if("xml"===t&&("space"===e||"lang"===e))return void this.skipPushAndWrite(t,e,n)}0===n.length&&(t="")}null!=t&&0!==t.length&&this.pushNamespaceImplicit(t,n),this.skipPushAndWrite(t,e,n)},r.prototype.writeEndAttribute=function(){this.currentState="StartElement",this.bufferText+='"'},r.prototype.writeStartElementInternal=function(t,e,n){this.bufferText+="<",0<t.length&&(this.rawText(t),this.bufferText+=":"),this.rawText(e);var i=this.elementStack.length;this.elementStack.push(new a),this.elementStack[i].set(t,e,n,this.namespaceStack.length-1),this.pushNamespaceImplicit(t,n);for(var r=0,o=this.attributeStack;r<o.length;r++)o[r].destroy();this.attributeStack=[]},r.prototype.writeEndElementInternal=function(t,e){this.contentPos!==this.bufferText.length+1?(this.bufferText+="</",null!=t&&0!==t.length&&(this.rawText(t),this.bufferText+=":"),this.rawText(e),this.bufferText+=">"):(this.bufferText=this.bufferText.substring(0,this.bufferText.length-1),this.bufferText+=" />")},r.prototype.writeStartAttributeInternal=function(t,e,n){this.bufferText+=" ",null!=t&&0<t.length&&(this.rawText(t),this.bufferText+=":"),this.rawText(e),this.bufferText+="=",this.bufferText+='"'},r.prototype.writeNamespaceDeclaration=function(t,e){this.writeStartNamespaceDeclaration(t),this.writeStringInternal(e,!0),this.bufferText+='"'},r.prototype.writeStartNamespaceDeclaration=function(t){null==t||0===t.length?this.rawText(' xmlns="'):(this.rawText(" xmlns:"),this.rawText(t),this.bufferText+="=",this.bufferText+='"')},r.prototype.writeStringInternal=function(t,e){t=(t=(t=(t=null==t?"":t).replace(/\&/g,"&amp;")).replace(/\</g,"&lt;")).replace(/\>/g,"&gt;"),e&&(t=t.replace(/\"/g,"&quot;")),this.bufferText+=t,e||(this.contentPos=0)},r.prototype.startElementContent=function(){for(var t=this.elementStack[this.elementStack.length-1].previousTop,e=this.namespaceStack.length-1;t<e;e--)"NeedToWrite"===this.namespaceStack[e].kind&&this.writeNamespaceDeclaration(this.namespaceStack[e].prefix,this.namespaceStack[e].namespaceUri);this.bufferText+=">",this.contentPos=this.bufferText.length+1},r.prototype.rawText=function(t){this.bufferText+=t},r.prototype.addNamespace=function(t,e,n){var i=this.namespaceStack.length;this.namespaceStack.push(new o),this.namespaceStack[i].set(t,e,n)},r.prototype.lookupPrefix=function(t){for(var e=this.namespaceStack.length-1;0<=e;e--)if(this.namespaceStack[e].namespaceUri===t)return this.namespaceStack[e].prefix},r.prototype.lookupNamespace=function(t){for(var e=this.namespaceStack.length-1;0<=e;e--)if(this.namespaceStack[e].prefix===t)return this.namespaceStack[e].namespaceUri},r.prototype.lookupNamespaceIndex=function(t){for(var e=this.namespaceStack.length-1;0<=e;e--)if(this.namespaceStack[e].prefix===t)return e;return-1},r.prototype.pushNamespaceImplicit=function(t,e){var n,i=this.lookupNamespaceIndex(t);if(-1!==i){if(i>this.elementStack[this.elementStack.length-1].previousTop){if(this.namespaceStack[i].namespaceUri!==e)throw new Error("XmlException namespace Uri needs to be the same as the one that is already declared");return}if("Special"===this.namespaceStack[i].kind){if("xml"!==t)throw new Error('InvalidArgumentException: Prefix "xmlns" is reserved for use by XML.');if(e!==this.namespaceStack[i].namespaceUri)throw new Error("InvalidArgumentException: Xml String");n="Implied"}else n=this.namespaceStack[i].namespaceUri===e?"Implied":"NeedToWrite"}else{if("http://www.w3.org/XML/1998/namespace"===e&&"xml"!==t||"http://www.w3.org/2000/xmlns/"===e&&"xmlns"!==t)throw new Error("InvalidArgumentException");n="NeedToWrite"}this.addNamespace(t,e,n)},r.prototype.pushNamespaceExplicit=function(t,e){var n=this.lookupNamespaceIndex(t);-1!==n&&n>this.elementStack[this.elementStack.length-1].previousTop?this.namespaceStack[n].kind="Written":this.addNamespace(t,e,"Written")},r.prototype.addAttribute=function(t,e,n){var i=this.attributeStack.length;this.attributeStack.push(new c),this.attributeStack[i].set(t,e,n);for(var r=0;r<i;r++)if(this.attributeStack[r].isDuplicate(t,e,n))throw new Error("XmlException: duplicate attribute name")},r.prototype.skipPushAndWrite=function(t,e,n){this.addAttribute(t,e,n),this.writeStartAttributeInternal(t,e,n)},r.prototype.checkName=function(t){if(/[ !@#$%^&*()+\=\[\]{};':"\\|,<>\/?]/.test(t))throw new Error("InvalidArgumentException: invalid name character")};var i=r;function r(){this.contentPos=0,this.bufferText="",this.bufferBlob=new Blob([""],{type:"text/plain"}),this.currentState="Initial",this.namespaceStack=[],this.namespaceStack.push(new o),this.namespaceStack[0].set("xmlns","http://www.w3.org/2000/xmlns/","Special"),this.namespaceStack.push(new o),this.namespaceStack[1].set("xml","http://www.w3.org/XML/1998/namespace","Special"),this.namespaceStack.push(new o),this.namespaceStack[2].set("","","Implied"),this.elementStack=[],this.elementStack.push(new a),this.elementStack[0].set("","","",this.namespaceStack.length-1),this.attributeStack=[],e.isMicrosoftBrowser=!!navigator.msSaveBlob}s.prototype.set=function(t,e,n){this.prefix=t,this.namespaceUri=e,this.kind=n},s.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.kind=void 0};var o=s;function s(){}h.prototype.set=function(t,e,n,i){this.previousTop=i,this.prefix=t,this.namespaceUri=n,this.localName=e},h.prototype.destroy=function(){this.previousTop=void 0,this.prefix=void 0,this.localName=void 0,this.namespaceUri=void 0};var a=h;function h(){}u.prototype.set=function(t,e,n){this.prefix=t,this.namespaceUri=n,this.localName=e},u.prototype.isDuplicate=function(t,e,n){return this.localName===e&&(this.prefix===t||this.namespaceUri===n)},u.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.localName=void 0};var c=u;function u(){}Object.defineProperty(l.prototype,"includeBom",{get:function(){return this.emitBOM},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"type",{get:function(){return this.encodingType},set:function(t){this.encodingType=t},enumerable:!0,configurable:!0}),l.prototype.initBOM=function(t){this.emitBOM=null==t||t},l.prototype.getByteCount=function(t){return p(t,"string"),""===t?this.utf8Len(t.charCodeAt(0)):(null!==this.type&&void 0!==this.type||(this.type="Ansi"),this.getByteCountInternal(t,0,t.length))},l.prototype.utf8Len=function(t){return t<=127?1:t<=2047?2:t<=65535?3:t<=2097151?4:0},l.prototype.isHighSurrogate=function(t){return 55296<=t&&t<=56319},l.prototype.toCodepoint=function(t,e){return 65536+((t=(1023&t)<<10)|1023&e)},l.prototype.getByteCountInternal=function(t,e,n){var i=0;if("Utf8"!==this.encodingType&&"Unicode"!==this.encodingType)return i=n;for(var r="Utf8"===this.encodingType,o=0;o<n;o++){var s,a,h=t.charCodeAt(r?e:e++);this.isHighSurrogate(h)?r?(s=h,a=t.charCodeAt(++e),i+=this.utf8Len(this.toCodepoint(s,a))):(i+=4,++o):i+=r?this.utf8Len(h):2,r&&e++}return i},l.prototype.getBytes=function(t,e,n){if(p(t,"string"),p(e,"charIndex"),p(n,"charCount"),e<0||n<0)throw new RangeError("Argument Out Of Range Exception: charIndex or charCount is less than zero");if(t.length-e<n)throw new RangeError("Argument Out Of Range Exception: charIndex and charCount do not denote a valid range in string");if(""===t)return new ArrayBuffer(0);null!==this.type&&void 0!==this.type||(this.type="Ansi");var i=this.getByteCountInternal(t,e,n);switch(this.type){case"Utf8":return this.getBytesOfUtf8Encoding(i,t,e,n);case"Unicode":return this.getBytesOfUnicodeEncoding(i,t,e,n);default:return this.getBytesOfAnsiEncoding(i,t,e,n)}},l.prototype.getString=function(t,e,n){if(p(t,"bytes"),p(e,"index"),p(n,"count"),e<0||n<0)throw new RangeError("Argument Out Of Range Exception: index or count is less than zero");if(t.byteLength-e<n)throw new RangeError("Argument Out Of Range Exception: index and count do not denote a valid range in bytes");if(0===t.byteLength||0===n)return"";null!==this.type&&void 0!==this.type||(this.type="Ansi");var i="",r=new Uint8Array(t);switch(this.type){case"Utf8":return this.getStringOfUtf8Encoding(r,e,n);case"Unicode":var o=new Uint16Array(t);return i=this.getStringofUnicodeEncoding(o,e,n);default:for(var s=e,a=r,h=0;h<n;h++){var c=a[s];i+=String.fromCharCode(c),s++}return i}},l.prototype.getBytesOfAnsiEncoding=function(t,e,n,i){for(var t=new ArrayBuffer(t),r=new Uint8Array(t),o=0,s=0;s<i;s++){var a=e.charCodeAt(n++);r[o]=a<2048?a:63,o++}return t},l.prototype.getBytesOfUtf8Encoding=function(t,e,n,i){for(var t=new ArrayBuffer(t),r=new Uint8Array(t),o=n,s=0,a=0;a<i;a++){var h=e.charCodeAt(o);h<=127?r[s]=h:h<2048?(r[s]=192|h>>6,r[++s]=128|63&h):h<55296||57344<=h?(r[s]=224|h>>12,r[++s]=128|h>>6&63,r[++s]=128|63&h):(r[s]=239,r[++s]=191,r[++s]=189),++s,++o}return t},l.prototype.getBytesOfUnicodeEncoding=function(t,e,n,i){for(var t=new ArrayBuffer(t),r=new Uint16Array(t),o=0;o<i;o++){var s=e.charCodeAt(o);r[o]=s}return t},l.prototype.getStringOfUtf8Encoding=function(t,e,n){for(var i=0,r=e,o="";i<n;i++){var s=t[r++];if(r>t.length)return o;127<s&&(191<s&&s<224&&r<n?s=(31&s)<<6|63&t[r]:223<s&&s<240&&r<t.byteLength?s=(15&s)<<12|(63&t[r])<<6|63&t[++r]:239<s&&s<248&&r<t.byteLength&&(s=(7&s)<<18|(63&t[r])<<12|(63&t[++r])<<6|63&t[++r]),++r),o+=String.fromCharCode(s)}return o},l.prototype.getStringofUnicodeEncoding=function(t,e,n){if(n>t.length)throw new RangeError("ArgumentOutOfRange_Count");for(var i=new Uint16Array(n),r=0;r<n&&r<t.length;r++)i[r]=t[e++];return String.fromCharCode.apply(null,i)},l.prototype.destroy=function(){this.emitBOM=void 0,this.encodingType=void 0};var f=l;function l(t){this.emitBOM=!0,this.encodingType="Ansi",this.initBOM(t)}function p(t,e){if(null==t)throw new Error("ArgumentException: "+e+" cannot be null or undefined")}Object.defineProperty(d.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"encoding",{get:function(){return this.enc},enumerable:!0,configurable:!0}),d.prototype.init=function(t){null==t?(this.enc=new f(!1),this.enc.type="Utf8"):(this.enc=t,this.setBomByte())},d.prototype.setBomByte=function(){if(this.encoding.includeBom)switch(this.encoding.type){case"Unicode":var t=new ArrayBuffer(2),e=new Uint8Array(t);e[0]=255,e[1]=254,this.bufferBlob=new Blob([t]);break;case"Utf8":e=new ArrayBuffer(3),t=new Uint8Array(e);t[0]=239,t[1]=187,t[2]=191,this.bufferBlob=new Blob([e]);break;default:this.bufferBlob=new Blob([""])}},d.prototype.save=function(t){""!==this.bufferText&&this.flush(),e.save(t,this.buffer)},d.prototype.write=function(t){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");p(t,"string"),this.bufferText+=t,10240<=this.bufferText.length&&this.flush()},d.prototype.flush=function(){var t;void 0!==this.bufferText&&null!==this.bufferText&&0!==this.bufferText.length&&(t=this.encoding.getBytes(this.bufferText,0,this.bufferText.length),this.bufferText="",this.bufferBlob=new Blob([this.bufferBlob,t]))},d.prototype.writeLine=function(t){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");p(t,"string"),this.bufferText=this.bufferText+t+"\r\n",10240<=this.bufferText.length&&this.flush()},d.prototype.destroy=function(){this.bufferBlob=void 0,this.bufferText=void 0,this.enc instanceof f&&this.enc.destroy(),this.enc=void 0};var m=d;function d(t){this.bufferBlob=new Blob([""]),this.bufferText="",this.init(t),e.isMicrosoftBrowser=!!navigator.msSaveBlob}t.Encoding=f,t.Namespace=o,t.Save=e,t.StreamWriter=m,t.XmlAttribute=c,t.XmlElement=a,t.XmlWriter=i,t.validateNullOrUndefined=p,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ej2-file-utils.umd.min.js.map

@@ -0,2 +1,11 @@

/*!
* filename: ej2-file-utils.min.js
* version : 32.1.24
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
this.ej=this.ej||{},this.ej.fileutils=function(t){"use strict";function e(t,e){if(null===t||void 0===t)throw new Error("ArgumentException: "+e+" cannot be null or undefined")}var n=function(){function t(){}return t.save=function(t,e){if(null===t||void 0===t||""===t)throw new Error("ArgumentException: fileName cannot be undefined, null or empty");var n=t.substring(t.lastIndexOf(".")+1,t.length),i=this.getMimeType(n);if(""!==i&&(e=new Blob([e],{type:i})),this.isMicrosoftBrowser)navigator.msSaveBlob(e,t);else{var r=document.createElementNS("http://www.w3.org/1999/xhtml","a");this.saveInternal(t,n,e,r,"download"in r)}},t.saveInternal=function(t,e,n,i,r){if(r){i.download=t;var o=window.URL.createObjectURL(n);i.href=o;var s=document.createEvent("MouseEvent");s.initEvent("click",!0,!0),i.dispatchEvent(s),setTimeout(function(){window.URL.revokeObjectURL(o),o=void 0})}else if("docx"!==e&&"xlsx"!==e){var a=window.URL.createObjectURL(n);window.open(a,"_blank")||(window.location.href=a)}else{var h=new FileReader;h.onloadend=function(){window.open(h.result,"_blank")||(window.location.href=h.result)},h.readAsDataURL(n)}},t.getMimeType=function(t){var e="";switch(t){case"html":e="text/html";break;case"pdf":e="application/pdf";break;case"docx":e="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"xlsx":e="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"txt":e="text/plain"}return e},t}(),i=function(){function t(){this.contentPos=0,this.bufferText="",this.bufferBlob=new Blob([""],{type:"text/plain"}),this.currentState="Initial",this.namespaceStack=[],this.namespaceStack.push(new r),this.namespaceStack[0].set("xmlns","http://www.w3.org/2000/xmlns/","Special"),this.namespaceStack.push(new r),this.namespaceStack[1].set("xml","http://www.w3.org/XML/1998/namespace","Special"),this.namespaceStack.push(new r),this.namespaceStack[2].set("","","Implied"),this.elementStack=[],this.elementStack.push(new o),this.elementStack[0].set("","","",this.namespaceStack.length-1),this.attributeStack=[],n.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),t.prototype.writeProcessingInstruction=function(t,e){if(void 0===t||null===t||0===t.length)throw new Error("ArgumentException: name should not be undefined, null or empty");if(this.checkName(t),void 0!==e&&null!==e||(e=""),3===t.length&&"xml"===t&&"Initial"!==this.currentState)throw new Error("InvalidArgumentException: Cannot write XML declaration.WriteStartDocument method has already written it");if("Initial"!==this.currentState||void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");this.writeStartDocument(),this.writeProcessingInstructionInternal(t,e)},t.prototype.writeStartDocument=function(t){if("Initial"!==this.currentState||void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");this.currentState="StartDocument",this.rawText('<?xml version="1.0" encoding="utf-8'),null!==t&&void 0!==t&&(this.rawText('" standalone="'),this.rawText(t?"yes":"no")),this.rawText('"?>')},t.prototype.writeEndDocument=function(){for(;this.elementStack.length-1>0;)this.writeEndElement();this.currentState="EndDocument",this.flush()},t.prototype.writeStartElement=function(t,e,n){if(void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");if(void 0===e||null===e||0===e.length)throw new Error("ArgumentException: localName cannot be undefined, null or empty");if(this.checkName(e),"Initial"===this.currentState&&this.writeStartDocument(),"StartElement"===this.currentState&&this.startElementContent(),this.currentState="StartElement",void 0===t||null===t)void 0!==n&&null!==n&&(t=this.lookupPrefix(n)),void 0!==t&&null!==t||(t="");else if(t.length>0&&(void 0!==n&&null!==n||(n=this.lookupNamespace(t)),void 0===n||null===n||void 0!==n&&0===n.length))throw new Error("ArgumentException: Cannot use a prefix with an empty namespace");void 0!==n&&null!==n||(n=this.lookupNamespace(t)),this.writeStartElementInternal(t,e,n)},t.prototype.writeEndElement=function(){"StartElement"===this.currentState?(this.startElementContent(),this.currentState="ElementContent"):"ElementContent"===this.currentState&&(this.currentState="ElementContent"),this.currentState="EndElement";var t=this.elementStack.length-1;this.writeEndElementInternal(this.elementStack[t].prefix,this.elementStack[t].localName),this.namespaceStack.splice(this.elementStack[t].previousTop+1),this.elementStack.splice(t),this.bufferText.length>10240&&this.flush()},t.prototype.writeElementString=function(t,e,n,i){this.writeStartElement(t,e,n),void 0!==i&&null!==i&&0!==i.length&&this.writeString(i),this.writeEndElement()},t.prototype.writeAttributeString=function(t,e,n,i){this.writeStartAttribute(t,e,n,i),this.writeStringInternal(i,!0),this.writeEndAttribute()},t.prototype.writeString=function(t){this.writeInternal(t,!1)},t.prototype.writeRaw=function(t){this.writeInternal(t,!0)},t.prototype.writeInternal=function(t,e){if(void 0!==t&&null!==t){if("StartElement"!==this.currentState&&"ElementContent"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");"StartElement"===this.currentState&&this.startElementContent(),this.currentState="ElementContent",e?this.rawText(t):this.writeStringInternal(t,!1)}},t.prototype.save=function(t){for(;this.elementStack.length-1>0;)this.writeEndElement();""!==this.bufferText&&this.flush(),n.save(t,this.buffer)},t.prototype.destroy=function(){this.bufferBlob=void 0;for(var t=0,e=this.namespaceStack;t<e.length;t++)e[t].destroy();this.namespaceStack=[];for(var n=0,i=this.elementStack;n<i.length;n++)i[n].destroy();this.elementStack=[],this.bufferText="",this.contentPos=0},t.prototype.flush=function(){void 0!==this.bufferBlob&&(this.bufferBlob=new Blob([this.bufferBlob,this.bufferText],{type:"text/plain"}),this.bufferText="")},t.prototype.writeProcessingInstructionInternal=function(t,e){this.bufferText+="<?",this.rawText(t),e.length>0&&(this.bufferText+=" ",e=e.replace(/\?\>/g,"? >"),this.bufferText+=e),this.bufferText+="?",this.bufferText+=">"},t.prototype.writeStartAttribute=function(t,e,n,i){if(void 0===e||null===e||0===e.length){if("xmlns"!==t)throw new Error("ArgumentException: localName cannot be undefined, null or empty");e="xmlns",t=""}if("StartElement"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");this.checkName(e),this.writeStartAttributePrefixAndNameSpace(t,e,n,i)},t.prototype.writeStartAttributePrefixAndNameSpace=function(t,e,n,i){void 0!==t&&null!==t||(void 0!==n&&null!==n&&("xmlns"===e&&"http://www.w3.org/2000/xmlns/"===n||(t=this.lookupPrefix(n))),void 0!==t&&null!==t||(t="")),void 0!==n&&null!==n||(void 0!==t&&null!==t&&t.length>0&&(n=this.lookupNamespace(t)),void 0!==n&&null!==n||(n="")),this.writeStartAttributeSpecialAttribute(t,e,n,i)},t.prototype.writeStartAttributeSpecialAttribute=function(t,e,n,i){if(0===t.length){if("x"===e[0]&&"xmlns"===e)return this.skipPushAndWrite(t,e,n),void this.pushNamespaceExplicit("",i);n.length>0&&(t=this.lookupPrefix(n))}else{if("x"===t[0]){if("xmlns"===t)return this.skipPushAndWrite(t,e,n),void this.pushNamespaceExplicit(e,i);if("xml"===t&&("space"===e||"lang"===e))return void this.skipPushAndWrite(t,e,n)}0===n.length&&(t="")}void 0!==t&&null!==t&&0!==t.length&&this.pushNamespaceImplicit(t,n),this.skipPushAndWrite(t,e,n)},t.prototype.writeEndAttribute=function(){this.currentState="StartElement",this.bufferText+='"'},t.prototype.writeStartElementInternal=function(t,e,n){this.bufferText+="<",t.length>0&&(this.rawText(t),this.bufferText+=":"),this.rawText(e);var i=this.elementStack.length;this.elementStack.push(new o),this.elementStack[i].set(t,e,n,this.namespaceStack.length-1),this.pushNamespaceImplicit(t,n);for(var r=0,s=this.attributeStack;r<s.length;r++)s[r].destroy();this.attributeStack=[]},t.prototype.writeEndElementInternal=function(t,e){this.contentPos!==this.bufferText.length+1?(this.bufferText+="</",void 0!==t&&null!==t&&0!==t.length&&(this.rawText(t),this.bufferText+=":"),this.rawText(e),this.bufferText+=">"):(this.bufferText=this.bufferText.substring(0,this.bufferText.length-1),this.bufferText+=" />")},t.prototype.writeStartAttributeInternal=function(t,e,n){this.bufferText+=" ",void 0!==t&&null!==t&&t.length>0&&(this.rawText(t),this.bufferText+=":"),this.rawText(e),this.bufferText+="=",this.bufferText+='"'},t.prototype.writeNamespaceDeclaration=function(t,e){this.writeStartNamespaceDeclaration(t),this.writeStringInternal(e,!0),this.bufferText+='"'},t.prototype.writeStartNamespaceDeclaration=function(t){void 0===t||null===t||0===t.length?this.rawText(' xmlns="'):(this.rawText(" xmlns:"),this.rawText(t),this.bufferText+="=",this.bufferText+='"')},t.prototype.writeStringInternal=function(t,e){null!==t&&void 0!==t||(t=""),t=(t=(t=t.replace(/\&/g,"&amp;")).replace(/\</g,"&lt;")).replace(/\>/g,"&gt;"),e&&(t=t.replace(/\"/g,"&quot;")),this.bufferText+=t,e||(this.contentPos=0)},t.prototype.startElementContent=function(){for(var t=this.elementStack[this.elementStack.length-1].previousTop,e=this.namespaceStack.length-1;e>t;e--)"NeedToWrite"===this.namespaceStack[e].kind&&this.writeNamespaceDeclaration(this.namespaceStack[e].prefix,this.namespaceStack[e].namespaceUri);this.bufferText+=">",this.contentPos=this.bufferText.length+1},t.prototype.rawText=function(t){this.bufferText+=t},t.prototype.addNamespace=function(t,e,n){var i=this.namespaceStack.length;this.namespaceStack.push(new r),this.namespaceStack[i].set(t,e,n)},t.prototype.lookupPrefix=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].namespaceUri===t)return this.namespaceStack[e].prefix},t.prototype.lookupNamespace=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].prefix===t)return this.namespaceStack[e].namespaceUri},t.prototype.lookupNamespaceIndex=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].prefix===t)return e;return-1},t.prototype.pushNamespaceImplicit=function(t,e){var n,i=this.lookupNamespaceIndex(t);if(-1!==i){if(i>this.elementStack[this.elementStack.length-1].previousTop){if(this.namespaceStack[i].namespaceUri!==e)throw new Error("XmlException namespace Uri needs to be the same as the one that is already declared");return}if("Special"===this.namespaceStack[i].kind){if("xml"!==t)throw new Error('InvalidArgumentException: Prefix "xmlns" is reserved for use by XML.');if(e!==this.namespaceStack[i].namespaceUri)throw new Error("InvalidArgumentException: Xml String");n="Implied"}else n=this.namespaceStack[i].namespaceUri===e?"Implied":"NeedToWrite"}else{if("http://www.w3.org/XML/1998/namespace"===e&&"xml"!==t||"http://www.w3.org/2000/xmlns/"===e&&"xmlns"!==t)throw new Error("InvalidArgumentException");n="NeedToWrite"}this.addNamespace(t,e,n)},t.prototype.pushNamespaceExplicit=function(t,e){var n=this.lookupNamespaceIndex(t);if(-1!==n&&n>this.elementStack[this.elementStack.length-1].previousTop)return void(this.namespaceStack[n].kind="Written");this.addNamespace(t,e,"Written")},t.prototype.addAttribute=function(t,e,n){var i=this.attributeStack.length;this.attributeStack.push(new s),this.attributeStack[i].set(t,e,n);for(var r=0;r<i;r++)if(this.attributeStack[r].isDuplicate(t,e,n))throw new Error("XmlException: duplicate attribute name")},t.prototype.skipPushAndWrite=function(t,e,n){this.addAttribute(t,e,n),this.writeStartAttributeInternal(t,e,n)},t.prototype.checkName=function(t){if(/[ !@#$%^&*()+\=\[\]{};':"\\|,<>\/?]/.test(t))throw new Error("InvalidArgumentException: invalid name character")},t}(),r=function(){function t(){}return t.prototype.set=function(t,e,n){this.prefix=t,this.namespaceUri=e,this.kind=n},t.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.kind=void 0},t}(),o=function(){function t(){}return t.prototype.set=function(t,e,n,i){this.previousTop=i,this.prefix=t,this.namespaceUri=n,this.localName=e},t.prototype.destroy=function(){this.previousTop=void 0,this.prefix=void 0,this.localName=void 0,this.namespaceUri=void 0},t}(),s=function(){function t(){}return t.prototype.set=function(t,e,n){this.prefix=t,this.namespaceUri=n,this.localName=e},t.prototype.isDuplicate=function(t,e,n){return this.localName===e&&(this.prefix===t||this.namespaceUri===n)},t.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.localName=void 0},t}(),a=function(){function t(t){this.emitBOM=!0,this.encodingType="Ansi",this.initBOM(t)}return Object.defineProperty(t.prototype,"includeBom",{get:function(){return this.emitBOM},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.encodingType},set:function(t){this.encodingType=t},enumerable:!0,configurable:!0}),t.prototype.initBOM=function(t){this.emitBOM=void 0===t||null===t||t},t.prototype.getByteCount=function(t){return e(t,"string"),""===t?this.utf8Len(t.charCodeAt(0)):(null!==this.type&&void 0!==this.type||(this.type="Ansi"),this.getByteCountInternal(t,0,t.length))},t.prototype.utf8Len=function(t){return t<=127?1:t<=2047?2:t<=65535?3:t<=2097151?4:0},t.prototype.isHighSurrogate=function(t){return t>=55296&&t<=56319},t.prototype.toCodepoint=function(t,e){return((t=(1023&t)<<10)|1023&e)+65536},t.prototype.getByteCountInternal=function(t,e,n){var i=0;if("Utf8"===this.encodingType||"Unicode"===this.encodingType){for(var r="Utf8"===this.encodingType,o=0;o<n;o++){var s=t.charCodeAt(r?e:e++);if(this.isHighSurrogate(s))if(r){var a=s,h=t.charCodeAt(++e);i+=this.utf8Len(this.toCodepoint(a,h))}else i+=4,++o;else i+=r?this.utf8Len(s):2;r&&e++}return i}return i=n},t.prototype.getBytes=function(t,n,i){if(e(t,"string"),e(n,"charIndex"),e(i,"charCount"),n<0||i<0)throw new RangeError("Argument Out Of Range Exception: charIndex or charCount is less than zero");if(t.length-n<i)throw new RangeError("Argument Out Of Range Exception: charIndex and charCount do not denote a valid range in string");if(""===t)return new ArrayBuffer(0);null!==this.type&&void 0!==this.type||(this.type="Ansi");var r=this.getByteCountInternal(t,n,i);switch(this.type){case"Utf8":return this.getBytesOfUtf8Encoding(r,t,n,i);case"Unicode":return this.getBytesOfUnicodeEncoding(r,t,n,i);default:return this.getBytesOfAnsiEncoding(r,t,n,i)}},t.prototype.getString=function(t,n,i){if(e(t,"bytes"),e(n,"index"),e(i,"count"),n<0||i<0)throw new RangeError("Argument Out Of Range Exception: index or count is less than zero");if(t.byteLength-n<i)throw new RangeError("Argument Out Of Range Exception: index and count do not denote a valid range in bytes");if(0===t.byteLength||0===i)return"";null!==this.type&&void 0!==this.type||(this.type="Ansi");var r="",o=new Uint8Array(t);switch(this.type){case"Utf8":return this.getStringOfUtf8Encoding(o,n,i);case"Unicode":var s=new Uint16Array(t);return r=this.getStringofUnicodeEncoding(s,n,i);default:for(var a=n,h=o,c=0;c<i;c++){var u=h[a];r+=String.fromCharCode(u),a++}return r}},t.prototype.getBytesOfAnsiEncoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint8Array(r),s=0,a=0;a<i;a++){var h=e.charCodeAt(n++);o[s]=h<2048?h:63,s++}return r},t.prototype.getBytesOfUtf8Encoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint8Array(r),s=n,a=0,h=0;h<i;h++){var c=e.charCodeAt(s);c<=127?o[a]=c:c<2048?(o[a]=192|c>>6,o[++a]=128|63&c):c<55296||c>=57344?(o[a]=224|c>>12,o[++a]=128|c>>6&63,o[++a]=128|63&c):(o[a]=239,o[++a]=191,o[++a]=189),++a,++s}return r},t.prototype.getBytesOfUnicodeEncoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint16Array(r),s=0;s<i;s++){var a=e.charCodeAt(s);o[s]=a}return r},t.prototype.getStringOfUtf8Encoding=function(t,e,n){var i=0,r=e,o="";for(i;i<n;i++){for(var s=t[r++];r>t.length;)return o;s>127&&(s>191&&s<224&&r<n?s=(31&s)<<6|63&t[r]:s>223&&s<240&&r<t.byteLength?s=(15&s)<<12|(63&t[r])<<6|63&t[++r]:s>239&&s<248&&r<t.byteLength&&(s=(7&s)<<18|(63&t[r])<<12|(63&t[++r])<<6|63&t[++r]),++r),o+=String.fromCharCode(s)}return o},t.prototype.getStringofUnicodeEncoding=function(t,e,n){if(n>t.length)throw new RangeError("ArgumentOutOfRange_Count");for(var i=new Uint16Array(n),r=0;r<n&&r<t.length;r++)i[r]=t[e++];return String.fromCharCode.apply(null,i)},t.prototype.destroy=function(){this.emitBOM=void 0,this.encodingType=void 0},t}(),h=function(){function t(t){this.bufferBlob=new Blob([""]),this.bufferText="",this.init(t),n.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"encoding",{get:function(){return this.enc},enumerable:!0,configurable:!0}),t.prototype.init=function(t){null===t||void 0===t?(this.enc=new a(!1),this.enc.type="Utf8"):(this.enc=t,this.setBomByte())},t.prototype.setBomByte=function(){if(this.encoding.includeBom)switch(this.encoding.type){case"Unicode":var t=new ArrayBuffer(2),e=new Uint8Array(t);e[0]=255,e[1]=254,this.bufferBlob=new Blob([t]);break;case"Utf8":var n=new ArrayBuffer(3),i=new Uint8Array(n);i[0]=239,i[1]=187,i[2]=191,this.bufferBlob=new Blob([n]);break;default:this.bufferBlob=new Blob([""])}},t.prototype.save=function(t){""!==this.bufferText&&this.flush(),n.save(t,this.buffer)},t.prototype.write=function(t){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");e(t,"string"),this.bufferText+=t,this.bufferText.length>=10240&&this.flush()},t.prototype.flush=function(){if(void 0!==this.bufferText&&null!==this.bufferText&&0!==this.bufferText.length){var t=this.encoding.getBytes(this.bufferText,0,this.bufferText.length);this.bufferText="",this.bufferBlob=new Blob([this.bufferBlob,t])}},t.prototype.writeLine=function(t){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");e(t,"string"),this.bufferText=this.bufferText+t+"\r\n",this.bufferText.length>=10240&&this.flush()},t.prototype.destroy=function(){this.bufferBlob=void 0,this.bufferText=void 0,this.enc instanceof a&&this.enc.destroy(),this.enc=void 0},t}();return t.Encoding=a,t.Namespace=r,t.Save=n,t.StreamWriter=h,t.XmlAttribute=s,t.XmlElement=o,t.XmlWriter=i,t.validateNullOrUndefined=e,t}({}),this.ejs=ej;
//# sourceMappingURL=ej2-file-utils.min.js.map

@@ -0,1 +1,10 @@

/*!
* filename: index.d.ts
* version : 32.1.24
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
import * as _fileutils from '@syncfusion/ej2-file-utils';

@@ -2,0 +11,0 @@

+1
-1
{
"name": "@syncfusion/ej2-file-utils",
"version": "32.1.19",
"version": "32.1.24",
"description": "Essential JS 2 File Library",

@@ -5,0 +5,0 @@ "author": "Syncfusion Inc.",