sharinpix
Version:
SharinPix Client
25 lines • 413 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["sharinpix.min"]=e():t["sharinpix.min"]=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){(function(e){"use strict";var r,i,s,o,a,u,h,c,f,l;h=n(7),f=n(13),l=n(19),c=n(25),a=n(26),u=n(28),r=n(71),i=function(){function t(t){this.options=t}return t.prototype.api_url=function(t){return""+this.options.endpoint+t},t.prototype.post=function(t,e,n){return null==n&&(n={admin:!0}),f.post(this.api_url(t)).set("Authorization",'Token token="'+this.token(n)+'"').set("Accept","application/json").send(e).then(function(t){return t.body})},t.prototype.put=function(t,e,n){return null==n&&(n={admin:!0}),f.put(this.api_url(t)).set("Authorization",'Token token="'+this.token(n)+'"').set("Accept","application/json").send(e).then(function(t){return t.body})},t.prototype.get=function(t,e){return null==e&&(e={admin:!0}),f.get(this.api_url(t)).set("Authorization",'Token token="'+this.token(e)+'"').set("Accept","application/json").then(function(t){return t.body})},t.prototype["delete"]=function(t,e){return null==e&&(e={admin:!0}),new r(function(n){return function(r,i){return f["delete"](n.api_url(t)).set("Authorization",'Token token="'+n.token(e)+'"').set("Accept","application/json").end(function(t){return 404!==t.status&&201!==t.status||r(!0),i(!1,t)})}}(this))},t.prototype.token=function(t){var e;return t.iss=this.options.id,e=h.jws.JWS.sign(null,{alg:"HS256",cty:"JWT"},JSON.stringify(t),{rstr:this.options.secret})},t.prototype.image_delete=function(t){return this["delete"]("/images/"+t)},t.prototype.upload=function(t,e,n){var r;return null==n&&(n={}),r={abilities:{}},r.abilities[e]={Access:{see:!0,image_upload:!0}},this.get("/albums/"+e,r).then(function(e){var n,r,i,s;i=f.post(e.upload_form.url),r=e.upload_form.params;for(n in r)s=r[n],i.field(n,s);return"undefined"!=typeof File&&null!==File&&t instanceof File?i.field("file",t):i.attach("file",t),i.then(function(t){return t.body})}).then(function(t){return function(i){return t.post("/albums/"+e+"/images",{cloudinary:i,album_id:e,metadatas:n},r).then(function(t){return t})}}(this))},t.prototype["import"]=function(t,e,n){return null==n&&(n={}),this.post("/imports",{import_type:"url",album_id:e,url:t,metadatas:n})},t.prototype.multiupload=function(t,e){var n;return n=[],u.fromString(t).on("data",function(t){return function(e){var r,i;return i=e[0],r=e[1],i&&r?n.push(a.reflect(function(e){return"http"===i.slice(0,4)?t["import"](i,r).then(function(t){return e(null,t)})["catch"](function(t){return e(t)}):(c.isAbsolute(i)||(i=c.join(csv_path,"../"+i)),t.upload(i,r).then(function(t){return e(null,t)})["catch"](function(t){return e(t)}))})):void 0}}(this)).on("end",function(){return a.parallelLimit(n,2,e)})},t}(),s=void 0,i.configure=function(t){var n,r,o,a;if(null==s&&(s={},"undefined"!=typeof e&&null!==e&&null!=e.env&&null!=e.env.SHARINPIX_URL&&i.configure(e.env.SHARINPIX_URL)),null!=t)if("string"==typeof t)r=l.parse(t),n=r.auth.split(":"),s.endpoint="https://"+r.hostname+r.pathname,s.id=n[0],s.secret=n[1];else if(t instanceof Object)for(o in t)a=t[o],s[o]=a;return s},o=void 0,i.get_instance=function(){return null!=o?o:o=new i(i.configure())},i["import"]=function(){var t;return(t=i.get_instance())["import"].apply(t,arguments)},i.upload=function(){var t;return(t=i.get_instance()).upload.apply(t,arguments)},i.multiupload=function(){var t;return(t=i.get_instance()).multiupload.apply(t,arguments)},i.image_delete=function(){var t;return(t=i.get_instance()).image_delete.apply(t,arguments)},t.exports=i}).call(e,n(6))},,,,,,function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(c===setTimeout)return setTimeout(t,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function s(t){if(f===clearTimeout)return clearTimeout(t);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function o(){g&&p&&(g=!1,p.length?d=p.concat(d):y=-1,d.length&&a())}function a(){if(!g){var t=i(o);g=!0;for(var e=d.length;e;){for(p=d,d=[];++y<e;)p&&p[y].run();y=-1,e=d.length}p=null,g=!1,s(t)}}function u(t,e){this.fun=t,this.array=e}function h(){}var c,f,l=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(t){c=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(t){f=r}}();var p,d=[],g=!1,y=-1;l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new u(t,e)),1!==d.length||g||i(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=h,l.addListener=h,l.once=h,l.off=h,l.removeListener=h,l.removeAllListeners=h,l.emit=h,l.prependListener=h,l.prependOnceListener=h,l.listeners=function(t){return[]},l.binding=function(t){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(t){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},function(t,e,n){(function(t){function r(t){var e,n,r="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),r+=ar.charAt(n>>6)+ar.charAt(63&n);if(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),r+=ar.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),r+=ar.charAt(n>>2)+ar.charAt((3&n)<<4)),ur)for(;(3&r.length)>0;)r+=ur;return r}function i(t){var e,n,r,i="",s=0;for(e=0;e<t.length&&t.charAt(e)!=ur;++e)r=ar.indexOf(t.charAt(e)),0>r||(0==s?(i+=f(r>>2),n=3&r,s=1):1==s?(i+=f(n<<2|r>>4),n=15&r,s=2):2==s?(i+=f(n),i+=f(r>>2),n=3&r,s=3):(i+=f(n<<2|r>>4),i+=f(15&r),s=0));return 1==s&&(i+=f(n<<2)),i}function s(t){var e,n=i(t),r=new Array;for(e=0;2*e<n.length;++e)r[e]=parseInt(n.substring(2*e,2*e+2),16);return r}function o(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function a(){return new o(null)}function u(t,e,n,r,i,s){for(;--s>=0;){var o=e*this[t++]+n[r]+i;i=Math.floor(o/67108864),n[r++]=67108863&o}return i}function h(t,e,n,r,i,s){for(var o=32767&e,a=e>>15;--s>=0;){var u=32767&this[t],h=this[t++]>>15,c=a*u+h*o;u=o*u+((32767&c)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(c>>>15)+a*h+(i>>>30),n[r++]=1073741823&u}return i}function c(t,e,n,r,i,s){for(var o=16383&e,a=e>>14;--s>=0;){var u=16383&this[t],h=this[t++]>>14,c=a*u+h*o;u=o*u+((16383&c)<<14)+n[r]+i,i=(u>>28)+(c>>14)+a*h,n[r++]=268435455&u}return i}function f(t){return dr.charAt(t)}function l(t,e){var n=gr[t.charCodeAt(e)];return null==n?-1:n}function p(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function d(t){this.t=1,this.s=0>t?-1:0,t>0?this[0]=t:-1>t?this[0]=t+this.DV:this.t=0}function g(t){var e=a();return e.fromInt(t),e}function y(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var r=t.length,i=!1,s=0;--r>=0;){var a=8==n?255&t[r]:l(t,r);0>a?"-"==t.charAt(r)&&(i=!0):(i=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,s+=n,s>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&o.ZERO.subTo(this,this)}function v(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function m(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<<e)-1,i=!1,s="",o=this.t,a=this.DB-o*this.DB%e;if(o-- >0)for(a<this.DB&&(n=this[o]>>a)>0&&(i=!0,s=f(n));o>=0;)e>a?(n=(this[o]&(1<<a)-1)<<e-a,n|=this[--o]>>(a+=this.DB-e)):(n=this[o]>>(a-=e)&r,0>=a&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=f(n));return i?s:"0"}function b(){var t=a();return o.ZERO.subTo(this,t),t}function S(){return this.s<0?this.negate():this}function E(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(e=n-t.t,0!=e)return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0}function A(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function w(){return this.t<=0?0:this.DB*(this.t-1)+A(this[this.t-1]^this.s&this.DM)}function R(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function x(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s}function F(t,e){var n,r=t%this.DB,i=this.DB-r,s=(1<<i)-1,o=Math.floor(t/this.DB),a=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)e[n+o+1]=this[n]>>i|a,a=(this[n]&s)<<r;for(n=o-1;n>=0;--n)e[n]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}function _(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)return void(e.t=0);var r=t%this.DB,i=this.DB-r,s=(1<<r)-1;e[0]=this[n]>>r;for(var o=n+1;o<this.t;++o)e[o-n-1]|=(this[o]&s)<<i,e[o-n]=this[o]>>r;r>0&&(e[this.t-n-1]|=(this.s&s)<<i),e.t=this.t-n,e.clamp()}function O(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);i>n;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=0>r?-1:0,-1>r?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()}function K(t,e){var n=this.abs(),r=t.abs(),i=n.t;for(e.t=i+r.t;--i>=0;)e[i]=0;for(i=0;i<r.t;++i)e[i+n.t]=n.am(0,r[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&o.ZERO.subTo(e,e)}function U(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()}function T(t,e,n){var r=t.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=a());var s=a(),u=this.s,h=t.s,c=this.DB-A(r[r.t-1]);c>0?(r.lShiftTo(c,s),i.lShiftTo(c,n)):(r.copyTo(s),i.copyTo(n));var f=s.t,l=s[f-1];if(0!=l){var p=l*(1<<this.F1)+(f>1?s[f-2]>>this.F2:0),d=this.FV/p,g=(1<<this.F1)/p,y=1<<this.F2,v=n.t,m=v-f,b=null==e?a():e;for(s.dlShiftTo(m,b),n.compareTo(b)>=0&&(n[n.t++]=1,n.subTo(b,n)),o.ONE.dlShiftTo(f,b),b.subTo(s,s);s.t<f;)s[s.t++]=0;for(;--m>=0;){var S=n[--v]==l?this.DM:Math.floor(n[v]*d+(n[v-1]+y)*g);if((n[v]+=s.am(0,S,n,m,0,f))<S)for(s.dlShiftTo(m,b),n.subTo(b,n);n[v]<--S;)n.subTo(b,n)}null!=e&&(n.drShiftTo(f,e),u!=h&&o.ZERO.subTo(e,e)),n.t=f,n.clamp(),c>0&&n.rShiftTo(c,n),0>u&&o.ZERO.subTo(n,n)}}}function P(t){var e=a();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e}function C(t){this.m=t}function D(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function j(t){return t}function I(t){t.divRemTo(this.m,null,t)}function H(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function J(t,e){t.squareTo(e),this.reduce(e)}function B(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function L(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function N(t){var e=a();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e}function M(t){var e=a();return t.copyTo(e),this.reduce(e),e}function k(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function V(t,e){t.squareTo(e),this.reduce(e)}function q(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function W(){return 0==(this.t>0?1&this[0]:this.s)}function z(t,e){if(t>4294967295||1>t)return o.ONE;var n=a(),r=a(),i=e.convert(this),s=A(t)-1;for(i.copyTo(n);--s>=0;)if(e.sqrTo(n,r),(t&1<<s)>0)e.mulTo(r,i,n);else{var u=n;n=r,r=u}return e.revert(n)}function G(t,e){var n;return n=256>t||e.isEven()?new C(e):new L(e),this.exp(t,n)}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function Y(){var t=a();return this.copyTo(t),t}function X(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Z(){return 0==this.t?this.s:this[0]<<24>>24}function $(){return 0==this.t?this.s:this[0]<<16>>16}function Q(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function tt(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function et(t){if(null==t&&(t=10),0==this.signum()||2>t||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),r=g(n),i=a(),s=a(),o="";for(this.divRemTo(r,i,s);i.signum()>0;)o=(n+s.intValue()).toString(t).substr(1)+o,i.divRemTo(r,i,s);return s.intValue().toString(t)+o}function nt(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),r=Math.pow(e,n),i=!1,s=0,a=0,u=0;u<t.length;++u){var h=l(t,u);0>h?"-"==t.charAt(u)&&0==this.signum()&&(i=!0):(a=e*a+h,++s>=n&&(this.dMultiply(r),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),i&&o.ZERO.subTo(this,this)}function rt(t,e,n){if("number"==typeof e)if(2>t)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),ft,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var r=new Array,i=7&t;r.length=(t>>3)+1,e.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}}function it(){var t=this.t,e=new Array;e[0]=this.s;var n,r=this.DB-t*this.DB%8,i=0;if(t-- >0)for(r<this.DB&&(n=this[t]>>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<<this.DB-r);t>=0;)8>r?(n=(this[t]&(1<<r)-1)<<8-r,n|=this[--t]>>(r+=this.DB-8)):(n=this[t]>>(r-=8)&255,0>=r&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e}function st(t){return 0==this.compareTo(t)}function ot(t){return this.compareTo(t)<0?this:t}function at(t){return this.compareTo(t)>0?this:t}function ut(t,e,n){var r,i,s=Math.min(t.t,this.t);for(r=0;s>r;++r)n[r]=e(this[r],t[r]);if(t.t<this.t){for(i=t.s&this.DM,r=s;r<this.t;++r)n[r]=e(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=s;r<t.t;++r)n[r]=e(i,t[r]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()}function ht(t,e){return t&e}function ct(t){var e=a();return this.bitwiseTo(t,ht,e),e}function ft(t,e){return t|e}function lt(t){var e=a();return this.bitwiseTo(t,ft,e),e}function pt(t,e){return t^e}function dt(t){var e=a();return this.bitwiseTo(t,pt,e),e}function gt(t,e){return t&~e}function yt(t){var e=a();return this.bitwiseTo(t,gt,e),e}function vt(){for(var t=a(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function mt(t){var e=a();return 0>t?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function bt(t){var e=a();return 0>t?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function St(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function Et(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+St(this[t]);return this.s<0?this.t*this.DB:-1}function At(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function wt(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=At(this[n]^e);return t}function Rt(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)}function xt(t,e){var n=o.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n}function Ft(t){return this.changeBit(t,ft)}function _t(t){return this.changeBit(t,gt)}function Ot(t){return this.changeBit(t,pt)}function Kt(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);i>n;)r+=this[n]+t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r+=t[n],e[n++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=0>r?-1:0,r>0?e[n++]=r:-1>r&&(e[n++]=this.DV+r),e.t=n,e.clamp()}function Ut(t){var e=a();return this.addTo(t,e),e}function Tt(t){var e=a();return this.subTo(t,e),e}function Pt(t){var e=a();return this.multiplyTo(t,e),e}function Ct(){var t=a();return this.squareTo(t),t}function Dt(t){var e=a();return this.divRemTo(t,e,null),e}function jt(t){var e=a();return this.divRemTo(t,null,e),e}function It(t){var e=a(),n=a();return this.divRemTo(t,e,n),new Array(e,n)}function Ht(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Jt(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function Bt(){}function Lt(t){return t}function Nt(t,e,n){t.multiplyTo(e,n)}function Mt(t,e){t.squareTo(e)}function kt(t){return this.exp(t,new Bt)}function Vt(t,e,n){var r=Math.min(this.t+t.t,e);for(n.s=0,n.t=r;r>0;)n[--r]=0;var i;for(i=n.t-this.t;i>r;++r)n[r+this.t]=this.am(0,t[r],n,r,0,this.t);for(i=Math.min(t.t,e);i>r;++r)this.am(0,t[r],n,r,0,e-r);n.clamp()}function qt(t,e,n){--e;var r=n.t=this.t+t.t-e;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)n[this.t+r-e]=this.am(e-r,t[r],n,0,0,this.t+r-e);n.clamp(),n.drShiftTo(1,n)}function Wt(t){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function zt(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=a();return t.copyTo(e),this.reduce(e),e}function Gt(t){return t}function Yt(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function Xt(t,e){t.squareTo(e),this.reduce(e)}function Zt(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function $t(t,e){var n,r,i=t.bitLength(),s=g(1);if(0>=i)return s;n=18>i?1:48>i?3:144>i?4:768>i?5:6,r=8>i?new C(e):e.isEven()?new Wt(e):new L(e);var o=new Array,u=3,h=n-1,c=(1<<n)-1;if(o[1]=r.convert(this),n>1){var f=a();for(r.sqrTo(o[1],f);c>=u;)o[u]=a(),r.mulTo(f,o[u-2],o[u]),u+=2}var l,p,d=t.t-1,y=!0,v=a();for(i=A(t[d])-1;d>=0;){for(i>=h?l=t[d]>>i-h&c:(l=(t[d]&(1<<i+1)-1)<<h-i,d>0&&(l|=t[d-1]>>this.DB+i-h)),u=n;0==(1&l);)l>>=1,--u;if((i-=u)<0&&(i+=this.DB,--d),y)o[l].copyTo(s),y=!1;else{for(;u>1;)r.sqrTo(s,v),r.sqrTo(v,s),u-=2;u>0?r.sqrTo(s,v):(p=s,s=v,v=p),r.mulTo(v,o[l],s)}for(;d>=0&&0==(t[d]&1<<i);)r.sqrTo(s,v),p=s,s=v,v=p,--i<0&&(i=this.DB-1,--d)}return r.revert(s)}function Qt(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var r=e;e=n,n=r}var i=e.getLowestSetBit(),s=n.getLowestSetBit();if(0>s)return e;for(s>i&&(s=i),s>0&&(e.rShiftTo(s,e),n.rShiftTo(s,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return s>0&&n.lShiftTo(s,n),n}function te(t){if(0>=t)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this[r])%t;return n}function ee(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return o.ZERO;for(var n=t.clone(),r=this.clone(),i=g(1),s=g(0),a=g(0),u=g(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;r.isEven();)r.rShiftTo(1,r),e?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(r)>=0?(n.subTo(r,n),e&&i.subTo(a,i),s.subTo(u,s)):(r.subTo(n,r),e&&a.subTo(i,a),u.subTo(s,u))}return 0!=r.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u}function ne(t){var e,n=this.abs();if(1==n.t&&n[0]<=yr[yr.length-1]){for(e=0;e<yr.length;++e)if(n[0]==yr[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<yr.length;){for(var r=yr[e],i=e+1;i<yr.length&&vr>r;)r*=yr[i++];for(r=n.modInt(r);i>e;)if(r%yr[e++]==0)return!1}return n.millerRabin(t)}function re(t){var e=this.subtract(o.ONE),n=e.getLowestSetBit();if(0>=n)return!1;var r=e.shiftRight(n);t=t+1>>1,t>yr.length&&(t=yr.length);for(var i=a(),s=0;t>s;++s){i.fromInt(yr[Math.floor(Math.random()*yr.length)]);var u=i.modPow(r,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var h=1;h++<n&&0!=u.compareTo(e);)if(u=u.modPowInt(2,this),0==u.compareTo(o.ONE))return!1;if(0!=u.compareTo(e))return!1}}return!0}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function ie(){this.i=0,this.j=0,this.S=new Array}function se(t){var e,n,r;for(e=0;256>e;++e)this.S[e]=e;for(n=0,e=0;256>e;++e)n=n+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[n],this.S[n]=r;this.i=0,this.j=0}function oe(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}function ae(){return new ie}function ue(t){br[Sr++]^=255&t,br[Sr++]^=t>>8&255,br[Sr++]^=t>>16&255,br[Sr++]^=t>>24&255,Sr>=Er&&(Sr-=Er)}function he(){ue((new Date).getTime())}function ce(){if(null==mr){for(he(),mr=ae(),mr.init(br),Sr=0;Sr<br.length;++Sr)br[Sr]=0;Sr=0}return mr.next()}function fe(t){var e;for(e=0;e<t.length;++e)t[e]=ce()}function le(){}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function pe(t,e){return new o(t,e)}function de(t,e){if(e<t.length+11)return alert("Message too long for RSA"),null;for(var n=new Array,r=t.length-1;r>=0&&e>0;){var i=t.charCodeAt(r--);128>i?n[--e]=i:i>127&&2048>i?(n[--e]=63&i|128,n[--e]=i>>6|192):(n[--e]=63&i|128,n[--e]=i>>6&63|128,n[--e]=i>>12|224)}n[--e]=0;for(var s=new le,a=new Array;e>2;){for(a[0]=0;0==a[0];)s.nextBytes(a);n[--e]=a[0]}return n[--e]=2,n[--e]=0,new o(n)}function ge(t,e,n){for(var r="",i=0;r.length<e;)r+=n(String.fromCharCode.apply(String,t.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return r}function ye(t,e,n){if(t.length+2*xr+2>e)throw"Message too long for RSA";var r,i="";for(r=0;r<e-t.length-2*xr-2;r+=1)i+="\x00";var s=rstr_sha1("")+i+""+t,a=new Array(xr);(new le).nextBytes(a);var u=ge(a,s.length,n||rstr_sha1),h=[];for(r=0;r<s.length;r+=1)h[r]=s.charCodeAt(r)^u.charCodeAt(r);var c=ge(h,a.length,rstr_sha1),f=[0];for(r=0;r<a.length;r+=1)f[r+1]=a[r]^c.charCodeAt(r);return new o(f.concat(h))}function ve(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function me(t,e){this.isPublic=!0,"string"!=typeof t?(this.n=t,this.e=e):null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=pe(t,16),this.e=parseInt(e,16)):alert("Invalid RSA public key")}function be(t){return t.modPowInt(this.e,this.n)}function Se(t){var e=de(t,this.n.bitLength()+7>>3);if(null==e)return null;var n=this.doPublic(e);if(null==n)return null;var r=n.toString(16);return 0==(1&r.length)?r:"0"+r}function Ee(t,e){var n=ye(t,this.n.bitLength()+7>>3,e);if(null==n)return null;var r=this.doPublic(n);if(null==r)return null;var i=r.toString(16);return 0==(1&i.length)?i:"0"+i}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function Ae(t,e){for(var n=t.toByteArray(),r=0;r<n.length&&0==n[r];)++r;if(n.length-r!=e-1||2!=n[r])return null;for(++r;0!=n[r];)if(++r>=n.length)return null;for(var i="";++r<n.length;){var s=255&n[r];128>s?i+=String.fromCharCode(s):s>191&&224>s?(i+=String.fromCharCode((31&s)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&s)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}function we(t,e,n){for(var r="",i=0;r.length<e;)r+=n(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])),i+=1;return r}function Re(t,e,n){t=t.toByteArray();var r;for(r=0;r<t.length;r+=1)t[r]&=255;for(;t.length<e;)t.unshift(0);if(t=String.fromCharCode.apply(String,t),t.length<2*xr+2)throw"Cipher too short";var r,i=t.substr(1,xr),s=t.substr(xr+1),o=we(s,xr,n||rstr_sha1),a=[];for(r=0;r<i.length;r+=1)a[r]=i.charCodeAt(r)^o.charCodeAt(r);var u=we(String.fromCharCode.apply(String,a),t.length-xr,rstr_sha1),h=[];for(r=0;r<s.length;r+=1)h[r]=s.charCodeAt(r)^u.charCodeAt(r);if(h=String.fromCharCode.apply(String,h),h.substr(0,xr)!==rstr_sha1(""))throw"Hash mismatch";h=h.substr(xr);var c=h.indexOf(""),f=-1!=c?h.substr(0,c).lastIndexOf("\x00"):-1;if(f+1!=c)throw"Malformed data";return h.substr(c+1)}function xe(t,e,n){this.isPrivate=!0,"string"!=typeof t?(this.n=t,this.e=e,this.d=n):null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=pe(t,16),this.e=parseInt(e,16),this.d=pe(n,16)):alert("Invalid RSA private key")}function Fe(t,e,n,r,i,s,o,a){if(this.isPrivate=!0,null==t)throw"RSASetPrivateEx N == null";if(null==e)throw"RSASetPrivateEx E == null";if(0==t.length)throw"RSASetPrivateEx N.length == 0";if(0==e.length)throw"RSASetPrivateEx E.length == 0";null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=pe(t,16),this.e=parseInt(e,16),this.d=pe(n,16),this.p=pe(r,16),this.q=pe(i,16),this.dmp1=pe(s,16),this.dmq1=pe(o,16),this.coeff=pe(a,16)):alert("Invalid RSA private key in RSASetPrivateEx")}function _e(t,e){var n=new le,r=t>>1;this.e=parseInt(e,16);for(var i=new o(e,16);;){for(;this.p=new o(t-r,1,n),0!=this.p.subtract(o.ONE).gcd(i).compareTo(o.ONE)||!this.p.isProbablePrime(10););for(;this.q=new o(r,1,n),0!=this.q.subtract(o.ONE).gcd(i).compareTo(o.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q,this.q=s}var a=this.p.subtract(o.ONE),u=this.q.subtract(o.ONE),h=a.multiply(u);if(0==h.gcd(i).compareTo(o.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(h),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(u),this.coeff=this.q.modInverse(this.p);break}}}function Oe(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),n=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(n)<0;)e=e.add(this.p);return e.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)}function Ke(t){var e=pe(t,16),n=this.doPrivate(e);return null==n?null:Ae(n,this.n.bitLength()+7>>3)}function Ue(t,e){var n=pe(t,16),r=this.doPrivate(n);return null==r?null:Re(r,this.n.bitLength()+7>>3,e)}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function Te(t,e){this.x=e,this.q=t}function Pe(t){return t==this?!0:this.q.equals(t.q)&&this.x.equals(t.x)}function Ce(){return this.x}function De(){return new Te(this.q,this.x.negate().mod(this.q))}function je(t){return new Te(this.q,this.x.add(t.toBigInteger()).mod(this.q))}function Ie(t){return new Te(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))}function He(t){return new Te(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))}function Je(){return new Te(this.q,this.x.square().mod(this.q))}function Be(t){return new Te(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))}function Le(t,e,n,r){this.curve=t,this.x=e,this.y=n,null==r?this.z=o.ONE:this.z=r,this.zinv=null}function Ne(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function Me(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function ke(t){if(t==this)return!0;if(this.isInfinity())return t.isInfinity();if(t.isInfinity())return this.isInfinity();var e,n;return e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),e.equals(o.ZERO)?(n=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q),n.equals(o.ZERO)):!1}function Ve(){return null==this.x&&null==this.y?!0:this.z.equals(o.ZERO)&&!this.y.toBigInteger().equals(o.ZERO)}function qe(){return new Le(this.curve,this.x,this.y.negate(),this.z)}function We(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),n=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(o.ZERO.equals(n))return o.ZERO.equals(e)?this.twice():this.curve.getInfinity();var r=new o("3"),i=this.x.toBigInteger(),s=this.y.toBigInteger(),a=(t.x.toBigInteger(),t.y.toBigInteger(),n.square()),u=a.multiply(n),h=i.multiply(a),c=e.square().multiply(this.z),f=c.subtract(h.shiftLeft(1)).multiply(t.z).subtract(u).multiply(n).mod(this.curve.q),l=h.multiply(r).multiply(e).subtract(s.multiply(u)).subtract(c.multiply(e)).multiply(t.z).add(e.multiply(u)).mod(this.curve.q),p=u.multiply(this.z).multiply(t.z).mod(this.curve.q);return new Le(this.curve,this.curve.fromBigInteger(f),this.curve.fromBigInteger(l),p)}function ze(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new o("3"),e=this.x.toBigInteger(),n=this.y.toBigInteger(),r=n.multiply(this.z),i=r.multiply(n).mod(this.curve.q),s=this.curve.a.toBigInteger(),a=e.square().multiply(t);o.ZERO.equals(s)||(a=a.add(this.z.square().multiply(s))),a=a.mod(this.curve.q);var u=a.square().subtract(e.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(r).mod(this.curve.q),h=a.multiply(t).multiply(e).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(a.square().multiply(a)).mod(this.curve.q),c=r.square().multiply(r).shiftLeft(3).mod(this.curve.q);return new Le(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(h),c)}function Ge(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,n=t,r=n.multiply(new o("3")),i=this.negate(),s=this;for(e=r.bitLength()-2;e>0;--e){s=s.twice();var a=r.testBit(e),u=n.testBit(e);a!=u&&(s=s.add(a?this:i))}return s}function Ye(t,e,n){var r;r=t.bitLength()>n.bitLength()?t.bitLength()-1:n.bitLength()-1;for(var i=this.curve.getInfinity(),s=this.add(e);r>=0;)i=i.twice(),t.testBit(r)?i=n.testBit(r)?i.add(s):i.add(this):n.testBit(r)&&(i=i.add(e)),--r;return i}function Xe(t,e,n){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(n),this.infinity=new Le(this,null,null)}function Ze(){return this.q}function $e(){return this.a}function Qe(){return this.b}function tn(t){return t==this?!0:this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)}function en(){return this.infinity}function nn(t){return new Te(this.q,t)}function rn(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var e=(t.length-2)/2,n=t.substr(2,e),r=t.substr(e+2,e);return new Le(this,this.fromBigInteger(new o(n,16)),this.fromBigInteger(new o(r,16)));default:return null}}function sn(t){for(var e=new Array,n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function on(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}function an(t){for(var e="",n=0;n<t.length;n++){var r=t[n].toString(16);1==r.length&&(r="0"+r),e+=r}return e}function un(t){return an(sn(t))}function hn(t){return r(un(t))}function cn(t){return ln(r(un(t)))}function fn(t){return on(s(pn(t)))}function ln(t){return t=t.replace(/\=/g,""),t=t.replace(/\+/g,"-"),t=t.replace(/\//g,"_")}function pn(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),t=t.replace(/-/g,"+"),t=t.replace(/_/g,"/")}function dn(t){return t.length%2==1&&(t="0"+t),ln(r(t))}function gn(t){return i(pn(t))}function yn(t){return r(An(Rn(t)))}function vn(t){return decodeURIComponent(wn(i(t)))}function mn(t){return An(Rn(t))}function bn(t){return decodeURIComponent(wn(t))}function Sn(t){for(var e="",n=0;n<t.length-1;n+=2)e+=String.fromCharCode(parseInt(t.substr(n,2),16));return e}function En(t){for(var e="",n=0;n<t.length;n++)e+=("0"+t.charCodeAt(n).toString(16)).slice(-2);return e}function An(t){return t.replace(/%/g,"")}function wn(t){return t.replace(/(..)/g,"%$1")}function Rn(t){for(var e=encodeURIComponent(t),n="",r=0;r<e.length;r++)"%"==e[r]?(n+=e.substr(r,3),r+=2):n=n+"%"+un(e[r]);return n}function xn(t){return t=t.replace(/\r\n/gm,"\n")}function Fn(t){return t=t.replace(/\r\n/gm,"\n"),t=t.replace(/\n/gm,"\r\n")}function _n(t){t=t.replace(/^\s*\[\s*/,""),t=t.replace(/\s*\]\s*$/,""),t=t.replace(/\s*/g,"");try{var e=t.split(/,/).map(function(t,e,n){var r=parseInt(t);if(0>r||r>255)throw"integer not in range 0-255";var i=("00"+r.toString(16)).slice(-2);return i}).join("");return e}catch(n){throw"malformed integer array string: "+n}}/*! rsapem-1.1.js (c) 2012 Kenji Urushima | kjur.github.com/jsrsasign/license
*/
function On(t){var e=t;return e=e.replace("-----BEGIN RSA PRIVATE KEY-----",""),e=e.replace("-----END RSA PRIVATE KEY-----",""),e=e.replace(/[ \n]+/g,"")}function Kn(t){var e=new Array,n=_r.getStartPosOfV_AtObj(t,0),r=_r.getPosOfNextSibling_AtObj(t,n),i=_r.getPosOfNextSibling_AtObj(t,r),s=_r.getPosOfNextSibling_AtObj(t,i),o=_r.getPosOfNextSibling_AtObj(t,s),a=_r.getPosOfNextSibling_AtObj(t,o),u=_r.getPosOfNextSibling_AtObj(t,a),h=_r.getPosOfNextSibling_AtObj(t,u),c=_r.getPosOfNextSibling_AtObj(t,h);return e.push(n,r,i,s,o,a,u,h,c),e}function Un(t){var e=Kn(t),n=_r.getHexOfV_AtObj(t,e[0]),r=_r.getHexOfV_AtObj(t,e[1]),i=_r.getHexOfV_AtObj(t,e[2]),s=_r.getHexOfV_AtObj(t,e[3]),o=_r.getHexOfV_AtObj(t,e[4]),a=_r.getHexOfV_AtObj(t,e[5]),u=_r.getHexOfV_AtObj(t,e[6]),h=_r.getHexOfV_AtObj(t,e[7]),c=_r.getHexOfV_AtObj(t,e[8]),f=new Array;return f.push(n,r,i,s,o,a,u,h,c),f}function Tn(t){var e=Un(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Pn(t){var e=On(t),n=i(e),r=Un(n);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function Cn(t,e){for(var n="",r=e/4-t.length,i=0;r>i;i++)n+="0";return n+t}function Dn(t,e){var n=function(t){return KJUR.crypto.Util.hashString(t,e)},r=n(t);return this.signWithMessageHash(r,e)}function jn(t,e){var n=KJUR.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),r=pe(n,16),i=this.doPrivate(r),s=i.toString(16);return Cn(s,this.n.bitLength())}function In(t){return Dn.call(this,t,"sha1")}function Hn(t){return Dn.call(this,t,"sha256")}function Jn(t,e,n){for(var r="",i=0;r.length<e;)r+=Sn(n(En(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return r}function Bn(t,e,n){var r=function(t){return KJUR.crypto.Util.hashHex(t,e)},i=r(En(t));return void 0===n&&(n=-1),this.signWithMessageHashPSS(i,e,n)}function Ln(t,e,n){var r,i=Sn(t),s=i.length,a=this.n.bitLength()-1,u=Math.ceil(a/8),h=function(t){return KJUR.crypto.Util.hashHex(t,e)};if(-1===n||void 0===n)n=s;else if(-2===n)n=u-s-2;else if(-2>n)throw"invalid salt length";if(s+n+2>u)throw"data too long";var c="";n>0&&(c=new Array(n),(new le).nextBytes(c),c=String.fromCharCode.apply(String,c));var f=Sn(h(En("\x00\x00\x00\x00\x00\x00\x00\x00"+i+c))),l=[];for(r=0;u-n-s-2>r;r+=1)l[r]=0;var p=String.fromCharCode.apply(String,l)+""+c,d=Jn(f,p.length,h),g=[];for(r=0;r<p.length;r+=1)g[r]=p.charCodeAt(r)^d.charCodeAt(r);var y=65280>>8*u-a&255;for(g[0]&=~y,r=0;s>r;r++)g.push(f.charCodeAt(r));return g.push(188),Cn(this.doPrivate(new o(g)).toString(16),this.n.bitLength())}function Nn(t,e,n){var r=new ve;r.setPublic(e,n);var i=r.doPublic(t);return i}function Mn(t,e,n){var r=Nn(t,e,n),i=r.toString(16).replace(/^1f+00/,"");return i}function kn(t){for(var e in KJUR.crypto.Util.DIGESTINFOHEAD){var n=KJUR.crypto.Util.DIGESTINFOHEAD[e],r=n.length;if(t.substring(0,r)==n){var i=[e,t.substring(r)];return i}}return[]}function Vn(t,e,n,r){var i=Mn(e,n,r),s=kn(i);if(0==s.length)return!1;var o=s[0],a=s[1],u=function(t){return KJUR.crypto.Util.hashString(t,o)},h=u(t);return a==h}function qn(t,e){var n=pe(t,16),r=Vn(e,n,this.n.toString(16),this.e.toString(16));return r}function Wn(t,e){e=e.replace(Cr,""),e=e.replace(/[ \n]+/g,"");var n=pe(e,16);if(n.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(n),i=r.toString(16).replace(/^1f+00/,""),s=kn(i);if(0==s.length)return!1;var o=s[0],a=s[1],u=function(t){return KJUR.crypto.Util.hashString(t,o)},h=u(t);return a==h}function zn(t,e){e=e.replace(Cr,""),e=e.replace(/[ \n]+/g,"");var n=pe(e,16);if(n.bitLength()>this.n.bitLength())return 0;var r=this.doPublic(n),i=r.toString(16).replace(/^1f+00/,""),s=kn(i);if(0==s.length)return!1;var o=(s[0],s[1]);return o==t}function Gn(t,e,n,r){var i=function(t){return KJUR.crypto.Util.hashHex(t,n)},s=i(En(t));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(s,e,n,r)}function Yn(t,e,n,r){var i=new o(e,16);if(i.bitLength()>this.n.bitLength())return!1;var s,a=function(t){return KJUR.crypto.Util.hashHex(t,n)},u=Sn(t),h=u.length,c=this.n.bitLength()-1,f=Math.ceil(c/8);if(-1===r||void 0===r)r=h;else if(-2===r)r=f-h-2;else if(-2>r)throw"invalid salt length";if(h+r+2>f)throw"data too long";var l=this.doPublic(i).toByteArray();for(s=0;s<l.length;s+=1)l[s]&=255;for(;l.length<f;)l.unshift(0);if(188!==l[f-1])throw"encoded message does not end in 0xbc";l=String.fromCharCode.apply(String,l);var p=l.substr(0,f-h-1),d=l.substr(p.length,h),g=65280>>8*f-c&255;if(0!==(p.charCodeAt(0)&g))throw"bits beyond keysize not zero";var y=Jn(d,p.length,a),v=[];for(s=0;s<p.length;s+=1)v[s]=p.charCodeAt(s)^y.charCodeAt(s);v[0]&=~g;var m=f-h-r-2;for(s=0;m>s;s+=1)if(0!==v[s])throw"leftmost octets not zero";if(1!==v[m])throw"0x01 marker not found";return d===Sn(a(En("\x00\x00\x00\x00\x00\x00\x00\x00"+u+String.fromCharCode.apply(String,v.slice(-r)))))}/*! x509-1.1.9.js (c) 2012-2016 Kenji Urushima | kjur.github.com/jsrsasign/license
*/
function Xn(){this.subjectPublicKeyRSA=null,this.subjectPublicKeyRSA_hN=null,this.subjectPublicKeyRSA_hE=null,this.hex=null,this.getSerialNumberHex=function(){return _r.getDecendantHexVByNthList(this.hex,0,[0,1])},this.getSignatureAlgorithmField=function(){var t=_r.getDecendantHexVByNthList(this.hex,0,[0,2,0]),e=KJUR.asn1.ASN1Util.oidHexToInt(t),n=KJUR.asn1.x509.OID.oid2name(e);return n},this.getIssuerHex=function(){return _r.getDecendantHexTLVByNthList(this.hex,0,[0,3])},this.getIssuerString=function(){return Xn.hex2dn(_r.getDecendantHexTLVByNthList(this.hex,0,[0,3]))},this.getSubjectHex=function(){return _r.getDecendantHexTLVByNthList(this.hex,0,[0,5])},this.getSubjectString=function(){return Xn.hex2dn(_r.getDecendantHexTLVByNthList(this.hex,0,[0,5]))},this.getNotBefore=function(){var t=_r.getDecendantHexVByNthList(this.hex,0,[0,4,0]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getNotAfter=function(){var t=_r.getDecendantHexVByNthList(this.hex,0,[0,4,1]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.readCertPEM=function(t){var e=Xn.pemToHex(t),n=Xn.getPublicKeyHexArrayFromCertHex(e),r=new ve;r.setPublic(n[0],n[1]),this.subjectPublicKeyRSA=r,this.subjectPublicKeyRSA_hN=n[0],this.subjectPublicKeyRSA_hE=n[1],this.hex=e},this.readCertPEMWithoutRSAInit=function(t){var e=Xn.pemToHex(t),n=Xn.getPublicKeyHexArrayFromCertHex(e);this.subjectPublicKeyRSA.setPublic(n[0],n[1]),this.subjectPublicKeyRSA_hN=n[0],this.subjectPublicKeyRSA_hE=n[1],this.hex=e},this.getInfo=function(){var t="Basic Fields\n";t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n";var e=Xn.getSubjectPublicKeyInfoPosFromCertHex(this.hex),n=_r.getHexOfTLV_AtObj(this.hex,e),r=Pr.getKey(n,null,"pkcs8pub");r instanceof ve&&(t+=" key algorithm: RSA\n",t+=" n="+r.n.toString(16).substr(0,16)+"...\n",t+=" e="+r.e.toString(16)+"\n"),t+="X509v3 Extensions:\n";for(var i=Xn.getV3ExtInfoListOfCertHex(this.hex),s=0;s<i.length;s++){var o=i[s],a=KJUR.asn1.x509.OID.oid2name(o.oid);""===a&&(a=o.oid);var u="";if(o.critical===!0&&(u="CRITICAL"),t+=" "+a+" "+u+":\n","basicConstraints"===a){var h=Xn.getExtBasicConstraints(this.hex);void 0===h.cA?t+=" {}\n":(t+=" cA=true",void 0!==h.pathLen&&(t+=", pathLen="+h.pathLen),t+="\n")}else if("keyUsage"===a)t+=" "+Xn.getExtKeyUsageString(this.hex)+"\n";else if("subjectKeyIdentifier"===a)t+=" "+Xn.getExtSubjectKeyIdentifier(this.hex)+"\n";else if("authorityKeyIdentifier"===a){var c=Xn.getExtAuthorityKeyIdentifier(this.hex);void 0!==c.kid&&(t+=" kid="+c.kid+"\n")}else if("extKeyUsage"===a){var f=Xn.getExtExtKeyUsageName(this.hex);t+=" "+f.join(", ")+"\n"}else if("subjectAltName"===a){var l=Xn.getExtSubjectAltName(this.hex);t+=" "+l.join(", ")+"\n"}else if("cRLDistributionPoints"===a){var p=Xn.getExtCRLDistributionPointsURI(this.hex);t+=" "+p+"\n"}else if("authorityInfoAccess"===a){var d=Xn.getExtAIAInfo(this.hex);void 0!==d.ocsp&&(t+=" ocsp: "+d.ocsp.join(",")+"\n"),void 0!==d.caissuer&&(t+=" caissuer: "+d.caissuer.join(",")+"\n")}}return t+="signature algorithm: "+Xn.getSignatureAlgorithmName(this.hex)+"\n",t+="signature: "+Xn.getSignatureValueHex(this.hex).substr(0,16)+"...\n"}}/*! nodeutil-1.0.0 (c) 2015 Kenji Urushima | kjur.github.com/jsrsasign/license
*/
function Zn(t){return n(12).readFileSync(t,"utf8")}function $n(t){var e=n(7),r=n(12);return e.rstrtohex(r.readFileSync(t,"binary"))}function Qn(t){var e=n(12);return e.readFileSync(t,"binary")}function tr(t,e){var r=n(12);r.writeFileSync(t,e,"binary")}function er(t,e){var r=n(12),i=n(7),s=i.hextorstr(e);r.writeFileSync(t,s,"binary")}var nr={};nr.userAgent=!1;var rr={};if("undefined"==typeof ir||!ir)var ir={};ir.namespace=function(){var t,e,n,r=arguments,i=null;for(t=0;t<r.length;t+=1)for(n=(""+r[t]).split("."),i=ir,e="YAHOO"==n[0]?1:0;e<n.length;e+=1)i[n[e]]=i[n[e]]||{},i=i[n[e]];return i},ir.log=function(t,e,n){var r=ir.widget.Logger;return r&&r.log?r.log(t,e,n):!1},ir.register=function(t,e,n){var r,i,s,o,a,u=ir.env.modules;for(u[t]||(u[t]={versions:[],builds:[]}),r=u[t],i=n.version,s=n.build,o=ir.env.listeners,r.name=t,r.version=i,r.build=s,r.versions.push(i),r.builds.push(s),r.mainClass=e,a=0;a<o.length;a+=1)o[a](r);e?(e.VERSION=i,e.BUILD=s):ir.log("mainClass is undefined for module "+t,"warn")},ir.env=ir.env||{modules:[],listeners:[]},ir.env.getVersion=function(t){return ir.env.modules[t]||null},ir.env.parseUA=function(t){var e,n=function(t){var e=0;return parseFloat(t.replace(/\./g,function(){return 1==e++?"":"."}))},r=nr,i={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:r&&r.cajaVersion,secure:!1,os:null},s=t||nr&&nr.userAgent,o=rr&&rr.location,a=o&&o.href;return i.secure=a&&0===a.toLowerCase().indexOf("https"),s&&(/windows|win32/i.test(s)?i.os="windows":/macintosh/i.test(s)?i.os="macintosh":/rhino/i.test(s)&&(i.os="rhino"),/KHTML/.test(s)&&(i.webkit=1),e=s.match(/AppleWebKit\/([^\s]*)/),e&&e[1]&&(i.webkit=n(e[1]),/ Mobile\//.test(s)?(i.mobile="Apple",e=s.match(/OS ([^\s]*)/),e&&e[1]&&(e=n(e[1].replace("_","."))),i.ios=e,i.ipad=i.ipod=i.iphone=0,e=s.match(/iPad|iPod|iPhone/),e&&e[0]&&(i[e[0].toLowerCase()]=i.ios)):(e=s.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/),e&&(i.mobile=e[0]),/webOS/.test(s)&&(i.mobile="WebOS",e=s.match(/webOS\/([^\s]*);/),e&&e[1]&&(i.webos=n(e[1]))),/ Android/.test(s)&&(i.mobile="Android",e=s.match(/Android ([^\s]*);/),e&&e[1]&&(i.android=n(e[1])))),e=s.match(/Chrome\/([^\s]*)/),e&&e[1]?i.chrome=n(e[1]):(e=s.match(/AdobeAIR\/([^\s]*)/),e&&(i.air=e[0]))),i.webkit||(e=s.match(/Opera[\s\/]([^\s]*)/),e&&e[1]?(i.opera=n(e[1]),e=s.match(/Version\/([^\s]*)/),e&&e[1]&&(i.opera=n(e[1])),e=s.match(/Opera Mini[^;]*/),e&&(i.mobile=e[0])):(e=s.match(/MSIE\s([^;]*)/),e&&e[1]?i.ie=n(e[1]):(e=s.match(/Gecko\/([^\s]*)/),e&&(i.gecko=1,e=s.match(/rv:([^\s\)]*)/),e&&e[1]&&(i.gecko=n(e[1]))))))),i},ir.env.ua=ir.env.parseUA(),function(){if(ir.namespace("util","widget","example"),"undefined"!=typeof YAHOO_config){var t,e=YAHOO_config.listener,n=ir.env.listeners,r=!0;if(e){for(t=0;t<n.length;t++)if(n[t]==e){r=!1;break}r&&n.push(e)}}}(),ir.lang=ir.lang||{},function(){var t=ir.lang,e=Object.prototype,n="[object Array]",r="[object Function]",i="[object Object]",s=[],o={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"},a=["toString","valueOf"],u={isArray:function(t){return e.toString.apply(t)===n},isBoolean:function(t){return"boolean"==typeof t},isFunction:function(t){return"function"==typeof t||e.toString.apply(t)===r},isNull:function(t){return null===t},isNumber:function(t){return"number"==typeof t&&isFinite(t)},isObject:function(e){return e&&("object"==typeof e||t.isFunction(e))||!1},isString:function(t){return"string"==typeof t},isUndefined:function(t){return"undefined"==typeof t},_IEEnumFix:ir.env.ua.ie?function(n,r){var i,s,o;for(i=0;i<a.length;i+=1)s=a[i],o=r[s],t.isFunction(o)&&o!=e[s]&&(n[s]=o)}:function(){},escapeHTML:function(t){return t.replace(/[&<>"'\/`]/g,function(t){return o[t]})},extend:function(n,r,i){if(!r||!n)throw new Error("extend failed, please check that all dependencies are included.");var s,o=function(){};if(o.prototype=r.prototype,n.prototype=new o,n.prototype.constructor=n,n.superclass=r.prototype,r.prototype.constructor==e.constructor&&(r.prototype.constructor=r),i){for(s in i)t.hasOwnProperty(i,s)&&(n.prototype[s]=i[s]);t._IEEnumFix(n.prototype,i)}},augmentObject:function(e,n){if(!n||!e)throw new Error("Absorb failed, verify dependencies.");var r,i,s=arguments,o=s[2];if(o&&o!==!0)for(r=2;r<s.length;r+=1)e[s[r]]=n[s[r]];else{for(i in n)!o&&i in e||(e[i]=n[i]);t._IEEnumFix(e,n)}return e},augmentProto:function(e,n){if(!n||!e)throw new Error("Augment failed, verify dependencies.");var r,i=[e.prototype,n.prototype];for(r=2;r<arguments.length;r+=1)i.push(arguments[r]);return t.augmentObject.apply(this,i),e},dump:function(e,n){var r,i,s=[],o="{...}",a="f(){...}",u=", ",h=" => ";if(!t.isObject(e))return e+"";if(e instanceof Date||"nodeType"in e&&"tagName"in e)return e;if(t.isFunction(e))return a;if(n=t.isNumber(n)?n:3,t.isArray(e)){for(s.push("["),r=0,i=e.length;i>r;r+=1)t.isObject(e[r])?s.push(n>0?t.dump(e[r],n-1):o):s.push(e[r]),s.push(u);s.length>1&&s.pop(),s.push("]")}else{s.push("{");for(r in e)t.hasOwnProperty(e,r)&&(s.push(r+h),t.isObject(e[r])?s.push(n>0?t.dump(e[r],n-1):o):s.push(e[r]),s.push(u));s.length>1&&s.pop(),s.push("}")}return s.join("")},substitute:function(e,n,r,s){for(var o,a,u,h,c,f,l,p,d,g=[],y=e.length,v="dump",m=" ",b="{",S="}";(o=e.lastIndexOf(b,y),!(0>o))&&(a=e.indexOf(S,o),!(o+1>a));)l=e.substring(o+1,a),h=l,f=null,u=h.indexOf(m),u>-1&&(f=h.substring(u+1),h=h.substring(0,u)),c=n[h],r&&(c=r(h,c,f)),t.isObject(c)?t.isArray(c)?c=t.dump(c,parseInt(f,10)):(f=f||"",p=f.indexOf(v),p>-1&&(f=f.substring(4)),d=c.toString(),c=d===i||p>-1?t.dump(c,parseInt(f,10)):d):t.isString(c)||t.isNumber(c)||(c="~-"+g.length+"-~",g[g.length]=l),e=e.substring(0,o)+c+e.substring(a+1),s===!1&&(y=o-1);for(o=g.length-1;o>=0;o-=1)e=e.replace(new RegExp("~-"+o+"-~"),"{"+g[o]+"}","g");return e},trim:function(t){try{return t.replace(/^\s+|\s+$/g,"")}catch(e){return t}},merge:function(){var e,n={},r=arguments,i=r.length;for(e=0;i>e;e+=1)t.augmentObject(n,r[e],!0);return n},later:function(e,n,r,i,o){e=e||0,n=n||{};var a,u,h=r,c=i;if(t.isString(r)&&(h=n[r]),!h)throw new TypeError("method undefined");return t.isUndefined(i)||t.isArray(c)||(c=[i]),a=function(){h.apply(n,c||s)},u=o?setInterval(a,e):setTimeout(a,e),{interval:o,cancel:function(){this.interval?clearInterval(u):clearTimeout(u)}}},isValue:function(e){return t.isObject(e)||t.isString(e)||t.isNumber(e)||t.isBoolean(e)}};t.hasOwnProperty=e.hasOwnProperty?function(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}:function(e,n){return!t.isUndefined(e[n])&&e.constructor.prototype[n]!==e[n]},u.augmentObject(t,u,!0),ir.util.Lang=t,t.augment=t.augmentProto,ir.augment=t.augmentProto,ir.extend=t.extend}(),ir.register("yahoo",ir,{version:"2.9.0",build:"2800"});/*! CryptoJS v3.1.2 core-fix.js
* code.google.com/p/crypto-js
* (c) 2009-2013 by Jeff Mott. All rights reserved.
* code.google.com/p/crypto-js/wiki/License
* THIS IS FIX of 'core.js' to fix Hmac issue.
* https://code.google.com/p/crypto-js/issues/detail?id=84
* https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js
*/
var sr=sr||function(t,e){var n={},r=n.lib={},i=r.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var n=new t;return e&&n.mixIn(e),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=r.WordArray=i.extend({init:function(t,n){t=this.words=t||[],n!=e?this.sigBytes=n:this.sigBytes=4*t.length},toString:function(t){return(t||a).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var s=0;i>s;s++){var o=n[s>>>2]>>>24-s%4*8&255;e[r+s>>>2]|=o<<24-(r+s)%4*8}else for(var s=0;i>s;s+=4)e[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n=[],r=0;e>r;r+=4)n.push(4294967296*t.random()|0);