UNPKG

jsprintmanager

Version:

Print Commands & Files, Manage Printers & Scan Docs from Javascript. JSPrintManager Solution allows you to print RAW Printer Commands as well as known File Formats (PDF, JPG, PNG, TIFF, etc.) from Javascript right to any printer available at the client ma

2 lines 213 kB
/*! JSPrintManager v8.0.0 (https://neodynamic.com/products/printing/js-print-manager) | Requires JSPrintManager Client App (https://neodynamic.com/downloads/jspm) | (c) Neodynamic (https://neodynamic.com) */ !function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSPM=e()}(function(){return function n(i,o,s){function a(t,e){if(!o[t]){if(!i[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);throw(r=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",r}r=o[t]={exports:{}},i[t][0].call(r.exports,function(e){return a(i[t][1][e]||e)},r,r.exports,n,i,o,s)}return o[t].exports}for(var u="function"==typeof require&&require,e=0;e<s.length;e++)a(s[e]);return a}({1:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BTComm=void 0;var s=e("./JSPrintManager"),e=(Object.defineProperty(n.prototype,"timeout",{get:function(){return this._timeout},set:function(e){this._timeout=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"receiveBufferSize",{get:function(){return this._receiveBufferSize},set:function(e){this._receiveBufferSize=e},enumerable:!1,configurable:!0}),n.prototype.onError=function(e,t){},n.prototype.onDataReceived=function(e){},n.prototype._onDataReceived=function(e){this.onDataReceived(e.data)},n.prototype.onClose=function(e){},n.prototype.connect=function(){var o=this;return new Promise(function(n,i){var e=o.propertiesJSON();e.on_update=function(e,t,r){t?n(e):r?(o.onClose(e),o._id=""):o._onDataReceived(e)},e.on_error=function(e,t,r){o.onError(e,r),t&&i(e)},o._id=s.JSPrintManager.WS.send(JSON.stringify({channel:o._channel,address:o._address,timeout:o._timeout,receive_buffer_size:o._receiveBufferSize}),e)})},n.prototype.send=function(e){var t=this.propertiesJSON();s.JSPrintManager.WS.send(JSON.stringify({data:e}),t)},n.prototype.close=function(){s.JSPrintManager.WS.send(JSON.stringify({close:!0}),this.propertiesJSON())},n.prototype.propertiesJSON=function(){if(!this._address)throw"The specified address is null or empty.";var e={type:"bt"};return this._id&&(e.id=this._id),e},n);function n(e,t){if(this._id="",this._address="",this._channel=1,this._timeout=1e3,this._receiveBufferSize=1024,!e)throw"The specified address is null or empty.";this._address=e,this._channel=t}r.BTComm=e},{"./JSPrintManager":11}],2:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ClientJob=void 0;var s=e("./JSPrintManager"),e=(n.prototype._generateDataAsync=function(){return new Promise(function(e){})},n.prototype.onUpdate=function(e,t){},n.prototype.onError=function(e,t){},n.prototype.sendToClient=function(){var o=this;return new Promise(function(n,i){o._generateDataAsync().then(function(e){var t={type:o._type,on_update:function(e,t,r){t?n(e):o.onUpdate(e,r)},on_error:function(e,t,r){o.onError(e,r),t&&i(e)}};s.JSPrintManager.WS.send(e,t)}).catch(function(e){return i(e)})})},n);function n(){this._type=""}r.ClientJob=e},{"./JSPrintManager":11}],3:[function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__awaiter||function(e,s,a,u){return new(a=a||Promise)(function(r,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function i(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,i)}o((u=u.apply(e,s||[])).next())})},u=this&&this.__generator||function(r,n){var i,o,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,o&&(s=2&t[0]?o.return:t[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,t[1])).done)return s;switch(o=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,o=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],o=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(r,"__esModule",{value:!0}),r.ClientPrintJob=void 0;var o,s=e("./ClientJob"),c=e("./ClientPrinter"),l=e("./Enums"),f=e("./Utils"),h=e("jszip"),i=(o=s.ClientJob,i(d,o),Object.defineProperty(d.prototype,"clientPrinter",{get:function(){return this._clientPrinter},set:function(e){this._clientPrinter=e},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"printerCommandsCopies",{get:function(){return this._printerCommandsCopies},set:function(e){if(e<1)throw"Copies must be greater than or equal to 1.";this._printerCommandsCopies=e},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"printerCommandsDocName",{get:function(){return this._printerCommandsDocName},set:function(e){this._printerCommandsDocName=e},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"printerCommands",{get:function(){return this._printerCommands},set:function(e){this._printerCommands=e},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"printerCommandsCodePage",{get:function(){return this._printerCommandsCodePage},set:function(e){this._printerCommandsCodePage=e},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"binaryPrinterCommands",{get:function(){return this._binaryPrinterCommands},set:function(e){this._binaryPrinterCommands=e,this._printerCommands=""},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"files",{get:function(){return this._printFileGroup},enumerable:!1,configurable:!0}),d.prototype.onUpdated=function(e){},d.prototype.onFinished=function(e){},d.prototype.onError=function(e,t){},d.prototype.onUpdate=function(e,t){t?this.onFinished(e):this.onUpdated(e)},d.prototype._genPFGArrayAsync=function(s){var t=this;return new Promise(function(n,i){var o,e;0!=s.length&&(o=new h,e=s.map(function(i){return a(t,void 0,void 0,function(){var t,r,n;return u(this,function(e){switch(e.label){case 0:return r=(t=o).file,n=[i.fileName],[4,i.getContent()];case 1:return r.apply(t,n.concat([e.sent()])),[2]}})})}),Promise.all(e).then(function(e){return a(t,void 0,void 0,function(){var t,r;return u(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),o.file("metadata.json",JSON.stringify(s.map(function(e){return e.getProperties()}))),t=n,[4,o.generateAsync({type:"blob"})];case 1:return t.apply(void 0,[e.sent()]),[3,3];case 2:return r=e.sent(),i(r),[3,3];case 3:return[2]}})})}).catch(function(e){return i(e)}))})},d.prototype._genPCArrayAsync=function(o,s,a){return new Promise(function(e,t){try{var r,n,i=new Uint8Array(0);(1<s||a)&&(r={copies:s,doc_name:a},n=f.Utils._str2UTF8Array("PCTAGS="+JSON.stringify(r)+"|"),(i=new Uint8Array(n.length)).set(n,0)),null!=o&&0<o.length&&e(new Blob([i,o]))}catch(e){t(e)}})},d.prototype._genPrinterArrayAsync=function(r){return new Promise(function(e,t){try{r=r||new c.UserSelectedPrinter,e(new Uint8Array(f.Utils._str2UTF8Array(r.serialize())))}catch(e){t(e)}})},d.prototype._cmd2bin=function(){if(this._printerCommands&&0<this._printerCommands.length)try{if(this._printerCommandsCodePage==l.Encoding.Default)this._binaryPrinterCommands=new Uint8Array(f.Utils._str2UTF8Array(this._printerCommands));else{if(!("cptable"in window))throw"cptable.js and cputils.js files from https://github.com/SheetJS/js-codepage project are missing";if(!("utils"in window.cptable))throw"cptable.js and cputils.js files from https://github.com/SheetJS/js-codepage project are missing";if(!(this._printerCommandsCodePage in window.cptable))throw"Encoding "+this._printerCommandsCodePage.toString()+" is missing. Add it fromhttps://github.com/SheetJS/js-codepage/tree/master/bits";this._binaryPrinterCommands=new Uint8Array(window.cptable.utils.encode(this._printerCommandsCodePage,this._printerCommands))}}catch(e){throw e}},d.prototype._generateDataAsync=function(){var e=this;return new Promise(function(n,t){e._cmd2bin();var i=new Uint8Array([99,112,106,2]);Promise.race([e._genPCArrayAsync(e.binaryPrinterCommands,e._printerCommandsCopies,e._printerCommandsDocName),e._genPFGArrayAsync(e._printFileGroup)]).then(function(r){e._genPrinterArrayAsync(e._clientPrinter).then(function(e){var t=f.Utils._intToByteArray(r.size);n(new Blob([i,t,r,e]))}).catch(function(e){t(e)})}).catch(function(e){t(e)})})},d);function d(){var e=null!==o&&o.apply(this,arguments)||this;return e._clientPrinter=null,e._printerCommandsCopies=1,e._printerCommandsDocName="",e._printerCommands="",e._printerCommandsCodePage=l.Encoding.Default,e._binaryPrinterCommands=null,e._printFileGroup=[],e}r.ClientPrintJob=i},{"./ClientJob":2,"./ClientPrinter":5,"./Enums":8,"./Utils":22,jszip:26}],4:[function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.ClientPrintJobGroup=void 0;var o,s=e("./ClientJob"),u=e("./Utils"),i=(o=s.ClientJob,i(a,o),Object.defineProperty(a.prototype,"jobs",{get:function(){return this._jobs},enumerable:!1,configurable:!0}),a.prototype._generateMiniJob=function(e){return new Promise(function(n,t){e._cmd2bin(),Promise.race([e._genPCArrayAsync(e.binaryPrinterCommands,e.printerCommandsCopies,e.printerCommandsDocName),e._genPFGArrayAsync(e.files)]).then(function(r){e._genPrinterArrayAsync(e.clientPrinter).then(function(e){var t=u.Utils._intToByteArray(r.size);n(new Blob([t,r,e]))}).catch(function(e){t(e)})}).catch(function(e){t(e)})})},a.prototype._generateDataAsync=function(){var n=this;return new Promise(function(o,t){for(var s=new Uint8Array([99,112,106,103,2]),a=new Uint8Array(u.Utils._intToByteArray(n.jobs.length)),e=[],r=0;r<n.jobs.length;r++)e.push(n._generateMiniJob(n.jobs[r]));Promise.all(e).then(function(e){for(var t=e.map(function(e){return{startIndex:0,endIndex:e.size-1}}),r=1;r<t.length;r++)t[r].startIndex=t[r-1].endIndex+1,t[r].endIndex+=t[r].startIndex;var n=JSON.stringify(t),i=e.reduce(function(e,t){return new Blob([e,t])}),e=new Uint8Array(u.Utils._intToByteArray(i.size));o(new Blob([s,a,e,i,n]))}).catch(function(e){t(e)})})},a);function a(){var e=null!==o&&o.apply(this,arguments)||this;return e._jobs=[],e}r.ClientPrintJobGroup=i},{"./ClientJob":2,"./Utils":22}],5:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BluetoothPrinter=r.UserSelectedPrinter=r.NetworkPrinter=r.SerialPortPrinter=r.ParallelPortPrinter=r.InstalledPrinter=r.DefaultPrinter=void 0;var u=e("./Enums"),e=(n.prototype.serialize=function(){return JSON.stringify({type:this.Id})},n);function n(){this.Id=0}r.DefaultPrinter=e;i.prototype.bool2str=function(e,t,r){return void 0===t&&(t="1"),void 0===r&&(r="0"),e?t:r},Object.defineProperty(i.prototype,"printerName",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"printToDefaultIfNotFound",{get:function(){return this._printDefault},set:function(e){this._printDefault=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"trayName",{get:function(){return this._tray},set:function(e){this._tray=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"paperName",{get:function(){return this._paper},set:function(e){this._paper=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"duplex",{get:function(){return this._duplex},set:function(e){this._duplex=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"autoDetectRawModeDataType",{get:function(){return this._autoDetectRawModeDataType},set:function(e){this._autoDetectRawModeDataType=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"driverModel",{get:function(){return this._driverModel},set:function(e){this._driverModel=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mediaType",{get:function(){return this._mediaType},set:function(e){this._mediaType=e},enumerable:!1,configurable:!0}),i.prototype.serialize=function(){if(!this._name)throw"The specified printer name is null or empty.";return JSON.stringify({type:this.Id,name:this._name,duplex:this._duplex,paper:this._paper,tray:this._tray,use_default:this._printDefault,auto_detect_raw_mode_data_type:this._autoDetectRawModeDataType,driver_model:this._driverModel,media_type:this._mediaType})},e=i;function i(e,t,r,n,i,o,s,a){if(void 0===t&&(t=!1),void 0===r&&(r=""),void 0===n&&(n=""),void 0===i&&(i=u.DuplexMode.Default),void 0===o&&(o=!1),void 0===s&&(s=0),void 0===a&&(a=""),this.Id=1,this._name="",this._printDefault=!1,this._tray="",this._paper="",this._duplex=u.DuplexMode.Default,this._autoDetectRawModeDataType=!1,this._driverModel=0,this._mediaType="",!e)throw"The specified printer name is null or empty.";this._name=e,this._printDefault=t,this._paper=n,this._tray=r,this._duplex=i,this._autoDetectRawModeDataType=o,this._driverModel=s,this._mediaType=a}r.InstalledPrinter=e;Object.defineProperty(o.prototype,"portName",{get:function(){return this._parallelPortName},set:function(e){this._parallelPortName=e},enumerable:!1,configurable:!0}),o.prototype.serialize=function(){if(!this.portName)throw"The specified parallel port name is null or empty.";return JSON.stringify({type:this.Id,port:this._parallelPortName})},e=o;function o(e){if(this.Id=2,this._parallelPortName="LPT1",!e)throw"The specified parallel port name is null or empty.";this._parallelPortName=e}r.ParallelPortPrinter=e;Object.defineProperty(s.prototype,"portName",{get:function(){return this._port},set:function(e){this._port=e},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"baudRate",{get:function(){return this._baud_rate},set:function(e){this._baud_rate=e},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"parity",{get:function(){return this._parity},set:function(e){this._parity=e},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"stopBits",{get:function(){return this._stop_bits},set:function(e){this._stop_bits=e},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"dataBits",{get:function(){return this._data_bits},set:function(e){this._data_bits=e},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"flowControl",{get:function(){return this._flow_control},set:function(e){this._flow_control=e},enumerable:!1,configurable:!0}),s.prototype.serialize=function(){if(!this.portName)throw"The specified serial port name is null or empty.";return JSON.stringify({type:this.Id,port:this._port,baud_rate:this._baud_rate,data_bits:this._data_bits,flow_control:this._flow_control,parity:this._parity,stop_bits:this._stop_bits})},e=s;function s(e,t,r,n,i,o){if(this.Id=3,this._port="COM1",this._baud_rate=9600,this._parity=u.Serial.Parity.None,this._stop_bits=u.Serial.StopBits.One,this._data_bits=u.Serial.DataBits.Eight,this._flow_control=u.Serial.Handshake.XOnXOff,!e)throw"The specified serial port name is null or empty.";this._port=e,this._baud_rate=t,this._parity=r,this._stop_bits=n,this._data_bits=i,this._flow_control=o}r.SerialPortPrinter=e;Object.defineProperty(a.prototype,"dnsName",{get:function(){return this._dnsName},set:function(e){this._dnsName=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"ipAddress",{get:function(){return this._ip},set:function(e){this._ip=e},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"port",{get:function(){return this._port},set:function(e){if(!(0<=e&&e<=65535))throw"Invalid Port Number";this._port=Math.floor(e)},enumerable:!1,configurable:!0}),a.prototype.serialize=function(){if(!this.dnsName&&!this.ipAddress)throw"You have to specify an IP address or a DNS name";return JSON.stringify({type:this.Id,ip:this._ip,dns:this._dnsName,port:this._port})},e=a;function a(e,t,r){if(this.Id=4,this._ip="0.0.0.0",this._port=0,this._dnsName="",!t&&!r)throw"You have to specify an IP address or a DNS name";t&&(this._ip=t),r&&(this._dnsName=r),this._port=e}r.NetworkPrinter=e;c.prototype.serialize=function(){return JSON.stringify({type:this.Id})},e=c;function c(){this.Id=5}r.UserSelectedPrinter=e;Object.defineProperty(l.prototype,"address",{get:function(){return this._address},set:function(e){this._address=e},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"channel",{get:function(){return this._channel},set:function(e){if(!(0<=e&&e<=65535))throw"Invalid Channel Number";this._channel=Math.floor(e)},enumerable:!1,configurable:!0}),l.prototype.serialize=function(){if(!this.address)throw"You have to specify an address";return JSON.stringify({type:this.Id,address:this._address,channel:this._channel})},e=l;function l(e,t){if(this.Id=6,this._address="00.00.00.00.00.00",this._channel=0,!e)throw"You have to specify an address";e&&(this._address=e),this._channel=t}r.BluetoothPrinter=e},{"./Enums":8}],6:[function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.ClientScanJob=void 0;var o,s=e("./ClientJob"),a=e("./Enums"),i=(o=s.ClientJob,i(u,o),Object.defineProperty(u.prototype,"scannerName",{get:function(){return this._scannerName},set:function(e){this._scannerName=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"pixelMode",{get:function(){return this._pixelMode},set:function(e){this._pixelMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"imageFormat",{get:function(){return this._imageFormat},set:function(e){this._imageFormat=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"enableDuplex",{get:function(){return this._enableDuplex},set:function(e){this._enableDuplex=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"enableFeeder",{get:function(){return this._enableFeeder},set:function(e){this._enableFeeder=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"feederCount",{get:function(){return this._feederCount},set:function(e){this._feederCount=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"jpgCompressionQuality",{get:function(){return this._jpgCompressionQuality},set:function(e){this._jpgCompressionQuality=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"threshold",{get:function(){return this._threshold},set:function(e){this._threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"dither",{get:function(){return this._dither},set:function(e){this._dither=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"pdfTitle",{get:function(){return this._pdfTitle},set:function(e){this._pdfTitle=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"showUI",{get:function(){return this._showUI},set:function(e){this._showUI=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"showProgressUI",{get:function(){return this._showProgressUI},set:function(e){this._showProgressUI=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"tiffCompression",{get:function(){return this._tiffCompression},set:function(e){this._tiffCompression=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"pngCompression",{get:function(){return this._pngCompression},set:function(e){this._pngCompression=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"rotAngle",{get:function(){return this._rotAngle},set:function(e){this._rotAngle=e},enumerable:!1,configurable:!0}),u.prototype.onFinished=function(e){},u.prototype.onError=function(e,t){},u.prototype.onUpdate=function(e,t){e.result&&this.onFinished(e)},u.prototype._generateDataAsync=function(){var r=this;return new Promise(function(e,t){r._resolution||t("Scan resolution is required"),r._scannerName||t("Scanner name is required");t={output_image_format:r._imageFormat,pixel_mode:r._pixelMode,scanner_name:r._scannerName,resolution:r._resolution,enable_duplex:r._enableDuplex,enable_feeder:r._enableFeeder,feeder_count:r._feederCount,jpg_compression_quality:r._jpgCompressionQuality,threshold:r._threshold,dither:r._dither,pdf_title:r._pdfTitle,show_UI:r._showUI,show_progress_UI:r._showProgressUI,tiff_compression:r._tiffCompression,png_compression:r._pngCompression,rot_angle:r._rotAngle};e(JSON.stringify(t))})},u);function u(){var e=null!==o&&o.apply(this,arguments)||this;return e._type="scan_job",e._scannerName="",e._pixelMode=a.PixelMode.Color,e._resolution=200,e._imageFormat=a.ScannerImageFormatOutput.JPG,e._enableDuplex=!1,e._enableFeeder=!1,e._feederCount=1,e._jpgCompressionQuality=100,e._threshold=128,e._dither=a.Dither.Threshold,e._pdfTitle="",e._showUI=!1,e._showProgressUI=!0,e._tiffCompression=a.TiffCompression.DEFAULT,e._pngCompression=a.PngCompression.DEFAULT,e._rotAngle=0,e}r.ClientScanJob=i},{"./ClientJob":2,"./Enums":8}],7:[function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.ClientVideoScanJob=void 0;var o,s=e("./ClientJob"),a=e("./Enums"),i=(o=s.ClientJob,i(u,o),Object.defineProperty(u.prototype,"videoDeviceName",{get:function(){return this._videoDeviceName},set:function(e){this._videoDeviceName=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"pixelMode",{get:function(){return this._pixelMode},set:function(e){this._pixelMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"imageFormat",{get:function(){return this._imageFormat},set:function(e){this._imageFormat=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"jpgCompressionQuality",{get:function(){return this._jpgCompressionQuality},set:function(e){this._jpgCompressionQuality=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"threshold",{get:function(){return this._threshold},set:function(e){this._threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"dither",{get:function(){return this._dither},set:function(e){this._dither=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"pdfTitle",{get:function(){return this._pdfTitle},set:function(e){this._pdfTitle=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"tiffCompression",{get:function(){return this._tiffCompression},set:function(e){this._tiffCompression=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"pngCompression",{get:function(){return this._pngCompression},set:function(e){this._pngCompression=e},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"rotAngle",{get:function(){return this._rotAngle},set:function(e){this._rotAngle=e},enumerable:!1,configurable:!0}),u.prototype.onFinished=function(e){},u.prototype.onError=function(e,t){},u.prototype.onUpdate=function(e,t){e.result&&this.onFinished(e)},u.prototype._generateDataAsync=function(){var r=this;return new Promise(function(e,t){r._videoDeviceName||t("Video Device Name is required");t={output_image_format:r._imageFormat,pixel_mode:r._pixelMode,jpg_compression_quality:r._jpgCompressionQuality,threshold:r._threshold,dither:r._dither,pdf_title:r._pdfTitle,video_device_name:r._videoDeviceName,use_video_device:!0,tiff_compression:r._tiffCompression,png_compression:r._pngCompression,rot_angle:r._rotAngle};e(JSON.stringify(t))})},u);function u(){var e=null!==o&&o.apply(this,arguments)||this;return e._type="scan_job",e._videoDeviceName="",e._pixelMode=a.PixelMode.Color,e._imageFormat=a.ScannerImageFormatOutput.JPG,e._jpgCompressionQuality=100,e._threshold=128,e._dither=a.Dither.Threshold,e._pdfTitle="",e._tiffCompression=a.TiffCompression.DEFAULT,e._pngCompression=a.PngCompression.DEFAULT,e._rotAngle=0,e}r.ClientVideoScanJob=i},{"./ClientJob":2,"./Enums":8}],8:[function(e,t,r){"use strict";var n,i;Object.defineProperty(r,"__esModule",{value:!0}),r.PngCompression=r.TiffCompression=r.SitesManagerAction=r.Dither=r.PrinterIcon=r.Serial=r.PrintOrientation=r.TextAlignment=r.PrintRotation=r.WSStatus=r.FileSourceType=r.PixelMode=r.ScannerImageFormatOutput=r.Sizing=r.DuplexMode=r.Encoding=r.PrintersInfoLevel=r.PrintFileType=void 0,(i=r.PrintFileType||(r.PrintFileType={}))[i.Image=0]="Image",i[i.Generic=1]="Generic",i[i.Document=2]="Document",i[i.WDOC=3]="WDOC",i[i.WXLS=4]="WXLS",i[i.WPDF=5]="WPDF",i[i.WTXT=6]="WTXT",i[i.Group=7]="Group",i[i.WTIF=8]="WTIF",(n=r.PrintersInfoLevel||(r.PrintersInfoLevel={}))[n.Basic=0]="Basic",n[n.Extended=1]="Extended",(i=r.Encoding||(r.Encoding={}))[i.Default=-1]="Default",i[i.IBM_EBCDIC_US_Canada=37]="IBM_EBCDIC_US_Canada",i[i.OEM_United_States=437]="OEM_United_States",i[i.IBM_EBCDIC_International=500]="IBM_EBCDIC_International",i[i.Polish_MS_DOS=620]="Polish_MS_DOS",i[i.Arabic_ASMO_708=708]="Arabic_ASMO_708",i[i.Arabic_Transparent_ASMO_Arabic_DOS=720]="Arabic_Transparent_ASMO_Arabic_DOS",i[i.OEM_Greek_formerly_437G_Greek_DOS=737]="OEM_Greek_formerly_437G_Greek_DOS",i[i.OEM_Baltic_Baltic_DOS=775]="OEM_Baltic_Baltic_DOS",i[i.OEM_Russian_Cyrillic_Euro_symbol=808]="OEM_Russian_Cyrillic_Euro_symbol",i[i.OEM_Multilingual_Latin_1_Western_European_DOS=850]="OEM_Multilingual_Latin_1_Western_European_DOS",i[i.OEM_Latin_2_Central_European_DOS=852]="OEM_Latin_2_Central_European_DOS",i[i.OEM_Cyrillic_primarily_Russian=855]="OEM_Cyrillic_primarily_Russian",i[i.OEM_Turkish_Turkish_DOS=857]="OEM_Turkish_Turkish_DOS",i[i.OEM_Multilingual_Latin_1_Euro_symbol=858]="OEM_Multilingual_Latin_1_Euro_symbol",i[i.OEM_Portuguese_Portuguese_DOS=860]="OEM_Portuguese_Portuguese_DOS",i[i.OEM_Icelandic_Icelandic_DOS=861]="OEM_Icelandic_Icelandic_DOS",i[i.OEM_Hebrew_Hebrew_DOS=862]="OEM_Hebrew_Hebrew_DOS",i[i.OEM_French_Canadian_French_Canadian_DOS=863]="OEM_French_Canadian_French_Canadian_DOS",i[i.OEM_Arabic_Arabic_864=864]="OEM_Arabic_Arabic_864",i[i.OEM_Nordic_Nordic_DOS=865]="OEM_Nordic_Nordic_DOS",i[i.OEM_Russian_Cyrillic_DOS=866]="OEM_Russian_Cyrillic_DOS",i[i.OEM_Modern_Greek_Greek_Modern_DOS=869]="OEM_Modern_Greek_Greek_Modern_DOS",i[i.IBM_EBCDIC_Multilingual_ROECE_Latin_2=870]="IBM_EBCDIC_Multilingual_ROECE_Latin_2",i[i.OEM_Cyrillic_primarily_Russian_Euro_Symbol=872]="OEM_Cyrillic_primarily_Russian_Euro_Symbol",i[i.Windows_Thai=874]="Windows_Thai",i[i.IBM_EBCDIC_Greek_Modern=875]="IBM_EBCDIC_Greek_Modern",i[i.Kamenicky_Czech_MS_DOS=895]="Kamenicky_Czech_MS_DOS",i[i.Japanese_Shift_JIS=932]="Japanese_Shift_JIS",i[i.Simplified_Chinese_GBK=936]="Simplified_Chinese_GBK",i[i.Korean=949]="Korean",i[i.Traditional_Chinese_Big5=950]="Traditional_Chinese_Big5",i[i.IBM_EBCDIC_French=1010]="IBM_EBCDIC_French",i[i.IBM_EBCDIC_Turkish_Latin_5=1026]="IBM_EBCDIC_Turkish_Latin_5",i[i.IBM_EBCDIC_Latin_1_Open_System=1047]="IBM_EBCDIC_Latin_1_Open_System",i[i.IBM_EBCDIC_Lao_1132_1133_1341=1132]="IBM_EBCDIC_Lao_1132_1133_1341",i[i.IBM_EBCDIC_US_Canada_037_Euro_symbol=1140]="IBM_EBCDIC_US_Canada_037_Euro_symbol",i[i.IBM_EBCDIC_Germany_20273_Euro_symbol=1141]="IBM_EBCDIC_Germany_20273_Euro_symbol",i[i.IBM_EBCDIC_Denmark_Norway_20277_Euro_symbol=1142]="IBM_EBCDIC_Denmark_Norway_20277_Euro_symbol",i[i.IBM_EBCDIC_Finland_Sweden_20278_Euro_symbol=1143]="IBM_EBCDIC_Finland_Sweden_20278_Euro_symbol",i[i.IBM_EBCDIC_Italy_20280_Euro_symbol=1144]="IBM_EBCDIC_Italy_20280_Euro_symbol",i[i.IBM_EBCDIC_Latin_America_Spain_20284_Euro_symbol=1145]="IBM_EBCDIC_Latin_America_Spain_20284_Euro_symbol",i[i.IBM_EBCDIC_United_Kingdom_20285_Euro_symbol=1146]="IBM_EBCDIC_United_Kingdom_20285_Euro_symbol",i[i.IBM_EBCDIC_France_20297_Euro_symbol=1147]="IBM_EBCDIC_France_20297_Euro_symbol",i[i.IBM_EBCDIC_International_500_Euro_symbol=1148]="IBM_EBCDIC_International_500_Euro_symbol",i[i.IBM_EBCDIC_Icelandic_20871_Euro_symbol=1149]="IBM_EBCDIC_Icelandic_20871_Euro_symbol",i[i.Unicode_UTF_16_little_endian_BMP_of_ISO_10646=1200]="Unicode_UTF_16_little_endian_BMP_of_ISO_10646",i[i.Unicode_UTF_16_big_endian=1201]="Unicode_UTF_16_big_endian",i[i.Windows_Central_Europe=1250]="Windows_Central_Europe",i[i.Windows_Cyrillic=1251]="Windows_Cyrillic",i[i.Windows_Latin_I=1252]="Windows_Latin_I",i[i.Windows_Greek=1253]="Windows_Greek",i[i.Windows_Turkish=1254]="Windows_Turkish",i[i.Windows_Hebrew=1255]="Windows_Hebrew",i[i.Windows_Arabic=1256]="Windows_Arabic",i[i.Windows_Baltic=1257]="Windows_Baltic",i[i.Windows_Vietnam=1258]="Windows_Vietnam",i[i.Korean_Johab=1361]="Korean_Johab",i[i.MAC_Roman=1e4]="MAC_Roman",i[i.Japanese_Mac=10001]="Japanese_Mac",i[i.MAC_Traditional_Chinese_Big5=10002]="MAC_Traditional_Chinese_Big5",i[i.Korean_Mac=10003]="Korean_Mac",i[i.Arabic_Mac=10004]="Arabic_Mac",i[i.Hebrew_Mac=10005]="Hebrew_Mac",i[i.Greek_Mac=10006]="Greek_Mac",i[i.Cyrillic_Mac=10007]="Cyrillic_Mac",i[i.MAC_Simplified_Chinese_GB_2312=10008]="MAC_Simplified_Chinese_GB_2312",i[i.Romanian_Mac=10010]="Romanian_Mac",i[i.Ukrainian_Mac=10017]="Ukrainian_Mac",i[i.Thai_Mac=10021]="Thai_Mac",i[i.MAC_Latin_2_Central_European=10029]="MAC_Latin_2_Central_European",i[i.Icelandic_Mac=10079]="Icelandic_Mac",i[i.Turkish_Mac=10081]="Turkish_Mac",i[i.Croatian_Mac=10082]="Croatian_Mac",i[i.Unicode_UTF_32_little_endian_byte_order=12e3]="Unicode_UTF_32_little_endian_byte_order",i[i.Unicode_UTF_32_big_endian_byte_order=12001]="Unicode_UTF_32_big_endian_byte_order",i[i.CNS_Taiwan_Chinese_Traditional=2e4]="CNS_Taiwan_Chinese_Traditional",i[i.TCA_Taiwan=20001]="TCA_Taiwan",i[i.ETEN_Taiwan_Chinese_Traditional=20002]="ETEN_Taiwan_Chinese_Traditional",i[i.IBM5550_Taiwan=20003]="IBM5550_Taiwan",i[i.TeleText_Taiwan=20004]="TeleText_Taiwan",i[i.Wang_Taiwan=20005]="Wang_Taiwan",i[i.Western_European_IA5_IRV_International_Alphabet_5=20105]="Western_European_IA5_IRV_International_Alphabet_5",i[i.IA5_German_7_bit=20106]="IA5_German_7_bit",i[i.IA5_Swedish_7_bit=20107]="IA5_Swedish_7_bit",i[i.IA5_Norwegian_7_bit=20108]="IA5_Norwegian_7_bit",i[i.US_ASCII_7_bit=20127]="US_ASCII_7_bit",i[i.T_61=20261]="T_61",i[i.ISO_6937_Non_Spacing_Accent=20269]="ISO_6937_Non_Spacing_Accent",i[i.IBM_EBCDIC_Germany=20273]="IBM_EBCDIC_Germany",i[i.IBM_EBCDIC_Denmark_Norway=20277]="IBM_EBCDIC_Denmark_Norway",i[i.IBM_EBCDIC_Finland_Sweden=20278]="IBM_EBCDIC_Finland_Sweden",i[i.IBM_EBCDIC_Italy=20280]="IBM_EBCDIC_Italy",i[i.IBM_EBCDIC_Latin_America_Spain=20284]="IBM_EBCDIC_Latin_America_Spain",i[i.IBM_EBCDIC_United_Kingdom=20285]="IBM_EBCDIC_United_Kingdom",i[i.IBM_EBCDIC_Japanese_Katakana_Extended=20290]="IBM_EBCDIC_Japanese_Katakana_Extended",i[i.IBM_EBCDIC_France=20297]="IBM_EBCDIC_France",i[i.IBM_EBCDIC_Arabic=20420]="IBM_EBCDIC_Arabic",i[i.IBM_EBCDIC_Greek=20423]="IBM_EBCDIC_Greek",i[i.IBM_EBCDIC_Hebrew=20424]="IBM_EBCDIC_Hebrew",i[i.IBM_EBCDIC_Korean_Extended=20833]="IBM_EBCDIC_Korean_Extended",i[i.IBM_EBCDIC_Thai=20838]="IBM_EBCDIC_Thai",i[i.Russian_Cyrillic_KOI8_R=20866]="Russian_Cyrillic_KOI8_R",i[i.IBM_EBCDIC_Icelandic=20871]="IBM_EBCDIC_Icelandic",i[i.IBM_EBCDIC_Cyrillic_Russian=20880]="IBM_EBCDIC_Cyrillic_Russian",i[i.IBM_EBCDIC_Turkish=20905]="IBM_EBCDIC_Turkish",i[i.IBM_EBCDIC_Latin_1_Open_System_1047_Euro_symbol=20924]="IBM_EBCDIC_Latin_1_Open_System_1047_Euro_symbol",i[i.Japanese_JIS_0208_1990_and_0212_1990=20932]="Japanese_JIS_0208_1990_and_0212_1990",i[i.Simplified_Chinese_GB2312_80=20936]="Simplified_Chinese_GB2312_80",i[i.Korean_Wansung=20949]="Korean_Wansung",i[i.IBM_EBCDIC_Cyrillic_Serbian_Bulgarian=21025]="IBM_EBCDIC_Cyrillic_Serbian_Bulgarian",i[i.Extended_Ext_Alpha_Lowercase=21027]="Extended_Ext_Alpha_Lowercase",i[i.Ukrainian_Cyrillic_KOI8_U=21866]="Ukrainian_Cyrillic_KOI8_U",i[i.ISO_8859_1_Latin_1_Western_European=28591]="ISO_8859_1_Latin_1_Western_European",i[i.ISO_8859_2_Latin_2_Central_European=28592]="ISO_8859_2_Latin_2_Central_European",i[i.ISO_8859_3_Latin_3=28593]="ISO_8859_3_Latin_3",i[i.ISO_8859_4_Baltic=28594]="ISO_8859_4_Baltic",i[i.ISO_8859_5_Cyrillic=28595]="ISO_8859_5_Cyrillic",i[i.ISO_8859_6_Arabic=28596]="ISO_8859_6_Arabic",i[i.ISO_8859_7_Greek=28597]="ISO_8859_7_Greek",i[i.ISO_8859_8_Hebrew_ISO_Visual=28598]="ISO_8859_8_Hebrew_ISO_Visual",i[i.ISO_8859_9_Turkish=28599]="ISO_8859_9_Turkish",i[i.ISO_8859_10_Latin_6=28600]="ISO_8859_10_Latin_6",i[i.ISO_8859_11_Latin_Thai=28601]="ISO_8859_11_Latin_Thai",i[i.ISO_8859_13_Latin_7_Estonian=28603]="ISO_8859_13_Latin_7_Estonian",i[i.ISO_8859_14_Latin_8_Celtic=28604]="ISO_8859_14_Latin_8_Celtic",i[i.ISO_8859_15_Latin_9=28605]="ISO_8859_15_Latin_9",i[i.ISO_8859_15_Latin_10=28606]="ISO_8859_15_Latin_10",i[i.Europa_3=29001]="Europa_3",i[i.ISO_8859_8_Hebrew_ISO_Logical=38598]="ISO_8859_8_Hebrew_ISO_Logical",i[i.Atari_ST_TT=47451]="Atari_ST_TT",i[i.ISO_2022_JIS_Japanese_with_no_halfwidth_Katakana=50220]="ISO_2022_JIS_Japanese_with_no_halfwidth_Katakana",i[i.ISO_2022_JIS_Japanese_with_halfwidth_Katakana=50221]="ISO_2022_JIS_Japanese_with_halfwidth_Katakana",i[i.ISO_2022_Japanese_JIS_X_0201_1989_1_byte_Kana_SO_SI=50222]="ISO_2022_Japanese_JIS_X_0201_1989_1_byte_Kana_SO_SI",i[i.ISO_2022_Korean=50225]="ISO_2022_Korean",i[i.ISO_2022_Simplified_Chinese=50227]="ISO_2022_Simplified_Chinese",i[i.EUC_Japanese=51932]="EUC_Japanese",i[i.EUC_Simplified_Chinese=51936]="EUC_Simplified_Chinese",i[i.EUC_Korean=51949]="EUC_Korean",i[i.HZ_GB2312_Simplified_Chinese=52936]="HZ_GB2312_Simplified_Chinese",i[i.GB18030_Simplified_Chinese_4_byte=54936]="GB18030_Simplified_Chinese_4_byte",i[i.ISCII_Devanagari=57002]="ISCII_Devanagari",i[i.ISCII_Bengali=57003]="ISCII_Bengali",i[i.ISCII_Tamil=57004]="ISCII_Tamil",i[i.ISCII_Telugu=57005]="ISCII_Telugu",i[i.ISCII_Assamese=57006]="ISCII_Assamese",i[i.ISCII_Oriya=57007]="ISCII_Oriya",i[i.ISCII_Kannada=57008]="ISCII_Kannada",i[i.ISCII_Malayalam=57009]="ISCII_Malayalam",i[i.ISCII_Gujarati=57010]="ISCII_Gujarati",i[i.ISCII_Punjabi=57011]="ISCII_Punjabi",i[i.Unicode_UTF_7=65e3]="Unicode_UTF_7",i[i.Unicode_UTF_8=65001]="Unicode_UTF_8",(n=r.DuplexMode||(r.DuplexMode={}))[n.Default=0]="Default",n[n.Simplex=1]="Simplex",n[n.DuplexLongEdge=2]="DuplexLongEdge",n[n.DuplexShortEdge=3]="DuplexShortEdge",(i=r.Sizing||(r.Sizing={}))[i.None=0]="None",i[i.Fit=1]="Fit",(n=r.ScannerImageFormatOutput||(r.ScannerImageFormatOutput={}))[n.JPG=0]="JPG",n[n.PNG=1]="PNG",n[n.TIFF=2]="TIFF",n[n.PDF=3]="PDF",(i=r.PixelMode||(r.PixelMode={}))[i.Grayscale=0]="Grayscale",i[i.Color=1]="Color",i[i.BlackAndWhite=2]="BlackAndWhite",(n=r.FileSourceType||(r.FileSourceType={}))[n.Base64=0]="Base64",n[n.Text=1]="Text",n[n.BLOB=2]="BLOB",n[n.URL=3]="URL",n[n.ExternalURL=4]="ExternalURL",(i=r.WSStatus||(r.WSStatus={}))[i.Open=0]="Open",i[i.Closed=1]="Closed",i[i.Blocked=2]="Blocked",i[i.WaitingForUserResponse=3]="WaitingForUserResponse",(n=r.PrintRotation||(r.PrintRotation={}))[n.None=0]="None",n[n.Rot90=1]="Rot90",n[n.Rot180=2]="Rot180",n[n.Rot270=3]="Rot270",(i=r.TextAlignment||(r.TextAlignment={}))[i.Left=0]="Left",i[i.Center=1]="Center",i[i.Right=2]="Right",i[i.Justify=3]="Justify",i[i.None=4]="None",(n=r.PrintOrientation||(r.PrintOrientation={}))[n.Portrait=0]="Portrait",n[n.Landscape=1]="Landscape",i=r.Serial||(r.Serial={}),(n=i.Parity||(i.Parity={}))[n.None=0]="None",n[n.Odd=1]="Odd",n[n.Even=2]="Even",n[n.Mark=3]="Mark",n[n.Space=4]="Space",(n=i.StopBits||(i.StopBits={}))[n.One=0]="One",n[n.OnePointFive=1]="OnePointFive",n[n.Two=2]="Two",(n=i.DataBits||(i.DataBits={}))[n.Eight=0]="Eight",n[n.Seven=1]="Seven",n[n.Six=2]="Six",n[n.Five=3]="Five",(i=i.Handshake||(i.Handshake={}))[i.None=0]="None",i[i.RequestToSend=1]="RequestToSend",i[i.RequestToSendXOnXOff=2]="RequestToSendXOnXOff",i[i.XOnXOff=3]="XOnXOff",(i=r.PrinterIcon||(r.PrinterIcon={}))[i.None=0]="None",i[i.Small=1]="Small",i[i.Large=2]="Large",i[i.ExtraLarge=3]="ExtraLarge",i[i.Jumbo=4]="Jumbo",(i=r.Dither||(r.Dither={}))[i.Threshold=0]="Threshold",i[i.FloydSteinberg=1]="FloydSteinberg",i[i.Bayer4x4=2]="Bayer4x4",i[i.Bayer8x8=3]="Bayer8x8",i[i.Cluster6x6=4]="Cluster6x6",i[i.Cluster8x8=5]="Cluster8x8",i[i.Cluster16x16=6]="Cluster16x16",(i=r.SitesManagerAction||(r.SitesManagerAction={}))[i.Allow=0]="Allow",i[i.Block=1]="Block",(i=r.TiffCompression||(r.TiffCompression={}))[i.DEFAULT=0]="DEFAULT",i[i.PACKBITS=256]="PACKBITS",i[i.DEFLATE=512]="DEFLATE",i[i.ADOBE_DEFLATE=1024]="ADOBE_DEFLATE",i[i.NONE=2048]="NONE",i[i.CCITTFAX3=4096]="CCITTFAX3",i[i.CCITTFAX4=8192]="CCITTFAX4",i[i.LZW=16384]="LZW",(r=r.PngCompression||(r.PngCompression={}))[r.DEFAULT=0]="DEFAULT",r[r.Z_BEST_SPEED=1]="Z_BEST_SPEED",r[r.Z_BEST_COMPRESSION=9]="Z_BEST_COMPRESSION",r[r.NONE=256]="NONE"},{}],9:[function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0}),r.IppMessage=r.Ipp=void 0;var h,d=e("buffer");(e=h=r.Ipp||(r.Ipp={}))[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e[e.PRINT_JOB=2]="PRINT_JOB",e[e.PRINT_URI=3]="PRINT_URI",e[e.VALIDATE_JOB=4]="VALIDATE_JOB",e[e.CREATE_JOB=5]="CREATE_JOB",e[e.SEND_DOCUMENT=6]="SEND_DOCUMENT",e[e.SEND_URI=7]="SEND_URI",e[e.CANCEL_JOB=8]="CANCEL_JOB",e[e.GET_JOB_ATTRIBUTES=9]="GET_JOB_ATTRIBUTES",e[e.GET_JOBS=10]="GET_JOBS",e[e.GET_PRINTER_ATTRIBUTES=11]="GET_PRINTER_ATTRIBUTES",e[e.HOLD_JOB=12]="HOLD_JOB",e[e.RELEASE_JOB=13]="RELEASE_JOB",e[e.RESTART_JOB=14]="RESTART_JOB",e[e.PAUSE_PRINTER=16]="PAUSE_PRINTER",e[e.RESUME_PRINTER=17]="RESUME_PRINTER",e[e.PURGE_JOBS=18]="PURGE_JOBS",e[e.OPERATION_ATTRIBUTES_TAG=1]="OPERATION_ATTRIBUTES_TAG",e[e.JOB_ATTRIBUTES_TAG=2]="JOB_ATTRIBUTES_TAG",e[e.END_OF_ATTRIBUTES_TAG=3]="END_OF_ATTRIBUTES_TAG",e[e.PRINTER_ATTRIBUTES_TAG=4]="PRINTER_ATTRIBUTES_TAG",e[e.UNSUPPORTED_ATTRIBUTES_TAG=5]="UNSUPPORTED_ATTRIBUTES_TAG",e[e.UNSUPPORTED=16]="UNSUPPORTED",e[e.UNKNOWN=18]="UNKNOWN",e[e.NO_VALUE=19]="NO_VALUE",e[e.INTEGER=33]="INTEGER",e[e.BOOLEAN=34]="BOOLEAN",e[e.ENUM=35]="ENUM",e[e.OCTET_STRING=48]="OCTET_STRING",e[e.DATE_TIME=49]="DATE_TIME",e[e.RESOLUTION=50]="RESOLUTION",e[e.RANGE_OF_INTEGER=51]="RANGE_OF_INTEGER",e[e.TEXT_WITH_LANG=53]="TEXT_WITH_LANG",e[e.NAME_WITH_LANG=54]="NAME_WITH_LANG",e[e.TEXT_WITHOUT_LANG=65]="TEXT_WITHOUT_LANG",e[e.NAME_WITHOUT_LANG=66]="NAME_WITHOUT_LANG",e[e.KEYWORD=68]="KEYWORD",e[e.URI=69]="URI",e[e.URI_SCHEME=70]="URI_SCHEME",e[e.CHARSET=71]="CHARSET",e[e.NATURAL_LANG=72]="NATURAL_LANG",e[e.MIME_MEDIA_TYPE=73]="MIME_MEDIA_TYPE",e[e.SUCCESSFUL_OK=0]="SUCCESSFUL_OK",e[e.SUCCESSFUL_OK_IGNORED_OR_SUBSTITUTED_ATTRIBUTES=1]="SUCCESSFUL_OK_IGNORED_OR_SUBSTITUTED_ATTRIBUTES",e[e.SUCCESSFUL_OK_CONFLICTING_ATTRIBUTES=2]="SUCCESSFUL_OK_CONFLICTING_ATTRIBUTES",e[e.CLIENT_ERROR_BAD_REQUEST=1024]="CLIENT_ERROR_BAD_REQUEST",e[e.CLIENT_ERROR_FORBIDDEN=1025]="CLIENT_ERROR_FORBIDDEN",e[e.CLIENT_ERROR_NOT_AUTHENTICATED=1026]="CLIENT_ERROR_NOT_AUTHENTICATED",e[e.CLIENT_ERROR_NOT_AUTHORIZED=1027]="CLIENT_ERROR_NOT_AUTHORIZED",e[e.CLIENT_ERROR_NOT_POSSIBLE=1028]="CLIENT_ERROR_NOT_POSSIBLE",e[e.CLIENT_ERROR_TIMEOUT=1029]="CLIENT_ERROR_TIMEOUT",e[e.CLIENT_ERROR_NOT_FOUND=1030]="CLIENT_ERROR_NOT_FOUND",e[e.CLIENT_ERROR_GONE=1031]="CLIENT_ERROR_GONE",e[e.CLIENT_ERROR_REQUEST_ENTITY_TOO_LARGE=1032]="CLIENT_ERROR_REQUEST_ENTITY_TOO_LARGE",e[e.CLIENT_ERROR_REQUEST_VALUE_TOO_LONG=1033]="CLIENT_ERROR_REQUEST_VALUE_TOO_LONG",e[e.CLIENT_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED=1034]="CLIENT_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED",e[e.CLIENT_ERROR_ATTRIBUTES_OR_VALUES_NOT_SUPPORTED=1035]="CLIENT_ERROR_ATTRIBUTES_OR_VALUES_NOT_SUPPORTED",e[e.CLIENT_ERROR_URI_SCHEME_NOT_SUPPORTED=1036]="CLIENT_ERROR_URI_SCHEME_NOT_SUPPORTED",e[e.CLIENT_ERROR_CHARSET_NOT_SUPPORTED=1037]="CLIENT_ERROR_CHARSET_NOT_SUPPORTED",e[e.CLIENT_ERROR_CONFLICTING_ATTRIBUTES=1038]="CLIENT_ERROR_CONFLICTING_ATTRIBUTES",e[e.CLIENT_ERROR_COMPRESSION_NOT_SUPPORTED=1039]="CLIENT_ERROR_COMPRESSION_NOT_SUPPORTED",e[e.CLIENT_ERROR_COMPRESSION_ERROR=1040]="CLIENT_ERROR_COMPRESSION_ERROR",e[e.CLIENT_ERROR_DOCUMENT_FORMAT_ERROR=1041]="CLIENT_ERROR_DOCUMENT_FORMAT_ERROR",e[e.CLIENT_ERROR_DOCUMENT_ACCESS_ERROR=1042]="CLIENT_ERROR_DOCUMENT_ACCESS_ERROR",e[e.SERVER_ERROR_INTERNAL_ERROR=1280]="SERVER_ERROR_INTERNAL_ERROR",e[e.SERVER_ERROR_OPERATION_NOT_SUPPORTED=1281]="SERVER_ERROR_OPERATION_NOT_SUPPORTED",e[e.SERVER_ERROR_SERVICE_UNAVAILABLE=1282]="SERVER_ERROR_SERVICE_UNAVAILABLE",e[e.SERVER_ERROR_VERSION_NOT_SUPPORTED=1283]="SERVER_ERROR_VERSION_NOT_SUPPORTED",e[e.SERVER_ERROR_DEVICE_ERROR=1284]="SERVER_ERROR_DEVICE_ERROR",e[e.SERVER_ERROR_TEMPORARY_ERROR=1285]="SERVER_ERROR_TEMPORARY_ERROR",e[e.SERVER_ERROR_NOT_ACCEPTING_JOBS=1286]="SERVER_ERROR_NOT_ACCEPTING_JOBS",e[e.SERVER_ERROR_BUSY=1287]="SERVER_ERROR_BUSY",e[e.SERVER_ERROR_JOB_CANCELED=1288]="SERVER_ERROR_JOB_CANCELED",e[e.SERVER_ERROR_MULTIPLE_DOCUMENT_JOBS_NOT_SUPPORTED=1289]="SERVER_ERROR_MULTIPLE_DOCUMENT_JOBS_NOT_SUPPORTED",e[e.PRINTER_IDLE=3]="PRINTER_IDLE",e[e.PRINTER_PROCESSING=4]="PRINTER_PROCESSING",e[e.PRINTER_STOPPED=5]="PRINTER_STOPPED",e[e.JOB_PENDING=3]="JOB_PENDING",e[e.JOB_PENDING_HELD=4]="JOB_PENDING_HELD",e[e.JOB_PROCESSING=5]="JOB_PROCESSING",e[e.JOB_PROCESSING_STOPPED=6]="JOB_PROCESSING_STOPPED",e[e.JOB_CANCELED=7]="JOB_CANCELED",e[e.JOB_ABORTED=8]="JOB_ABORTED",e[e.JOB_COMPLETED=9]="JOB_COMPLETED";o.decode=function(e,t,r){e instanceof Array&&(e=new d.Buffer(e)),r=r||e.length;var n=t=t||0,i={version:{},groups:[]};i.version.major=e.readInt8(n++),i.version.minor=e.readInt8(n++),i._oprationIdOrStatusCode=e.readInt16BE(n),i.requestId=e.readInt32BE(n+=2),n+=4;for(var o=e.readInt8(n++);o!==h.END_OF_ATTRIBUTES_TAG&&n<r;){for(var s={tag:o,attributes:[]},o=e.readInt8(n++);15<o;){var a,u,c,l=new b,f=l.decode(e,n);switch(n+=l.bytes,o){case h.INTEGER:a=(u=new _).decode(e,n),n+=u.bytes;break;case h.BOOLEAN:a=(u=new m).decode(e,n),n+=u.bytes;break;case h.ENUM:a=(u=new p).decode(e,n),n+=u.bytes;break;case h.DATE_TIME:a=(u=new C).decode(e,n),n+=u.bytes;break;case h.TEXT_WITH_LANG:case h.NAME_WITH_LANG:a=(u=new E).decode(e,n),n+=u.bytes;break;default:a=(u=new b).decode(e,n),n+=u.bytes}f?s.attributes.push(c={tag:o,name:f,value:[a]}):c.value.push(a),o=e.readInt8(n++)}i.groups.push(s)}return this._bytes=n-t,i},o._calcEncodingLength=function(e){var t=8;return e.groups&&(t+=e.groups.reduce(function(e,t){return e+=1,e+=t.attributes.reduce(function(e,r){return e+=(Array.isArray(r.value)?r.value:[r.value]).reduce(function(e,t){switch(e+=1,e+=(new b).encodingLength(1===e?r.name:""),r.tag){case h.INTEGER:return e+(new _).encodingLength(t);case h.BOOLEAN:return e+(new m).encodingLength(t);case h.ENUM:return e+(new p).encodingLength(t);case h.DATE_TIME:return e+(new C).encodingLength(t);case h.TEXT_WITH_LANG:case h.NAME_WITH_LANG:return e+(new E).encodingLength(t);default:return e+(new b).encodingLength(t)}},0)},0)},0)),t++,e.data&&(t+=e.data.length),t},o.encode=function(e){var i=i||new d.Buffer(this._calcEncodingLength(e)),o=o||0,t=o;return i.writeInt8(e.version?e.version.major:1,o++),i.writeInt8(e.version?e.version.minor:1,o++),i.writeInt16BE(void 0===e.statusCode?e.operationId:e.statusCode,o),o+=2,i.writeInt32BE(e.requestId,o),o+=4,e.groups&&e.groups.forEach(function(e){i.writeInt8(e.tag,o++),e.attributes.forEach(function(n){(Array.isArray(n.value)?n.value:[n.value]).forEach(function(e,t){var r;switch(i.writeInt8(n.tag,o++),(r=new b).encode(t?"":n.name,i,o),o+=r.bytes,n.tag){case h.INTEGER:case h.BOOLEAN:(r=new _).encode(e,i,o),o+=r.bytes;break;case h.ENUM:(r=new p).encode(e,i,o),o+=r.bytes;break;case h.DATE_TIME:(r=new C).encode(e,i,o),o+=r.bytes;break;case h.TEXT_WITH_LANG:case h.NAME_WITH_LANG:(r=new E).encode(e,i,o),o+=r.bytes;break;default:(r=new b).encode(e,i,o),o+=r.bytes}})})}),i.writeInt8(h.END_OF_ATTRIBUTES_TAG,o++),e.data&&(o+=e.data.copy(i,o)),this._bytes=o-t,i},e=o;function o(){}r.IppMessage=e;s.prototype.decode=function(e,t){return 0},s.prototype.encode=function(e,t,r){return null},e=s;function s(){this.encodingLength=function(e){return 0}}var a,_=(i(u,a=e),u.prototype.decode=function(e,t){t=e.readInt32BE(t+2);return this.bytes=6,t},u.prototype.encode=function(e,t,r){return t.writeInt16BE(4,r),t.writeInt32BE(e,r+2),this.bytes=6,t},u);function u(){var e=null!==a&&a.apply(this,arguments)||this;return e.encodingLength=function(e){return 6},e}var c,p=(i(l,c=e),l.prototype.decode=function(e,t){t=e.readInt32BE(t+2);return this.bytes=6,t},l.prototype.encode=function(e,t,r){return t.writeInt16BE(4,r),t.writeInt32BE(e,r+2),this.bytes=6,t},l);function l(){var e=null!==c&&c.apply(this,arguments)||this;return e.encodingLength=function(e){return 6},e}var f,m=(i(y,f=e),y.prototype.decode=function(e,t){t=e.readInt8(t+2)===h.TRUE;return this.bytes=3,Number(t)},y.prototype.encode=function(e,t,r){return t.writeInt16BE(1,r),t.writeInt8(e?h.TRUE:h.FALSE,r+2),this.bytes=3,t},y);function y(){var e=null!==f&&f.apply(this,arguments)||this;return e.encodingLength=function(e){return 6},e}var g,b=(i(v,g=e),v.prototype.decode=function(e,t){var r=e.readInt16BE(t),t=e.toString("utf-8",t+2,t+2+r);return this.bytes=r+2,t},v.prototype.encode=function(e,t,r){e=t.write(e,r+2);return t.writeInt16BE(e,r),this.bytes=e+2,t},v);function v(){var e=null!==g&&g.apply(this,arguments)||this;return e.encodingLength=function(e){return d.Buffer.byteLength(e)+2},e}var w,E=(i(S,w=e),S.prototype.decode=function(e,t){var r=t;t+=2;var n=new b,i=n.decode(e,t);t+=n.bytes;e=n.decode(e,t);return t+=n.bytes,this.bytes=t-r,{lang:i,value:e}},S.prototype.encode=function(e,t,r){var n=new b;n.encode(e.lang,t,r+2);var i=n.bytes;return n.encode(e.value,t,r+2+i),i+=n.bytes,t.writeInt16BE(i,r),this.bytes=i+2,t},S);function S(){var e=null!==w&&w.apply(this,arguments)||this;return e.encodingLength=function(e){return d.Buffer.byteLength(e.lang)+d.Buffer.byteLength(e.value)+6},e}var O,C=(i(I,O=e),I.prototype.decode=function(e,t){var r=60*e.readInt8(t+11)+e.readInt8(t+12),t=new Date(Date.UTC(e.readInt16BE(t+2),e.readInt8(t+4)-1,e.readInt8(t+5),e.readInt8(t+6),e.readInt8(t+7)+r,e.readInt8(t+8),100*e.readInt8(t+9)));return this.bytes=13,t},I.prototype.encode=function(e,t,r){return t.writeInt16BE(11,r),t.writeInt16BE(e.getFullYear(),r+2),t.writeInt8(e.getMonth()+1,r+4),t.writeInt8(e.getDate(),r+5),t.writeInt8(e.getHours(),r+6),t.writeInt8(e.getMinutes(),r+7),t.writeInt8(e.getSeconds(),r+8),t.writeInt8(Math.floor(e.getMilliseconds()/100),r+9),t.write(0<e.getTimezoneOffset()?"-":"+",r+10),t.writeInt8(e.getTimezoneOffset()/60,r+11),t.writeInt8(e.getTimezoneOffset()%60,r+12),this.bytes=13,t},I);function I(){var e=null!==O&&O.apply(this,arguments)||this;return e.encodingLength=function(e){return 13},e}},{buffer:24}],10:[function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.IppMessage=r.Ipp=r.BTComm=r.TcpComm=r.SerialComm=r.PrintFileXLS=r.PrintFileTXT=r.PrintFileTIF=r.PrintFilePDF=r.PrintFileGroup=r.PrintFileDOC=r.PrintFile=r.JSPrintManager=r.ClientVideoScanJob=r.ClientScanJob=r.ClientPrintJobGroup=r.ClientPrintJob=r.BluetoothPrinter=r.UserSelectedPrinter=r.SerialPortPrinter=r.ParallelPortPrinter=r.NetworkPrinter=r.InstalledPrinter=r.DefaultPrinter=void 0;var o=e("./ClientPrinter");Object.defineProperty(r,"DefaultPrinter",{enumerable:!0,get:function(){return o.DefaultPrinter}}),Object.defineProperty(r,"InstalledPrinter",{enumerable:!0,get:function(){return o.InstalledPrinter}}),Object.defineProperty(r,"NetworkPrinter",{enumerable:!0,get:function(){return o.NetworkPrinter}}),Object.defineProperty(r,"ParallelPortPrinter",{enumerable:!0,get:function(){return o.ParallelPortPrinter}}),Object.defineProperty(r,"SerialPortPrinter",{enumerable:!0,get:function(){return o.SerialPortPrinter}}),Object.defineProperty(r,"UserSelectedPrinter",{enumerable:!0,get:function(){return o.UserSelectedPrinter}}),Object.defineProperty(r,"BluetoothPrinter",{enumerable:!0,get:function(){return o.BluetoothPrinter}});var s=e("./ClientPrintJob");Object.defineProperty(r,"ClientPrintJob",{enumerable:!0,get:function(){return s.ClientPrintJob}});var a=e("./ClientPrintJobGroup");Object.defineProperty(r,"Cli