if(typeof (JSON)=="undefined"){JSON=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=function(){return this};Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()};var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapeable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==="string"){return c}return"\\u"+("0000"+(+(a.charCodeAt(0))).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&"toJSON" in value&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}return{quotedForm:quote,stringify:function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})},parse:function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+(+(a.charCodeAt(0))).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}()}Array.prototype.indexOf=function(D,B){for(var C=0,A=this.length;C<A;C++){if(B?B(this[C],D):(this[C]==D)){return C}}return -1};Array.prototype.indexOfKey=function(D,F,E){for(var C=0,A=this.length;C<A;C++){var B=this[C];if(B){B=B[D]}if(B&&(E?(E(B,F)==0):(B==F))){return C}}return -1};Array.prototype.find=function(E,C){for(var D=0,B=this.length;D<B;D++){var A=this[D];if(C?C(A,E):(A==E)){return A}}return null};Array.prototype.map=function(F,B){var A=[];for(var C=0,D=this.length;C<D;C++){var E=F(this[C],C,this);if(E!=null||B){A[A.length]=E}}return A.concat.apply([],A)};Array.prototype.remove=function(D,B){var E=this.length;for(var C=E-1;C>=0;C--){var A=this[C];if(B?B(A,D):(A==D)){Array.prototype.splice.call(this,C,1);break}}return this};Array.prototype.moveItem=function(C,E){var A=null;if(C<E){var B=this.slice(0,E);var D=B.splice(C,1);A=B.concat(D,this.slice(E))}else{if(C>E){var D=this.splice(C,1);A=this.slice(0,E).concat(D,this.slice(E))}else{A=[].concat(this)}}return A};Array.prototype.sortByKey=function(B,A){this.sort(function(F,D){var E=F&&F[B],G=D&&D[B];var C=E<G?-1:(E>G?1:0);if(A){C*=-1}return C});return this};if(!Array.prototype.filter){Array.prototype.filter=function(B,E){var A=this.length;if(typeof B!="function"){throw new TypeError()}var D=new Array();var E=arguments[1];for(var C=0;C<A;C++){if(C in this){var F=this[C];if(B.call(E,F,C,this)){D.push(F)}}}return D}}String.format=function(A){var B=arguments.length>1?Array.prototype.slice.call(arguments,1):[];return A.replace(/\{(\d+)\}/g,function(C,D){return B[D]})};String.jsEscape=function(A){if(!A){return A}var C="";for(var B=0;B<A.length;B++){var D=A.charAt(B);if(D=="\r"||D=="'"||D=="#"||D=='"'){C+="\\"}else{if(D=="\n"){C+="\\n\\"}}C+=D}return C};String.prototype.htmlUnescape=function(){var F=this;var E="";var B=F.length;for(var C=0;C<B;C++){var G=F.charAt(C);if(G!="&"){E+=G}else{if(C<=B-5&&F.substring(C,C+5)=="&amp;"){E+="&";C+=4}else{if(C<=B-4&&F.substring(C,C+4)=="&lt;"){E+="<";C+=3}else{if(C<=B-4&&F.substring(C,C+4)=="&gt;"){E+=">";C+=3}else{if(C<=B-6&&F.substring(C,C+6)=="&quot;"){E+='"';C+=5}else{if(C<B-1&&F.charAt(C+1)=="#"){var A=F.indexOf(";",C+1);var D=parseInt(F.substring(C+2,A));E+=String.fromCharCode(D);C=A}else{E+=G}}}}}}}return E};String.prototype.htmlEscape=function(){var C=13,E=10,H=9;var I={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","?":"&#63;"};var F="";for(var D=0;D<this.length;D++){var G=this.charAt(D);var A=I[G];if(!A){var B=this.charCodeAt(D);if(B>=32&&B<=127||B==C||B==E||B==H){A=G}else{A="&#"+B+";"}}F+=A}return F};String.htmlEscape=function(A){return A!=null&&typeof (A)!="undefined"?A.toString().htmlEscape():A};String.htmlUnescape=function(A){return A!=null&&typeof (A)!="undefined"?A.toString().htmlUnescape():A};String.prototype.trim=function(){if(this.length>0){var C,A;var B=" \t\r\n",D=this.length;for(C=0;C<D&&B.indexOf(this.charAt(C))>=0;C++){}for(A=D-1;A>=0&&B.indexOf(this.charAt(A))>=0;A--){}if(C<=A){return this.substring(C,A+1)}}return""};String.prototype.startsWith=function(B){if(this==B){return true}var A=Math.min(this.length,B.length);return B&&(this.substring(0,A)==B)};String.prototype.endsWith=function(B){var A=Math.min(this.length,B.length);return B&&(this.substring(this.length-A)==B)};String.prototype.replaceAll=function(C,B){var A=this.replace(new RegExp(C,"g"),B);return A};String.trim=function(A){return A?A.trim():null};String.startsWith=function(B,A){return B?B.startsWith(A):false};String.endsWith=function(B,A){return B?B.endsWith(A):false};Number.prototype.zeroPad=function(A){var D=this.toString();var B=D.length;for(var C=B;C<A;C++){D="0"+D}return D};Number.prototype.formatWithCommas=function(){var C=this.toString();var B="";var F=C.length;var D=C.indexOf(".");if(D>0){F=D;B=C.substring(D)}for(var E=F-1;E>=0;E--){var A=C.charAt(E);if((F-1-E)%3==0&&E<F-1&&E>=0){B=","+B}B=A+B}return B};Number.prototype.formatAsCurrency=function(G){var B=this;if(isNaN(B)){B=0}G=G||"$";var A=B<0;B=Math.floor((Math.abs(B)+0.005)*100)/100;var I=new String(B);var F=I.indexOf(".");var H=F>=0?I.substring(0,F):I;var C=F>=0?I.substring(F):"";var J="";for(var E=H.length-1,D=0;E>=0;E--,D++){J=((E>0&&D%3==2)?",":"")+H.charAt(E)+J}if(C==""){J+=".00"}else{if(C.length==2){J+=C+"0"}else{J+=C}}J=A?("("+G+J+")"):(G+J);return J};Date.MILLISECONDS_PER_DAY=86400000;Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.weekdayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Date.parseDate=function(E,F){var D=/^([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})( ([0-9]{1,2})(:([0-9]{1,2}))?(:([0-9]{1,2}))?( ?[ap]m)?)?$/i.exec(E);if(D&&D.length>=8){var C=parseInt(D[1],10),J=parseInt(D[2],10),K=parseInt(D[3],10);if(F){var G=J;J=C;C=G}C-=1;if(J>31||C>11){return null}if(D[4]){var M=parseInt(D[5],10),I=D[7]?parseInt(D[7],10):0,O=D[9]?parseInt(D[9],10):0;if(M>23||I>59||O>59){return null}if(D[10]&&M>12){return null}var L=D[10]&&D[10].toLowerCase().trim()=="pm"?"pm":"am";if(L=="pm"){M=M<12?(M+12):12}else{if(M==12){M=0}}return new Date(K,C,J,M,I,O)}return new Date(K,C,J)}var B=new Date(E);var A=B.getTime();if(!isNaN(A)){return B}var N=/^([0-9]{4})\-([0-9]{2})\-([0-9]{2})([ T]([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]{1,3})?)?Z?$/;var D=N.exec(E);if(D&&D.length>=8){var H=D[5]!=null;var O=H?String.format("{0}/{1}/{2} {3}:{4}:{5}",D[2],D[3],D[1],D[5],D[6],D[7]):String.format("{0}/{1}/{2}",D[2],D[3],D[1]);return new Date(O)}return null};Date.prototype.format=function(A){var B=this.getHours();var C={yyyy:this.getFullYear(),MM:(this.getMonth()+1).zeroPad(2),dd:this.getDate().zeroPad(2),HH:B.zeroPad(2),hh:(B>12?(B-12):B).zeroPad(2),mm:this.getMinutes().zeroPad(2),ss:this.getSeconds().zeroPad(2),a:B<=11?"am":"pm"};return A.replace(/(yyyy)|(MM)|(dd)|(HH)|(hh)|(mm)|(ss)|(a)/g,function(D){return C[D]})};Function.prototype.createDelegate=function(C,B,A){var D=this;return function(){var F=B||arguments;if(A===true){F=Array.prototype.slice.call(arguments,0);F=F.concat(B)}else{if(typeof A=="number"){F=Array.prototype.slice.call(arguments,0);var E=[A,0].concat(B);Array.prototype.splice.apply(F,E)}}return D.apply(C||window,F)}};if(typeof (sf)=="undefined"){sf={App:{},core:{},data:{},util:{}}}sf.extend=function(A,C,B){var D=function(){};D.prototype=C.prototype;A.prototype=new D();A.prototype.constructor=A;A.superclass=C.prototype;if(C.prototype.constructor==Object.prototype.constructor){C.prototype.constructor=C}if(B){for(var E in B){A[E]=B[E]}}};sf.override=function(A,B,C){if(typeof (C)=="function"){C.super_=A[B];A[B]=C}};sf.doEval=function(aString){eval("__evalResult = "+aString);return __evalResult};sf.util.isPrimitiveType=function(A){var B=typeof (A);return B!="string"&&B!="number"&&B!="boolean"&&!(B instanceof Date)};sf.util.sort=function(B,A){if(B&&B instanceof Array&&B.length>=2){if(A){B.sort(A)}else{var C=B[0];if(C instanceof Date){B.sort(function(G,F){var E=G?G.getTime():0,D=F?F.getTime():0;return E<D?-1:(E==D?0:1)})}else{B.sort()}}}return B};sf.util.StringWriter=function(){var A=[];this.write=function(B){if(typeof (B)!="undefined"&&B!=null){A.push(typeof (B)=="string"?B:B.toString())}return this};this.toString=function(){return A.join("")};this.reset=function(){A=[];return this}};sf.util.writeJSON=function(G,M,I){var A=typeof (I)=="string";var K=G;var C=typeof (K);if(K&&typeof (K.getClass)=="function"){var H=String(K.getClass().getName());if(H=="java.lang.String"){C="string"}else{if(H=="java.lang.Double"||H=="java.lang.Float"||H=="java.math.BigDecimal"){K=new Number(K.doubleValue());C="number"}else{if(H=="java.lang.Integer"||H=="java.lang.Long"||H=="java.math.BigInteger"){K=new Number(K.longValue());C="number"}}}}switch(String(C)){case"string":M.write(JSON.quotedForm(String(K)));break;case"number":case"boolean":case"null":M.write(K);break;case"object":default:if(!K){M.write("null");return"null"}if("writeJSON" in K&&typeof (K.writeJSON)=="function"){K.writeJSON(M,A?(I+"    "):undefined)}else{if(K instanceof Date){M.write('"'+K.format("yyyy-MM-dd HH:mm:ss")+'"');C="date"}else{if(K instanceof Array||typeof (K.length)==="number"&&!(K.propertyIsEnumerable("length"))){M.write("[");var J=A&&K.length>=1&&typeof (K[0])=="object";if(J){M.write("\n")}for(var E=0,B=K.length;E<B;E++){if(J){M.write(I+"    ")}sf.util.writeJSON(K[E],M,A?(I+"    "):undefined);if(E<B-1){M.write(","+(A?" ":""))}M.write(J?"\n":" ")}M.write(J?I:"");M.write("]");C="array"}else{var F=function(N){var P=0;for(var O in N){var Q=typeof (N[O]);if(Object.hasOwnProperty.call(N,O)&&sf.util.isPrimitiveType(N[O])){return false}P++;if(P>8){return false}}return true};var L=A&&!F(K);M.write("{");if(L){M.write("\n")}var D=0;for(k in K){if(Object.hasOwnProperty.call(K,k)&&typeof (K[k])!=="function"){if(L){M.write(I+"    ")}D++;if(D>1){M.write(","+(A?" ":""))}M.write(JSON.quotedForm(String(k))+":"+(A?" ":""));sf.util.writeJSON(K[k],M,A?(I+"    "):undefined);if(L){M.write("\n")}}}M.write((L?I:"")+"}");C="object"}}}}return C};sf.util.toJSONString=function(A,C){var B=new sf.util.StringWriter();sf.util.writeJSON(A,B,C);return B.toString()};sf.util.parseCSV=function(L,K,A){K=K||",";A=A||'"';var C=new RegExp(String.format("([{0}\015\012] *)",K),"g");var H=new RegExp(String.format("({0}{0})*{0}([{1}\015\012] *)",A,K),"g");var N=0;var D=[],B=[];function O(P){if(P.length>1||P.length>0&&P[0]!=""){D.push(P)}}do{var G=(L.charAt(N)==A)?H:C;G.lastIndex=N;var M=G.exec(L);if(!M||!M.length){break}var J=G.lastIndex-M[M.length-1].length;var I=L.substring(N,J);if(I.charAt(0)==A){I=I.substring(1,I.length-1).replaceAll(A+A,A)}else{I=I.trim()}B.push(I);var F=M[0];if(F.indexOf(K)<0){O(B);B=[]}N=G.lastIndex;if(L.charAt(N)=="\n"&&F=="\r"){N++}}while(true);if(N<L.length){var E=L.substring(N).trim();if(E){B.push(E)}}O(B);return D};sf.util.ArrayOfMaps=function(C,B){if(typeof (C)!="string"){throw"ArrayOfMaps: Constructor expects a string as first argument, but found "+typeof (C)}var D=C;this.push=function(F){if(!F||typeof (F[D])=="undefined"){throw"ArrayOfMaps.push: cannot find key field named '"+_keyName+"'"}Array.prototype.push.call(this,F);this[F[C]]=B[A];return this};this.concat=function(){return new sf.util.ArrayOfMaps(_keyName,Array.prototype.concat.apply(this,arguments))};this.pop=function(){var F=Array.prototype.pop.call(this);delete this[F[D]];return F};this.shift=function(){var F=Array.prototype.shift.call(this);delete this[F[D]];return F};this.slice=function(){return new sf.util.ArrayOfMaps(_keyName,Array.prototype.slice.apply(this,arguments))};this.splice=function(){var H=new sf.util.ArrayOfMaps(_keyName,Array.prototype.splice.apply(this,arguments));var G=H?H.length:0;for(var F=0;F<G;F++){delete this[H[j][D]]}return H};this.unshift=function(){Array.prototype.unshift.apply(this,arguments);var H=arguments.length;for(var G=0;G<H;G++){var F=arguments[G];this[F[D]]=F}return this};this.indexOfKey=function(F){return this.indexOf(F,function(H,G){return H[D]==G})};for(var A=0,E=B?B.length:0;A<E;A++){this.push(B[A])}};sf.util.ArrayOfMaps.prototype=new Array();sf.data.PhoneNumber=function(B,C,E,H){var D=String.trim(C);var G=String.trim(E);var F=String.trim(B)||"1";var A=String.trim(H);if(F=="1"&&/^[0-9]{7}$/.test(G)){G=G.substring(0,3)+"-"+G.substring(3)}this.areaCode=function(){return D};this.number=function(){return G};this.countryCode=function(){return F};this.extension=function(){return A};this.isNorthAmerican=function(){return(!F||F=="1")&&/^[0-9]{3}$/.test(D)&&/^[0-9]{3}-[0-9]{4}$/.test(G)};this.toString=function(){var I=(D?("("+D+") "):"")+(G||"")+(A?(" x "+A):"");return(!F||F=="1")?I:String.format("+{0} {1}",F,I)}};sf.data.PhoneNumber.buildFrom=function(B,D){if(!B){return new sf.data.PhoneNumber(null,null,B)}B=B.trim();if(B.startsWith("+")){var E=B.substring(1).split(/[^\d]+/);if(E[0]!="1"){return new sf.data.PhoneNumber(E[0],E[1],E[2],E[3])}}var A=/^(\+?1[ \-\.])?\(?([0-9]{3})\)? *[\-\.]?([0-9]{3}) *[\-\.]?([0-9]{4})( *[ x] *([0-9]+))?$/;var E=A.exec(B);if(E&&E.length){return new sf.data.PhoneNumber("1",String.trim(E[2]),E[3]+"-"+E[4],E[6])}A=/^(\+?1[ \-\.])?\(?([0-9]{3})\)? *[\-\.]?([0-9]+)( *[ x] *([0-9]+))?$/;var E=A.exec(B);if(E&&E.length){return new sf.data.PhoneNumber("1",String.trim(E[2]),E[3],E[5])}var F=/^\+([0-9]+)[ \-\.] *([0-9]+)[ \-\.]*([0-9]*)( *[ x] *([0-9]+))?$/;E=F.exec(B);if(E&&E.length){function C(H,G){return H&&G?(H+G):(H?H:G)}return new sf.data.PhoneNumber(E[1],C(E[2],E[3]),E[5])}return new sf.data.PhoneNumber(null,null,B)};sf.data.TypeInfo={DEFAULT_DATE_FORMAT:"MM/dd/yyyy",typeNames:function(){if(!this._names){this._names=[];for(var A in this._desc){this._names.push(A)}}return this._names},comparisonOperators:function(A){if(A=="phone"||A=="emailAddress"||A=="url"||A=="imageUrl"||A=="text"){return this._desc.string.compareOps}var B=this._desc[A];return B&&B.compareOps||sf.data.TypeInfo._defaultComparisonOps},label:function(A){if(A=="text"){return"Text"}var B=this._desc[A];return B&&B.label||A},_defaultColWidthPx:{date:80,datetime:120,picklist:80,number:60,integer:60,currency:60,timeofday:60,phone:120,emailAddress:120,url:40,imageUrl:40,"boolean":40,duration:40},defaultColWidthPx:function(A){return sf.data.TypeInfo._defaultColWidthPx[A]||120},converter:function(A){if(A=="text"){A="string"}var B=this._desc[A];return B&&B.converter},comparator:function(A){var B=null;switch(A){case"picklist":case"reference":B=function(F,E){var D=F instanceof Array&&F.length>=2?F[1]:(F?F.toString():null);var C=E instanceof Array&&E.length>=2?E[1]:(E?E.toString():null);return D<C?-1:(D==C?0:1)};break;default:B=function(D,C){return D<C?-1:(D>C?1:0)};break}return B},htmlFormatter:function(A){if(A=="text"){A="string"}var B=this._desc[A];return B?B.toHTML:(function(C){return C})},toHTML:function(A,B){if(A=="text"){A="string"}var C=this._desc[A];return C?C.toHTML(B):String(B)},toString:function(A,B){if(A=="text"){A="string"}var C=this._desc[A];return C?C.toString(B):String(B)},_desc:{string:{label:"String",compareOps:[{value:"starts with",text:"starts with"},{value:"ends with",text:"ends with"},{value:"eq",text:"equals"},{value:"lt",text:"less than"},{value:"le",text:"at most"},{value:"ge",text:"at least"},{value:"gt",text:"greater than"},{value:"ne",text:"not equal to"},{value:"contains",text:"contains"},{value:"does not contain",text:"does not contain"},{value:"does not start with",text:"does not start with"},{value:"does not end with",text:"does not end with"},{value:"is null",text:"is empty"},{value:"is not null",text:"is not empty"}],converter:function(A){return A!=null?A.toString().trim():null},toHTML:function(A){return A==null?"":String(A)},toString:function(A){return A==null?"":String(A)}},currency:{label:"Currency",converter:function(B){if(typeof (B)!="string"){return typeof (B)=="number"?B:null}var A=B.toString();if(/^\-?\$?[0-9,]+(\.[0-9]*)?$/.test(A)){A=A.replaceAll(",","").replace("$","");return A.indexOf(".")>=0?parseFloat(A,10):parseInt(A,10)}return null},toHTML:function(A){return sf.data.TypeInfo.toString("currency",A)},toString:function(A){if(A==null){return""}if(typeof (A)=="string"){A=A.trim();if(A==""){return""}A=parseFloat(A)}return !isNaN(A)&&typeof (A)=="number"?A.formatAsCurrency():A}},number:{label:"Fractional number",converter:function(A){if(typeof (A)=="string"&&/^\-?[0-9,]+(\.[0-9]*)?$/.test(A.toString())){A=A.replaceAll(",","");return A.indexOf(".")>=0?parseFloat(A,10):parseInt(A,10)}return typeof (A)=="number"?A:null},toHTML:function(A){return sf.data.TypeInfo.toString("number",A)},toString:function(A){if(A==null){return""}return typeof (A)=="number"?A.formatWithCommas():String(A)}},integer:{label:"Whole number",converter:function(A){if(typeof (A)=="string"&&/^\-?[0-9,]+$/.test(A.toString())){return parseInt(A.replaceAll(",",""),10)}return typeof (A)=="number"?A:null},toHTML:function(A){return sf.data.TypeInfo.toString("integer",A)},toString:function(A){if(typeof (A)=="undefined"||A==null){return""}return typeof (A)=="number"?A.toString():A}},date:{label:"Date",compareOps:[{value:"eq",text:"equals"},{value:"lt",text:"earlier than"},{value:"le",text:"not later than"},{value:"ge",text:"not earlier than"},{value:"gt",text:"later than"},{value:"ne",text:"not equal to"},{value:"is null",text:"is empty"},{value:"is not null",text:"is not empty"}],converter:function(A){var B=Date.parseDate(A,sf.data.TypeInfo.DEFAULT_DATE_FORMAT);return B!=null?B:null},toHTML:function(A){return sf.data.TypeInfo.toString("date",A)},toString:function(A){if(A==null){return""}return(A&&typeof (A.format)=="function")?A.format(sf.data.TypeInfo.DEFAULT_DATE_FORMAT):A}},datetime:{label:"Date & time",compareOps:[{value:"eq",text:"equals"},{value:"lt",text:"earlier than"},{value:"le",text:"not later than"},{value:"ge",text:"not earlier than"},{value:"gt",text:"later than"},{value:"ne",text:"not equal to"},{value:"is null",text:"is empty"},{value:"is not null",text:"is not empty"}],converter:function(A){var B=Date.parseDate(A,sf.data.TypeInfo.DEFAULT_DATE_FORMAT);return B!=null?B:null},toHTML:function(A){return sf.data.TypeInfo.toString("datetime",A)},toString:function(A){if(typeof (A)=="undefined"||A==null){return""}return(A&&typeof (A.format)=="function")?A.format(sf.data.TypeInfo.DEFAULT_DATE_FORMAT+" hh:mm a"):A}},timeofday:{label:"Time of day",converter:function(G){var E=new RegExp("^([0-9]{1,2})(:[0-9]{1,2})?(:[0-9]{1,2})? *(am|pm)?$","i");var F=E.exec(G);if(F){var D=0,B=0,C=0,A=false;D=parseInt(F[1],10);if(F[2]){B=parseInt(F[2].substring(1),10)}if(F[3]){C=parseInt(F[3].substring(1),10)}if(F[4]){A=F[4].toLowerCase()=="pm"}if(A){if(D>=13){return null}D+=12}return D<24&&B<60&&C<60?(D*3600+B*60+C):null}return null},toHTML:function(A){return sf.data.TypeInfo.toString("timeofday",A)},toString:function(A){return sf.data.TypeInfo.htmlFormatter("duration")(A)}},duration:{label:"Duration",converter:function(B){if(B){B=B.trim()}var D=0,A=0,C=0;var E=/^([0-9]{1,2})(:[0-9]{1,2})(:[0-9]{1,2})?$/.exec(B);if(E){D=parseInt(E[1],10);A=parseInt(E[2].substring(1),10);if(E[3]){C=parseInt(E[3].substring(1),10)}return A<60&&C<60?(D*3600+A*60+C):null}E=/^([0-9]{1,2}h)?( *[0-9]{1,2}m)?( *[0-9]{1,2}s)?$/.exec(B);if(E){if(E[1]){D=parseInt(E[1])}if(E[2]){A=parseInt(E[2].trim())}if(E[3]){C=parseInt(E[3].trim())}return A<60&&C<60?(D*3600+A*60+C):null}return sf.data.TypeInfo.converter("number")(B)},toHTML:function(A){return sf.data.TypeInfo.toString("duration",A)},toString:function(E){if(E==null){return""}if(typeof (E)=="string"){var B=parseInt(E,10);if(isNaN(B)){return E}E=B}if(typeof (E)=="number"){var D=Math.floor(E/3600);var A=Math.floor((E%3600)/60);var C=E%60;return String.format("{0}:{1}:{2}",D.zeroPad(2),A.zeroPad(2),C.zeroPad(2))}return E}},phone:{label:"Phone number",converter:function(B){var A=sf.data.PhoneNumber.buildFrom(B);return A!=null?A:null},toHTML:function(A){return sf.data.TypeInfo.toString("phone",A)},toString:function(A){return A?A.toString():""}},emailAddress:{label:"Email address",converter:function(A){var B=/^[a-z0-9_\-\+\.]+@[a-z0-9_\-\+\.]+\.[a-z]{2,4}$/i;return B.test(A)?A:null},toHTML:function(A){return sf.data.TypeInfo.toString("emailAddress",A)},toString:function(A){return A?A.toString():""}},url:{label:"Web URL",converter:function(B){var A=new RegExp("(http(s)?://)?[w:.-/]+","i");return A.test(B)?B:null},toString:function(A){if(!value||typeof (value)!="string"){return""}if(!value.startsWith("http://")&&!value.startsWith("https://")){value="http://"+value}return value},toHTML:function(A){if(!A||typeof (A)!="string"){return""}if(!A.startsWith("http://")&&!A.startsWith("https://")){A="http://"+A}return String.format('<a title="{0} (opens in new window)" class="sf-weblink" href="{0}" target="_blank">&nbsp;</a>',A)}},imageUrl:{label:"URL for image",converter:function(B){var A=new RegExp("(http(s)?://)?[w:.-/]+","i");return A.test(B)?B:null},toString:function(A){if(!A||typeof (A)!="string"){return""}if(!A.startsWith("http://")&&!A.startsWith("https://")){A="http://"+A}return A},toHTML:function(A){if(!A||typeof (A)!="string"){return""}if(!A.startsWith("http://")&&!A.startsWith("https://")){A="http://"+A}return String.format('<img src="{0}" class="sf-imageref" />',A)}},"boolean":{label:"Yes/No",compareOps:[{value:"eq",text:"is"}],converter:function(A){switch(typeof (A)){case"string":A=A.toLowerCase();return(A==="1"||A=="y"||A=="yes"||A=="true")?true:false;case"boolean":return A}return null},toString:function(A){return A?"1":""},toHTML:function(A){return A?'<span class="sf-boolean">&radic;</span>':""}},picklist:{label:"Picklist",compareOps:[{value:"in",text:"is"},{value:"not in",text:"is not"},{value:"is null",text:"is empty"},{value:"is not null",text:"is not empty"}],converter:function(A){return A},toString:function(A){if(!A){return""}if(A instanceof Array){return A.length>=2?A[1]:(A.length==1?A[0]:"")}return A},toHTML:function(A){return sf.data.TypeInfo.toString("picklist",A)}},reference:{label:"Reference",converter:function(A){return A},toHTML:function(A){return sf.data.TypeInfo.toString("reference",A)},toString:function(A){if(!A){return""}if(A instanceof Array){return A.length>=2?A[1]:(A.length==1?A[0]:"")}return null}}},_defaultComparisonOps:[{value:"lt",text:"less than"},{value:"le",text:"at most"},{value:"eq",text:"equals"},{value:"ge",text:"at least"},{value:"gt",text:"greater than"},{value:"ne",text:"not equal to"},{value:"is null",text:"is empty"},{value:"is not null",text:"is not empty"}],_names:null};