!function e(t,r,n){function a(o,l){if(!r[o]){if(!t[o]){var s="function"==typeof require&&require;if(!l&&s)return s(o,!0);if(i)return i(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return a(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o0?o-4:o;for(r=0;r>16&255,s[c++]=t>>8&255,s[c++]=255&t;2===l&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,s[c++]=255&t);1===l&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,s[c++]=t>>8&255,s[c++]=255&t);return s},r.fromByteArray=function(e){for(var t,r=e.length,a=r%3,i=[],o=0,l=r-a;ol?l:o+16383));1===a?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,s=o.length;l0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var a,i,o=[],l=t;l>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],2:[function(e,t,r){(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ "use strict";var n=e("base64-js"),a=e("ieee754");r.Buffer=t,r.SlowBuffer=function(e){+e!=e&&(e=0);return t.alloc(+e)},r.INSPECT_MAX_BYTES=50;function i(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return r.__proto__=t.prototype,r}function t(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return o(e,t,r)}function o(e,r,n){if("string"==typeof e)return function(e,r){"string"==typeof r&&""!==r||(r="utf8");if(!t.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|f(e,r),a=i(n),o=a.write(e,r);o!==n&&(a=a.slice(0,o));return a}(e,r);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer))return function(e,r,n){if(r<0||e.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function f(e,r){if(t.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===n)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return I(e).length;default:if(i)return a?-1:R(e).length;r=(""+r).toLowerCase(),i=!0}}function d(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function h(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function p(e,r,n,a,i){if(0===e.length)return-1;if("string"==typeof n?(a=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),L(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof r&&(r=t.from(r,a)),t.isBuffer(r))return 0===r.length?-1:g(e,r,n,a,i);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):g(e,[r],n,a,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,a){var i,o=1,l=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,l/=2,s/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var c=-1;for(i=r;il&&(r=l-s),i=r;i>=0;i--){for(var f=!0,d=0;da&&(n=a):n=a;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o>8,a=r%256,i.push(a),i.push(n);return i}(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function E(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a239?4:u>223?3:u>191?2:1;if(a+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[a+1]))&&(s=(31&u)<<6|63&i)>127&&(c=s);break;case 3:i=e[a+1],o=e[a+2],128==(192&i)&&128==(192&o)&&(s=(15&u)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:i=e[a+1],o=e[a+2],l=e[a+3],128==(192&i)&&128==(192&o)&&128==(192&l)&&(s=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&l)>65535&&s<1114112&&(c=s)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nt&&(e+=" ... "),""},t.prototype.compare=function(e,r,n,a,i){if(O(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===a&&(a=0),void 0===i&&(i=this.length),r<0||n>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&r>=n)return 0;if(a>=i)return-1;if(r>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(a>>>=0),l=(n>>>=0)-(r>>>=0),s=Math.min(o,l),u=this.slice(a,i),c=e.slice(r,n),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;an)&&(r=n);for(var a="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function P(e,r,n,a,i,o){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||re.length)throw new RangeError("Index out of range")}function M(e,t,r,n,a,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),a.write(e,t,r,n,23,4),r+4}function $(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),a.write(e,t,r,n,52,8),r+8}t.prototype.slice=function(e,r){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r>>=0,t>>>=0,r||A(e,t,this.length);for(var n=this[e],a=1,i=0;++i>>=0,t>>>=0,r||A(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},t.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var n=this[e],a=1,i=0;++i=(a*=128)&&(n-=Math.pow(2,8*t)),n},t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var n=t,a=1,i=this[e+--n];n>0&&(a*=256);)i+=this[e+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},t.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),a.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),a.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),a.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),a.read(this,e,!1,52,8)},t.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||P(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,n)||P(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+r},t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*r-1);P(this,e,t,r,a-1,-a)}var i=0,o=1,l=0;for(this[t]=255&e;++i>0)-l&255;return t+r},t.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*r-1);P(this,e,t,r,a-1,-a)}var i=r-1,o=1,l=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===l&&0!==this[t+i+1]&&(l=1),this[t+i]=(e/o>>0)-l&255;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},t.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return $(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return $(this,e,t,!1,r)},t.prototype.copy=function(e,r,n,a){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),a||0===a||(a=this.length),r>=e.length&&(r=e.length),r||(r=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-r=0;--o)e[o+r]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,a),r);return i},t.prototype.fill=function(e,r,n,a){if("string"==typeof e){if("string"==typeof r?(a=r,r=0,n=this.length):"string"==typeof n&&(a=n,n=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!t.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===e.length){var i=e.charCodeAt(0);("utf8"===a&&i<128||"latin1"===a)&&(e=i)}}else"number"==typeof e&&(e&=255);if(r<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=r;o55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function I(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function x(e,t,r,n){for(var a=0;a=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function L(e){return e!=e}}).call(this,e("buffer").Buffer)},{"base64-js":1,buffer:2,ieee754:4}],3:[function(e,t,r){"use strict";var n={single_source_shortest_paths:function(e,t,r){var a={},i={};i[t]=0;var o,l,s,u,c,f,d,h=n.PriorityQueue.make();for(h.push(t,0);!h.empty();)for(s in l=(o=h.pop()).value,u=o.cost,c=e[l]||{})c.hasOwnProperty(s)&&(f=u+c[s],d=i[s],(void 0===i[s]||d>f)&&(i[s]=f,h.push(s,f),a[s]=l));if(void 0!==r&&void 0===i[r]){var p=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(p)}return a},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var a=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(a,r)},PriorityQueue:{make:function(e){var t,r=n.PriorityQueue,a={};for(t in e=e||{},r)r.hasOwnProperty(t)&&(a[t]=r[t]);return a.queue=[],a.sorter=e.sorter||r.default_sorter,a},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==t&&(t.exports=n)},{}],4:[function(e,t,r){r.read=function(e,t,r,n,a){var i,o,l=8*a-n-1,s=(1<>1,c=-7,f=r?a-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=l;c>0;i=256*i+e[t+f],f+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===i)i=1-u;else{if(i===s)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),i-=u}return(h?-1:1)*o*Math.pow(2,i-n)},r.write=function(e,t,r,n,a,i){var o,l,s,u=8*i-a-1,c=(1<>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-o))<1&&(o--,s*=2),(t+=o+f>=1?d/s:d*Math.pow(2,1-f))*s>=2&&(o++,s/=2),o+f>=c?(l=0,o=c):o+f>=1?(l=(t*s-1)*Math.pow(2,a),o+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;e[r+h]=255&l,h+=p,l/=256,a-=8);for(o=o<0;e[r+h]=255&o,h+=p,o/=256,u-=8);e[r+h-p]|=128*g}},{}],5:[function(e,t,r){var n=e("./can-promise"),a=e("./core/qrcode"),i=e("./renderer/canvas"),o=e("./renderer/svg-tag.js");function l(e,t,r,i,o){var l=[].slice.call(arguments,1),s=l.length,u="function"==typeof l[s-1];if(!u&&!n())throw new Error("Callback required as last argument");if(!u){if(s<1)throw new Error("Too few arguments provided");return 1===s?(r=t,t=i=void 0):2!==s||t.getContext||(i=r,r=t,t=void 0),new Promise((function(n,o){try{var l=a.create(r,i);n(e(l,t,i))}catch(e){o(e)}}))}if(s<2)throw new Error("Too few arguments provided");2===s?(o=r,r=t,t=i=void 0):3===s&&(t.getContext&&void 0===o?(o=i,i=void 0):(o=i,i=r,r=t,t=void 0));try{var c=a.create(r,i);o(null,e(c,t,i))}catch(e){o(e)}}r.create=a.create,r.toCanvas=l.bind(null,i.render),r.toDataURL=l.bind(null,i.renderToDataURL),r.toString=l.bind(null,(function(e,t,r){return o.render(e,r)}))},{"./can-promise":6,"./core/qrcode":22,"./renderer/canvas":29,"./renderer/svg-tag.js":30}],6:[function(e,t,r){t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},{}],7:[function(e,t,r){var n=e("./utils").getSymbolSize;r.getRowColCoords=function(e){if(1===e)return[];for(var t=Math.floor(e/7)+2,r=n(e),a=145===r?26:2*Math.ceil((r-13)/(2*t-2)),i=[r-7],o=1;o>>7-e%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n},{}],10:[function(e,t,r){var n=e("../utils/buffer");function a(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new n(e*e),this.data.fill(0),this.reservedBit=new n(e*e),this.reservedBit.fill(0)}a.prototype.set=function(e,t,r,n){var a=e*this.size+t;this.data[a]=r,n&&(this.reservedBit[a]=!0)},a.prototype.get=function(e,t){return this.data[e*this.size+t]},a.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},a.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=a},{"../utils/buffer":32}],11:[function(e,t,r){var n=e("../utils/buffer"),a=e("./mode");function i(e){this.mode=a.BYTE,this.data=new n(e)}i.getBitsLength=function(e){return 8*e},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){for(var t=0,r=this.data.length;t=0&&e.bit<4},r.from=function(e,t){if(r.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return t}}},{}],14:[function(e,t,r){var n=e("./utils").getSymbolSize;r.getPositions=function(e){var t=n(e);return[[0,0],[t-7,0],[0,t-7]]}},{"./utils":26}],15:[function(e,t,r){var n=e("./utils"),a=n.getBCHDigit(1335);r.getEncodedBits=function(e,t){for(var r=e.bit<<3|t,i=r<<10;n.getBCHDigit(i)-a>=0;)i^=1335<=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},t.exports=i},{"./mode":19,"./utils":26}],18:[function(e,t,r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var n=3,a=3,i=40,o=10;function l(e,t,n){switch(e){case r.Patterns.PATTERN000:return(t+n)%2==0;case r.Patterns.PATTERN001:return t%2==0;case r.Patterns.PATTERN010:return n%3==0;case r.Patterns.PATTERN011:return(t+n)%3==0;case r.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case r.Patterns.PATTERN101:return t*n%2+t*n%3==0;case r.Patterns.PATTERN110:return(t*n%2+t*n%3)%2==0;case r.Patterns.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}r.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},r.from=function(e){return r.isValid(e)?parseInt(e,10):void 0},r.getPenaltyN1=function(e){for(var t=e.size,r=0,a=0,i=0,o=null,l=null,s=0;s=5&&(r+=n+(a-5)),o=c,a=1),(c=e.get(u,s))===l?i++:(i>=5&&(r+=n+(i-5)),l=c,i=1)}a>=5&&(r+=n+(a-5)),i>=5&&(r+=n+(i-5))}return r},r.getPenaltyN2=function(e){for(var t=e.size,r=0,n=0;n=10&&(1488===n||93===n)&&r++,a=a<<1&2047|e.get(l,o),l>=10&&(1488===a||93===a)&&r++}return r*i},r.getPenaltyN4=function(e){for(var t=0,r=e.data.length,n=0;n=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},r.getBestModeForData=function(e){return a.testNumeric(e)?r.NUMERIC:a.testAlphanumeric(e)?r.ALPHANUMERIC:a.testKanji(e)?r.KANJI:r.BYTE},r.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},r.isValid=function(e){return e&&e.bit&&e.ccBits},r.from=function(e,t){if(r.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return t}}},{"./regex":24,"./version-check":27}],20:[function(e,t,r){var n=e("./mode");function a(e){this.mode=n.NUMERIC,this.data=e.toString()}a.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(e){var t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);var a=this.data.length-t;a>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*a+1))},t.exports=a},{"./mode":19}],21:[function(e,t,r){var n=e("../utils/buffer"),a=e("./galois-field");r.mul=function(e,t){var r=new n(e.length+t.length-1);r.fill(0);for(var i=0;i=0;){for(var i=r[0],o=0;o>n&1),n<6?e.set(n,8,a,!0):n<8?e.set(n+1,8,a,!0):e.set(i-15+n,8,a,!0),n<8?e.set(8,i-n-1,a,!0):n<9?e.set(8,15-n-1+1,a,!0):e.set(8,15-n-1,a,!0);e.set(i-8,8,1,!0)}function b(e,t,r){var i=new o;r.forEach((function(t){i.put(t.mode.bit,4),i.put(t.getLength(),g.getCharCountIndicator(t.mode,e)),t.write(i)}));var l=8*(a.getSymbolTotalCodewords(e)-f.getTotalCodewordsCount(e,t));for(i.getLengthInBits()+4<=l&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);for(var s=(l-i.getLengthInBits())/8,u=0;u=0&&l<=6&&(0===s||6===s)||s>=0&&s<=6&&(0===l||6===l)||l>=2&&l<=4&&s>=2&&s<=4?e.set(i+l,o+s,!0,!0):e.set(i+l,o+s,!1,!0))}(w,t),function(e){for(var t=e.size,r=8;r=7&&function(e,t){for(var r,n,a,i=e.size,o=h.getEncodedBits(t),l=0;l<18;l++)r=Math.floor(l/3),n=l%3+i-8-3,a=1==(o>>l&1),e.set(r,n,a,!0),e.set(n,r,a,!0)}(w,t),function(e,t){for(var r=e.size,n=-1,a=r-1,i=7,o=0,l=r-1;l>0;l-=2)for(6===l&&l--;;){for(var s=0;s<2;s++)if(!e.isReserved(a,l-s)){var u=!1;o>>i&1)),e.set(a,l-s,u),-1===--i&&(o++,i=7)}if((a+=n)<0||r<=a){a-=n,n=-n;break}}}(w,p),isNaN(n)&&(n=c.getBestMask(w,y.bind(null,w,r))),c.applyMask(n,w),y(w,r,n),{modules:w,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}r.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");var r,n,o=i.M;return void 0!==t&&(o=i.from(t.errorCorrectionLevel,i.M),r=h.from(t.version),n=c.from(t.maskPattern),t.toSJISFunc&&a.setToSJISFunction(t.toSJISFunc)),w(e,r,o,n)}},{"../utils/buffer":32,"./alignment-pattern":7,"./bit-buffer":9,"./bit-matrix":10,"./error-correction-code":12,"./error-correction-level":13,"./finder-pattern":14,"./format-info":15,"./mask-pattern":18,"./mode":19,"./reed-solomon-encoder":23,"./segments":25,"./utils":26,"./version":28,isarray:33}],23:[function(e,t,r){var n=e("../utils/buffer"),a=e("./polynomial");function i(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(e){this.degree=e,this.genPoly=a.generateECPolynomial(this.degree)},i.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var t=new n(this.degree);t.fill(0);var r=n.concat([e,t],e.length+this.degree),i=a.mod(r,this.genPoly),o=this.degree-i.length;if(o>0){var l=new n(this.degree);return l.fill(0),i.copy(l,o),l}return i},t.exports=i},{"../utils/buffer":32,"./polynomial":21}],24:[function(e,t,r){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",a="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";r.KANJI=new RegExp(n,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=new RegExp(a,"g"),r.NUMERIC=new RegExp("[0-9]+","g"),r.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var i=new RegExp("^"+n+"$"),o=new RegExp("^[0-9]+$"),l=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(e){return i.test(e)},r.testNumeric=function(e){return o.test(e)},r.testAlphanumeric=function(e){return l.test(e)}},{}],25:[function(e,t,r){var n=e("./mode"),a=e("./numeric-data"),i=e("./alphanumeric-data"),o=e("./byte-data"),l=e("./kanji-data"),s=e("./regex"),u=e("./utils"),c=e("dijkstrajs");function f(e){return unescape(encodeURIComponent(e)).length}function d(e,t,r){for(var n,a=[];null!==(n=e.exec(r));)a.push({data:n[0],index:n.index,mode:t,length:n[0].length});return a}function h(e){var t,r,a=d(s.NUMERIC,n.NUMERIC,e),i=d(s.ALPHANUMERIC,n.ALPHANUMERIC,e);return u.isKanjiModeEnabled()?(t=d(s.BYTE,n.BYTE,e),r=d(s.KANJI,n.KANJI,e)):(t=d(s.BYTE_KANJI,n.BYTE,e),r=[]),a.concat(i,t,r).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function p(e,t){switch(t){case n.NUMERIC:return a.getBitsLength(e);case n.ALPHANUMERIC:return i.getBitsLength(e);case n.KANJI:return l.getBitsLength(e);case n.BYTE:return o.getBitsLength(e)}}function g(e,t){var r,s=n.getBestModeForData(e);if((r=n.from(t,s))!==n.BYTE&&r.bit=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(o))},r.rawSplit=function(e){return r.fromArray(h(e,u.isKanjiModeEnabled()))}},{"./alphanumeric-data":8,"./byte-data":11,"./kanji-data":17,"./mode":19,"./numeric-data":20,"./regex":24,"./utils":26,dijkstrajs:3}],26:[function(e,t,r){var n,a=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},r.getSymbolTotalCodewords=function(e){return a[e]},r.getBCHDigit=function(e){for(var t=0;0!==e;)t++,e>>>=1;return t},r.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');n=e},r.isKanjiModeEnabled=function(){return void 0!==n},r.toSJIS=function(e){return n(e)}},{}],27:[function(e,t,r){r.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},{}],28:[function(e,t,r){var n=e("./utils"),a=e("./error-correction-code"),i=e("./error-correction-level"),o=e("./mode"),l=e("./version-check"),s=e("isarray"),u=n.getBCHDigit(7973);function c(e,t){return o.getCharCountIndicator(e,t)+4}function f(e,t){var r=0;return e.forEach((function(e){var n=c(e.mode,t);r+=n+e.getBitsLength()})),r}r.from=function(e,t){return l.isValid(e)?parseInt(e,10):t},r.getCapacity=function(e,t,r){if(!l.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=o.BYTE);var i=8*(n.getSymbolTotalCodewords(e)-a.getTotalCodewordsCount(e,t));if(r===o.MIXED)return i;var s=i-c(r,e);switch(r){case o.NUMERIC:return Math.floor(s/10*3);case o.ALPHANUMERIC:return Math.floor(s/11*2);case o.KANJI:return Math.floor(s/13);case o.BYTE:default:return Math.floor(s/8)}},r.getBestVersionForData=function(e,t){var n,a=i.from(t,i.M);if(s(e)){if(e.length>1)return function(e,t){for(var n=1;n<=40;n++){if(f(e,n)<=r.getCapacity(n,t,o.MIXED))return n}}(e,a);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,t,n){for(var a=1;a<=40;a++)if(t<=r.getCapacity(a,n,e))return a}(n.mode,n.getLength(),a)},r.getEncodedBits=function(e){if(!l.isValid(e)||e<7)throw new Error("Invalid QR Code version");for(var t=e<<12;n.getBCHDigit(t)-u>=0;)t^=7973<':"",f="0&&u>0&&e[s-1]||(n+=o?i("M",u+r,.5+c+r):i("m",a,0),a=0,o=!1),u+1',d='viewBox="0 0 '+u+" "+u+'"',h=''+c+f+"\n";return"function"==typeof r&&r(null,h),h}},{"./utils":31}],31:[function(e,t,r){function n(e){if("string"!=typeof e)throw new Error("Color should be defined as hex string");var t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");var r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}r.getOptions=function(e){e||(e={}),e.color||(e.color={});var t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,a=e.scale||4;return{width:r,scale:r?4:a,margin:t,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},r.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},r.getImageWidth=function(e,t){var n=r.getScale(e,t);return Math.floor((e+2*t.margin)*n)},r.qrToImageData=function(e,t,n){for(var a=t.modules.size,i=t.modules.data,o=r.getScale(a,n),l=Math.floor((a+2*n.margin)*o),s=n.margin*o,u=[n.color.light,n.color.dark],c=0;c=s&&f>=s&&c=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function o(e,t){var n;return r.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t)).__proto__=r.prototype:(null===(n=e)&&(n=new r(t)),n.length=t),n}function l(e,t){var n=o(e,t<0?0:0|i(t));if(!r.TYPED_ARRAY_SUPPORT)for(var a=0;a55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function c(e){return r.isBuffer(e)?e.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)?e.byteLength:("string"!=typeof e&&(e=""+e),0===e.length?0:u(e).length)}r.TYPED_ARRAY_SUPPORT&&(r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),r.prototype.write=function(e,t,r){void 0===t||void 0===r&&"string"==typeof t?(r=this.length,t=0):isFinite(t)&&(t|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(e,t,r,n){return function(e,t,r,n){for(var a=0;a=t.length||a>=e.length);++a)t[a+r]=e[a];return a}(u(t,e.length-r),e,r,n)}(this,e,t,r)},r.prototype.slice=function(e,t){var n,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!r.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i0&&localStorage.removeItem(t)}},{key:"getData",value:function(e){var t;if("undefined"==typeof Storage)return null;var r=localStorage.getItem(e);return void 0!==r&&null!=r&&""!==r?void 0===(t=JSON.parse(r))||null==t||void 0!==t.status&&null!=t.status&&"SUCCESS"!==t.status?null:t:null}},{key:"setData",value:function(e,t){if("undefined"==typeof Storage)return null;if(void 0!==t.status&&null!=t.status&&"SUCCESS"!==t.status)return null;var r=JSON.stringify(t);return localStorage.setItem(e,r),r}}])&&n(t.prototype,r),a&&n(t,a),e}();r.default=a},{}],35:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(e("./ModuleBase")),a=i(e("../api-common/RequestCache"));function i(e){return e&&e.__esModule?e:{default:e}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var r=0;r0}},i=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tempOptions={},this.formId=t,this.formError=!1,this.formObject=null,this.errorMessages="",this.popupDialog=null,this.validateAll=r,this.errorMap=[],this.settings={thirdPartyPopup:null,LabelErrorClass:!1,ShowPopup:!0},this.settings=jQuery.extend(this.settings,n),this.inputTypes=["text","radio","checkbox","file","password","select-one","select-multi","textarea","fileupload","signature"],this.validator=a}var t,r,i;return t=e,r=[{key:"clearError",value:function(e,t){var r=e.attr("id");$("#".concat(this.formId," #field_").concat(r)).removeClass("error"),$("#".concat(this.formId," #help_").concat(r)).html("")}},{key:"addError",value:function(e,t){this.formError=!0,null!=e.attr("message")?(this.errorMessages+="".concat(e.attr("message"),"\n"),this.errorMap[e.attr("name")]=e.attr("message")):this.errorMap[e.attr("name")]="";var r=e.attr("id"),n=e.attr("validation"),a=e.attr("validation");$("#".concat(this.formId," #field_").concat(r)).addClass("error"),void 0===a||null==a||""===a?$("#".concat(this.formId," #help_err_").concat(r)).html(a):void 0===n||null==n||""===n?$("#".concat(this.formId," #help_err_").concat(r)).html("Required"):"float"===n||"number"===n?$("#".concat(this.formId," #help_err_").concat(r)).html("Number required"):"email"===n?$("#".concat(this.formId," #help_err_").concat(r)).html("Email required"):$("#".concat(this.formId," #help_err_").concat(r)).html("Required")}},{key:"showErrors",value:function(){this.formError&&(void 0!==this.settings.thirdPartyPopup&&null!=this.settings.thirdPartyPopup?this.settings.thirdPartyPopup.alert():!0===this.settings.ShowPopup&&(void 0!==this.tempOptions.popupTop&&null!=this.tempOptions.popupTop?this.alert("Errors Found",this.errorMessages,this.tempOptions.popupTop):this.alert("Errors Found",this.errorMessages,-1)))}},{key:"checkValues",value:function(e){this.tempOptions=e;var t=this;this.formError=!1,this.errorMessages="",this.formObject={};var r=function(e){var r=null,n=e.attr("name");!1!==t.settings.LabelErrorClass&&$("label[for='".concat(n,"']")).removeClass(t.settings.LabelErrorClass);var a=e.attr("id"),i=e.attr("type");if(e.hasClass("select2-focusser")||e.hasClass("select2-input"))return!0;if(jQuery.inArray(i,t.inputTypes)>=0){if(e.hasClass("uploadInput"))r=e.attr("val");else if("radio"===i||"checkbox"===i)r=$("input[name='".concat(n,"']:checked")).val();else if(e.hasClass("select2Field"))r=null!=$("#".concat(t.formId," #").concat(a)).select2("data")&&void 0!==$("#".concat(t.formId," #").concat(a)).select2("data")?$("#".concat(t.formId," #").concat(a)).select2("data").id:"";else if(e.hasClass("select2Multi"))if(null!=$("#".concat(t.formId," #").concat(a)).select2("data")&&void 0!==$("#".concat(t.formId," #").concat(a)).select2("data")){var o=$("#".concat(t.formId," #").concat(a)).select2("data");r=[];for(var l=0;l')),null!=this.getFilters()&&(""!==e&&(e+="  "),e+=''),e+="  ",this.filtersAlreadySet?e+='':e+=''),e=e.replace(/__id__/g,this.getTableName()),""!==(e=""!==this.currentFilterString&&null!=this.currentFilterString?e.replace(/__filterString__/g,this.currentFilterString):e.replace(/__filterString__/g,"Reset Filters"))&&(e='
'.concat(e,"
")),e}},{key:"getActionButtonHeader",value:function(){return{sTitle:"",sClass:"center"}}},{key:"getTableHTMLTemplate",value:function(){return'
'}},{key:"isSortable",value:function(){return!0}},{key:"createTable",value:function(e){if(this.getRemoteTable())this.createTableServer(e);else{var t=this.getHeaders();for(var r in t)t[r].sTitle=this.gt(t[r].sTitle);var n,a=this.getTableData();if(this.showActionButtons()&&t.push(this.getActionButtonHeader()),this.showActionButtons())for(var i=0;i")),$("#".concat(e,"ModelLabel")).html(t),$("#".concat(e,"ModelBody")).html(""),$("#".concat(e,"ModelBody")).append(r)}},{key:"deleteRow",value:function(e){this.deleteParams.id=e,this.renderModel("delete","Confirm Deletion","Are you sure you want to delete this item ?"),$("#deleteModel").modal("show")}},{key:"showMessage",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=this,o="";o=a?"#plainMessageModel":"#messageModel",$(o).off(),a?this.renderModel("plainMessage",e,t):this.renderModel("message",e,t),null!=r?($(o).modal({show:!0}),$(o).on("hidden.bs.modal",(function(){r.apply(i,n),$(".modal-backdrop").remove()}))):$(o).modal({backdrop:"static"})}},{key:"showDomElement",value:function(e,t,r,n,a){var i=this,o="";o=a?"#dataMessageModel":"#messageModel",$(o).unbind("hide"),a?this.renderModelFromDom("dataMessage",e,t):this.renderModelFromDom("message",e,t),null!=r?($(o).modal({show:!0}),$(o).on("hidden.bs.modal",(function(){r.apply(i,n),$(".modal-backdrop").remove()}))):$(o).modal({backdrop:"static"})}},{key:"confirmDelete",value:function(){void 0===this.deleteParams.id&&null==this.deleteParams.id||this.deleteObj(this.deleteParams.id,[]),$("#deleteModel").modal("hide")}},{key:"cancelDelete",value:function(){$("#deleteModel").modal("hide"),this.deleteParams.id=null}},{key:"closeMessage",value:function(){$("#messageModel").modal("hide")}},{key:"cancelYesno",value:function(){$("#yesnoModel").modal("hide")}},{key:"closePlainMessage",value:function(){$("#plainMessageModel").modal("hide"),$("#dataMessageModel").modal("hide")}},{key:"closeDataMessage",value:function(){$("#dataMessageModel").modal("hide")}},{key:"save",value:function(e,t){var r=new a.default("".concat(this.getTableName(),"_submit"),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(r.checkValues()){var n=r.getFormParameters();n=this.forceInjectValuesBeforeSave(n);var i=this.doCustomValidation(n);if(null==i){this.csrfRequired&&(n.csrf=$("#".concat(this.getTableName(),"Form")).data("csrf"));var o=$("#".concat(this.getTableName(),"_submit #id")).val();null!=o&&void 0!==o&&""!==o&&(n.id=o),n=this.makeEmptyDateFieldsNull(n),this.add(n,[],e,t)}else $("#".concat(this.getTableName(),"Form .label")).html(i),$("#".concat(this.getTableName(),"Form .label")).show(),this.scrollToTop()}}},{key:"makeEmptyDateFieldsNull",value:function(e){return this.getFormFields().forEach((function(t){"date"!==t[1].type&&"datetime"!==t[1].type||""!==e[t[0]]&&"0000-00-00"!==e[t[0]]&&"0000-00-00 00:00:00"!==e[t[0]]||("none"===t[1].validation?e[t[0]]="NULL":delete e[t[0]])})),e}},{key:"validatePassword",value:function(e){return e.length<8?this.gt("Password too short"):e.length>20?this.gt("Password too long"):e.match(/.*[0-9]+.*$/)?e.match(/.*[a-z]+.*$/)?e.match(/.*[A-Z]+.*$/)?e.match(/.*[\W]+.*$/)?null:this.gt("Password must include at least one symbol"):this.gt("Password must include at least one uppercase letter"):this.gt("Password must include at least one lowercase letter"):this.gt("Password must include at least one number")}},{key:"forceInjectValuesBeforeSave",value:function(e){return e}},{key:"doCustomValidation",value:function(e){return null}},{key:"filterQuery",value:function(){var e=new a.default("".concat(this.getTableName(),"_filter"),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(e.checkValues()){var t=e.getFormParameters();if(this.doCustomFilterValidation(t)){for(var r in t)t.hasOwnProperty(r)&&"NULL"===t[r]&&delete t[r];this.setFilter(t),this.filtersAlreadySet=!0,$("#".concat(this.getTableName(),"_resetFilters")).show(),this.currentFilterString=this.getFilterString(t),this.get([]),this.closePlainMessage()}}}},{key:"getFilterString",value:function(e){var t,r,n,a,i,o,l="",s=this.getFilters();for(var u in null==n&&(n=[]),e)if(e.hasOwnProperty(u)){if(i="",o=null,"select"===(n=this.getMetaFieldValues(u,s)).type||"select2"===n.type){if(void 0!==n["remote-source"]&&null!=n["remote-source"])t=n["remote-source"],"NULL"===e[u]?i=void 0!==n["null-label"]&&null!=n["null-label"]?n["null-label"]:"Not Selected":o=i=this.fieldMasterData["".concat(t[0],"_").concat(t[1],"_").concat(t[2])][e[u]];else if(r=n.source[0],"NULL"===e[u])i=void 0!==n["null-label"]&&null!=n["null-label"]?n["null-label"]:"Not Selected";else for(var c=0;c');s.attr("id",l),s.html(t),s.find(".datefield").datepicker({viewMode:2}),s.find(".timefield").datetimepicker({language:"en",pickDate:!1}),s.find(".datetimefield").datetimepicker({language:"en"}),s.find(".colorpick").colorpicker(),tinymce.init({selector:"#".concat(s.attr("id")," .tinymce"),height:"400"}),s.find(".simplemde").each((function(){var e=new SimpleMDE({element:$(this)[0]});$(this).data("simplemde",e)})),s.find(".select2Field").each((function(){$(this).select2().select2("val",$(this).find("option:eq(0)").val())})),s.find(".select2Multi").each((function(){$(this).select2().on("change",(function(e){var t=$(this).parents(".row"),r=t.find(".select2-choices").height();t.height(parseInt(r,10))}))})),this.showDomElement("Edit",s,null,null,!0),$(".filterBtn").off(),$(".filterBtn").on("click",(function(e){e.preventDefault(),e.stopPropagation();try{modJs.filterQuery()}catch(e){}return!1})),void 0!==this.filter&&null!=this.filter&&""!==this.filter&&this.fillForm(this.filter,"#".concat(this.getTableName(),"_filter"),this.getFilters())}},{key:"preRenderForm",value:function(e){}},{key:"renderForm",value:function(e){var t=[];null!=e&&void 0!==e||(this.currentId=null),this.preRenderForm(e);for(var r,n=this.templates.formTemplate,a="",i=this.getFormFields(),o=0;o')).attr("id",u):r=$("#".concat(this.getTableName(),"Form")),r.html(n),r.find(".datefield").datepicker({viewMode:2}),r.find(".timefield").datetimepicker({language:"en",pickDate:!1}),r.find(".datetimefield").datetimepicker({language:"en"}),r.find(".colorpick").colorpicker(),tinymce.init({selector:"#".concat(r.attr("id")," .tinymce"),height:"400"}),r.find(".simplemde").each((function(){var e=new SimpleMDE({element:$(this)[0]});$(this).data("simplemde",e)}));var c=this.codeMirror;c&&r.find(".code").each((function(){var e=c.fromTextArea($(this)[0],{lineNumbers:!1,matchBrackets:!0,continueComments:"Enter",extraKeys:{"Ctrl-Q":"toggleComment"}});$(this).data("codemirror",e)})),r.find(".select2Field").each((function(){$(this).select2().select2("val",$(this).find("option:eq(0)").val())})),r.find(".select2Multi").each((function(){$(this).select2().on("change",(function(e){var t=$(this).parents(".row"),r=t.find(".select2-choices").height();t.height(parseInt(r,10))}))})),r.find(".signatureField").each((function(){t.push($(this).attr("id"))}));for(var f=0;f')),u=0;u
  • ')).replace("#_edit_#",'
  • ')).replace(/#_id_#/g,n.id),n)void 0!==(i=n[c])&&null!=i&&"string"==typeof i&&(i=i.replace(/(?:\r\n|\r|\n)/g,"
    ")),r=r.replace("#_".concat(c,"_#"),i);void 0!==t[1].render&&null!=t[1].render&&(r=r.replace("#_renderFunction_#",t[1].render(n))),(a=$(r)).attr("fieldId","".concat(t[0],"_div")),s.append(a)}return s}},{key:"resetDataGroup",value:function(e){$("#".concat(e[0])).val(""),$("#".concat(e[0],"_div")).html("")}},{key:"showDataGroup",value:function(e,t){var r=this.templates.datagroupTemplate,n="",a=e[1].form;void 0!==t&&null!=t&&void 0!==t.id?this.currentDataGroupItemId=t.id:this.currentDataGroupItemId=null;for(var i=0;i');l.attr("id",o),l.html(r),l.find(".datefield").datepicker({viewMode:2}),l.find(".timefield").datetimepicker({language:"en",pickDate:!1}),l.find(".datetimefield").datetimepicker({language:"en"}),l.find(".colorpick").colorpicker(),tinymce.init({selector:"#".concat(l.attr("id")," .tinymce"),height:"400"}),l.find(".simplemde").each((function(){var e=new SimpleMDE({element:$(this)[0]});$(this).data("simplemde",e)})),l.find(".select2Field").each((function(){$(this).select2().select2("val",$(this).find("option:eq(0)").val())})),l.find(".select2Multi").each((function(){$(this).select2().on("change",(function(e){var t=$(this).parents(".row"),r=t.find(".select2-choices").height();t.height(parseInt(r,10))}))})),this.currentDataGroupField=e,this.showDomElement("Add ".concat(e[1].label),l,null,null,!0),void 0!==t&&null!=t?this.fillForm(t,"#".concat(this.getTableName(),"_field_").concat(e[0]),e[1].form):this.setDefaultValues("#".concat(this.getTableName(),"_field_").concat(e[0]),e[1].form),$(".groupAddBtn").off(),void 0!==t&&null!=t&&void 0!==t.id?$(".groupAddBtn").on("click",(function(e){e.preventDefault(),e.stopPropagation();try{modJs.editDataGroup()}catch(e){console.log("Error editing data group: ".concat(e.message))}return!1})):$(".groupAddBtn").on("click",(function(e){e.preventDefault(),e.stopPropagation();try{modJs.addDataGroup()}catch(e){console.log("Error adding data group: ".concat(e.message))}return!1}))}},{key:"addDataGroup",value:function(){var e,t=this.currentDataGroupField;$("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).html(""),$("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).hide();var r=new a.default("".concat(this.getTableName(),"_field_").concat(t[0]),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(r.checkValues()){var n=r.getFormParameters();if(void 0!==t[1]["custom-validate-function"]&&null!=t[1]["custom-validate-function"]){if(!(e=t[1]["custom-validate-function"].apply(this,[n])).valid)return $("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).html(e.message),$("#".concat(this.getTableName(),"_field_").concat(t[0],"_error")).show(),!1;n=e.params}var i=$("#".concat(t[0])).val();""===i&&(i="[]");var o=JSON.parse(i);n.id="".concat(t[0],"_").concat(this.dataGroupGetNextAutoIncrementId(o)),o.push(n),void 0!==t[1]["sort-function"]&&null!=t[1]["sort-function"]&&o.sort(t[1]["sort-function"]),i=JSON.stringify(o);var l=this.dataGroupToHtml(i,t);$("#".concat(t[0],"_div")).html(""),$("#".concat(t[0],"_div")).append(l),this.makeDataGroupSortable(t,$("#".concat(t[0],"_div_inner"))),$("#".concat(t[0])).val(i),this.orderDataGroup(t),this.closeDataMessage(),this.showMessage("Item Added","This change will be effective only when you save the form")}return!0}},{key:"nl2br",value:function(e,t){var r="";try{for(var n=e.split(" "),a=0,i=0;it?(r+="".concat(n[i],"
    "),a=0):r+="".concat(n[i]," ")}catch(e){}return r}},{key:"makeDataGroupSortable",value:function(e,t){t.data("field",e),t.data("firstSort",!0),t.sortable({create:function(){$(this).height($(this).height())},"ui-floating":!1,start:function(e,t){$("#sortable-ul-selector-id").sortable({sort:function(e,t){var r=$(e.target);if(!/html|body/i.test(r.offsetParent()[0].tagName)){var n=e.pageY-r.offsetParent().offset().top-t.helper.outerHeight(!0)/2;t.helper.css({top:"".concat(n,"px")})}}})},revert:!0,stop:function(){modJs.orderDataGroup($(this).data("field"))},axis:"y",scroll:!1,placeholder:"sortable-placeholder",cursor:"move"})}},{key:"orderDataGroup",value:function(e){var t,r=[],n=$("#".concat(e[0],"_div_inner [fieldid='").concat(e[0],"_div']")),a=$("#".concat(e[0])).val();""===a&&(a="[]");var i=JSON.parse(a);n.each((function(){for(var e in t=$(this).attr("id"),i)if(i[e].id===t){r.push(i[e]);break}})),$("#".concat(e[0])).val(JSON.stringify(r))}},{key:"editDataGroup",value:function(){var e=this.currentDataGroupField,t=this.currentDataGroupItemId,r=new a.default("".concat(this.getTableName(),"_field_").concat(e[0]),!0,{ShowPopup:!1,LabelErrorClass:"error"});if(r.checkValues()){var n=r.getFormParameters();if(void 0!==e[1]["custom-validate-function"]&&null!=e[1]["custom-validate-function"]){var i=e[1]["custom-validate-function"].apply(this,[n]);if(!i.valid)return $("#".concat(this.getTableName(),"_field_").concat(e[0],"_error")).html(i.message),$("#".concat(this.getTableName(),"_field_").concat(e[0],"_error")).show(),!1;n=i.params}if(this.doCustomFilterValidation(n)){var o=$("#".concat(e[0])).val();""===o&&(o="[]");for(var l=JSON.parse(o),s={},u=-1,c=[],f=0;f=r&&(r=parseInt(t,10)+1)}return r}},{key:"deleteDataGroupItem",value:function(e){for(var t=e.substring(0,e.lastIndexOf("_")),r=$("#".concat(t)).val(),n=JSON.parse(r),a=[],i=0;i")}catch(e){}if(void 0!==r[a][1].formatter&&r[a][1].formatter&&$.isFunction(r[a][1].formatter))try{n=r[a][1].formatter(n)}catch(e){}$("".concat(t," #").concat(r[a][0])).html(n)}else if("fileupload"===r[a][1].type)null!=e[r[a][0]]&&void 0!==e[r[a][0]]&&""!==e[r[a][0]]&&($("".concat(t," #").concat(r[a][0])).html(e[r[a][0]]),$("".concat(t," #").concat(r[a][0])).attr("val",e[r[a][0]]),$("".concat(t," #").concat(r[a][0])).show(),$("".concat(t," #").concat(r[a][0],"_download")).show(),$("".concat(t," #").concat(r[a][0],"_remove")).show()),!0===r[a][1].readonly&&$("".concat(t," #").concat(r[a][0],"_upload")).remove();else if("select"===r[a][1].type)void 0!==e[r[a][0]]&&null!=e[r[a][0]]&&""!==e[r[a][0]]||(e[r[a][0]]="NULL"),$("".concat(t," #").concat(r[a][0])).val(e[r[a][0]]);else if("select2"===r[a][1].type)void 0!==e[r[a][0]]&&null!=e[r[a][0]]&&""!==e[r[a][0]]||(e[r[a][0]]="NULL"),$("".concat(t," #").concat(r[a][0])).select2("val",e[r[a][0]]);else if("select2multi"===r[a][1].type){void 0!==e[r[a][0]]&&null!=e[r[a][0]]&&""!==e[r[a][0]]||(e[r[a][0]]="NULL");var u=[];if(void 0!==e[r[a][0]]&&null!=e[r[a][0]]&&""!==e[r[a][0]])try{u=JSON.parse(e[r[a][0]])}catch(e){}$("".concat(t," #").concat(r[a][0])).select2("val",u);var c=$("".concat(t," #").concat(r[a][0])).find(".select2-choices").height();$("".concat(t," #").concat(r[a][0])).find(".controls").css("min-height","".concat(c,"px")),$("".concat(t," #").concat(r[a][0])).css("min-height","".concat(c,"px"))}else if("datagroup"===r[a][1].type)try{var f=this.dataGroupToHtml(e[r[a][0]],r[a]);$("".concat(t," #").concat(r[a][0])).val(e[r[a][0]]),$("".concat(t," #").concat(r[a][0],"_div")).html(""),$("".concat(t," #").concat(r[a][0],"_div")).append(f),this.makeDataGroupSortable(r[a],$("".concat(t," #").concat(r[a][0],"_div_inner")))}catch(e){}else if("signature"===r[a][1].type)""===e[r[a][0]]&&void 0===e[r[a][0]]&&null==e[r[a][0]]||$("".concat(t," #").concat(r[a][0])).data("signaturePad").fromDataURL(e[r[a][0]]);else if("simplemde"===r[a][1].type)$("".concat(t," #").concat(r[a][0])).data("simplemde").value(e[r[a][0]]);else if("code"===r[a][1].type){var d=$("".concat(t," #").concat(r[a][0])).data("codemirror");d&&d.getDoc().setValue(e[r[a][0]])}else $("".concat(t," #").concat(r[a][0])).val(e[r[a][0]])}},{key:"cancel",value:function(){$("#".concat(this.getTableName(),"Form")).hide(),$("#".concat(this.getTableName())).show()}},{key:"renderFormField",value:function(e){var t=0;if(void 0===this.fieldTemplates[e[1].type]||null==this.fieldTemplates[e[1].type])return"";var r=this.fieldTemplates[e[1].type];if(e[1].label=this.gt(e[1].label),"none"!==e[1].validation&&"emailOrEmpty"!==e[1].validation&&"numberOrEmpty"!==e[1].validation&&"placeholder"!==e[1].type&&e[1].label.indexOf("*")<0&&(["select","select2"].indexOf(e[1].type)>=0&&!0===e[1]["allow-null"]||(e[1].label="".concat(e[1].label,'*'))),"select"===e[1].type||"select2"===e[1].type||"select2multi"===e[1].type){if(r=(r=r.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label),void 0!==e[1].source&&null!=e[1].source)r=r.replace("_options_",this.renderFormSelectOptions(e[1].source,e));else if(void 0!==e[1]["remote-source"]&&null!=e[1]["remote-source"]){var n="".concat(e[1]["remote-source"][0],"_").concat(e[1]["remote-source"][1],"_").concat(e[1]["remote-source"][2]);r=r.replace("_options_",this.renderFormSelectOptionsRemote(this.fieldMasterData[n],e))}}else if("colorpick"===e[1].type)r=(r=r.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("date"===e[1].type)r=(r=r.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("datetime"===e[1].type)r=(r=r.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("time"===e[1].type)r=(r=r.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);else if("fileupload"===e[1].type){r=(r=r.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);var a=this.getCurrentProfile();t=null!=a&&void 0!==a?a.id:-1*this.getUser().id,r=(r=r.replace(/_userId_/g,t)).replace(/_group_/g,this.tab),r=(r=void 0!==e[1].filetypes&&null!=e[1].filetypes?r.replace(/_filetypes_/g,e[1].filetypes):r.replace(/_filetypes_/g,"all")).replace(/_rand_/g,this.generateRandom(14))}else"datagroup"===e[1].type||"signature"===e[1].type||"tinymce"===e[1].type||e[1].type,r=(r=r.replace(/_id_/g,e[0])).replace(/_label_/g,e[1].label);return r=void 0!==e[1].validation&&null!=e[1].validation&&""!==e[1].validation?r.replace(/_validation_/g,'validation="'.concat(e[1].validation,'"')):r.replace(/_validation_/g,""),r=void 0!==e[1].help&&null!==e[1].help?(r=r.replace(/_helpline_/g,e[1].help)).replace(/_hidden_class_help_/g,""):(r=r.replace(/_helpline_/g,"")).replace(/_hidden_class_help_/g,"hide"),r=void 0!==e[1].placeholder&&null!==e[1].placeholder?r.replace(/_placeholder_/g,'placeholder="'.concat(e[1].placeholder,'"')):r.replace(/_placeholder_/g,""),r=void 0!==e[1].mask&&null!==e[1].mask?r.replace(/_mask_/g,'mask="'.concat(e[1].mask,'"')):r.replace(/_mask_/g,"")}},{key:"renderFormSelectOptions",value:function(e,t){var r="";null!=t&&void 0!==t&&!0===t[1]["allow-null"]&&(void 0!==t[1]["null-label"]&&null!=t[1]["null-label"]?r+='"):r+='');var n=[];for(var a in e)n.push(e[a]);!0===t[1].sort&&n.sort((function(e,t){return(e=e[1])<(t=t[1])?-1:e>t?1:0}));for(var i=0;i_val_';r+=s=(s=s.replace("_id_",o)).replace("_val_",this.gt(l))}return r}},{key:"renderFormSelectOptionsRemote",value:function(e,t){var r="";!0===t[1]["allow-null"]&&(void 0!==t[1]["null-label"]&&null!=t[1]["null-label"]?r+='"):r+='');var n=[];for(var a in e)n.push([a,e[a]]);"true"===t[1].sort&&n.sort((function(e,t){return(e=e[1])<(t=t[1])?-1:e>t?1:0}));for(var i=0;i_val_';r+=s=(s=s.replace("_id_",o)).replace("_val_",this.gt(l))}return r}},{key:"setCustomTemplates",value:function(e){this.customTemplates=e}},{key:"setEmailTemplates",value:function(e){this.emailTemplates=e}},{key:"getCustomTemplate",value:function(e){return this.customTemplates[e]}},{key:"setFieldTemplates",value:function(e){this.fieldTemplates=e}},{key:"getMetaFieldForRendering",value:function(e){return""}},{key:"clearDeleteParams",value:function(){this.deleteParams={}}},{key:"getShowAddNew",value:function(){return this.showAddNew}},{key:"getAddNewLabel",value:function(){return"Add New"}},{key:"setShowAddNew",value:function(e){this.showAddNew=e}},{key:"setShowDelete",value:function(e){this.showDelete=e}},{key:"setShowEdit",value:function(e){this.showEdit=e}},{key:"setShowSave",value:function(e){this.showSave=e}},{key:"setShowCancel",value:function(e){this.showCancel=e}},{key:"getCustomTableParams",value:function(){return{}}},{key:"getActionButtons",value:function(e){return modJs.getActionButtonsHtml(e.aData[0],e.aData)}},{key:"getActionButtonsHtml",value:function(e,t){var r='
    _edit__delete__clone_
    ';return r=this.showAddNew?r.replace("_clone_",''):r.replace("_clone_",""),r=this.showDelete?r.replace("_delete_",''):r.replace("_delete_",""),r=(r=(r=this.showEdit?r.replace("_edit_",''):r.replace("_edit_","")).replace(/_id_/g,e)).replace(/_BASE_/g,this.baseUrl)}},{key:"generateRandom",value:function(e){for(var t=new Date,r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n="",a=e;a>0;--a)n+=r[Math.round(Math.random()*(r.length-1))];return n+t.getTime()}},{key:"checkFileType",value:function(e,t){var r=document.getElementById(e),n="";return r.value.lastIndexOf(".")>0&&(n=r.value.substring(r.value.lastIndexOf(".")+1,r.value.length)),n=n.toLowerCase(),!(t.split(",").indexOf(n)<0&&(r.value="",this.showMessage("File Type Error","Selected file type is not supported"),this.clearFileElement(e),1))}},{key:"clearFileElement",value:function(e){var t=$("#".concat(e));t.replaceWith(t=t.val("").clone(!0))}},{key:"fixJSON",value:function(e){return"1"===this.noJSONRequests&&(e=window.btoa(e)),e}},{key:"getClientDate",value:function(e){var t=this.getClientGMTOffset();return e.addMinutes(60*t)}},{key:"getClientGMTOffset",value:function(){var e=new Date,t=new Date(e.getFullYear(),0,1,0,0,0,0),r=t.toGMTString();return(t-new Date(r.substring(0,r.lastIndexOf(" ")-1)))/36e5}},{key:"getHelpLink",value:function(){return null}},{key:"showLoader",value:function(){$("#iceloader").show()}},{key:"hideLoader",value:function(){$("#iceloader").hide()}},{key:"generateOptions",value:function(e){var t="";for(var r in e)t+=''.replace("__val__",r).replace("__text__",e[r]);return t}},{key:"isModuleInstalled",value:function(e,t){return void 0!==modulesInstalled&&null!==modulesInstalled&&1===modulesInstalled["".concat(e,"_").concat(t)]}},{key:"setCustomFields",value:function(e){for(var t,r,n=0;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r";if(void 0!==e.customFields&&null!==e.customFields&&Object.keys(e.customFields).length>0){var f;for(var d in e.customFields){e.customFields[d][1]||(e.customFields[d][1]=this.gt("Other Details"));var h=e.customFields[d][1].toLocaleLowerCase();if(h=h.replace(" ","_"),$("#cont_".concat(h)).length<=0){var p='

    #_section.name_#

    ';p=(p=p.replace("#_section_#",h)).replace("#_section.name_#",e.customFields[d][1]),$("#customFieldsCont").append($(p))}f=(f='
    ').replace("#_label_#",d),f="fileupload"===e.customFields[d][2]?f.replace("#_value_#","")):f.replace("#_value_#",e.customFields[d][0]),$("#cont_".concat(h)).append($(f))}}else $("#customFieldsCont").remove();$("#".concat(this.getTableName()," #subordinates")).html(u),$("#".concat(this.getTableName()," #name")).html("".concat(e.first_name," ").concat(e.last_name)),this.currentUserId=e.id,$("#".concat(this.getTableName()," #profile_image_").concat(e.id)).attr("src",e.image),"No"===this.checkPermission("Upload/Delete Profile Image")&&($("#employeeUploadProfileImage").remove(),$("#employeeDeleteProfileImage").remove()),"No"===this.checkPermission("Edit Employee Details")&&$("#employeeProfileEditInfo").remove(),r!==n&&$("#employeeUpdatePassword").remove(),this.cancel()}},{key:"modEmployeeGetFailCallBack",value:function(e){}},{key:"editEmployee",value:function(){this.edit(this.currentUserId)}},{key:"changePassword",value:function(){$("#adminUsersModel").modal("show"),$("#adminUsersChangePwd #newpwd").val(""),$("#adminUsersChangePwd #conpwd").val(""),$("#adminUsersChangePwd_error").hide()}},{key:"changePasswordConfirm",value:function(){$("#adminUsersChangePwd_error").hide();var e=$("#adminUsersChangePwd #newpwd").val(),t=$("#adminUsersChangePwd #conpwd").val();if(t!==e)return $("#adminUsersChangePwd_error").html("Passwords don't match"),void $("#adminUsersChangePwd_error").show();var r=this.validatePassword(e);if(null!=r)return $("#adminUsersChangePwd_error").html(r),void $("#adminUsersChangePwd_error").show();var n={pwd:t},a=JSON.stringify(n),i=[];i.callBackData=[],i.callBackSuccess="changePasswordSuccessCallBack",i.callBackFail="changePasswordFailCallBack",this.customAction("changePassword","modules=employees",a,i)}},{key:"closeChangePassword",value:function(){$("#adminUsersModel").modal("hide")}},{key:"changePasswordSuccessCallBack",value:function(e,t){this.closeChangePassword(),this.showMessage("Password Change","Password changed successfully")}},{key:"changePasswordFailCallBack",value:function(e,t){this.closeChangePassword(),this.showMessage("Error",e)}}]),r}(a.default),y=function(e){d(r,e);var t=p(r);function r(e,n,a,i){var o;return u(this,r),(o=t.call(this,e,n,a,i)).nodeIdCounter=0,o}return f(r,[{key:"convertToTree",value:function(e){for(var t={id:-1,title:"",name:"",children:[]},r=null,n=0;n"),n.parent=null;break}i[o.id]=1,a=o}}return""===t||(this.showMessage("Company Structure is having a cyclic dependency","We found a cyclic dependency due to following reasons:
    ".concat(t)),!1)}}]),r}(function(e){d(r,e);var t=p(r);function r(){return u(this,r),t.apply(this,arguments)}return f(r,[{key:"getDataMapping",value:function(){return["id","title","address","type","country","parent"]}},{key:"getHeaders",value:function(){return[{sTitle:"ID",bVisible:!1},{sTitle:"Name"},{sTitle:"Address"},{sTitle:"Type"},{sTitle:"Country",sClass:"center"},{sTitle:"Parent Structure"}]}},{key:"getFormFields",value:function(){return[["id",{label:"ID",type:"hidden",validation:""}],["title",{label:"Name",type:"text",validation:""}],["description",{label:"Details",type:"textarea",validation:""}],["address",{label:"Address",type:"textarea",validation:"none"}],["type",{label:"Type",type:"select",source:[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],["country",{label:"Country",type:"select","remote-source":["Country","code","name"]}],["parent",{label:"Parent Structure",type:"select","allow-null":!0,"remote-source":["CompanyStructure","id","title"]}]]}}]),r}(a.default)),b=function(e){d(r,e);var t=p(r);function r(){return u(this,r),t.apply(this,arguments)}return f(r,[{key:"getDataMapping",value:function(){return[]}},{key:"getHeaders",value:function(){return[]}},{key:"getFormFields",value:function(){return[]}},{key:"setApiUrl",value:function(e){this.apiUrl=e}},{key:"setToken",value:function(e){this.token=e}},{key:"get",value:function(){var e=document.getElementById("apiQRcode");n.default.toCanvas(e,JSON.stringify({key:"IceHrm",url:this.apiUrl,token:this.token}),(function(e){e&&console.log(e)}))}}]),r}(a.default);t.exports={EmployeeAdapter:v,CompanyGraphAdapter:y,ApiAccessAdapter:b}},{"../../../api/AdapterBase":35,qrcode:5}]},{},[38]); //# sourceMappingURL=employees.js.map