forked from mhzed/tinysoap
-
Notifications
You must be signed in to change notification settings - Fork 21
/
browser-soap-min.js
2 lines (2 loc) · 45.4 KB
/
browser-soap-min.js
1
2
!function(t,e){var n=t.bind(e)();e["browser-soap"]=n,"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=n)}(function(){var t={};return t.__sr="undefined"==typeof require?function(){}:require,t.__r=function(e){var n=t[e];return null===n.sts&&n.load.call(),n.mod.exports},t.https={sts:1,mod:{exports:t.__sr("https")}},t.http={sts:1,mod:{exports:t.__sr("http")}},t.util={sts:1,mod:{exports:t.__sr("util")}},t.fs={sts:1,mod:{exports:t.__sr("fs")}},t.crypto={sts:1,mod:{exports:t.__sr("crypto")}},t.a={sts:null,mod:{exports:{}},load:function(){function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var n=t.a.mod,s=(n.exports,function(e){var n={},s=n[e];return s?t.__r(s):t.__sr(e)});s.resolve=t.__sr.resolve,t.a.sts=0,n.exports.decode=function(t,n,s,r){n=n||"&",s=s||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\+/g;t=t.split(n);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var p=t.length;a>0&&p>a&&(p=a);for(var c=0;p>c;++c){var h,u,l,m,_=t[c].replace(o,"%20"),f=_.indexOf(s);f>=0?(h=_.substr(0,f),u=_.substr(f+1)):(h=_,u=""),l=decodeURIComponent(h),m=decodeURIComponent(u),e(i,l)?Array.isArray(i[l])?i[l].push(m):i[l]=[i[l],m]:i[l]=m}return i};var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};n.exports.encode=function(t,e,n,s){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(s){var i=encodeURIComponent(r(s))+n;return Array.isArray(t[s])?t[s].map(function(t){return i+encodeURIComponent(r(t))}).join(e):i+encodeURIComponent(r(t[s]))}).join(e):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(t)):""},t.a.sts=1}.bind(this)},t.b={sts:null,mod:{exports:{}},load:function(){function e(t,e,n){if(t&&"object"==typeof t&&t.href)return t;var s={href:t},r=t,o=c.exec(r);if(o&&(o=o[0],s.protocol=o,r=r.substr(o.length)),n||o||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var a="//"===r.substr(0,2);!a||o&&l[o]||(r=r.substr(2),s.slashes=!0)}if(!l[o]&&(a||o&&!m[o])){for(var p=-1,h=0,f=u.length;f>h;h++){var d=r.indexOf(u[h]);-1!==d&&(0>p||p>d)&&(p=d)}-1!==p?(s.host=r.substr(0,p),r=r.substr(p)):(s.host=r,r="");for(var E=i(s.host),y=Object.keys(E),h=0,f=y.length;f>h;h++){var g=y[h];s[g]=E[g]}s.hostname=s.hostname||""}var v=r.indexOf("#");-1!==v&&(s.hash=r.substr(v),r=r.slice(0,v));var x=r.indexOf("?");return-1!==x?(s.search=r.substr(x),s.query=r.substr(x+1),e&&(s.query=_.parse(s.query)),r=r.slice(0,x)):e&&(s.query={}),r&&(s.pathname=r),s.path=s.pathname+s.search,s}function n(t){"string"==typeof t&&(t=e(t));var n=t.protocol||"",s=void 0!==t.host?t.host:void 0!==t.hostname?(t.auth?t.auth+"@":"")+t.hostname+(t.port?":"+t.port:""):!1,r=t.pathname||"",i=t.search||t.query&&"?"+("object"==typeof t.query?_.stringify(t.query):String(t.query))||"",o=t.hash||"";return n&&":"!==n.substr(-1)&&(n+=":"),t.slashes||(!n||m[n])&&s!==!1?(s="//"+(s||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):s||(s=""),o&&"#"!==o.charAt(0)&&(o="#"+o),i&&"?"!==i.charAt(0)&&(i="?"+i),n+s+r+i+o}function s(t,e){return n(r(t,e))}function r(t,s){if(!t)return s;if(t=e(n(t),!1,!0),s=e(n(s),!1,!0),t.hash=s.hash,""===s.href)return t;if(s.slashes&&!s.protocol)return s.protocol=t.protocol,s;if(s.protocol&&s.protocol!==t.protocol){if(!m[s.protocol])return s;if(t.protocol=s.protocol,!s.host&&!l[s.protocol]){for(var r=(s.pathname||"").split("/");r.length&&!(s.host=r.shift()););s.host||(s.host=""),""!==r[0]&&r.unshift(""),r.length<2&&r.unshift(""),s.pathname=r.join("/")}return t.pathname=s.pathname,t.search=s.search,t.query=s.query,t.host=s.host||"",delete t.auth,delete t.hostname,t.port=s.port,t}var i=t.pathname&&"/"===t.pathname.charAt(0),o=void 0!==s.host||s.pathname&&"/"===s.pathname.charAt(0),a=o||i||t.host&&s.pathname,p=a,c=t.pathname&&t.pathname.split("/")||[],r=s.pathname&&s.pathname.split("/")||[],h=t.protocol&&!m[t.protocol]&&void 0!==t.host;if(h&&(delete t.hostname,delete t.auth,delete t.port,t.host&&(""===c[0]?c[0]=t.host:c.unshift(t.host)),delete t.host,s.protocol&&(delete s.hostname,delete s.auth,delete s.port,s.host&&(""===r[0]?r[0]=s.host:r.unshift(s.host)),delete s.host),a=a&&(""===r[0]||""===c[0])),o)t.host=s.host||""===s.host?s.host:t.host,t.search=s.search,t.query=s.query,c=r;else if(r.length)c||(c=[]),c.pop(),c=c.concat(r),t.search=s.search,t.query=s.query;else if("search"in s)return h&&(t.host=c.shift()),t.search=s.search,t.query=s.query,t;if(!c.length)return delete t.pathname,t;for(var u=c.slice(-1)[0],_=(t.host||s.host)&&("."===u||".."===u)||""===u,f=0,d=c.length;d>=0;d--)u=c[d],"."==u?c.splice(d,1):".."===u?(c.splice(d,1),f++):f&&(c.splice(d,1),f--);if(!a&&!p)for(;f--;f)c.unshift("..");!a||""===c[0]||c[0]&&"/"===c[0].charAt(0)||c.unshift(""),_&&"/"!==c.join("/").substr(-1)&&c.push("");var E=""===c[0]||c[0]&&"/"===c[0].charAt(0);return h&&(t.host=E?"":c.shift()),a=a||t.host&&c.length,a&&!E&&c.unshift(""),t.pathname=c.join("/"),t}function i(t){var e={},n=t.indexOf("@");-1!==n&&(e.auth=t.substr(0,n),t=t.substr(n+1));var s=h.exec(t);return s&&(s=s[0],e.port=s.substr(1),t=t.substr(0,t.length-s.length)),t&&(e.hostname=t),e}var o=t.b.mod,a=o.exports,p=function(e){var n={"./querystring":"a"},s=n[e];return s?t.__r(s):t.__sr(e)};p.resolve=t.__sr.resolve,t.b.sts=0,a=o.exports,a.parse=e,a.resolve=s,a.resolveObject=r,a.format=n;var c=/^([a-z0-9]+:)/,h=/:[0-9]+$/,u=["/","?",";","#"],l={file:!0,"file:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=p("./querystring");t.b.sts=1}.bind(this)},t.c={sts:null,mod:{exports:{}},load:function(){var e=t.c.mod,n=(e.exports,function(e){var n={},s=n[e];return s?t.__r(s):t.__sr(e)});n.resolve=t.__sr.resolve,t.c.sts=0;var s={};s.x=function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;for(var t,e=["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"],n=0;n<e.length;n++)try{t=new ActiveXObject(e[n]);break}catch(s){}return t},s.send=function(t,e,n,r,i,o){void 0===o&&(o=!0);var a=s.x();a.open(n,t,o),a.onreadystatechange=function(){4==a.readyState&&e(a)};for(var p=Object.keys(i),c=0;c<p.length;c++){var h=p[c];a.setRequestHeader(h,i[h])}a.send(r)},e.exports=s,t.c.sts=1}.bind(this)},t.d={sts:null,mod:{exports:{}},load:function(){var e=t.d.mod,n=e.exports,s=function(e){var n={"./url":"b","./ajax":"c",https:"https",http:"http"},s=n[e];return s?t.__r(s):t.__sr(e)};s.resolve=t.__sr.resolve,t.d.sts=0;var r=s("./url"),i=s("./ajax"),o="0.2.0";n.request=function(t,e,n,a,p){if("undefined"!=typeof window){_={"User-Agent":"node-soap/"+o,Accept:"text/html,application/xhtml+xml,application/xml","Accept-Encoding":"none","Accept-Charset":"utf-8","Content-Type":"application/x-www-form-urlencoded",Connection:"close",Host:l},a=a||{};for(var c in a)_[c]=a[c];i.send(t,function(t){var e={statusCode:t.status},s=Math.floor(t.status/100);2===s?n(null,e,t.responseText):n("Eroor:: "+t.status,e,t.responseText)},e?"POST":"GET",e,_)}else{var h=r.parse(t),u="https:"==h.protocol,l=h.hostname,m=(parseInt(h.port||(u?443:80)),[h.pathname||"/",h.search||"",h.hash||""].join(""),e?"POST":"GET"),_={"User-Agent":"node-soap/"+o,Accept:"text/html,application/xhtml+xml,application/xml","Accept-Encoding":"none","Accept-Charset":"utf-8",Connection:"close",Host:l};"string"==typeof e&&(_["Content-Length"]=Buffer.byteLength(e,"utf8"),_["Content-Type"]="application/x-www-form-urlencoded"),a=a||{};for(var c in a)_[c]=a[c];var f=h;f.method=m,f.headers=_,p=p||{};for(var c in p)f[c]=p[c];var d;d=s(u?"https":"http");var E=d.request(f,function(t,e){var e="";t.on("data",function(t){e+=t}),t.on("end",function(){n(null,t,e)})});E.on("error",n),E.end(e)}},t.d.sts=1}.bind(this)},t.e={sts:null,mod:{exports:{}},load:function(){var e=t.e.mod,n=(e.exports,function(e){var n={},s=n[e];return s?t.__r(s):t.__sr(e)});n.resolve=t.__sr.resolve,t.e.sts=0,e.exports=function(t,e){if(1!=!!t)throw console.log(e),new Error(e)},t.e.sts=1}.bind(this)},t.f={sts:null,mod:{exports:{}},load:function(){function e(t,e){for(var n in t)if(t[n]===e)return n}var n=t.f.mod,s=n.exports,r=function(e){var n={"./http":"d","./assert":"e","./url":"b"},s=n[e];return s?t.__r(s):t.__sr(e)};r.resolve=t.__sr.resolve,t.f.sts=0;var i=r("./http"),o=r("./assert"),a=(r("./url"),function(t,e){this.wsdl=t,this._initializeServices(e)});a.prototype.setEndpoint=function(t){this.endpoint=t,this._initializeServices(t)},a.prototype.describe=function(){this.wsdl.definitions.types;return this.wsdl.describeServices()},a.prototype.setSecurity=function(t){this.security=t},a.prototype.setSOAPAction=function(t){this.SOAPAction=t},a.prototype._initializeServices=function(t){var e=this.wsdl.definitions,n=e.services;for(var s in n)this[s]=this._defineService(n[s],t)},a.prototype._defineService=function(t,e){var n=t.ports,s={};for(var r in n)s[r]=this._definePort(n[r],e?e:n[r].location);return s},a.prototype._definePort=function(t,e){var n=e,s=t.binding,r=s.methods,i={};for(var o in r)i[o]=this._defineMethod(r[o],n),this[o]||(this[o]=i[o]);return i},a.prototype._defineMethod=function(t,e){var n=this;return function(s,r){"function"==typeof s&&(r=s,s={}),n._invoke(t,s,e,function(t,e,n){r(t,e,n)})}},a.prototype._invoke=function(t,n,s,r){var a=this,p=t.$name,c=t.input,h=t.output,u=t.style,l=this.wsdl.definitions,m=l.$targetNamespace,_="",f="",d=null,E={SOAPAction:this.SOAPAction?this.SOAPAction(m,p):(m.lastIndexOf("/")!=m.length-1?m+"/":m)+p,"Content-Type":"text/xml; charset=utf-8"},y={},g=e(l.xmlns,m);a.security&&a.security.addHeaders&&a.security.addHeaders(E),a.security&&a.security.addOptions&&a.security.addOptions(y),c.parts?(o(!u||"rpc"==u,"invalid message definition for document style binding"),f=a.wsdl.objectToRpcXML(p,n,g,m),"encoded"===t.inputSoap&&(_='soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ')):"string"==typeof n?f=n:(o(!u||"document"==u,"invalid message definition for rpc style binding"),f=a.wsdl.objectToDocumentXML(c.$name,n,c.targetNSAlias,c.targetNamespace)),d='<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" '+_+this.wsdl.xmlnsInEnvelope+"><soap:Header>"+(a.security?a.security.toXML():"")+"</soap:Header><soap:Body>"+f+"</soap:Body></soap:Envelope>",i.request(s,d,function(t,e,n){if(t)r(t,n?a.wsdl.xmlToObject(n):null,n);else{try{var s=a.wsdl.xmlToObject(n)}catch(i){return r(i,e,n)}var o=s.Body[h.$name];o||(o=s.Body[p+"Response"]),r(null,o,n)}},E,y)},s.Client=a,t.f.sts=1}.bind(this)},t.g={sts:null,mod:{exports:{}},load:function(){var e=t.g.mod,n=e.exports,s=function(e){var n={util:"util",fs:"fs",util:"util"},s=n[e];return s?t.__r(s):t.__sr(e)};s.resolve=t.__sr.resolve,t.g.sts=0,function(){function t(t){var e=/&/g,n=/</g,s=/>/g,r=/"/g,i=/'/g;return t=t.replace(e,"&"),t=t.replace(n,"<"),t=t.replace(s,">"),t=t.replace(r,'"'),t=t.replace(i,"'")}var e=function(t){t=i.replace(t,null,null,"\r\n","\n"),t=i.replace(t,null,null,"\r","\n"),this.m_xml=t,this.m_iP=0,this.m_iState=e._STATE_PROLOG,this.m_stack=new o,this._clearAttributes(),this.m_pause=!1,this.m_preInterruptIState=e._STATE_PROLOG,this.m_namespaceList=new Array,this.m_chunkTransitionContinuation=null};e._NONE=0,e._ELM_B=1,e._ELM_E=2,e._ELM_EMP=3,e._ATT=4,e._TEXT=5,e._ENTITY=6,e._PI=7,e._CDATA=8,e._COMMENT=9,e._DTD=10,e._ERROR=11,e._INTERRUPT=12,e._CONT_XML=0,e._CONT_ALT=1,e._ATT_NAME=0,e._ATT_VAL=1,e._STATE_PROLOG=1,e._STATE_DOCUMENT=2,e._STATE_MISC=3,e._errs=new Array,e._errs[e.ERR_CLOSE_PI=0]="PI: missing closing sequence",e._errs[e.ERR_CLOSE_DTD=1]="DTD: missing closing sequence",e._errs[e.ERR_CLOSE_COMMENT=2]="Comment: missing closing sequence",e._errs[e.ERR_CLOSE_CDATA=3]="CDATA: missing closing sequence",e._errs[e.ERR_CLOSE_ELM=4]="Element: missing closing sequence",e._errs[e.ERR_CLOSE_ENTITY=5]="Entity: missing closing sequence",e._errs[e.ERR_PI_TARGET=6]="PI: target is required",e._errs[e.ERR_ELM_EMPTY=7]="Element: cannot be both empty and closing",e._errs[e.ERR_ELM_NAME=8]='Element: name must immediatly follow "<"',e._errs[e.ERR_ELM_LT_NAME=9]='Element: "<" not allowed in element names',e._errs[e.ERR_ATT_VALUES=10]="Attribute: values are required and must be in quotes",e._errs[e.ERR_ATT_LT_NAME=11]='Element: "<" not allowed in attribute names',e._errs[e.ERR_ATT_LT_VALUE=12]='Attribute: "<" not allowed in attribute values',e._errs[e.ERR_ATT_DUP=13]="Attribute: duplicate attributes not allowed",e._errs[e.ERR_ENTITY_UNKNOWN=14]="Entity: unknown entity",e._errs[e.ERR_INFINITELOOP=15]="Infininte loop",e._errs[e.ERR_DOC_STRUCTURE=16]="Document: only comments, processing instructions, or whitespace allowed outside of document element",e._errs[e.ERR_ELM_NESTING=17]="Element: must be nested correctly",e.prototype.continueParsing=function(t){this.m_chunkTransitionContinuation&&(t=this.m_chunkTransitionContinuation+t),t=i.replace(t,null,null,"\r\n","\n"),t=i.replace(t,null,null,"\r","\n"),this.m_xml=t,this.m_iP=0,this.m_iState=e._STATE_DOCUMENT,this.m_pause=!1,this.m_preInterruptIState=e._STATE_PROLOG,this.m_chunkTransitionContinuation=null},e.prototype._addAttribute=function(t,e){this.m_atts[this.m_atts.length]=new Array(t,e)},e.prototype._checkStructure=function(t){if(e._STATE_PROLOG==this.m_iState){if((e._TEXT==t||e._ENTITY==t)&&-1!=i.indexOfNonWhitespace(this.getContent(),this.getContentBegin(),this.getContentEnd()))return this._setErr(e.ERR_DOC_STRUCTURE);(e._ELM_B==t||e._ELM_EMP==t)&&(this.m_iState=e._STATE_DOCUMENT)}if(e._STATE_DOCUMENT==this.m_iState){if((e._ELM_B==t||e._ELM_EMP==t)&&this.m_stack.push(this.getName()),e._ELM_E==t||e._ELM_EMP==t){var n=this.m_stack.pop();if(null==n||n!=this.getName())return this._setErr(e.ERR_ELM_NESTING)}if(0==this.m_stack.count())return this.m_iState=e._STATE_MISC,t}if(e._STATE_MISC==this.m_iState){if(e._ELM_B==t||e._ELM_E==t||e._ELM_EMP==t||e.EVT_DTD==t)return this._setErr(e.ERR_DOC_STRUCTURE);if((e._TEXT==t||e._ENTITY==t)&&-1!=i.indexOfNonWhitespace(this.getContent(),this.getContentBegin(),this.getContentEnd()))return this._setErr(e.ERR_DOC_STRUCTURE)}return t},e.prototype._clearAttributes=function(){this.m_atts=new Array},e.prototype._findAttributeIndex=function(t){for(var n=0;n<this.m_atts.length;n++)if(this.m_atts[n][e._ATT_NAME]==t)return n;return-1},e.prototype.getAttributeCount=function(){return this.m_atts?this.m_atts.length:0},e.prototype.getAttributeName=function(t){return 0>t||t>=this.m_atts.length?null:this.m_atts[t][e._ATT_NAME]},e.prototype.getAttributeValue=function(n){return 0>n||n>=this.m_atts.length?null:t(this.m_atts[n][e._ATT_VAL])},e.prototype.getAttributeValueByName=function(t){return this.getAttributeValue(this._findAttributeIndex(t))},e.prototype.getColumnNumber=function(){return i.getColumnNumber(this.m_xml,this.m_iP)},e.prototype.getContent=function(){return this.m_cSrc==e._CONT_XML?this.m_xml:this.m_cAlt},e.prototype.getContentBegin=function(){return this.m_cB},e.prototype.getContentEnd=function(){return this.m_cE},e.prototype.getLineNumber=function(){return i.getLineNumber(this.m_xml,this.m_iP)},e.prototype.getName=function(){return this.m_name},e.prototype.pause=function(){this.m_pause=!0},e.prototype.resume=function(){this.m_pause=!1,this.m_iState=this.m_preInterruptIState},e.prototype.next=function(){return this.m_pause?(this.m_preInterruptIState=this.m_iState,e._INTERRUPT):this._checkStructure(this._parse())},e.prototype._parse=function(){function t(t,e,n){for(var s=0;s<t.length;s++)if(t.charAt(s)!=e.charAt(n+s))return-1;return n}if(this.m_iP==this.m_xml.length)return e._NONE;var n=this.m_xml.charAt(this.m_iP);return"<"!==n&&"&"!==n?this._parseText(this.m_iP):this.m_iP==t("<?",this.m_xml,this.m_iP)?this._parsePI(this.m_iP+2):this.m_iP==t("<!DOCTYPE",this.m_xml,this.m_iP)?this._parseDTD(this.m_iP+9):this.m_iP==t("<!--",this.m_xml,this.m_iP)?this._parseComment(this.m_iP+4):this.m_iP==t("<![CDATA[",this.m_xml,this.m_iP)?this._parseCDATA(this.m_iP+9):this.m_iP==t("<",this.m_xml,this.m_iP)?this._parseElement(this.m_iP+1):this.m_iP==t("&",this.m_xml,this.m_iP)?this._parseEntity(this.m_iP+1):this._parseText(this.m_iP)},e.prototype._parsePrefixAndElementName=function(t){return splits=t.split(":",2),{prefix:1===splits.length?"":splits[0],name:1===splits.length?t:splits[1]}},e.prototype._parseNamespacesAndAtts=function(t){that=this;var e=[],n=[];return t.map(function(t){return"xmlns"===t[0].slice(0,5)?e.push({prefix:t[0].slice(6),uri:t[1],scopetag:that.m_name}):n.push(t),"not used"}),this.m_namespaceList=this.m_namespaceList.concat(e),[n,e.map(function(t){return[t.prefix,t.uri]})]},e.prototype._getContextualNamespace=function(t){if(""!==t)for(n in this.m_namespaceList)if(n=this.m_namespaceList[n],n.prefix===t)return n.uri;for(var e=this.m_namespaceList.length-1;e>=0;e--){var n=this.m_namespaceList[e];if(""===n.prefix)return n.uri}return""},e.prototype._removeExpiredNamesapces=function(t){var e=[];this.m_namespaceList.map(function(n){n.scopetag!==t&&e.push(n)}),this.m_namespaceList=e},e.prototype._parseAttribute=function(t,n){var s,r,o,a,p,c,h,u;return this.m_cAlt="",s=i.indexOfNonWhitespace(this.m_xml,t,n),-1==s||s>=n?s:(o=this.m_xml.indexOf("=",s),-1==o||o>n?this._setErr(e.ERR_ATT_VALUES):(r=i.lastIndexOfNonWhitespace(this.m_xml,s,o),a=i.indexOfNonWhitespace(this.m_xml,o+1,n),-1==a||a>n?this._setErr(e.ERR_ATT_VALUES):(c=this.m_xml.charAt(a),-1==i.QUOTES.indexOf(c)?this._setErr(e.ERR_ATT_VALUES):(p=this.m_xml.indexOf(c,a+1),-1==p||p>n?this._setErr(e.ERR_ATT_VALUES):(h=this.m_xml.substring(s,r+1),u=this.m_xml.substring(a+1,p),-1!=h.indexOf("<")?this._setErr(e.ERR_ATT_LT_NAME):-1!=u.indexOf("<")?this._setErr(e.ERR_ATT_LT_VALUE):(u=i.replace(u,null,null,"\n"," "),u=i.replace(u,null,null," "," "),iRet=this._replaceEntities(u),iRet==e._ERROR?iRet:(u=this.m_cAlt,-1!=this._findAttributeIndex(h)?this._setErr(e.ERR_ATT_DUP):(this._addAttribute(h,u),this.m_iP=p+2,e._ATT))))))))},e.prototype._parseCDATA=function(t){var n=this.m_xml.indexOf("]]>",t);return-1==n?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-9),e._INTERRUPT):(this._setContent(e._CONT_XML,t,n),this.m_iP=n+3,e._CDATA)},e.prototype._parseComment=function(t){var n=this.m_xml.indexOf("-->",t);return-1==n?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-4),e._INTERRUPT):(this._setContent(e._CONT_XML,t,n),this.m_iP=n+3,e._COMMENT)},e.prototype._parseDTD=function(t){var n,s,r,i;if(n=this.m_xml.indexOf(">",t),-1==n)return this.m_chunkTransitionContinuation=this.m_xml.slice(t-9),e._INTERRUPT;for(r=this.m_xml.indexOf("[",t),s=-1!=r&&n>r?"]>":">";;){if(n==i)return this._setErr(e.ERR_INFINITELOOP);if(i=n,n=this.m_xml.indexOf(s,t),-1==n)return this._setErr(e.ERR_CLOSE_DTD);if("]]>"!=this.m_xml.substring(n-1,n+2))break}return this.m_iP=n+s.length,e._DTD},e.prototype._parseElement=function(t){util=s("util");var n,r,o,a,p,c,h;if(r=n=this.m_xml.indexOf(">",t),-1==n)return this.m_chunkTransitionContinuation=this.m_xml.slice(t-1),e._INTERRUPT;if("/"==this.m_xml.charAt(t)?(p=e._ELM_E,t++):p=e._ELM_B,"/"==this.m_xml.charAt(n-1)){if(p==e._ELM_E)return this._setErr(e.ERR_ELM_EMPTY);p=e._ELM_EMP,r--}if(r=i.lastIndexOfNonWhitespace(this.m_xml,t,r),n-t!=1&&i.indexOfNonWhitespace(this.m_xml,t,r)!=t)return this._setErr(e.ERR_ELM_NAME);if(this._clearAttributes(),o=i.indexOfWhitespace(this.m_xml,t,r),-1==o)o=r+1;else for(this.m_iP=o;this.m_iP<r;){if(this.m_iP==h)return this._setErr(e.ERR_INFINITELOOP);if(h=this.m_iP,a=this._parseAttribute(this.m_iP,r),a==e._ERROR)return a}return c=this.m_xml.substring(t,o),-1!=c.indexOf("<")?this._setErr(e.ERR_ELM_LT_NAME):(this.m_name=c,this.m_iP=n+1,p)},e.prototype._parseEntity=function(t){var n=this.m_xml.indexOf(";",t);return-1==n?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-1),e._INTERRUPT):(this.m_iP=n+1,this._replaceEntity(this.m_xml,t,n))},e.prototype._parsePI=function(t){var n,s,r,o,a;return n=this.m_xml.indexOf("?>",t),-1==n?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-2),e._INTERRUPT):(s=i.indexOfNonWhitespace(this.m_xml,t,n),-1==s?this._setErr(e.ERR_PI_TARGET):(r=i.indexOfWhitespace(this.m_xml,s,n),-1==r&&(r=n),o=i.indexOfNonWhitespace(this.m_xml,r,n),-1==o&&(o=n),a=i.lastIndexOfNonWhitespace(this.m_xml,o,n),-1==a&&(a=n-1),this.m_name=this.m_xml.substring(s,r),this._setContent(e._CONT_XML,o,a+1),this.m_iP=n+2,e._PI))},e.prototype._parseText=function(t){var n,s;for(n=t;n<this.m_xml.length&&(s=this.m_xml.charAt(n),"<"!==s&&"&"!==s);++n);return this._setContent(e._CONT_XML,t,n),this.m_iP=n,e._TEXT},e.prototype._replaceEntities=function(t,n,s){if(i.isEmpty(t))return"";n=n||0,s=s||t.length;var r,o,a="";for(r=t.indexOf("&",n),o=n;r>0&&s>r;){if(a+=t.substring(o,r),o=t.indexOf(";",r)+1,0==o||o>s)return this._setErr(e.ERR_CLOSE_ENTITY);if(iRet=this._replaceEntity(t,r+1,o-1),iRet==e._ERROR)return iRet;a+=this.m_cAlt,r=t.indexOf("&",o)}return o!=s&&(a+=t.substring(o,s)),this._setContent(e._CONT_ALT,a),e._ENTITY},e.prototype._replaceEntity=function(t,n,s){if(i.isEmpty(t))return-1;switch(n=n||0,s=s||t.length,t.substring(n,s)){case"amp":strEnt="&";break;case"lt":strEnt="<";break;case"gt":strEnt=">";break;case"apos":strEnt="'";break;case"quot":strEnt='"';break;case"nbsp":strEnt="";break;case"lt":strEnt="<";break;case"gt":strEnt=">";break;case"amp":strEnt="&";break;case"cent":strEnt="¢";break;case"pound":strEnt="£";break;case"yen":strEnt="¥";break;case"euro":strEnt="€";break;case"sect":strEnt="§";break;case"copy":strEnt="©";break;case"reg":strEnt="®";break;default:strEnt="#"==t.charAt(n)?String.fromCharCode(parseInt(t.substring(n+1,s))):" "}return this._setContent(e._CONT_ALT,strEnt),e._ENTITY},e.prototype._setContent=function(t){var n=arguments;e._CONT_XML==t?(this.m_cAlt=null,this.m_cB=n[1],this.m_cE=n[2]):(this.m_cAlt=n[1],this.m_cB=0,this.m_cE=n[1].length),this.m_cSrc=t},e.prototype._setErr=function(t){var n=e._errs[t];return this.m_cAlt=n,this.m_cB=0,this.m_cE=n.length,this.m_cSrc=e._CONT_ALT,e._ERROR};var r=function(t){var e=new function(){},n=function(){};n.prototype.onStartDocument=function(t){e.onStartDocument=t},n.prototype.onEndDocument=function(t){e.onEndDocument=t},n.prototype.onStartElementNS=function(t){e.onStartElementNS=t},n.prototype.onEndElementNS=function(t){e.onEndElementNS=t},n.prototype.onCharacters=function(t){e.onCharacters=t},n.prototype.onCdata=function(t){e.onCdata=t},n.prototype.onComment=function(t){e.onComment=t},n.prototype.onWarning=function(t){e.onWarning=t},n.prototype.onError=function(t){e.onError=t},t(new n),this.m_hndDoc=e,this.m_hndErr=e,this.m_hndLex=e,this.m_interrupted=!1};r.DOC_B=1,r.DOC_E=2,r.ELM_B=3,r.ELM_E=4,r.CHARS=5,r.PI=6,r.CD_B=7,r.CD_E=8,r.CMNT=9,r.DTD_B=10,r.DTD_E=11,r.prototype.parseFile=function(t){var e=s("fs"),n=this;e.readFile(t,function(t,e){n.parseString(e)})},r.prototype.parseString=function(t){util=s("util");var n=this,i=!0;n.m_parser?(n.m_parser.continueParsing(t),i=!0):(n.m_parser=new e(t),i=!1),n.m_bErr=!1,n.m_bErr||i||n._fireEvent(r.DOC_B),n._parseLoop(),n.m_bErr||n.m_interrupted||n._fireEvent(r.DOC_E),n.m_xml=null,n.m_iP=0,n.m_interrupted=!1},r.prototype.pause=function(){this.m_parser.pause()},r.prototype.resume=function(){this.m_parser.resume(),this.m_interrupted=!1;var t=this;setTimeout(function(){t._parseLoop(),t.m_bErr||t.m_interrupted||t._fireEvent(r.DOC_E)},0)},r.prototype.setDocumentHandler=function(t){this.m_hndDoc=t},r.prototype.setErrorHandler=function(t){this.m_hndErr=t},r.prototype.setLexicalHandler=function(t){this.m_hndLex=t},r.prototype.getColumnNumber=function(){return this.m_parser.getColumnNumber()},r.prototype.getLineNumber=function(){return this.m_parser.getLineNumber()},r.prototype.getMessage=function(){return this.m_strErrMsg},r.prototype.getPublicId=function(){return null},r.prototype.getSystemId=function(){return null},r.prototype.getLength=function(){return this.m_parser.getAttributeCount()},r.prototype.getName=function(t){return this.m_parser.getAttributeName(t)},r.prototype.getValue=function(t){return this.m_parser.getAttributeValue(t)},r.prototype.getValueByName=function(t){return this.m_parser.getAttributeValueByName(t)},r.prototype._fireError=function(t){this.m_strErrMsg=t,this.m_bErr=!0,this.m_hndErr&&this.m_hndErr.onError&&this.m_hndErr.onError(this.m_strErrMsg)},r.prototype._fireEvent=function(t){var e,n,s=arguments,i=s.length-1;this.m_bErr||(r.DOC_B==t?(n="onStartDocument",e=this.m_hndDoc):r.DOC_E==t?(n="onEndDocument",e=this.m_hndDoc):r.ELM_B==t?(n="onStartElementNS",e=this.m_hndDoc):r.ELM_E==t?(n="onEndElementNS",e=this.m_hndDoc):r.CHARS==t?(n="onCharacters",e=this.m_hndDoc):r.PI==t?(n="processingInstruction",e=this.m_hndDoc):r.CD_B==t?(n="onCdata",e=this.m_hndLex):r.CD_E==t?(n="onEndCDATA",e=this.m_hndLex):r.CMNT==t&&(n="onComment",e=this.m_hndLex),e&&e[n]&&(0==i?e[n]():1==i?e[n](s[1]):2==i?e[n](s[1],s[2]):3==i?e[n](s[1],s[2],s[3]):4==i?e[n](s[1],s[2],s[3],s[4]):5==i?e[n](s[1],s[2],s[3],s[4],s[5]):6==i&&e[n](s[1],s[2],s[3],s[4],s[5],s[6])))},r.prototype._parseLoop=function(t){var n,t;for(t=this.m_parser;!this.m_bErr;)if(n=t.next(),n==e._ELM_B){theatts=this.m_parser.m_atts,nameobject=t._parsePrefixAndElementName(t.getName()),theattsandnamespace=t._parseNamespacesAndAtts(theatts);var s=t._getContextualNamespace(nameobject.prefix);this._fireEvent(r.ELM_B,nameobject.name,theattsandnamespace[0],""===nameobject.prefix?null:nameobject.prefix,""===s?null:s,theattsandnamespace[1])}else if(n==e._ELM_E){nameobject=t._parsePrefixAndElementName(t.getName());var s=t._getContextualNamespace(nameobject.prefix);t._removeExpiredNamesapces(t.getName()),this._fireEvent(r.ELM_E,nameobject.name,""===nameobject.prefix?null:nameobject.prefix,""===s?null:s)}else if(n==e._ELM_EMP){theatts=this.m_parser.m_atts,nameobject=t._parsePrefixAndElementName(t.getName()),theattsandnamespace=t._parseNamespacesAndAtts(theatts);var s=t._getContextualNamespace(nameobject.prefix);this._fireEvent(r.ELM_B,nameobject.name,theattsandnamespace[0],""===nameobject.prefix?null:nameobject.prefix,""===s?null:s,theattsandnamespace[1],!0),t._removeExpiredNamesapces(t.getName()),this._fireEvent(r.ELM_E,nameobject.name,""===nameobject.prefix?null:nameobject.prefix,""===s?null:s,!0)}else if(n==e._TEXT)this._fireEvent(r.CHARS,t.getContent().slice(t.getContentBegin(),t.getContentEnd()));else if(n==e._ENTITY)this._fireEvent(r.CHARS,t.getContent(),t.getContentBegin(),t.getContentEnd()-t.getContentBegin());else if(n==e._PI)this._fireEvent(r.PI,t.getName(),t.getContent().substring(t.getContentBegin(),t.getContentEnd()));else if(n==e._CDATA)this._fireEvent(r.CD_B,t.getContent().slice(t.getContentBegin(),t.getContentEnd()));else if(n==e._COMMENT)this._fireEvent(r.CMNT,t.getContent().slice(t.getContentBegin(),t.getContentEnd()));else if(n==e._DTD);else if(n==e._ERROR)this._fireError(t.getContent());else{if(n==e._INTERRUPT)return void(this.m_interrupted=!0);if(n==e._NONE)return}};var i=function(){};i.WHITESPACE=" \n\r",i.QUOTES="\"'",i.getColumnNumber=function(t,e){if(i.isEmpty(t))return-1;e=e||t.length;{var n=t.substring(0,e).split("\n");n[n.length-1]}n.length--;var s=n.join("\n").length;return e-s},i.getLineNumber=function(t,e){return i.isEmpty(t)?-1:(e=e||t.length,t.substring(0,e).split("\n").length)},i.indexOfNonWhitespace=function(t,e,n){if(i.isEmpty(t))return-1;e=e||0,n=n||t.length;for(var s=e;n>s;s++)if(-1==i.WHITESPACE.indexOf(t.charAt(s)))return s;return-1},i.indexOfWhitespace=function(t,e,n){if(i.isEmpty(t))return-1;e=e||0,n=n||t.length;for(var s=e;n>s;s++)if(-1!=i.WHITESPACE.indexOf(t.charAt(s)))return s;return-1},i.isEmpty=function(t){return null==t||0==t.length},i.lastIndexOfNonWhitespace=function(t,e,n){if(i.isEmpty(t))return-1;e=e||0,n=n||t.length;for(var s=n-1;s>=e;s--)if(-1==i.WHITESPACE.indexOf(t.charAt(s)))return s;return-1},i.replace=function(t,e,n,s,r){return i.isEmpty(t)?"":(e=e||0,n=n||t.length,t.toString().substring(e,n).split(s).join(r))};var o=function(){this.m_arr=new Array};o.prototype.clear=function(){this.m_arr=new Array},o.prototype.count=function(){return this.m_arr.length},o.prototype.destroy=function(){this.m_arr=null},o.prototype.peek=function(){return 0==this.m_arr.length?null:this.m_arr[this.m_arr.length-1]},o.prototype.pop=function(){if(0==this.m_arr.length)return null;var t=this.m_arr[this.m_arr.length-1];return this.m_arr.length--,t},o.prototype.push=function(t){this.m_arr[this.m_arr.length]=t},n.SaxParser=r}(),t.g.sts=1}.bind(this)},t.h={sts:null,mod:{exports:{}},load:function(){function e(t){var e=null!=t?t.indexOf(":"):-1;return 0>e?{namespace:null,name:t}:{namespace:t.substring(0,e),name:t.substring(e+1)}}function n(t){return"string"==typeof t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):t}function s(t){return t.replace(d,"").replace(E,"")}function r(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function i(t,e){for(var n in t)if(t[n]===e)return n}function o(t){var t=t.split(" "),e={};return t.forEach(function(t){e[t.replace(/^_/,"")]=($[t]||[y])[0]}),e}function a(t,e,n){"function"==typeof e&&(n=e,e={});var s;return l.request(t,null,function(r,i,o){r?n(r):i&&200==i.statusCode?(s=new B(o,t,e),s.onReady(n)):n(new Error("Invalid WSDL URL: "+t))}),s}var p=t.h.mod,c=p.exports,h=function(e){var n={"node-xml":"g","./http":"d","./url":"b","./assert":"e"},s=n[e];return s?t.__r(s):t.__sr(e)};h.resolve=t.__sr.resolve,t.h.sts=0;var u=h("node-xml"),l=h("./http"),m=h("./url"),_=h("./assert"),f={string:1,"boolean":1,decimal:1,"float":1,"double":1,anyType:1,"byte":1,"int":1,"long":1,"short":1,unsignedByte:1,unsignedInt:1,unsignedLong:1,unsignedShort:1,duration:0,dateTime:0,time:0,date:0,gYearMonth:0,gYear:0,gMonthDay:0,gDay:0,gMonth:0,hexBinary:0,base64Binary:0,anyURI:0,QName:0,NOTATION:0},d=/^[\s\xA0]+/,E=/[\s\xA0]+$/,y=function(t,n){var s=e(t);this.nsName=t,this.namespace=s.namespace,this.name=s.name,this.children=[],this.xmlns={};for(var r in n){var i=/^xmlns:?(.*)$/.exec(r);i?this.xmlns[i[1]]=n[r]:this["$"+r]=n[r]}};y.prototype.deleteFixedAttrs=function(){this.children&&0===this.children.length&&delete this.children,this.xmlns&&0===Object.keys(this.xmlns).length&&delete this.xmlns,delete this.nsName,delete this.namespace,delete this.name},y.prototype.allowedChildren=[],y.prototype.startElement=function(t,n,s){if(this.allowedChildren){var r=this.allowedChildren[e(n).name];r?t.push(new r(n,s)):this.unexpected(n)}},y.prototype.endElement=function(t,e){if(this.nsName===e){if(t.length<2)return;var n=t[t.length-2];this!==t[0]&&(r(t[0].xmlns,this.xmlns),n.children.push(this),n.addChild(this)),t.pop()}},y.prototype.addChild=function(){},y.prototype.unexpected=function(t){throw new Error("Found unexpected element ("+t+") inside "+this.nsName)},y.prototype.description=function(){return this.$name||this.name},y.prototype.init=function(){},y.createSubClass=function(){var t=this,e=function(){t.apply(this,arguments),this.init()};return e.prototype.__proto__=t.prototype,e};var g=y.createSubClass(),v=y.createSubClass(),x=y.createSubClass(),T=y.createSubClass(),b=y.createSubClass(),C=y.createSubClass(),A=y.createSubClass(),S=y.createSubClass(),R=y.createSubClass(),N=y.createSubClass(),w=y.createSubClass(),O=y.createSubClass(),L=y.createSubClass(),P=y.createSubClass(),M=y.createSubClass(),I=y.createSubClass(),D=y.createSubClass(),j=y.createSubClass(),$={types:[O,"schema"],schema:[w,"element complexType simpleType include import"],element:[g,"annotation complexType"],simpleType:[T,"restriction"],restriction:[b,"enumeration"],enumeration:[C,""],complexType:[A,"annotation sequence all"],sequence:[S,"element"],all:[R,"element"],service:[D,"port documentation"],port:[I,"address"],binding:[M,"_binding SecuritySpec operation"],portType:[P,"operation"],message:[N,"part documentation"],operation:[L,"documentation input output fault _operation"],input:[v,"body SecuritySpecRef documentation header"],output:[x,"body SecuritySpecRef documentation header"],fault:[y,"_fault"],definitions:[j,"types message portType binding service"]};for(var U in $){var k=$[U];k[0].prototype.allowedChildren=o(k[1])}N.prototype.init=function(){this.element=null,
this.parts=null},w.prototype.init=function(){this.complexTypes={},this.types={},this.elements={},this.includes=[]},O.prototype.init=function(){this.schemas={}},L.prototype.init=function(){this.input=null,this.output=null,this.inputSoap=null,this.outputSoap=null,this.style="",this.soapAction=""},P.prototype.init=function(){this.methods={}},M.prototype.init=function(){this.transport="",this.style="",this.methods={}},I.prototype.init=function(){this.location=null},D.prototype.init=function(){this.ports={}},j.prototype.init=function(){"definitions"!==this.name&&this.unexpected(nsName),this.messages={},this.portTypes={},this.bindings={},this.services={},this.schemas={}},w.prototype.addChild=function(t){if(!(t.$name in f)){if("include"===t.name||"import"===t.name){var e=t.$schemaLocation||t.$location;e&&this.includes.push({namespace:t.$namespace||t.$targetNamespace||this.$targetNamespace,location:e})}else"complexType"===t.name?this.complexTypes[t.$name]=t:"element"===t.name?this.elements[t.$name]=t:t.$name&&(this.types[t.$name]=t);this.children.pop()}},O.prototype.addChild=function(t){_(t instanceof w),t.$targetNamespace?this.schemas[t.$targetNamespace]=t:this.schemas[t.includes[0].namespace]=t},v.prototype.addChild=function(t){"body"===t.name&&(this.use=t.$use,"encoded"===this.use&&(this.encodingStyle=t.$encodingStyle),this.children.pop())},x.prototype.addChild=function(t){"body"===t.name&&(this.use=t.$use,"encoded"===this.use&&(this.encodingStyle=t.$encodingStyle),this.children.pop())},L.prototype.addChild=function(t){"operation"===t.name&&(this.soapAction=t.$soapAction||"",this.style=t.$style||"",this.children.pop())},M.prototype.addChild=function(t){"binding"===t.name&&(this.transport=t.$transport,this.style=t.$style,this.children.pop())},I.prototype.addChild=function(t){"address"===t.name&&"undefined"!=typeof t.$location&&(this.location=t.$location)},j.prototype.addChild=function(t){var e=this;t instanceof O?e.schemas=t.schemas:t instanceof N?e.messages[t.$name]=t:t instanceof P?e.portTypes[t.$name]=t:t instanceof M?("http://schemas.xmlsoap.org/soap/http"===t.transport||"http://www.w3.org/2003/05/soap/bindings/HTTP/"===t.transport)&&(e.bindings[t.$name]=t):t instanceof D?e.services[t.$name]=t:_(!1,"Invalid child type"),this.children.pop()},N.prototype.postProcess=function(t){var n,s=null,r=this.children||[];for(var i in r)if("part"===(n=r[i]).name){s=n;break}if(s){if(s.$element){delete this.parts;var o=e(s.$element),a=o.namespace;this.element=t.schemas[t.xmlns[a]].elements[o.name],this.element.targetNSAlias=a,this.element.targetNamespace=t.xmlns[a],this.children.splice(0,1)}else{this.parts={},delete this.element;for(var s,i=0;s=this.children[i];i++){_("part"===s.name,"Expected part element");var o=e(s.$type),a=t.xmlns[o.namespace],p=o.name,c=t.schemas[a];this.parts[s.$name]="undefined"!=typeof c?t.schemas[a].types[p]||t.schemas[a].complexTypes[p]:s.$type,this.parts[s.$name].namespace=o.namespace,this.parts[s.$name].xmlns=a,this.children.splice(i--,1)}}this.deleteFixedAttrs()}},L.prototype.postProcess=function(t,n){for(var s,r=this.children,i=0;s=r[i];i++)if("input"===s.name||"output"===s.name)if("binding"!==n){var o=e(s.$message).name,a=t.messages[o];a.postProcess(t),a.element?(t.messages[a.element.$name]=a,this[s.name]=a.element):this[s.name]=a,r.splice(i--,1)}else this[s.name]=s,r.splice(i--,1);this.deleteFixedAttrs()},P.prototype.postProcess=function(t){var e=this.children;if("undefined"!=typeof e){for(var n,s=0;n=e[s];s++)"operation"==n.name&&(n.postProcess(t,"portType"),this.methods[n.$name]=n,e.splice(s--,1));delete this.$name,this.deleteFixedAttrs()}},M.prototype.postProcess=function(t){var n=e(this.$type).name,s=t.portTypes[n],r=this.style,i=this.children;s.postProcess(t),this.methods=s.methods;for(var o,a=0;o=i[a];a++)if("operation"==o.name){o.postProcess(t,"binding"),i.splice(a--,1),o.style||(o.style=r);var p=this.methods[o.$name];p.style=o.style,p.soapAction=o.soapAction,p.inputSoap=o.input||null,p.outputSoap=o.output||null,p.inputSoap&&p.inputSoap.deleteFixedAttrs(),p.outputSoap&&p.outputSoap.deleteFixedAttrs()}delete this.$name,delete this.$type,this.deleteFixedAttrs()},D.prototype.postProcess=function(t){for(var n,s=this.children,r=t.bindings,i=0;n=s[i];i++)if("port"==n.name){var o=e(n.$binding).name,a=r[o];a&&(a.postProcess(t),this.ports[n.$name]={location:n.location,binding:a},s.splice(i--,1))}delete this.$name,this.deleteFixedAttrs()},T.prototype.description=function(){for(var t,e=this.children,n=0;t=e[n];n++)if(t instanceof b)return this.$name+"|"+t.description();return{}},b.prototype.description=function(){var t=this.$base?this.$base+"|":"";return t+this.children.map(function(t){return t.description()}).join(",")},C.prototype.description=function(){return this.$value},A.prototype.description=function(t){for(var e,n=this.children,s=0;e=n[s];s++)if(e instanceof S||e instanceof R)return e.description(t);return{}},g.prototype.description=function(t){var n,s={},r=this.$name;if(this.$minOccurs!==this.$maxOccurs&&(r+="[]"),this.$type){var i=e(this.$type).name,o=t.xmlns[e(this.$type).namespace],n=t.schemas[o],a=n&&(n.complexTypes[i]||n.types[i]);s[r]=!a||i in f?this.$type:a.description(t)}else{var p=this.children;s[r]={};for(var c,h=0;c=p[h];h++)c instanceof A&&(s[r]=c.description(t))}return s},R.prototype.description=S.prototype.description=function(t){for(var e,n=this.children,s={},r=0;e=n[r];r++){var i=e.description(t);for(var o in i)s[o]=i[o]}return s},N.prototype.description=function(t){if(this.element)return this.element&&this.element.description(t);var e={};return e[this.$name]=this.parts,e},P.prototype.description=function(t){var e={};for(var n in this.methods){var s=this.methods[n];e[n]=s.description(t)}return e},L.prototype.description=function(t){var e=this.input.description(t),n=this.output.description(t);return{input:e&&e[Object.keys(e)[0]],output:n&&n[Object.keys(n)[0]]}},M.prototype.description=function(t){var e={};for(var n in this.methods){var s=this.methods[n];e[n]=s.description(t)}return e},D.prototype.description=function(t){var e={};for(var n in this.ports){var s=this.ports[n];e[n]=s.binding.description(t)}return e};var B=function(t,e,n){var s,r=this;if(this.uri=e,this.callback=function(){},this.options=n||{},"string"==typeof t)s=this._fromXML;else{if("object"!=typeof t)throw new Error("WSDL constructor takes either an XML string or service definition");s=this._fromServices}setTimeout(function(){s.call(r,t),r.processIncludes(function(t){r.definitions.deleteFixedAttrs();var e=r.services=r.definitions.services;if(e)for(var n in e)e[n].postProcess(r.definitions);var s=r.definitions.complexTypes;if(s)for(var n in s)s[n].deleteFixedAttrs();var i=r.definitions.bindings;for(var o in i){var a=i[o];if("document"===a.style){var p=a.methods,c=a.topElements={};for(var h in p){var u=p[h].input.$name,l=p[h].output.$name;c[u]={methodName:h,outputName:l}}}}r.xmlnsInEnvelope=r._xmlnsMap(),r.callback(t,r)})},0)};B.prototype.onReady=function(t){t&&(this.callback=t)},B.prototype._processNextInclude=function(t,e){var n=this,s=t.shift();return s?void a(m.resolve(n.uri,s.location),function(r,i){n.definitions.schemas[s.namespace||i.definitions.$targetNamespace]=i.definitions,n._processNextInclude(t,function(t){e(t)})}):e()},B.prototype.processIncludes=function(t){var e=this.definitions.schemas,n=[];for(var s in e){var r=e[s];n=n.concat(r.includes||[])}this._processNextInclude(n,t)},B.prototype.describeServices=function(){var t={};for(var e in this.services){var n=this.services[e];t[e]=n.description(this.definitions)}return t},B.prototype.toXML=function(){return this.xml||""},B.prototype.xmlToObject=function(t){var n,r,i=this,o=new u.SaxParser(function(t){n=t}),a=null,p={},c={Envelope:{Header:{Security:{UsernameToken:{Username:"string",Password:"string"}}},Body:{Fault:{faultcode:"string",faultstring:"string",detail:"string"}}}},h=[{name:null,object:p,schema:c}],l={};n.onStartElementNS(function(t,n,s,o,p){t=s?s+":"+t:t;n=n.reduce(function(t,e){return t[e[0]]=e[1],t},{}),p.forEach(function(t){var e=t[0],s=t[1];n["xmlns"+(e?":":"")+e]=s});var c=e(t).name,u=h[h.length-1],m=u.schema,_={},f=c;if(!a&&"Body"===u.name&&"Fault"!==c){var d=i.definitions.messages[c];if(!d){var E=!1,y=!1;/Response$/.test(c)?(y=!0,c=c.replace(/Response$/,"")):/Request$/.test(c)?(E=!0,c=c.replace(/Request$/,"")):/Solicit$/.test(c)&&(E=!0,c=c.replace(/Solicit$/,""));var g=i.definitions.portTypes,v=Object.keys(g),x=g[v[0]];c=E?x.methods[c].input.$name:x.methods[c].output.$name,d=i.definitions.messages[c],i.definitions.messages[f]=i.definitions.messages[c]}m=d.description(i.definitions),a=f}n.href&&(r=n.href.substr(1),l[r]||(l[r]={hrefs:[],obj:null}),l[r].hrefs.push({par:u.object,key:c})),(r=n.id)&&(l[r]||(l[r]={hrefs:[],obj:null})),m&&m[c+"[]"]&&(c+="[]"),h.push({name:f,object:_,schema:m&&m[c],id:n.id})}),n.onEndElementNS(function(t,n){t=n?n+":"+t:t;var s=h.pop(),r=s.object,i=h[h.length-1],o=i.object,a=i.schema,p=e(t).name;a&&a[p+"[]"]?(o[p]||(o[p]=[]),o[p].push(r)):p in o?(Array.isArray(o[p])||(o[p]=[o[p]]),o[p].push(r)):o[p]=r,s.id&&(l[s.id].obj=r)}),n.onCharacters(function(t){if(t=s(t),t.length){var n,r=h[h.length-1],i=e(r.schema).name;n="int"===i?parseInt(t,10):"dateTime"===i?new Date(t):"string"!=typeof r.object?t:r.object+t,r.object=n}}),o.parseString(t);for(var m in l){var _=l[m],f=_.obj;_.hrefs.forEach(function(t){t.par[t.key]=f})}var d=p.Envelope.Body;return d.Fault,p.Envelope},B.prototype.objectToDocumentXML=function(t,e,n,s){var r={};return r[t]=e,this.objectToXML(r,null,n,s)},B.prototype.objectToRpcXML=function(t,e,s,r){var o=[],a=this.definitions,s=s||i(a.xmlns,r),r=r||a.xmlns[s],p="_xmlns";o.push(["<",s,":",t,">"].join(""));for(var c in e)if(c!=p){var h=e[c];o.push(["<",c,">"].join("")),o.push("object"==typeof h?this.objectToXML(h):n(h)),o.push(["</",c,">"].join(""))}return o.push(["</",s,":",t,">"].join("")),o.join("")},B.prototype.objectToXML=function(t,e,s,r){var i=this,o=[],a="",p=s?s+":":"";if(Array.isArray(t))for(var c,h=0;c=t[h];h++)h>0&&(o.push(["</",p,e,">"].join("")),o.push(["<",p,e,a,">"].join(""))),o.push(i.objectToXML(c,e));else if("object"==typeof t)for(var e in t){var u=t[e];o.push(["<",p,e,a,">"].join("")),o.push(i.objectToXML(u,e)),o.push(["</",p,e,">"].join(""))}else t&&o.push(n(t));return o.join("")},B.prototype._parse=function(t){var n,s=this,r=new u.SaxParser(function(t){n=t}),i=[],o=null;return n.onStartElementNS(function(t,n,r,a,p){t=r?r+":"+t:t;n=n.reduce(function(t,e){return t[e[0]]=e[1],t},{}),p.forEach(function(t){var e=t[0],s=t[1];n["xmlns"+(e?":":"")+e]=s});var c=i[i.length-1];if(c)try{c.startElement(i,t,n)}catch(h){if(s.options.strict)throw h;i.push(new y(t,n))}else{var u=e(t).name;if("definitions"===u)o=new j(t,n);else{if("schema"!==u)throw new Error("Unexpected root element of WSDL or include");o=new w(t,n)}i.push(o)}}),n.onEndElementNS(function(t,e){t=e?e+":"+t:t;var n=i[i.length-1];_(n,"Unmatched close tag: "+t),n.endElement(i,t)}),n.onWarning(function(t){console.log("<WARNING>"+t+"</WARNING>")}),n.onError(function(t){console.log("<ERROR>"+JSON.stringify(t)+"</ERROR>")}),r.parseString(t),o},B.prototype._fromXML=function(t){this.definitions=this._parse(t),this.xml=t},B.prototype._fromServices=function(){},B.prototype._xmlnsMap=function(){var t=this.definitions.xmlns,e="";for(var n in t)if(""!==n){var s=t[n];switch(s){case"http://xml.apache.org/xml-soap":case"http://schemas.xmlsoap.org/wsdl/":case"http://schemas.xmlsoap.org/wsdl/soap/":case"http://schemas.xmlsoap.org/soap/encoding/":case"http://www.w3.org/2001/XMLSchema":continue}~s.indexOf("http://schemas.xmlsoap.org/")||~s.indexOf("http://www.w3.org/")||~s.indexOf("http://xml.apache.org/")||(e+=" xmlns:"+n+'="'+s+'"')}return e},c.open_wsdl=a,c.WSDL=B,t.h.sts=1}.bind(this)},t.i={sts:null,mod:{exports:{}},load:function(){function e(t,e,n){"function"==typeof e&&(n=e,e={});var s=l[t];s?n(null,s):c(t,e,function(e,s){return e?n(e):(l[t]=s,void n(null,s))})}function n(t,n,s,r){"function"==typeof n&&(r=s,s=n,n={}),r=n.endpoint||r,e(t,n,function(t,e){s(t,e&&new p(e,r))})}function s(t,e){this._username=t,this._password=e}function r(t,e,n){this._username=t,this._password=e,this._passwordType=n||"PasswordText"}var i=t.i.mod,o=i.exports,a=function(e){var n={"./client":"f","./wsdl":"h",crypto:"crypto","./wsdl":"h"},s=n[e];return s?t.__r(s):t.__sr(e)};a.resolve=t.__sr.resolve,t.i.sts=0;var p=a("./client").Client,c=a("./wsdl").open_wsdl,h=a("crypto"),u=a("./wsdl").WSDL,l={};s.prototype.addHeaders=function(t){t.Authorization="Basic "+new Buffer(this._username+":"+this._password||"").toString("base64")},s.prototype.toXML=function(){return""};var m=function(t,e,n){var s=h.createHash("sha1"),r=new Buffer(t||"","base64").toString("binary");s.update(r+e+n);var i=s.digest("base64");return i};r.prototype.toXML=function(){function t(t){function e(t){return 10>t?"0"+t:t}return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z"}var e=new Date,n=t(e),s=t(new Date(e.getTime()+6e5)),r=h.createHash("sha1");r.update(n+Math.random());var i=r.digest("base64");return'<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsu:Timestamp wsu:Id="Timestamp-'+n+'"><wsu:Created>'+n+"</wsu:Created><wsu:Expires>"+s+'</wsu:Expires></wsu:Timestamp><wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-'+n+'"><wsse:Username>'+this._username+"</wsse:Username>"+("PasswordText"===this._passwordType?"<wsse:Password>"+this._password+"</wsse:Password>":'<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">'+m(i,n,this._password)+"</wsse:Password>")+'<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">'+i+"</wsse:Nonce><wsu:Created>"+n+"</wsu:Created></wsse:UsernameToken></wsse:Security>"},o.BasicAuthSecurity=s,o.WSSecurity=r,o.createClient=n,o.passwordDigest=m,o.WSDL=u,t.i.sts=1}.bind(this)},t.j={sts:null,mod:{exports:{}},load:function(){var e=t.j.mod,n=(e.exports,function(e){var n={"./lib/soap":"i"},s=n[e];return s?t.__r(s):t.__sr(e)});n.resolve=t.__sr.resolve,t.j.sts=0,e.exports=n("./lib/soap"),t.j.sts=1}.bind(this)},t.__r("j")},this);