UNPKG

inet-core

Version:
49 lines 22.1 kB
window.undefined=window.undefined;iNet={version:"5.8.1.0",build_date:"31/07/2017",BLANK_IMAGE_URL:"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="};iNet.apply=function(b,c,e){e&&iNet.apply(b,e);if(b&&c&&typeof c=="object")for(var g in c)b[g]=c[g];return b}; (function(){var b=navigator.userAgent.toLowerCase(),c=Object.prototype.toString,e=function(a){return a.test(b)},g=document.compatMode=="CSS1Compat",i=document.documentMode,k=e(/opera/),l=e(/chrome/),m=e(/webkit/),o=!l&&e(/safari/),q=o&&e(/applewebkit\/4/),A=o&&e(/version\/3/),B=o&&e(/version\/4/),p=!k&&e(/msie/),v=p&&(e(/msie 7/)||i==7),w=p&&(e(/msie 8/)&&i!=7&&i!=9&&i!=10||i==8),x=p&&(e(/msie 9/)&&i!=7&&i!=8&&i!=10||i==9),y=p&&(e(/msie 10/)&&i!=7&&i!=8&&i!=9||i==10),C=p&&!v&&!w&&!x&&!y;i=p&&i&&!(i>= 7)||!p;var s=!m&&e(/gecko/),D=s&&e(/rv:1\.8/),E=s&&e(/rv:1\.9/),F=s&&e(/rv:2\.0/);g=p&&!g;var G=e(/windows|win32/),H=e(/macintosh|mac os x/),I=e(/adobeair/);e=e(/linux/);var t=/^https/i.test(window.location.protocol),z=/[,;\s]+/;iNet.apply(iNet,{isFunction:function(a){return c.apply(a)==="[object Function]"},getContextPath:function(){var a=window.location.pathname;if(a=="/")return"/";var d=a.indexOf("/",1);if(d==0)d=a.length;return a.substr(0,d)},matchMedia:function(a){return window.matchMedia(a)}, matchWidth:function(a){return iNet.matchMedia("(min-width:"+a+"px)").matches},getUrl:function(a){var d=window.location.protocol+"//";d+=window.location.hostname;var f=window.location.port;if(!iNet.isEmpty(f))if(t&&f!=443)d+=":"+f;else if(!t&&f!=80)d+=":"+f;var h=window.location.pathname;if(h.length>1){var j=h.indexOf("/",1);if(j==0)j=h.length;d+=h.substr(0,j)}h=iNet.prefix||"smartcloud";j=iNet.extension||".cpx";return a.indexOf("/")==0?d+"/"+h+a+j:d+"/"+h+"/"+a+j},getXUrl:function(a,d){var f=!iNet.isEmpty(d)? d:iNet.pattern;if(!iNet.isEmpty(f))return iNet.getUrl(f+"/"+a);return iNet.getUrl(a)},getPUrl:function(a){var d=window.location.protocol+"//";d+=window.location.hostname;var f=window.location.port;if(!iNet.isEmpty(f))if(t&&f!=443)d+=":"+f;else if(!t&&f!=80)d+=":"+f;var h=window.location.pathname;if(h.length>1){var j=h.indexOf("/",1);if(j==0)j=h.length;d+=h.substr(0,j)}h=iNet.firmPrefix||iNet.prefix||"smartcloud";j=iNet.extension||".cpx";if(h==="icloud")h="smartcloud";return a.indexOf("/")==0?d+"/"+ h+a+j:d+"/"+h+"/"+a+j},getSSOUrl:function(a,d){if(iNet.isEmpty(a))return"";return iNet.urlAppend(iNet.getUrl("ssorequest/redirect"),(!iNet.isEmpty(d)?"application="+d+"&":"")+"url="+encodeURIComponent(a))},getSSODiscoveryUrl:function(a,d){if(iNet.isEmpty(a))return"";return iNet.urlAppend(iNet.getUrl("ssodiscovery/redirect"),(!iNet.isEmpty(d)?"application="+d+"&":"")+"url="+encodeURIComponent(a))},getSSOCallback:function(a,d){var f=d||{};if(!iNet.isEmpty(a))f.application=a;var h=Object.keys(f).map(function(j){return encodeURIComponent(j)+ "="+encodeURIComponent(f[j])}).join("&");return iNet.urlAppend(iNet.getPUrl("ssocallback/redirect"),h)},urlAppend:function(a,d){if(!iNet.isEmpty(d))return a+(a.indexOf("?")===-1?"?":"&")+d;return a},clone:function(a){if(null==a||"object"!=typeof a)return a;var d=a.constructor();if(d)for(var f in a)if(a.hasOwnProperty(f))d[f]=a[f];return d},copy:function(a,d,f,h){if(typeof f==="string")f=f.split(z);for(var j,n=0,r=f?f.length:0;n<r;n++){j=f[n];if(d.hasOwnProperty(j)||h&&j in d)a[j]=d[j]}return a},copyIf:function(a, d,f){if(typeof f==="string")f=f.split(z);for(var h,j=0,n=f?f.length:0;j<n;j++){h=f[j];if(a[h]===undefined)a[h]=d[h]}return a},isObject:function(a){return a&&typeof a=="object"},isString:function(a){return typeof a==="string"},isNumber:function(a){return typeof a==="number"&&isFinite(a)},isBoolean:function(a){return typeof a==="boolean"},isArray:function(a){return c.apply(a)==="[object Array]"},isDefined:function(a){return typeof a!=="undefined"},isIterable:function(a){return a&&typeof a!=="string"? a.length!==undefined:false},isEmpty:function(a,d){return a===null||a===undefined||iNet.isArray(a)&&!a.length||(!d?a==="":false)||iNet.isEmptyObject(a)},valueFrom:function(a,d,f){return iNet.isEmpty(a,f)?d:a},isEmptyObject:function(a){if(!iNet.isObject(a))return false;for(var d in a)return false;return true},isEmail:function(a){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a)},isDate:function(a){return c.call(a)=== "[object Date]"},isPrimitive:function(a){a=typeof a;return a==="string"||a==="number"||a==="boolean"},isElement:function(a){return a?a.nodeType===1:false},isOpera:k,isWebKit:m,isChrome:l,isSafari:o,isSafari3:A,isSafari4:B,isSafari2:q,isIE:p,isIE6:C,isIE7:v,isIE8:w,isIE9:x,isIE10:y,isGecko:s,isGecko2:D,isGecko3:E,isGecko4:F,isBorderBox:g,isLinux:e,isWindows:G,isMac:H,isAir:I,isSupport:i,toArray:function(){return p?function(a,d,f,h){h=[];iNet.each(a,function(j){h.push(j)});return h.slice(d||0,f||h.length)}: function(a,d,f){return Array.prototype.slice.call(a,d||0,f||a.length)}}(),applyIf:function(a,d){if(a)for(var f in d)if(iNet.isEmpty(a[f]))a[f]=d[f];return a},each:function(a,d,f){if(!iNet.isEmpty(a,true))for(var h=0,j=a.length;h<j;h++)if(d.call(f||a[h],a[h],h,a)===false)return h},namespace:function(){var a,d;iNet.each(arguments,function(f){d=f.split(".");a=window[d[0]]=window[d[0]]||{};iNet.each(d.slice(1),function(h){a=a[h]=a[h]||{}})});return a},getParam:function(a,d){if(window["ctx_"+a])return window["ctx_"+ a];a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var f=RegExp("[\\?&]"+a+"=([^&#]*)").exec(d||window.location.href);return f?f[1]:""},parserHtml:function(a){if(a===undefined||a===null||a.length===undefined)return"";a.replace(/</g,"&lt;");a.replace(/>/g,"&gt;");a.replace(/\n/g,"<br />");return a},generateId:function(){for(var a="",d=0;d<24;d++)a+=Math.floor(Math.random()*15).toString(15);return a},generateUUID:function(){var a=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(d){var f=(a+Math.random()*16)%16|0;a=Math.floor(a/16);return(d=="x"?f:f&3|8).toString(16)})},alphaGenerateId:function(){for(var a="",d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",f=d.length,h=0;h<f;h++)a+=d.charAt(Math.floor(Math.random()*f));return a.substr(f-24)},getDate:function(a){var d=a||(new Date).getTime();try{return(new Date(d)).getTime()}catch(f){return(new Date).getTime()}},getLayout:function(){return window.parent},getApp:function(){var a=iNet.getLayout(),d=null;if(a&& a.iNet)d=a.iNet.APP;return d},getSize:function(a){var d=0,f;if(iNet.isArray(a))d=a.length;else if(iNet.isObject(a))for(f in a)a.hasOwnProperty(f)&&d++;else d=a.length;return d},getCurrency:function(a){var d=iNet.lang||iNet.language,f=a.toString().split(".");f[0]=f[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,");var h=f.join(".");switch(d){case "en":return String.format("{0} USD",h);default:return String.format("{0} VND",h)}},valueFrom:function(a,d,f){return iNet.isEmpty(a,f)?d:a},emptyFn:function(){}, pass:function(a,d,f){iNet.isArray(d)||(d=iNet.isIterable(d)?iNet.Array.clone(d):d!==undefined?[d]:[]);return function(){var h=d.slice();h.push.apply(h,arguments);return a.apply(f||this,h)}},override:function(a,d){if(d){var f=a.prototype;iNet.apply(f,d);if(iNet.isIE&&d.toString!=a.toString)f.toString=d.toString}},extend:function(){var a=function(f){for(var h in f)this[h]=f[h]},d=Object.prototype.constructor;return function(f,h,j){if(iNet.isObject(h)){j=h;h=f;f=j.constructor!=d?j.constructor:function(){h.apply(this, arguments)}}var n=function(){},r=h.prototype;n.prototype=r;n=f.prototype=new n;n.constructor=f;f.superclass=r;if(r.constructor==d)r.constructor=h;f.override=function(u){iNet.override(f,u)};n.superclass=n.supr=function(){return r};n.override=a;iNet.override(f,j);f.extend=function(u){iNet.extend(f,u)};return f}}(),getIconByAppName:function(a,d){if(iNet.isEmpty(d)||iNet.isEmpty(a))throw Error("Domain or application name must not empty");var f=new URL(d),h=a.toLowerCase()+".png";return f.origin+f.pathname.substring(0, f.pathname.indexOf("/",2))+"/images/"+h},loadScript:function(a,d){var f=document.createElement("script");f.type="text/javascript";f.src=a;if(f.readyState)f.onreadystatechange=function(){var h=this.readyState;if(h==="loaded"||h==="complete"){f.onreadystatechange=null;d()}};else f.onload=d;document.getElementsByTagName("head")[0].appendChild(f)}});iNet.ns=iNet.namespace})(); iNet.Url={encode:function(b){return escape(this._utf8_encode(b))},decode:function(b){return this._utf8_decode(unescape(b))},_utf8_encode:function(b){b=b.replace(/\r\n/g,"\n");for(var c="",e=0;e<b.length;e++){var g=b.charCodeAt(e);if(g<128)c+=String.fromCharCode(g);else{if(g>127&&g<2048)c+=String.fromCharCode(g>>6|192);else{c+=String.fromCharCode(g>>12|224);c+=String.fromCharCode(g>>6&63|128)}c+=String.fromCharCode(g&63|128)}}return c},_utf8_decode:function(b){for(var c="",e=0,g=0,i=0,k=0;e<b.length;){g= b.charCodeAt(e);if(g<128){c+=String.fromCharCode(g);e++}else if(g>191&&g<224){i=b.charCodeAt(e+1);c+=String.fromCharCode((g&31)<<6|i&63);e+=2}else{i=b.charCodeAt(e+1);k=b.charCodeAt(e+2);c+=String.fromCharCode((g&15)<<12|(i&63)<<6|k&63);e+=3}}return c}}; iNet.Template={parse:function(b,c){var e=document.getElementById(b),g=function(k){return k};if(iNet.isFunction(e.converter))g=e.converter;var i=g(c);return e.innerHTML.toString().replace(/{(\w+)}/g,function(k,l){return typeof i[l]!=="undefined"?i[l]:""})}}; iNet.apply(Function.prototype,{createInterceptor:function(b,c){var e=this;return!iNet.isFunction(b)?this:function(){var g=arguments;b.target=this;b.method=e;return b.apply(c||this||window,g)!==false?e.apply(this||window,g):null}},createCallback:function(){var b=arguments,c=this;return function(){return c.apply(window,b)}},createDelegate:function(b,c,e){var g=this;return function(){var i=c||arguments;if(e===true){i=Array.prototype.slice.call(arguments,0);i=i.concat(c)}else if(iNet.isNumber(e)){i=Array.prototype.slice.call(arguments, 0);var k=[e,0].concat(c);Array.prototype.splice.apply(i,k)}return g.apply(b||window,i)}},defer:function(b,c,e,g){c=this.createDelegate(c,e,g);if(b>0)return setTimeout(c,b);c();return 0}});iNet.PluginManager={bindEvent:function(b,c,e){if(b.addEventListener)b.addEventListener(c,e,false);else b.attachEvent&&b.attachEvent("on"+c,e)},sendMessageTo:function(b,c){c=c||window.parent;c.postMessage(b,"*")},sendMessage:function(b){iNet.PluginManager.sendMessageTo(b,window.parent)}}; iNet.applyIf(String,{format:function(b){var c=iNet.toArray(arguments,1);return b.replace(/\{(\d+)\}/g,function(e,g){return c[g]})},parseTemplate:function(b,c,e,g){var i=this,k=c,l=document.getElementById(b);b=l.getAttribute("data-converter");var m=l.getAttribute("data-fn");e||(e=l.getAttribute("data-keys").split("|"));if(b&&iNet.isFunction(l[b]))b=l[b];if(g&&iNet.isFunction(g))b=g;else if(m)g=m.split("|");if(iNet.isFunction(b))k=b(c);return l.innerHTML.replace(/\{(\d+)\}/g,function(o,q){if(g)if(g[q]&& iNet.isFunction(l[g[q]]))return l[g[q]].call(i,k[e[q]]||"",k,e[q]);return k[e[q]]||""})},trim:function(){return this.replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,"")},startsWith:function(b){return this.match("^"+b)==b},endsWith:function(b){return this.match(b+"$")==b}}); iNet.applyIf(String.prototype,{escapeHtml:function(){return this.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},unEscapeHtml:function(){return this.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')},replaceBreak:function(){return this.replace(/\r\n|\r|\n/g,"<br />")},capitalize:function(){return this.charAt(0).toUpperCase()+this.slice(1)},removeAccents:function(){var b=["\u00e0","\u00e1","\u1ea1","\u1ea3","\u00e3","\u00e2", "\u1ea7","\u1ea5","\u1ead","\u1ea9","\u1eab","\u0103","\u1eb1","\u1eaf","\u1eb7","\u1eb3","\u1eb5","\u00e8","\u00e9","\u1eb9","\u1ebb","\u1ebd","\u00ea","\u1ec1","\u1ebf","\u1ec7","\u1ec3","\u1ec5","\u00ec","\u00ed","\u1ecb","\u1ec9","\u0129","\u00f2","\u00f3","\u1ecd","\u1ecf","\u00f5","\u00f4","\u1ed3","\u1ed1","\u1ed9","\u1ed5","\u1ed7","\u01a1","\u1edd","\u1edb","\u1ee3","\u1edf","\u1ee1","\u00f9","\u00fa","\u1ee5","\u1ee7","\u0169","\u01b0","\u1eeb","\u1ee9","\u1ef1","\u1eed","\u1eef","\u1ef3", "\u00fd","\u1ef5","\u1ef7","\u1ef9","\u0111","\u00c0","\u00c1","\u1ea0","\u1ea2","\u00c3","\u00c2","\u1ea6","\u1ea4","\u1eac","\u1ea8","\u1eaa","\u0102","\u1eb0","\u1eae","\u1eb6","\u1eb2","\u1eb4","\u00c8","\u00c9","\u1eb8","\u1eba","\u1ebc","\u00ca","\u1ec0","\u1ebe","\u1ec6","\u1ec2","\u1ec4","\u00cc","\u00cd","\u1eca","\u1ec8","\u0128","\u00d2","\u00d3","\u1ecc","\u1ece","\u00d5","\u00d4","\u1ed2","\u1ed0","\u1ed8","\u1ed4","\u1ed6","\u01a0","\u1edc","\u1eda","\u1ee2","\u1ede","\u1ee0","\u00d9", "\u00da","\u1ee4","\u1ee6","\u0168","\u01af","\u1eea","\u1ee8","\u1ef0","\u1eec","\u1eee","\u1ef2","\u00dd","\u1ef4","\u1ef6","\u1ef8","\u0110"],c=["a","a","a","a","a","a","a","a","a","a","a","a","a","a","a","a","a","e","e","e","e","e","e","e","e","e","e","e","i","i","i","i","i","o","o","o","o","o","o","o","o","o","o","o","o","o","o","o","o","o","u","u","u","u","u","u","u","u","u","u","u","y","y","y","y","y","d","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","A","E","E","E","E","E", "E","E","E","E","E","E","I","I","I","I","I","O","O","O","O","O","O","O","O","O","O","O","O","O","O","O","O","O","U","U","U","U","U","U","U","U","U","U","U","Y","Y","Y","Y","Y","D"];return this.replace(/[^\u0000-\u007E]/g,function(e){var g=b.indexOf(e);return g<0?e:c[g]})},replaceSpace:function(b){return this.replace(/ /g,b||"-")},cutStr:function(b){var c=this.split(" "),e="";b-=3;for(var g=0;g<c.length;g++){var i=e+(e.length>0?" ":"")+c[g];if(i.length<=b)e=i;else break}return e+(this.length>b?"...": "")}}); Date.replaceChars={shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longMonths:["January","February","March","April","May","June","July","August","September","October","November","December"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d:function(){return(this.getDate()<10?"0":"")+this.getDate()},D:function(){return Date.replaceChars.shortDays[this.getDay()]},j:function(){return this.getDate()},l:function(){return Date.replaceChars.longDays[this.getDay()]}, N:function(){return this.getDay()+1},S:function(){return this.getDate()%10==1&&this.getDate()!=11?"st":this.getDate()%10==2&&this.getDate()!=12?"nd":this.getDate()%10==3&&this.getDate()!=13?"rd":"th"},w:function(){return this.getDay()},z:function(){return"Not Yet Supported"},W:function(){return"Not Yet Supported"},F:function(){return Date.replaceChars.longMonths[this.getMonth()]},m:function(){return(this.getMonth()<9?"0":"")+(this.getMonth()+1)},M:function(){return Date.replaceChars.shortMonths[this.getMonth()]}, n:function(){return this.getMonth()+1},t:function(){return"Not Yet Supported"},L:function(){return this.getFullYear()%4==0&&this.getFullYear()%100!=0||this.getFullYear()%400==0?"1":"0"},o:function(){return"Not Supported"},Y:function(){return this.getFullYear()},y:function(){return(""+this.getFullYear()).substr(2)},a:function(){return this.getHours()<12?"am":"pm"},A:function(){return this.getHours()<12?"AM":"PM"},B:function(){return"Not Yet Supported"},g:function(){return this.getHours()%12||12},G:function(){return this.getHours()}, h:function(){return((this.getHours()%12||12)<10?"0":"")+(this.getHours()%12||12)},H:function(){return(this.getHours()<10?"0":"")+this.getHours()},i:function(){return(this.getMinutes()<10?"0":"")+this.getMinutes()},s:function(){return(this.getSeconds()<10?"0":"")+this.getSeconds()},e:function(){return"Not Yet Supported"},I:function(){return"Not Supported"},O:function(){return(-this.getTimezoneOffset()<0?"-":"+")+(Math.abs(this.getTimezoneOffset()/60)<10?"0":"")+Math.abs(this.getTimezoneOffset()/60)+ "00"},P:function(){return(-this.getTimezoneOffset()<0?"-":"+")+(Math.abs(this.getTimezoneOffset()/60)<10?"0":"")+Math.abs(this.getTimezoneOffset()/60)+(Math.abs(this.getTimezoneOffset()%60)<10?"0":"")+Math.abs(this.getTimezoneOffset()%60)},T:function(){var b=this.getMonth();this.setMonth(0);var c=this.toTimeString().replace(/^.+ \(?([^\)]+)\)?$/,"$1");this.setMonth(b);return c},Z:function(){return-this.getTimezoneOffset()*60},c:function(){return this.format("Y-m-d")+"T"+this.format("H:i:sP")},r:function(){return this.toString()}, U:function(){return this.getTime()/1E3}};Date.prototype.format=function(b){for(var c="",e=Date.replaceChars,g=0;g<b.length;g++){var i=b.charAt(g);c+=e[i]?e[i].call(this):i}return c};Date.prototype.getDayOfYear=function(){var b=new Date(this.getFullYear(),0,0);b=new Date(this.getFullYear(),this.getMonth(),this.getDate())-b;return Math.ceil(b/864E5)};Date.prototype.getWeek=function(){var b=new Date(this.getFullYear(),0,0),c=this.getDayOfYear();return Math.ceil((c+b.getDay()+1)/7)}; Date.prototype.getWeekOfMonth=function(){var b=(new Date(this.getFullYear(),this.getMonth(),1)).getDay();return Math.ceil((this.getDate()+b)/7)};Date.prototype.getDateByDayOfYear=function(b){var c=this.getFullYear();return new Date((new Date(c,0)).setDate(b||0))}; iNet.JSON={encode:function(b){if(typeof JSON=="object"&&JSON.stringify)return JSON.stringify(b);var c=typeof b;if(b===null)return"null";if(c!="undefined"){if(c=="number"||c=="boolean")return b+"";if(c=="string")return this.quoteString(b);if(c=="object"){if(typeof b.toJSON=="function")return this.encode(b.toJSON());if(b.constructor===Date){var e=b.getUTCMonth()+1;if(e<10)e="0"+e;c=b.getUTCDate();if(c<10)c="0"+c;var g=b.getUTCFullYear(),i=b.getUTCHours();if(i<10)i="0"+i;var k=b.getUTCMinutes();if(k< 10)k="0"+k;var l=b.getUTCSeconds();if(l<10)l="0"+l;b=b.getUTCMilliseconds();if(b<100)b="0"+b;if(b<10)b="0"+b;return'"'+g+"-"+e+"-"+c+"T"+i+":"+k+":"+l+"."+b+'Z"'}if(b.constructor===Array){e=[];for(c=0;c<b.length;c++)e.push(this.encode(b[c])||"null");return"["+e.join(",")+"]"}c=[];for(e in b){g=typeof e;if(g=="number")g='"'+e+'"';else if(g=="string")g=this.quoteString(e);else continue;if(typeof b[e]!="function"){i=this.encode(b[e]);c.push(g+":"+i)}}return"{"+c.join(", ")+"}"}}},decode:function(b){if(typeof JSON== "object"&&JSON.parse)return JSON.parse(b);return eval("("+b+")")},decodeSecure:function(b){if(typeof JSON=="object"&&JSON.parse)return JSON.parse(b);var c=b;c=c.replace(/\\["\\\/bfnrtu]/g,"@");c=c.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");c=c.replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(c))return eval("("+b+")");else throw new SyntaxError("Error parsing JSON, source is not valid.");},quoteString:function(b){if(b.match(this._escapeable))return'"'+ b.replace(this._escapeable,function(c){var e=this._meta[c];if(typeof e==="string")return e;e=c.charCodeAt();return"\\u00"+Math.floor(e/16).toString(16)+(e%16).toString(16)})+'"';return'"'+b+'"'},_escapeable:/["\\\x00-\x1f\x7f-\x9f]/g,_meta:{"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}}; iNet.Base64={_keyString:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(b){if(iNet.isEmpty(b))return"";b=escape(b);var c="",e,g,i="",k,l,m="",o=0;do{e=b.charCodeAt(o++);g=b.charCodeAt(o++);i=b.charCodeAt(o++);k=e>>2;e=(e&3)<<4|g>>4;l=(g&15)<<2|i>>6;m=i&63;if(isNaN(g))l=m=64;else if(isNaN(i))m=64;c=c+this._keyString.charAt(k)+this._keyString.charAt(e)+this._keyString.charAt(l)+this._keyString.charAt(m)}while(o<b.length);return c},decode:function(b){if(iNet.isEmpty(b))return""; var c="",e,g,i="",k,l="",m=0;if(/[^A-Za-z0-9\+\/\=]/g.exec(b))throw Error("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding.");b=b.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=this._keyString.indexOf(b.charAt(m++));g=this._keyString.indexOf(b.charAt(m++));k=this._keyString.indexOf(b.charAt(m++));l=this._keyString.indexOf(b.charAt(m++));e=e<<2|g>>4;g=(g&15)<<4|k>>2;i=(k&3)<<6|l;c+=String.fromCharCode(e);if(k!= 64)c+=String.fromCharCode(g);if(l!=64)c+=String.fromCharCode(i)}while(m<b.length);return unescape(c)},encodeObject:function(b){if(iNet.isEmpty(b))return"";return this.encode(iNet.JSON.encode(b))},decodeObject:function(b){if(iNet.isEmpty(b))return{};return iNet.JSON.decode(this.decode(b))},isBase64:function(b){return/^(?:[A-Z0-9+\/]{4})*(?:[A-Z0-9+\/]{2}==|[A-Z0-9+\/]{3}=|[A-Z0-9+\/]{4})$/i.test(b)}}; iNet.ns("iNet.ui","iNet.ui.common","iNet.ui.form","iNet.ui.dialog","iNet.ui.grid","iNet.resources.message","iNet.resources.grid");iNet.Component=function(){}; iNet.Component.prototype={on:function(b,c){this.events=this.events||{};if(!iNet.isEmpty(b)&&iNet.isFunction(c)){var e=c||iNet.emptyFn;this.events[b]=e}return true},un:function(b){this.events=this.events||{};iNet.isEmpty(b)||delete this.events[b];return true},hasEvent:function(b){this.events=this.events||{};return iNet.isFunction(this.events[b])},fireEvent:function(){this.events=this.events||{};var b=iNet.toArray(arguments);if(!(b.length<1)){var c=this.events[b[0].toLowerCase()]||iNet.emptyFn;b.shift(); c.apply(this,b)}}}; window.$&&$(function(){iNet.ui.Widget=function(b){var c=b||{};this.$element=this.$element&&this.$element.length>0?this.$element:$(String.format("#{0}",this.id));iNet.apply(this,c);if(this.$element.length<1)throw Error("Widget $element must not be null");};iNet.extend(iNet.ui.Widget,iNet.Component,{constructor:iNet.ui.Widget,setParent:function(b){this.parent=b},getParent:function(){return this.parent},getEl:function(){return this.$element||$()},getMask:function(){return this.getEl()},show:function(){this.getEl().removeClass("hide").show(); this.fireEvent("shown",this,this.getParent())},hide:function(){this.getEl().hide();this.fireEvent("hide",this,this.getParent())},getId:function(){return this.getEl().prop("id")},isWidget:function(){return true},isVisible:function(){return this.getEl().is(":visible")},isHidden:function(){return this.getEl().is(":hidden")},destroy:function(){this.getEl().remove();delete this}})});