/*
 * Isomorphic SmartClient
 * Version v12.0p_2025-11-27 (2025-11-27)
 * Copyright(c) 1998 and beyond Isomorphic Software, Inc. All rights reserved.
 * "SmartClient" is a trademark of Isomorphic Software, Inc.
 *
 * licensing@smartclient.com
 *
 * http://smartclient.com/license
 */

if(window.isc&&window.isc.module_Core&&!window.isc.module_DataBinding){isc.module_DataBinding=1;isc._moduleStart=isc._DataBinding_start=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc._moduleEnd&&(!isc.Log||(isc.Log&&isc.Log.logIsDebugEnabled('loadTime')))){isc._pTM={message:'DataBinding load/parse time: '+(isc._moduleStart-isc._moduleEnd)+'ms',category:'loadTime'};if(isc.Log&&isc.Log.logDebug)isc.Log.logDebug(isc._pTM.message,'loadTime');else if(isc._preLog)isc._preLog[isc._preLog.length]=isc._pTM;else isc._preLog=[isc._pTM]}isc.definingFramework=true;if(window.isc&&isc.version!="v12.0p_2025-11-27/LGPL Development Only"&&!isc.DevUtil){isc.logWarn("SmartClient module version mismatch detected: This application is loading the core module from SmartClient version '"+isc.version+"' and additional modules from 'v12.0p_2025-11-27/LGPL Development Only'. Mixing resources from different SmartClient packages is not supported and may lead to unpredictable behavior. If you are deploying resources from a single package you may need to clear your browser cache, or restart your browser."+(isc.Browser.isSGWT?" SmartGWT developers may also need to clear the gwt-unitCache and run a GWT Compile.":""))}
isc.ClassFactory.defineClass("TextSettings");isc.A=isc.TextSettings;isc.A.DOUBLE="double";isc.A.BACKSLASH="backslash";isc.A=isc.TextSettings.getPrototype();isc.A.fieldList=null;isc.A.fieldSeparator=",";isc.A.lineSeparator=null;isc.A.escapingMode=isc.TextSettings.BACKSLASH;isc.A=isc.TextSettings.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getEscapingModeEscapeChar=function isc_TextSettings_getEscapingModeEscapeChar(){switch(this.escapingMode){case isc.TextSettings.DOUBLE:return"\"";break;case isc.TextSettings.BACKSLASH:return"\\";break}
return""});isc.B._maxIndex=isc.C+1;isc.ClassFactory.defineClass("TextExportSettings","TextSettings");isc.A=isc.TextExportSettings;isc.A.LEADING_SPACE="leadingSpace";isc.A.FORMULA="formula";isc.A=isc.TextExportSettings.getPrototype();isc.A.lineSeparator="\n";isc.A.quoteValues=true;isc.A.nullValueText="";isc.A.useDisplayValue=false;isc.A.forceText=null;isc.A.dateFormat=null;isc.A.dateTimeFormat=null;isc.A.timeFormat=null;isc.ClassFactory.defineClass("TextImportSettings","TextSettings");isc.A=isc.TextImportSettings;isc.A.$935=false;isc.A=isc.TextImportSettings.getPrototype();isc.A.hasHeaderLine=false;isc.A.trim=false;isc.A=isc.TextImportSettings.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getSpecialCharactersRegExp=function isc_TextImportSettings_getSpecialCharactersRegExp(_1){var _2=this.lineSeparator?"\\"+this.lineSeparator:"(\r)?\n";_2+="|\\"+this.getEscapingModeEscapeChar()+"\"";_2+="|\\"+this.fieldSeparator;_2+="|\\\"";return new RegExp(_2,_1)},isc.A.removeUnescapedQuotes=function isc_TextImportSettings_removeUnescapedQuotes(_1){var _2=this.getEscapingModeEscapeChar();var _3=new RegExp("\\"+_2+"\"","g");var _4=_2=="\""?new RegExp("([^\"]|^)\"(?!\")","g"):new RegExp("\"\"|([^\\"+_2+"]|^)\"","g");return _1.replace(_4,"$1").replace(_3,"\"")},isc.A.addFinalLineSeparatorIfNotPresent=function isc_TextImportSettings_addFinalLineSeparatorIfNotPresent(_1){var _2=this.lineSeparator||"\n";var _3=new RegExp(_2+"$");if(!_1.match(_3,_1))_1+=_2;return _1},isc.A.parseTextAndApplyFunctions=function isc_TextImportSettings_parseTextAndApplyFunctions(_1,_2,_3){var _4=this.fieldSeparator;var _5=this.getEscapingModeEscapeChar()+"\"";var _6=this.getSpecialCharactersRegExp();var _7=0,_8=false;;for(var _9,_10=_1,_11=0;null!=(_9=_10.match(_6));_10=_10.substring(_12),_11+=_12){var _12=_9[0].length+_9.index;switch(_9[0]){case _5:break;case"\"":_8=!_8;break;default:if(_8)continue;var _13=_1.substring(_7,_11+_9.index);if(this.trim)_13=_13.trim();if(_13=="\"\""&&this.escapingMode==isc.TextSettings.DOUBLE){_13=""}
_13=this.removeUnescapedQuotes(_13);_7=_11+_12;_2(_13);if(_9[0]!=_4){if(_3())_10=""}
break}}
return _1.substring(_7)});isc.B._maxIndex=isc.C+4;if(!isc.Comm)isc.defineClass("Comm");isc.A=isc.Comm;isc.A.XML_BACKREF_PREFIX="$$BACKREF$$:";isc.A.$36r=/^([_:A-Za-z])([_:.A-Za-z0-9]|-)*$/;isc.A.serializeBackrefs=true;isc.A=isc.Comm;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.xmlSerialize=function isc_c_Comm_xmlSerialize(_1,_2,_3){return isc.Comm.$ew(_1,_2,_3?"":null)},isc.A.$ew=function isc_c_Comm__xmlSerialize(_1,_2,_3,_4){if(isc.Browser.isSGWT&&window.SmartGWT.isNativeJavaObject(_2)){if(_2==null)_2=null;else{if(window.SmartGWT.warnOnSerializeError){window.SmartGWT.throwUnconvertibleObjectException(_2,window.SmartGWT.serializeErrorMessage)}
_2=String.asSource(_2+"")}}
var _5=_1!=null;if(!_4||!_4.objRefs){_4=isc.addProperties({},_4);_4.objRefs={obj:[],path:[]};if(!_4.objPath){if(_2&&_2.getID)_4.objPath=_2.getID();else _4.objPath=""}
if(_1==null){if(isc.isA.Class(_2))_1=_2.getClassName();else if(isc.isAn.Array(_2))_1="Array";else if(isc.isA.Object(_2))_1=_2.$schemaId||"Object";else _1="ISC_Auto"}}
if(_2==null){if(isc.Comm.xmlSchemaMode||!isc.Comm.$850){return isc.Comm.$ex(_1,"")}else{return isc.Comm.$ex(_1,null,"nil")}}
if(isc.isA.String(_2)){return isc.Comm.$ex(_1,isc.makeXMLSafe(_2),(isc.Comm.xmlSchemaMode?"string":null))}
if(isc.isA.Function(_2)){if(_2.iscAction)return isc.StringMethod.$41u(_2.iscAction);return null}
if(_2==window){this.logWarn("Serializer encountered the window object at path: "+_4.objPath+" - returning null for this slot.");return null}
if(isc.RPCManager.preserveTypes){if(isc.isA.Number(_2)||isc.isA.SpecialNumber(_2)){if(_2.toString().contains("."))
return isc.Comm.$ex(_1,_2,"double");return isc.Comm.$ex(_1,_2,"long")}
if(isc.isA.Boolean(_2))return isc.Comm.$ex(_1,_2,"boolean")}else{if(isc.isA.Number(_2)||isNaN(_2)){return isc.Comm.$ex(_1,_2)}
if(isc.isA.Boolean(_2))return isc.Comm.$ex(_1,_2)}
var _6=isc.JSONEncoder.$zl(_4.objRefs,_2);if(_6!=null&&_4.objPath.contains(_6)){var _7=_4.objPath.substring(_6.length,_6.length+1);if(_7=="."||_7=="["||_7=="]"){if(this.serializeBackrefs){return isc.Comm.$36u(_1)+isc.Comm.XML_BACKREF_PREFIX+_6+isc.Comm.$36v(_1)}
return isc.emptyString}}
isc.JSONEncoder.$zm(_4.objRefs,_2,_4.objPath);if(isc.isA.Function(_2.$ew)){return _2.$ew(_1,null,null,_3,_4.objRefs,_4.objPath)}else if(isc.isA.Class(_2)){this.logWarn("Attempt to serialize class of type: "+_2.getClassName()+" at path: "+_4.objPath+" - returning null for this slot.");return null}
var _8=_4.isRoot==false?false:true;if(isc.isAn.Array(_2))
return isc.Comm.$36s(_1,_2,_4.objPath,_4.objRefs,_3,_8);var _9;if(_2.getSerializeableFields){_9=_2.getSerializeableFields([],[])}else{_9=_2}
return isc.Comm.$36t(_1,_9,_4.objPath,_4.objRefs,_3,_8)},isc.A.$36s=function isc_c_Comm__xmlSerializeArray(_1,_2,_3,_4,_5,_6){var _7=isc.Comm.$36u(_1,"List",null,null,null,_6);for(var i=0,_9=_2.length;i<_9;i++){var _10=_2[i];var _11={objRefs:_4,objPath:isc.JSONEncoder.$zp(_3,i),isRoot:false};_7=isc.StringBuffer.concat(_7,(_5!=null?isc.StringBuffer.concat("\n",_5,"\t"):""),isc.Comm.$ew((_10!=null?_10.$schemaId:null)||"elem",_10,(_5!=null?isc.StringBuffer.concat(_5,"\t"):null),_11))}
_7=isc.StringBuffer.concat(_7,(_5!=null?isc.StringBuffer.concat("\n",_5):""),isc.Comm.$36v(_1));return _7},isc.A.$36w=function isc_c_Comm__isValidXMLIdentifier(_1){return isc.Comm.xmlSchemaMode||_1.match(this.$36r)},isc.A.$36t=function isc_c_Comm__xmlSerializeObject(_1,_2,_3,_4,_5,_6){if(isc.isAn.Instance(_2))_1=_2.getClassName();else if(_2._constructor&&_2._constructor!="AdvancedCriteria"&&_2._constructor!="RelativeDate")_1=_2._constructor;var _7=isc.Comm.$36u(_1,"Object",null,null,null,_6);_2=isc.JSONEncoder.$42b(_2);for(var _8 in _2){if(_8==null)continue;if(_8==isc.gwtRef||_8==isc.gwtModule)continue;if(_8.startsWith('$'))continue;var _9=_2[_8];if(isc.isA.Function(_9)&&!_9.iscAction)continue;var _10=_8.toString();var _11={objRefs:_4,objPath:isc.JSONEncoder.$zp(_3,_8),isRoot:false};_7=isc.StringBuffer.concat(_7,(_5!=null?isc.StringBuffer.concat("\n",_5,"\t"):""),isc.Comm.$ew(_10,_9,(_5!=null?isc.StringBuffer.concat(_5,"\t"):null),_11))}
_7=isc.StringBuffer.concat(_7,(_5!=null?isc.StringBuffer.concat("\n",_5):""),isc.Comm.$36v(_1));return _7},isc.A.$36x=function isc_c_Comm__getPrefix(_1,_2){if(_1[_2]!=null){return _1[_2]}else{if(_1.$36y==null)_1.$36y=0;return(_1[_2]="ns"+_1.$36y++)}},isc.A.$36u=function isc_c_Comm__xmlOpenTag(_1,_2,_3,_4,_5,_6){var _7=isc.SB.create();var _8=_3!=null;if(_3!=null&&isc.isAn.Object(_4)){_8=false;_4=this.$36x(_4,_3)}
var _9='';if(!this.$36w(_1)){_9=' _isc_name="'+isc.makeXMLSafeAttribute(_1)+'"';_1="Object"}
if(_3){_4=_4||"schNS";_7.append("<",_4,":",_1);if(_8)_7.append(" xmlns:",_4,"=\"",_3,"\"")}else{_7.append("<",_1)}
if(_9)_7.append(_9);if(_6&&!this.omitXSI){_7.append(" xmlns:xsi=\"http://www.w3.org/2000/10/XMLSchema-instance\"")}
if(_2&&!this.omitXSI){_7.append(" xsi:type=\"xsd:",isc.makeXMLSafeAttribute(_2),"\"")}
if(!_5)_7.append(">");return _7.release(false)},isc.A.$36v=function isc_c_Comm__xmlCloseTag(_1,_2,_3){if(_2!=null&&isc.isAn.Object(_3)){_3=this.$36x(_3,_2)}
if(!this.$36w(_1))_1="Object";if(_2){_3=_3||"schNS";return isc.SB.concat("</",_3,":",_1,">")}else{return isc.SB.concat("</",_1,">")}},isc.A.$ex=function isc_c_Comm__xmlValue(_1,_2,_3,_4,_5){if(_3=="base64Binary"){_2="<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\""+_2+"\"/>"}
if(_3=="nil"){return isc.Comm.$36u(_1,null,_4,_5,true)+" xsi:nil=\"true\"/>"}
return isc.StringBuffer.concat(isc.Comm.$36u(_1,_3,_4,_5),_2,isc.Comm.$36v(_1,_4,_5))});isc.B._maxIndex=isc.C+9;isc.defineClass("XMLDoc").addMethods({addPropertiesOnCreate:false,init:function(_1,_2){this.nativeDoc=_1;this.namespaces=_2;this.documentElement=this.nativeDoc.documentElement},hasParseError:function(){if(isc.Browser.isIE){var _1=this.nativeDoc.parseError;return _1!=null&&_1!=0}
return this.nativeDoc.documentElement&&this.nativeDoc.documentElement.tagName=="parsererror"},addNamespaces:function(_1){this.namespaces=this.$363(_1);if(this.$364){var _2=isc.xml.xmlResponses.find("ID",this.$364);if(_2)_2.xmlNamespaces=this.namespaces}},$363:function(_1){if(_1==null)return this.namespaces;if(this.namespaces==null)return _1;return isc.addProperties({},this.namespaces,_1)},selectNodes:function(_1,_2,_3){return isc.xml.selectNodes(this.nativeDoc,_1,this.$363(_2),_3)},selectString:function(_1,_2){return isc.xml.selectString(this.nativeDoc,_1,this.$363(_2))},selectNumber:function(_1,_2){return isc.xml.selectNumber(this.nativeDoc,_1,this.$363(_2))},selectScalar:function(_1,_2,_3){return isc.xml.selectScalar(this.nativeDoc,_1,this.$363(_2),_3)},selectScalarList:function(_1,_2){return isc.xml.selectScalarList(this.nativeDoc,_1,this.$363(_2))},getElementById:function(_1){return this.nativeDoc.getElementById(_1)},getElementsByTagName:function(_1){return this.nativeDoc.getElementsByTagName(_1)}});isc.XMLDoc.getPrototype().toString=function(){return"[XMLDoc <"+this.documentElement.tagName+">]"};isc.defineClass("XMLTools").addClassProperties({loadXML:function(_1,_2,_3){_3=_3||{};_3.operationType=_3.operationType||"loadXML";this.getXMLResponse(isc.addProperties({actionURL:_1,httpMethod:"GET",callback:_2},_3))},getXMLResponse:function(_1){_1.$37b=_1.callback;_1.callback={target:this,methodName:"$37c"};_1.httpMethod=_1.httpMethod||"POST";this.logInfo("loading XML from: "+_1.actionURL,"xmlComm");isc.rpc.sendProxied(_1)},xmlResponses:[],$365:0,trimEmptyXMLThreshold:100,$37c:function(_1,_2,_3){if(_1.isStructured&&!_3.isRestRequest){this.fireCallback(_3.$37b,"xmlDoc,xmlText,rpcResponse,rpcRequest",[null,null,_1,_3]);return}
var _4=_3.isRestRequest?_1.results:_1.httpResponseText,_5=this.parseXML(_4);if(this.logIsInfoEnabled("xmlComm")){this.logInfo("XML reply with text: "+(this.logIsDebugEnabled("xmlComm")?_4:this.echoLeaf(_4)),"xmlComm")}
var _6=false;if(_4==null||(_4.length<this.trimEmptyXMLThreshold&&_4.trim()==""))
{_6=true}
if(!_6&&(!_5||_5.getElementsByTagName("parsererror").length>0)){_1.status=-1}else{var _7=this.xmlResponses;if(this.logIsDebugEnabled("xmlComm")||(isc.Page.isLoaded()&&isc.debugMaster))
{var _8=this.$365++;_7.add({ID:_8,text:_4});if(_5)_5.$364=_8;if(_7.length>10)_7.shift();if(isc.debugMaster)isc.debugMaster.call("window.updateCommWatcher",[_7])}else{_7.length=0}}
this.fireCallback(_3.$37b,"xmlDoc,xmlText,rpcResponse,rpcRequest",[_5,_4,_1,_3])},useIEXMLHackaround:isc.Browser.isIE,disableIEXMLHackaround:function(){this.useIEXMLHackaround=false},xmlDOMConstructors:["MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"],mozAnchorBug:isc.Browser.isMoz&&(isc.Browser.geckoVersion<20080205)&&window.location.href.indexOf("#")!=-1,$167k:/xmlns:xml=(?:"http:\/\/www.w3.org\/XML\/1998\/namespace"|'http:\/\/www.w3.org\/XML\/1998\/namespace')/g,parseXML:function(_1,_2){if(_1==null)return;_1=this.trimXMLStart(_1);if(this.useIEXMLHackaround){if(this.$167k.test(_1.substring(0,1000))){_1=_1.replace(this.$167k,"")}}
var _3;if(!isc.Browser.isIE){try{if((this.mozAnchorBug||this.useAnchorWorkaround)&&this.useAnchorWorkaround!==false)
{var _4="<IFRAME STYLE='position:absolute;visibility:hidden;top:-1000px' ID='isc_parseXMLFrame'></IFRAME>";if(!isc.Page.isLoaded()){document.write(_4)}else{isc.Element.insertAdjacentHTML(document.getElementsByTagName("body")[0],"beforeEnd",_4)}
var _5=document.getElementById("isc_parseXMLFrame");var _6=_5.contentWindow;window.isc.xmlSource=_1;_6.location.href="javascript:top.isc.parsedXML=new top.isc.XMLTools.getXMLParser().parseFromString(top.isc.xmlSource, 'text/xml')";_3=window.isc.parsedXML;isc.xmlSource=isc.parsedXML=null;_5.parentNode.removeChild(_5)}else{_3=this.getXMLParser().parseFromString(_1,"text/xml")}}catch(e){if(!_2)this.$37d(this.echo(e));return null}
if(!_2&&_3.documentElement&&_3.documentElement.tagName=="parsererror")
{this.$37d(_3.documentElement.textContent);return null}
return isc.XMLDoc.create(_3)}
_3=this.getXMLParser();if(!_3){this.$37a("XMLTools.parseXML()");return}
_3.loadXML(_1);if(_3.parseError!=0){var _7=_3.parseError;if(!_2){this.$37d("\rReason: "+_7.reason+"Line number: "+_7.line+", character: "+_7.linepos+"\rLine contents: "+_7.srcText+(!isc.isA.emptyString(_7.url)?"\rSource URL: "+_7.url:""))}
return null}
return isc.XMLDoc.create(_3)},trimXMLStart:function(_1){if(_1.indexOf("<?xml")!=-1)
{var _2=_1.match(new RegExp("^\\s*<\\?[^?]*\\?>"));if(_2){_1=_1.substring(_2[0].length)}}
if(isc.Browser.isIE&&_1.indexOf("<!DOCTYPE")!=-1){var _2=_1.match(new RegExp("^\\s*<!DOCTYPE .*>"));if(_2){_1=_1.substring(_2[0].length)}}
return _1},$37d:function(_1,_2){this.logWarn("Error parsing XML: "+_1+(this.logIsDebugEnabled("parseXML")?"\rXML was:\r"+_2+"\rTrace:"+this.getStackTrace():""),"parseXML")},getXMLParser:function(){if(!isc.Browser.isIE){if(!this.$37e)this.$37e=new DOMParser();return this.$37e}
var _1;if(this.$37f){_1=new ActiveXObject(this.$37f)}else{for(var i=0;i<this.xmlDOMConstructors.length;i++){try{var _3=this.xmlDOMConstructors[i];_1=new ActiveXObject(_3);if(_1){this.logInfo("Using XML DOM constructor: "+_3);this.$37f=_3;break}}catch(e){}}
if(!_1){this.logWarn("Couldn't create XML DOM parser - tried the following constructors: "+this.echoAll(this.xmlDOMConstructors))}}
return _1},nativeXMLAvailable:function(){if(isc.Browser.isSafari&&!isc.Browser.isApollo&&(isc.Browser.safariVersion<522))
return false;return this.$37e!=null||this.getXMLParser()!=null},$37a:function(_1){if(this.nativeXMLAvailable()||!this.logIsWarnEnabled())return false;var _2="Feature "+_1+" requires a native XML parser which is not available ";if(isc.Browser.isSafari){_2+="because this version of Safari does not support native XML processing."}else{_2+="because ActiveX is currently disabled."}
_2+=" Please see the 'Features requiring ActiveX or Native support' topic in the client-side reference under Client Reference/System for more information";this.logWarn(_2);return true},serverToJS:function(_1,_2,_3){isc.DMI.callBuiltin({methodName:"xmlToJS",callback:_2,arguments:_1,requestParams:{evalVars:_3,evalResult:true}})},toJSCode:function(_1,_2){isc.DMI.callBuiltin("xmlToJS",_1,_2)},$pa:"*",elementToObject:function(_1){if(_1==null)return null;var _2=this.getAttributes(_1);var _3=_1.getElementsByTagName(this.$pa);for(var i=0;i<_3.length;i++){var _5=_3[i];_2[_5.tagName]=this.getElementText(_5)}
return _2},$366:":",getLocalName:function(_1){if(!isc.Browser.isIE){var _2=_1.localName;if(_2==null)return _1.nodeName;return _2}
var _3=_1.nodeName,_4=_3.indexOf(this.$366);if(_4!=-1)return _3.substring(_4+1);return _3},$27c:"List",$45s:"xmlToJS",toJS:function(_1,_2,_3,_4,_5){if(_1==null)return null;if(isc.isAn.XMLDoc(_1))_1=_1.nativeDoc;if(_1.documentElement)_1=_1.documentElement;_5=_5||isc.emptyObject;if(isc.isAn.Array(_1)){var _6=[];for(var i=0;i<_1.length;i++){_6[i]=this.toJS(_1[i],_2,_3,_4,_5)}
return _6}
var _8,_9;var _10=this.getExplicitType(_1,_4);if(_4||!_3||(_3&&isc.DS.get(_10)==null)){if(_4){var _11=this.isRefElement(_1);if(_11)
{var _12=isc.Canvas.getById(_11);if(_12!=null)return _12}
var _13=this.firstElementChild(_1),_11=_13?this.isRefElement(_13):null;if(_11&&this.getElementChildren(_1).length==1)
{var _12=isc.Canvas.getById(_11);if(_12!=null)return _12}
if(!_10){var _14=_1.tagName;if(_14==this.$27c||isc.DS.get(_14))_10=_1.tagName}}
if(_10!=null&&_10==this.$27c){var _15=this.getElementChildren(_1);return this.toJS(_15,_2,_3,_4,_5)}
if(_10){if(isc.DS.get(_10)!=null){_3=isc.DS.get(_10)}else if(isc.SimpleType.getType(_10)!=null){return isc.SimpleType.validateValue(_10,this.getElementText(_1))}}}
if(_3&&_3.xmlToJS)return _3.xmlToJS(_1,_5);if(this.elementIsNil(_1))return null;if(_3){_9=_2||_3.getFieldNames();_8={};for(var i=0;i<_9.length;i++){var _16=_9[i],_17=_3.getField(_16);if(_17==null||(_17.valueXPath==null&&_17.getFieldValue==null))continue;var _18=_3.getFieldValue(_1,_16,_17);if(_18!=null){if(this.logIsDebugEnabled(this.$45s)){this.logDebug("valueXPath / getFieldValue() field: "+_3.ID+"."+_16+" on element: "+this.echoLeaf(_1)+" got value: "+_18,"xmlToJS")}
_8[_16]=_18}}}
_8=this.getAttributes(_1,_2,_8,_3!=null,_3);if(!this.$37g(_8)&&!this.hasElementChildren(_1))
{return this.getElementText(_1)}
if(_8[this.$367]&&_8[this.$367]=="xsd:Object"){delete _8[this.$367]}
var _15=_1.childNodes;if(this.logIsDebugEnabled(this.$45s)){this.logDebug("using DataSource: "+_3+" for complex element: "+this.echoLeaf(_1)+" childNodes: "+this.echoLeaf(_15)+" has attributes: "+this.$37g(_8),"xmlToJS")}
var _19=false;for(var i=0;i<_15.length;i++){var _20=_15[i];var _21=this.getLocalName(_20);if(this.isTextNode(_20))continue;_19=true;if(_2&&!_2.contains(_21))continue;var _17=_3?_3.getField(_21):null;if(_17&&(_17.valueXPath||_17.getFieldValue))continue;var _22;if(this.logIsInfoEnabled(this.$45s)){this.logInfo("dataSource: "+_3+", field: "+this.echoLeaf(_17)+(_17!=null?" type: "+_17.type:"")+", XML element: "+this.echoLeaf(_20),"xmlToJS")}
var _23=_20;if(_17&&_17.multiple){var _24=this.getElementChildren(_20);if(_24.length>0)_23=_24}
if(!_3||_17==null||_17.type==null||_17.type=="any"){if(this.logIsDebugEnabled(this.$45s)){this.logDebug("applying schemaless transform at: "+(_3?_3.ID:"[schemaless]")+"."+_21,"xmlToJS")}
_22=this.toJS(_23,null,null,_4,_5)}else{var _25=_3.getSchema(_17.type);if(_25!=null){var _26=_17.propertiesOnly?{propertiesOnly:true}:_5;_22=this.toJS(_23,null,_25,_4,_26);if(this.logIsDebugEnabled(this.$45s)){this.logDebug("complexType field: "+this.echoLeaf(_17)+" got value: "+this.echoLeaf(_22),"xmlToJS")}}else{if(isc.isAn.Array(_23)){_22=[];for(var j=0;j<_23.length;j++){_22.add(_3.validateFieldValue(_17,this.getElementText(_23[j])))}}else{_22=_3.validateFieldValue(_17,this.getElementText(_23))}
if(this.logIsDebugEnabled(this.$45s)){this.logDebug("simpleType field: "+this.echoLeaf(_17)+" got value: "+this.echoLeaf(_22),"xmlToJS")}}}
if(_17&&_17.multiple){if(_22==null||isc.isA.emptyString(_22))_22=[];else if(!isc.isAn.Array(_22))_22=[_22]}
if(_8[_21]){if(!isc.isAn.Array(_8[_21]))_8[_21]=[_8[_21]];if(_17&&_17.multiple&&isc.isAn.Array(_22)){_8[_21].addList(_22)}else{_8[_21].add(_22)}}else{_8[_21]=_22}}
if(!_19){var _28=this.getElementText(_1),_29=_5.textContentProperty||(_3?_3.textContentProperty:"xmlTextContent");if(_3){_17=_3.getTextContentField();if(_17)_28=_3.validateFieldValue(_17,_28)}
if(_28!=null&&!isc.isAn.emptyString(_28)){_8[_29]=_28}}
if(_4){if(!_8._constructor&&_3&&(_3.instanceConstructor||_3.Constructor)){_8._constructor=_3.instanceConstructor||_3.Constructor}
if(!_8.scClassName&&_3&&_3.scClassName){_8.scClassName=_3.scClassName}
if(_8._constructor&&(_5==null||!_5.propertiesOnly)&&isc.ClassFactory.getClass(_8._constructor)){var _30=_8._constructor;delete _8._constructor;return isc.ClassFactory.newInstance(_30,_8)}}
return _8},$45t:"type",$367:"xsi:type",getExplicitType:function(_1,_2){if(_1==null||this.isTextNode(_1))return;var _3=this.getXSIAttribute(_1,this.$45t);if(_3){if(_3.contains(isc.colon))_3=_3.substring(_3.indexOf(isc.colon)+1)}else if(_2){_3=_1.getAttribute("constructor");if(_3&&!isc.DS.get(_3))_3=null}
return _3},$71v:"ref",isRefElement:function(_1){if(_1==null||this.isTextNode(_1)){return false}
var _2=_1.getAttribute(this.$71v);if(_2&&_1.attributes.length==1&&!this.hasElementChildren(_1))return _2},toComponents:function(_1,_2){if(isc.DS.get("Canvas")==null){this.logWarn("Can't find schema for Canvas - make sure you've loaded component schema via <isomorphic:loadSystemSchema/> jsp tag or by some other mechanism")}
if(isc.isA.String(_1)){var _3=this.parseXML(_1,true);if(_3.hasParseError()){this.logWarn("xml failed to parse xmlDoc, wrapping in root node");_3=this.parseXML("<isomorphicXML>"+_1+"</isomorphicXML>")}
_1=_3}
return this.toJS(_1,null,null,true,_2)},$gy:"number",getFieldValue:function(_1,_2,_3,_4,_5){if(_1.ownerDocument==null)return _1[_2];_3=_3||(_4?_4.getField(_2):isc.emptyObject);try{var _6;if(_3.valueXPath){var _7=(_4?_4.getSchema(_3.type):isc.DS.get(_3.type));if(_7){var _8=isc.xml.selectNodes(_1,_3.valueXPath,_5),_9=isc.xml.toJS(_8,null,_7);if(!_3.multiple&&_9.length==1)_9=_9[0];return _9}else{_6=isc.xml.selectScalar(_1,_3.valueXPath,_5)}}else{_6=isc.xml.getXMLFieldValue(_1,_2)}
_4=_4||isc.DS.get("Object");_6=_4.validateFieldValue(_3,_6);return _6}catch(e){this.logWarn("error getting value for field: '"+_2+(_3.valueXPath?"', valueXPath: '"+_3.valueXPath:"")+"' in record: "+this.echo(_1)+"\r: "+this.echo(e)+this.getStackTrace());return null}},getXMLFieldValue:function(_1,_2){var _3=_1.getAttribute(_2);if(_3!=null)return _3;var _4=_1.getElementsByTagName(_2)[0];if(_4==null)return null;return(isc.Browser.isIE?_4.text:_4.textContent)},$37g:function(_1){for(var _2 in _1){if(_2==this.$367)continue;return true}
return false},$71f:"xmlns:",getAttributes:function(_1,_2,_3,_4,_5){_3=_3||{};var _6;if(_2){if(!isc.isAn.Array(_2))_2=[_2];for(var i=0;i<_2.length;i++){var _8=_2[i];if(_4&&_3[_8]!==_6)continue;var _9=_1.getAttribute(_8);if(_9==null||isc.isAn.emptyString(_9))continue;if(_5&&_5.getField(_8)){_9=_5.validateFieldValue(_5.getField(_8),_9)}
_3[_8]=_9}
return _3}
var _10=_1.attributes;if(_10!=null){for(var i=0;i<_10.length;i++){var _11=_10[i],_8=_11.name;if(_8=="constructor")_8="_constructor";if(_4&&_3[_8]!==_6)continue;if(isc.startsWith(_8,this.$71f)&&_5&&_5.dropNamespaceDeclarations)continue;var _9=_11.value;if(_9==null||isc.isAn.emptyString(_9))continue;if(_5&&_5.getField(_8)){_9=_5.validateFieldValue(_5.getField(_8),_9)}
_3[_8]=_9}}
return _3},$45u:{nil:"xsi:nil","null":"xsi:null",type:"xsi:type"},xsiNamespaces:["http://www.w3.org/2001/XMLSchema-instance","http://www.w3.org/1999/XMLSchema-instance"],getXSIAttribute:function(_1,_2){var _3;if(isc.Browser.isOpera){for(var i=0;i<this.xsiNamespaces.length;i++){_3=_1.getAttributeNS(this.xsiNamespaces[i],_2);if(_3!=null)return _3}
return _3}
return _1.getAttribute(this.$45u[_2])},$45v:"nil",$45w:"null",$18r:"false",$w0:"0",elementIsNil:function(_1){if(_1==null||!isc.isA.XMLNode(_1)||_1.nodeType!=1)return false;var _2=this.getXSIAttribute(_1,this.$45v);if(_2&&_2!=this.$18r&&_2!=this.$w0)return true;var _2=this.getXSIAttribute(_1,this.$45w);if(_2&&_2!=this.$18r&&_2!=this.$w0)return true;return false},getElementText:function(_1){if(this.elementIsNil(_1))return null;if(!_1)return null;var _2=_1.firstChild;if(!_2){if((isc.Browser.isMoz||isc.Browser.isChrome)&&_1.nodeType==2)return _1.value;return isc.emptyString}
var _3=_2.data;if(isc.Browser.isMoz&&_3!=null&&_3.length>4000)return _1.textContent;return _3},isTextNode:function(_1){if(_1==null)return false;var _2=_1.nodeType;return(_2==3||_2==4||_2==8)},hasElementChildren:function(_1){return this.firstElementChild(_1)!=null},firstElementChild:function(_1){if(_1==null||(_1.hasChildNodes!=null&&_1.hasChildNodes()==false))return null;var _2=_1.childNodes;if(!_2)return null;var _3=_2.length;for(var i=0;i<_3;i++){var _5=_2[i];if(!this.isTextNode(_5))return _5}
return null},setAttributes:function(_1,_2){var _3;for(var _4 in _2){var _5=_2[_4];if(_5==null){_1.removeAttribute(_4);continue}
if(isc.Browser.isIE&&(_5===true||_5===false)){_5=isc.emptyString+_5}
_1.setAttribute(_4,_2[_4])}},$37h:function(_1,_2){var _3=isc.SB.create(),_4=_1.documentElement,_2=_2||isc.emptyObject,_5;if(!_2["default"]){_5=this.$45x(_4);if(_5)_3.append('xmlns:default="',_5,'" ')}
var _6=_1.documentElement.attributes;for(var i=0;i<_6.length;i++){var _8=_6[i],_9=_8.prefix;if(_9=="xmlns"&&_9!=_8.name){if(_2[_8.baseName]!=null)continue;_3.append(_8.name,'="',_8.value,'" ')}}
return _3.release(false)},$45x:function(_1){var _2=this.logIsDebugEnabled("xmlSelect");if((_1.prefix==null||isc.isAn.emptyString(_1.prefix))&&_1.namespaceURI)
{if(_2){this.logWarn("using docElement ns, prefix: "+_1.prefix,"xmlSelect")}
return _1.namespaceURI}else if(_1.firstChild){var _3
for(var i=0;i<_1.childNodes.length;i++){var _5=_1.childNodes[i];if(_5.nodeType==3)continue;var _6=_5.namespaceURI;if(!_6)break;if(_5.prefix==null||isc.isAn.emptyString(_5.prefix)){_3=_5.namespaceURI;break}}
if(_3!=null){if(_2){this.logDebug("using default namespace detected on child: "+_3,"xmlSelect")}}
if(_3==null&&_1.namespaceURI){_3=_1.namespaceURI;if(_2){this.logDebug("using document element's namespace as default namespace: "+_3,"xmlSelect")}}
if(!_3)_3="http://openuri.org/defaultNamespace";return _3}},$ho:"[",selectObjects:function(_1,_2,_3){if(isc.contains("|")){var _4=_2.split(/|/),_5=[];for(var i=0;i<_4.length;i++){_5.addList(this.selectObjects(_4[i],_1))}
return _5}
var _7=isc.isAn.Array(_1)?_1:[_1];if(_2!=isc.slash){if(isc.startsWith(_2,isc.slash)){_2=_2.substring(1);if(isc.startsWith(_2,isc.slash)){this.logWarn("Selector \"\\\\\" does not supported. It was truncated.");_2=_2.substring(1)}}
var _8=_2.split(/[\/@]/);_7=this.$37i(_8,_7,isc.slash)}
if(_3&&_7.length<=1)return _7[0];return _7},$37i:function(_1,_2,_3){var _4=_1[0];_1=_1.length>1?_1.slice(1):null;if(_2==null)return null;var _5,_6=_4,_7=_4.indexOf(this.$ho);if(_7!=-1){_6=_4.substring(0,_7);_5=_4.substring(_7+1,_4.length-1)}
var _8=[];for(var i=0;i<_2.length;i++){var _10=_2[i];if(_6!=isc.star){_10=_10[_6]}else{var _11=isc.getValues(_10);_10=[];for(var i=0;i<_11.length;i++){if(!isc.isAn.Array(_11[i]))_10.add(_11[i]);else _10.addList(_11[i])}}
if(_10==null)continue;if(!isc.isAn.Array(_10)){_8.add(_10)}else{_8.addList(_10)}}
if(_5){var _12=this.$37j(_8,_5);_8=_12}
if(_1==null||_1.length==0)return _8;_3+=_4+isc.slash;return this.$37i(_1,_8,_3)},$37j:function(_1,_2){var _3=parseInt(_2);if(!isNaN(_3)){return[_1[_3-1]]}
if(_2=="last()")return[_1.last()];var _4=_2.match(/^([a-zA-Z_0-9:\-\.\(\)]*)\s*(<|>|!=|=|<=|>=|)\s*(.*)$/),_5,_6,_7;if(_4==null){if(!_2.match(/^[a-zA-Z_0-9:\-\.]*$/)){this.logWarn("couldn't parse predicate expression: "+_2);return null}
_5=_2}else{_5=_4[1],_6=_4[2],_7=_4[3]}
if(_6=="=")_6="==";if(_7=="true()")_7=true;else if(_7=="false()")_7=false;if(_5=="position()")_5="position";var _8=isc.$aq("item,position","return "+(_5!="position"?"item.":"")+_5+(_6?_6+_7:""));var _9=[];for(var i=0;i<_1.length;i++){if(_8(_1[i],i+1))_9.add(_1[i])}
return _9},selectNodes:function(_1,_2,_3,_4){if(isc.isA.String(_1)){_1=this.parseXML(_1)}
if(isc.Browser.isSafari&&(isc.Browser.isApollo||(isc.Browser.safariVersion<522)))
{this.$37a("XPath");return this.safariSelectNodes(_1,_2,_3,_4)}
if(isc.isAn.XMLDoc(_1)){return _1.selectNodes(_2,_3,_4)}
var _5=isc.timestamp();var _6=this.$37k(_1,_2,_3,_4);var _7=isc.timestamp();if(this.logIsInfoEnabled("xmlSelect")){this.logInfo("selectNodes: expression: "+_2+" returned "+this.echoLeaf(_6)+": "+(_7-_5)+"ms","xmlSelect")}
return _6},safariSelectNodes:function(_1,_2,_3,_4){var _5=[];if(!_2){return null}
var _6=_2.substring(_2.indexOf(":")+1);var _7;if(_6.endsWith("/*")){_7=true;_6=_6.substring(0,_6.indexOf("/*"))}
var _8=_1.getElementsByTagName(_6);if(_7&&_8.length>0){var _9=_8[0];_8=_9.childNodes}
for(var i=0;i<_8.length;i++){if(_8[i].nodeType==3)continue;_5.add(_8[i])}
if(_7&&_5.length==1)_5=_5[0];return _5},$37l:function(_1,_2,_3){if(_1==null)return isc.emptyString;if(_2==null)_2=isc.getKeys(_1);var _4=isc.SB.create(),_3=(_3!=null?"\n"+_3:"");for(var i=0;i<_2.length;i++){var _6=_2[i];_4.append(_3," xmlns:",_6,'="',_1[_6],'"')}
return _4.release(false)},$53z:function(_1){var _2=_1.lookupNamespaceURI("");if(isc.Browser.isSafari&&(_2==null||_2=="")){_2=_1.getAttribute("xmlns")}
if(_2==null)_2=_1.namespaceURI;if(_2==null)_2="";return _2},$37k:function(_1,_2,_3,_4){if(_1==null)return;var _5=_1.ownerDocument;if(_5==null&&_1.documentElement){_5=_1;_1=_5.documentElement}
if(_5==null)return null;if(isc.Browser.isIE){if(isc.Browser.version>5.5){_5.setProperty("SelectionLanguage","XPath");var _6=this.$37h(_5,_3);if(_3)_6+=this.$37l(_3);if(this.logIsDebugEnabled("xmlSelect")){this.logDebug("selectNodes: expression: "+_2+", using namespaces: "+_6,"xmlSelect")}
_5.setProperty("SelectionNamespaces",_6)}
if(_4)return _1.selectSingleNode(_2);var _7=_1.selectNodes(_2);return this.$37m(_7)}
var _8=_5.createNSResolver(_5.documentElement),_9=this.$53z(_5.documentElement);if(this.logIsDebugEnabled("xmlSelect")){this.logDebug("Using namespaces: "+isc.echo(_3)+", defaultNamespace: '"+_9+"'","xmlSelect")}
var _10=function(_12){if(_3&&_3[_12])return _3[_12];if(_12=="default")return _9;return _8.lookupNamespaceURI(_12)};var _11=_5.evaluate(_2,_1,_10,0,null);if(_4)return _11.iterateNext();return this.$37m(_11)},$37m:function(_1){var _2=[];if(isc.Browser.isIE||_1.iterateNext==null){for(var i=0;i<_1.length;i++){_2.add(_1.item(i))}}else{var _4;while(_4=_1.iterateNext()){_2.add(_4)}}
return _2},getElementChildren:function(_1){var _2=[],_3=_1.childNodes;for(var i=0;i<_3.length;i++){var _5=_3[i];if(this.isTextNode(_5))continue;_2.add(_5)}
return _2},selectString:function(_1,_2,_3){return this.selectScalar(_1,_2,_3)},selectNumber:function(_1,_2,_3){return this.selectScalar(_1,_2,_3,true)},selectScalar:function(_1,_2,_3,_4){if(isc.isA.String(_1))_1=this.parseXML(_1);if(isc.isAn.XMLDoc(_1))return _1.selectScalar(_2,_3,_4);var _5;if(isc.Browser.isSafari&&isc.Browser.isApollo||(isc.Browser.safariVersion<522)){var _6=_2.substring(_2.indexOf(":")+1);_5=_1.getElementsByTagName(_6)[0]}else{_5=this.selectNodes(_1,_2,_3,true)}
if(_5==null)return null;var _7=this.getElementText(_5);return _4?parseInt(_7):_7},selectScalarList:function(_1,_2,_3){if(isc.isA.String(_1))_1=this.parseXML(_1);if(isc.isAn.XMLDoc(_1))return _1.selectScalarList(_2,_3);var _4=this.selectNodes(_1,_2,_3);for(var i=0;i<_4.length;i++){_4[i]=_4[i].nodeValue}
return _4},transformNodes:function(_1,_2){if(isc.isAn.XMLDoc(_1))_1=_1.nativeDoc;if(isc.isAn.XMLDoc(_2))_2=_2.nativeDoc;if(isc.Browser.isIE){if(_1){return _1.transformNode(_2)}
return null}
var _3=new XSLTProcessor();_3.importStylesheet(_2);if(isc.Browser.isMoz&&this.mozAnchorBug&&isc.Browser.geckoVersion<20051107){var _4=document.implementation.createDocument("","test",null);var _5=_3.transformToFragment(_1,_4);return new XMLSerializer().serializeToString(_5)}
if(_1){var _6=_3.transformToDocument(_1);return new XMLSerializer().serializeToString(_6)}
return null},serializeToString:function(_1){this.$37n=this.$37n||isc.xml.parseXML('<xsl:stylesheet version=\'1.0\' xmlns:xsl=\'http://www.w3.org/1999/XSL/Transform\'>\r<xsl:output method="xml" indent="yes"/>\r<xsl:strip-space elements="*"/>\r<xsl:template match="/">\r  <xsl:copy-of select="."/>\r</xsl:template>\r</xsl:stylesheet>');return this.transformNodes(_1,this.$37n)},loadXMLSchema:function(_1,_2,_3,_4,_5){_3=_3||{};_3.operationType=_3.operationType||"loadXMLSchema";this.loadWSDL(_1,_2,_3,_4,_5,true)},loadWSDL:function(_1,_2,_3,_4,_5,_6){if(!this.$37o){var _7=isc.Page.getIsomorphicClientDir()+"schema/schemaTranslator.xsl";_7=_7.replace(/https?:\/\/[^\/]*\//,"/");if(_7.startsWith("//"))_7=_7.substring(1);this.$37o="LOADING";isc.xml.loadXML(_7,function(_9,_10,_11){isc.xml.logDebug("schema translator loaded");if(isc.Browser.isMoz&&_11.xmlHttpRequest&&_11.xmlHttpRequest.responseXML)
{isc.xml.$37o=isc.XMLDoc.create(_11.xmlHttpRequest.responseXML)}else{isc.xml.$37o=_9}
isc.xml.loadWSDL(_1,_2,_3,_4,_5,_6)});return}
_3=_3||{};_3.operationType=_3.operationType||"loadWSDL";var _8={location:_1,callback:_2,autoLoadImports:_4,wsProperties:_5||{},returnSchemaSet:_6};isc.xml.loadXML(_1,function(_9,_10,_11,_12){_8.rpcResponse=_11;_8.rpcRequest=_12;isc.xml.$37p(_9,_8)},_3)},loadWSDLFromXML:function(_1,_2,_3,_4,_5){if(isc.isA.String(_1))_1=isc.xml.parseXML(_1);this.$37p(_1,{callback:_2,autoLoadImports:_3,wsProperties:_4,returnSchemaSet:_5})},useClientXML:true,$37p:function(_1,_2){if(!isc.isAn.XMLDoc(this.$37o)){this.logInfo("deferred schema translator, schema translator not loaded","xmlComm");isc.Timer.setTimeout({methodName:"$37p",target:this,args:[_1,_2]});return}
this.logInfo("transforming schema: "+this.echoLeaf(_1)+" with translator "+this.echoLeaf(this.$37o),"xmlComm");var _3=this.transformNodes(_1,this.$37o);if(this.logIsDebugEnabled("xmlComm")){this.logWarn("XML service definition is: \n"+_3)}
var _4=_2.wsProperties,_5=_4.initiator;if(_4.captureXML){_4.xmlSource=_3;if(_5)_5.addImportXMLSource(_3,_2.location)}
if(this.useClientXML){var _1=isc.xml.parseXML(_3),_6=_1?this.$37m(_1.documentElement.childNodes):null,_7=_6?this.toJS(_6,null,null,true):null;this.$37q(_2);return}
this.logInfo("about to call serverToJS with: "+this.echoLeaf(_3)+", callback: "+this.echo(_2.callback),"xmlComm");this.serverToJS(_3,function(){isc.Log.logWarn("serverToJS returned");isc.xml.$37q(_2)})},$37q:function(_1){var _2;if(_1.returnSchemaSet){_2=isc.SchemaSet.$37r}else{_2=isc.WebService.$37r||isc.SchemaSet.$37r}
isc.WebService.$37r=isc.SchemaSet.$37r=null;if(!_2&&_1.rpcRequest.willHandleError==false)return;if(_2)_2.location=_1.location;if(_1.wsProperties&&_2)_2.setProperties(_1.wsProperties);var _3=(isc.isA.WebService(_2)?"service":"schemaSet")+",rpcRequest";var _4=[_2,_1.rpcRequest];if(_1.autoLoadImports&&_2&&_2.loadImports){var _5=this;_2.loadImports(function(){_5.$41k(_1.callback,_3,_4)})}else{this.$41k(_1.callback,_3,_4)}},$41k:function(_1,_2,_3){this.fireCallback(_1,_2,_3)},getCompleteSource:function(_1,_2,_3){var _4=_1.importSources;if(!_4)return"";_4=_4.getProperty("xmlText");_4.unshift(_1.xmlSource);_4=this.map("trimXMLStart",_4);var _5=_4.join("\n");if(_3){this.fireCallback(_2,"source",[_5]);return}
this.toJSCode(_5,function(_6,_7){this.fireCallback(_2,"source",[_7])})}});isc.xml=isc.XML=isc.XMLTools;isc.defineClass("DataSource");isc.DS=isc.DataSource;isc.A=isc.DataSource;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.dataSourceObjectSuffix="DS";isc.A._dataSources={};isc.A.$54v={};isc.A.$54w={};isc.A.$532="element";isc.A.$45t="type";isc.A.$99u={};isc.A.$99v={};isc.A.$163n={};isc.A.TABLE="table";isc.A.VIEW="view";isc.A.loaderURL="[ISOMORPHIC]/DataSourceLoader";isc.A.deepCloneOnEdit=true;isc.A.DS_FN={};isc.A.$37t="<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' ";isc.A.$37w="</soap:Envelope>";isc.A.$37u="<soap:Header>";isc.A.$51y="</soap:Header>";isc.A.$37v="<soap:Body";isc.A.$51z="</soap:Body>";isc.B.push(isc.A.$159k=function isc_c_DataSource__cloneDSRequest(_1,_2){if(_1==null)return null;if(_1.unconvertedDSRequest!=null){_1=_1.unconvertedDSRequest}
var _3={operationId:_1.operationId,operationType:_1.operationType,data:isc.shallowClone(_1.data),textMatchStyle:_1.textMatchStyle,sortBy:_1.sortBy,startRow:_1.startRow,endRow:_1.endRow,oldValues:_1.oldValues,outputs:_1.outputs,httpMethod:_1.httpMethod,httpHeaders:_1.httpHeaders,params:_1.params,useHttpProxy:_1.useHttpProxy,willHandleError:_1.willHandleError,actionURL:_1.actionURL,dataProtocol:_1.dataProtocol,additionalOutputs:_1.additionalOutputs,allowIE9Leak:_1.allowIE9Leak,bypassCache:("$135u"in _1?_1.$135u:_1.bypassCache),callbackParam:_1.callbackParam,clientContext:_1.clientContext,componentId:_1.componentId,containsCredentials:_1.containsCredentials,contentType:_1.contentType,downloadResult:_1.downloadResult,downloadToNewWindow:_1.downloadToNewWindow,evalResult:_1.evalResult,evalVars:_1.evalVars,fallbackToEval:("$135v"in _1?_1.$135v:_1.fallbackToEval),generateRelatedUpdates:_1.generateRelatedUpdates,groupBy:_1.groupBy,headerData:_1.headerData,ignoreTimeout:_1.ignoreTimeout,keepParentsOnFilter:_1.keepParentsOnFilter,lineBreakStyle:_1.lineBreakStyle,omitNullMapValuesInResponse:_1.omitNullMapValuesInResponse,paramsOnly:_1.paramsOnly,parentNode:("$135w"in _1?_1.$135w:_1.parentNode),pendingAdd:_1.pendingAdd,progressiveLoading:_1.progressiveLoading,resultSet:_1.resultSet,resultTree:_1.resultTree,sendNoQueue:_1.sendNoQueue,serverOutputAsString:_1.serverOutputAsString,shouldUseCache:_1.shouldUseCache,streamResults:_1.streamResults,summaryFunctions:_1.summaryFunctions,suppressAutoDraw:_1.suppressAutoDraw,timeout:_1.timeout,transport:_1.transport,useFlatFields:_1.useFlatFields,useFlatHeaderFields:_1.useFlatHeaderFields,useSimpleHttp:_1.useSimpleHttp,useStrictJSON:("$135x"in _1?_1.$135x:_1.useStrictJSON),useXmlHttpRequest:_1.useXmlHttpRequest,validationMode:_1.validationMode};if(!_2){_3.showPrompt=_1.showPrompt}
for(var _4 in _1){if(_4.startsWith("export")||(!_2&&_4.startsWith("prompt")))
{_3[_4]=_1[_4]}}
return _3},isc.A.$135y=function isc_c_DataSource__cloneDSResponse(_1){if(_1==null)return null;return{clientContext:_1.clientContext,data:isc.shallowClone(_1.data),dataSource:_1.dataSource,endRow:_1.endRow,errors:_1.errors,fromOfflineCache:_1.fromOfflineCache,httpHeaders:_1.httpHeaders,httpResponseCode:_1.httpResponseCode,httpResponseText:_1.httpResponseText,invalidateCache:_1.invalidateCache,offlineTimestamp:_1.offlineTimestamp,operationType:_1.operationType,queueStatus:_1.queueStatus,startRow:_1.startRow,status:_1.status,totalRows:_1.totalRows,transactionNum:_1.transactionNum}});isc.B._maxIndex=isc.C+2;isc.A=isc.DataSource;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$748="ref:";isc.A.serializeTimeAsDatetime=false;isc.A.$78d=[];isc.A.maxResponsesToCache=100;isc.A.offlineMessage="This data not available while offline";isc.A.maxFileSizeExceededMessage="Size of '${uploadedFileName}' (${uploadedFileSize}) exceeded maximum allowed file size of ${maxFileSize}";isc.A.requiredFileMessage="'${uploadedFileName}' was empty, but empty files are not allowed.";isc.B.push(isc.A.create=function isc_c_DataSource_create(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13){var _14=_1?_1.ID:null;if(isc.DataSource.$92w){var _15;if(_14)_15=isc.DataSource.get(_14);if(_15)return _15}
if(this.DS_FN)delete this.DS_FN[_14];return this.invokeSuper(this,"create",_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13)},isc.A.isLoaded=function isc_c_DataSource_isLoaded(_1){if(!_1)return false;if(isc.isA.DataSource(_1)||this._dataSources[_1])return true;return false},isc.A.getDataSource=function isc_c_DataSource_getDataSource(_1,_2,_3,_4){if(!_1)return null;if(isc.isA.DataSource(_1))return _1;if(isc.startsWith(_1,this.$748)){_1=_1.substring(4)}
if(_4&&isc.WebService){if(_4==isc.DS.$532)return this.$54v[_1];if(_4==isc.DS.$45t)return this.$54w[_1];return null}
var _5=this._dataSources[_1];if(!_5){if(isc.DataSource.DS_FN&&isc.DataSource.DS_FN[_1]){var _6=isc.DataSource.DS_FN[_1];delete isc.DataSource.DS_FN[_1];_6.call(null)}
_5=this._dataSources[_1];if(!_5){_5=this.$37x(_1,_2);if(_5)_5.ID=_1}}
if(_5){if(_2){this.fireCallback(_2,"dsID",[_5.ID],_5)}
return _5}
if(_2){this.load(_1,_2,_3)}
return null},isc.A.loadSchema=function isc_c_DataSource_loadSchema(_1,_2,_3){this.logWarn("Attempt to load schema for DataSource '"+_1+"'. This dataSource cannot be found. To load DataSources from the server without explicit inclusion in your application requires optional SmartClient server support - not present in this build.");return null},isc.A.get=function isc_c_DataSource_get(_1,_2,_3,_4){return this.getDataSource(_1,_2,_3,_4)},isc.A.$37x=function isc_c_DataSource__loadDataSource(_1,_2){if(_2)return null;if(_1!=isc.auto&&this.logIsDebugEnabled()){this.logDebug("isc.DataSource '"+_1+"' not present")}
return null},isc.A.getRegisteredDataSources=function isc_c_DataSource_getRegisteredDataSources(){return isc.getKeys(this._dataSources)},isc.A.getRegisteredDataSourceObjects=function isc_c_DataSource_getRegisteredDataSourceObjects(){var _1=this.getRegisteredDataSources(),_2=[];for(var i=0;i<_1.length;i++){_2.add(this.getDataSource(_1[i]))}
return _2},isc.A.isRegistered=function isc_c_DataSource_isRegistered(_1){if(this._dataSources[_1])return true;return false},isc.A.getForeignFieldName=function isc_c_DataSource_getForeignFieldName(_1){var _2=_1.foreignKey,_3=_2.indexOf(".");if(_3==-1)return _2;return _2.substring(_3+1)},isc.A.getForeignDSName=function isc_c_DataSource_getForeignDSName(_1,_2){var _3=_1.foreignKey,_4=_3.indexOf(".");if(_4==-1){if(_2==null)return null;return isc.isA.String(_2)?_2:_2.ID}
return _3.substring(0,_4)},isc.A.registerDataSource=function isc_c_DataSource_registerDataSource(_1){if(this.logIsInfoEnabled()){this.logInfo("Registered new isc.DataSource '"+_1.ID+"'")}
if(_1.ID){var _2=this._dataSources[_1.ID];if(!_2||!_1.schemaNamespace){this._dataSources[_1.ID]=_1}
var _3=_1._constructor||_1.Constructor||_1.type;if(_3&&(_3!=_1.ID)){this.$163n[_3]=_1.ID}
if(_1.tableCode){this.$99u[_1.tableCode]=_1.ID;var _4=this.$99v[_1.tableCode];if(_4){for(var i=0;i<_4.length;i++){var _6=_4[i];var _7=isc.DS.get(_6);var _8=_7.getFields();var _9=_1.getFields();for(var _10 in _8){for(var _11 in _9){if(_8[_10].fkColumnCode==_9[_11].columnCode){_8[_10].foreignKey=_1.ID+"."+_9[_11].name;break}}}
_7.addChildDataSource(_1);_4.removeAt(i);i--}
if(_4.length==0){delete this.$99v[_1.tableCode]}}}}
if(isc.Schema&&isc.isA.Schema(_1)){if(isc.isAn.XSElement(_1))this.$54v[_1.ID]=_1;else if(isc.isAn.XSComplexType(_1))this.$54w[_1.ID]=_1;return}
var _12=_1.getLocalFields(true);var _13=this.$37z=(this.$37z||{});for(var _14 in _12){var _15=_12[_14];var _16=null;if(_15.fkTableCode){_16=this.$99u[_15.fkTableCode];if(_16==null){if(this.$99v[_15.fkTableCode]==null){this.$99v[_15.fkTableCode]=[]}
this.$99v[_15.fkTableCode].add(_1.ID);continue}
var _17=isc.DS.get(_16);var _9=_17.getFields();for(var _11 in _9){if(_9[_11].columnCode==_15.fkColumnCode){_15.foreignKey=_17.ID+"."+_9[_11].name}}}else if(_15.foreignKey){var _16=this.getForeignDSName(_15,_1)}else{continue}
if(isc.DS.isRegistered(_16)){isc.DS.get(_16).addChildDataSource(_1)}else{if(_13[_16]==null){_13[_16]=[]}
_13[_16].add(_1)}}
var _18=_13[_1.ID];if(_18!=null){_1.map("addChildDataSource",_18);_13[_1.ID]=null}
var _19=this.$370=this.$370||{};if(_1.childRelations){for(var i=0;i<_1.childRelations.length;i++){var _20=_1.childRelations[i],_21=_20.dsName,_22=isc.DS.get(_21);if(_22){this.$371(_1,_22,_20)}else{if(_19[_21]==null){_19[_21]=[]}
_20.parentDS=_1.ID;_19[_21].add(_20)}}}
var _23=_19[_1.ID];if(_23){for(var i=0;i<_23.length;i++){var _20=_23[i];this.$371(isc.DS.get(_20.parentDS),_1,_20)}}},isc.A.$371=function isc_c_DataSource__addChildRelation(_1,_2,_3){_1.addChildDataSource(_2);if(!_3.fieldName)return;var _4=_2.getField(_3.fieldName);if(!_4.foriegnKey){_4.foreignKey=_1.ID+"."+_1.getPrimaryKeyFieldNames()[0]}},isc.A.registerSgwtDS=function isc_c_DataSource_registerSgwtDS(_1,_2){isc.DataSource.DS_FN[_1]=_2},isc.A.unregisterSgwtDS=function isc_c_DataSource_unregisterSgwtDS(_1){delete isc.DataSource.DS_FN[_1]},isc.A.reregisterSgwtDS=function isc_c_DataSource_reregisterSgwtDS(_1,_2){isc.DataSource.DS_FN[_2]=isc.DataSource.DS_FN[_1];delete isc.DataSource.DS_FN[_1]},isc.A.getFieldValue=function isc_c_DataSource_getFieldValue(_1,_2,_3,_4,_5){return isc.Canvas.$70o(_3,_1,_2,_4,true,_5)},isc.A.saveValueViaDataPath=function isc_c_DataSource_saveValueViaDataPath(_1,_2,_3,_4,_5){return isc.Canvas.$70n(_2,_1,_3,_4,null,true,_5)},isc.A.clearValueAtDataPath=function isc_c_DataSource_clearValueAtDataPath(_1,_2,_3){if(_2==null){_2=_1}
isc.Canvas.$70m(_2,_3,null,true)},isc.A.dupRequest=function isc_c_DataSource_dupRequest(_1){if(!_1||_1.$178g)return _1;return isc.addProperties({$178g:true},_1)},isc.A.getInheritanceDistance=function isc_c_DataSource_getInheritanceDistance(_1,_2){var _3=isc.ClassFactory.getClass(_1),_4=isc.ClassFactory.getClass(_2);if(_3==null||_4==null){this.logWarn("Invalid superclass and/or subclass argument provided");return-1}
if(!_4.isA(_1)){this.logWarn(_2+" is not a subclass of "+_1);return-1}
if(isc.isA.SGWTFactoryObject(_3)){if(!isc.isA.SGWTFactoryObject(_4)){_3=_3.getDefaultScClass();if(!_3){this.logWarn("Could not get defaultScClass for SGWTFactory "+_1);return-1}}}else if(isc.isA.SGWTFactoryObject(_4)){_4=_4.getDefaultScClass();if(!_4){this.logWarn("Could not get defaultScClass for SGWTFactory "+_2);return-1}}
for(var _5=0;_4!=_3;_5++){_4=_4.getSuperClass()}
return _5},isc.A.isSimpleTypeValue=function isc_c_DataSource_isSimpleTypeValue(_1){if(_1!=null&&(!isc.isAn.Object(_1)||isc.isA.Date(_1)))return true;return false},isc.A.getNearestSchema=function isc_c_DataSource_getNearestSchema(_1){if(_1==null)return null;var _2;if(isc.isA.String(_1))_2=_1;else{_2=isc.isAn.Instance(_1)?_1.getClassName():_1._constructor||_1.type||_1.$schemaId}
var _3=isc.DS.get(_2);if(!_3){_3=isc.DS.get(this.$163n[_2])}
if(_3)return _3;var _4=isc.ClassFactory.getClass(_2);var _5=_4;if(_4!=null){var _6=null;while(_3==null&&(_4=_4.getSuperClass())!=null&&_4!=_6)
{_3=isc.DS.get(_4.getClassName());if(_3==null){_3=isc.DS.get(this.$163n[_2])}
_6=_4}
if(!_3){if(isc.isA.SGWTFactoryObject(_5)){var _7=_5.getDefaultScClassName();if(_7)return this.getNearestSchema(_7)}}}
return _3||isc.DS.get("Object")},isc.A.getNearestSchemaClass=function isc_c_DataSource_getNearestSchemaClass(_1){if(_1==null)return null;var _2;while(_2==null){var _3=isc.DS.get(_1);if(_3==null){var _4=isc.ClassFactory.getClass(_1);if(_4&&isc.isA.SGWTFactoryObject(_4)){return _4}else{return null}}
_2=isc.ClassFactory.getClass(_3._constructor||_3.Constructor||_3.type);if(_2!=null)return _2;_1=_3.inheritsFrom;if(!_1)return null}
return null},isc.A.$372=function isc_c_DataSource__getStandardOperationType(_1){switch(_1){case"fetch":case"select":case"filter":return"fetch";case"add":case"insert":return"add";case"update":return"update";case"remove":case"delete":return"remove";default:return _1}},isc.A.isClientOnly=function isc_c_DataSource_isClientOnly(_1){if(isc.isA.String(_1))_1=this.getDataSource(_1);if(!_1)return false;return _1.clientOnly},isc.A.makeFileSpec=function isc_c_DataSource_makeFileSpec(_1){var _2={};_1=_1.trim();if(_1.startsWith("/"))_1=_1.slice(1);if(_1.endsWith("/"))_1=_1.slice(0,-1);var _3=_1.split("/");var _4=_3[_3.length-1];var _5=_4.split(".");var _6=_5.length;switch(_6){case 0:case 1:break;case 2:if(!_5[1].contains(" ")){_2.fileType=_5[1]}
break;default:_2.fileType=_5[_6-2];_2.fileFormat=_5[_6-1];if(_2.fileFormat.contains(" ")){delete _2.fileType;delete _2.fileFormat}else if(_2.fileType.contains(" ")){_2.fileType=_2.fileFormat;delete _2.fileFormat}
break}
var _7=(_2.fileType?_2.fileType.length+1:0)+(_2.fileFormat?_2.fileFormat.length+1:0);if(_7==0){_2.fileName=_1}else{_2.fileName=_1.slice(0,-_7)}
return _2},isc.A.makeDefaultOperation=function isc_c_DataSource_makeDefaultOperation(_1,_2,_3){var _4=isc.rpc.app();if(isc.isA.DataSource(_1))_1=_1.ID;if(!_1){_1="auto"}else if(_3){var _5=isc.DataSource.get(_1);if(isc.isA.DataSource(_5)){if(!_5.createdOperations)_5.createdOperations={};var _6=_5.createdOperations[_3];if(_6==null){_6={ID:_3,dataSource:_1,type:_2,filterType:"paged",loadDataOnDemand:true};_5.createdOperations[_3]=_6}
return _6}}
if(_4.operations==null)_4.operations={};_3=_3||_1+"_"+_2;var _6=_4.operations[_3];if(_6==null){_6={ID:_3,dataSource:_1,type:_2,filterType:"paged",loadDataOnDemand:true,source:"auto"};_4.operations[_3]=_6}
return _6},isc.A.handleUpdate=function isc_c_DataSource_handleUpdate(_1,_2){if(!this.isUpdateOperation(_2.operationType))return;var _3=this.get(_2.dataSource);_3.updateCaches(_1,_2)},isc.A.isUpdateOperation=function isc_c_DataSource_isUpdateOperation(_1){if(_1=="add"||_1=="update"||_1=="remove"||_1=="replace"||_1=="delete"||_1=="insert")return true},isc.A.getUpdatedData=function isc_c_DataSource_getUpdatedData(_1,_2,_3){var _4=this.get(_1.dataSource);return _4.getUpdatedData(_1,_2,_3)},isc.A.filterCriteriaForFormValues=function isc_c_DataSource_filterCriteriaForFormValues(_1){if(isc.DS.isAdvancedCriteria(_1))return _1;var _2={};for(var _3 in _1){var _4=_1[_3];if(_4==null||isc.is.emptyString(_4))continue;if(isc.isAn.Array(_4)){if(_4.length==0)continue;for(var i=0;i<_4.length;i++){var _6=_4[i];if(isc.isAn.emptyString(_6))continue}}
_2[_3]=_4}
return _2},isc.A.checkEmptyCriteria=function isc_c_DataSource_checkEmptyCriteria(_1,_2){if((_2||this.isAdvancedCriteria(_1))&&_1.criteria){if(_1.criteria.length==0)return null;for(var i=_1.criteria.length-1;i>=0;i--){var _4=_1.criteria[i],_5=false;if(!_4)_5=true;else{if(!_4.criteria){if(isc.isA.emptyObject(_4))_5=true}else{var _6=this.checkEmptyCriteria(_4,true);if(_6)_1.criteria[i]=_6;else _5=true}}
if(_5)_1.criteria.removeAt(i)}}
return _1},isc.A.load=function isc_c_DataSource_load(_1,_2,_3,_4){var _5;if(isc.isAn.Object(_3)){_5=_3.mockMode;_4=_3.loadParents;_3=_3.forceReload}
var _6,_7;if(!isc.isAn.Array(_1)){_7=isc.DataSource.$37s;if(_7[_1]){_7[_1].add(_2);return null}else{_7[_1]=[];_7[_1].add(_2)}
_6=_1;_1=[_1]}
if(_1.length<=0){this.logWarn("No DataSource IDs passed in.");return}
var _8=[];for(var i=0;i<_1.length;i++){if(!this.isLoaded(_1[i])||_3)_8.add(_1[i])}
var _10=_8.join(","),_11=isc.DataSource.loaderURL+(isc.DataSource.loaderURL.contains("?")?"&":"?")+(_4?"loadParents=true&":"")+(_5?"mockMode=true&":"")+"dataSource="+_10,_12=_1;;if(_8.length>0){isc.RPCManager.send(null,function(_14,_15,_16){if(_14.httpResponseCode==404){isc.warn("The DataSourceLoader servlet is not available at the configured DataSource.loaderURL ('"+isc.DataSource.loaderURL+"').");return null}
if(_4&&!_3)isc.DataSource.$92w=true;try{eval(_15)}catch(e){isc.logWarn("Response from DataSourceLoader caused exception "+isc.echoAll(e)+", response was:\n"+_15)}
delete isc.DataSource.$92w;if(_6){for(var i=0;i<_7[_6].length;i++){var _13=_7[_6][i];if(_13)this.fireCallback(_13,["dsID"],[_12])}
delete _7[_6]}else{if(_2)this.fireCallback(_2,["dsID"],[_12])}},{actionURL:_11,httpMethod:"GET",willHandleError:true})}else{this.logWarn("DataSource(s) already loaded: "+_1.join(",")+"\nUse forceReload to reload such DataSources");if(_2)this.fireCallback(_2,["dsID"],[_12]);if(_6)delete _7[_6]}},isc.A.loadWithParents=function isc_c_DataSource_loadWithParents(_1,_2,_3){if(isc.isAn.Object(_3)){_3.loadParents=true}
this.load(_1,_2,_3,true)},isc.A.getSortBy=function isc_c_DataSource_getSortBy(_1){if(!isc.isA.Array(_1))_1=[_1];var _2=[];for(var i=0;i<_1.length;i++){var _4=_1.get(i);_2.add((!Array.shouldSortAscending(_4.direction)?"-":"")+_4.property)}
return _2},isc.A.getSortSpecifiers=function isc_c_DataSource_getSortSpecifiers(_1){if(!isc.isA.Array(_1))_1=[_1];var _2=[];for(var i=0;i<_1.length;i++){var _4=_1.get(i),_5="ascending",_6=_4;if(_4.substring(0,1)=="-"){_5="descending";_6=_4.substring(1)}
_2.add({property:_6,direction:_5})}
return _2},isc.A.isAdvancedCriteria=function isc_c_DataSource_isAdvancedCriteria(_1,_2){if(!_1||isc.isAn.emptyObject(_1))return false;if(!_2){return(_1&&_1._constructor=="AdvancedCriteria")}
if(!isc.isA.DataSource(_2))_2=this.get(_2);if(_1._constructor=="AdvancedCriteria")return true;var _3=false,_4=_2.getSearchOperator(_1.operator);if(_2.getField(_1.fieldName)&&_4){_3=true}
else if(_2.getField("fieldName")||_2.getField("operator"))_3=false;else if(_1.fieldName&&(_1.operator&&_4)){_3=true}
else if(_1.fieldName&&_1.value!=null&&_1.operator==null){_3=true}else{var _5;if(_1.operator!=_5){var _6=_4;if(_6!=null&&(_6.isAnd||_6.isOr)){_3=true}}}
this.logInfo("Criteria object:"+this.echo(_1)+" not explicitly marked as AdvancedCriteria"+(_3?" but treating as Advanced based on format.":" - treating as SimpleCriteria."),"AdvancedCriteria");return _3},isc.A.copyCriteria=function isc_c_DataSource_copyCriteria(_1){if(_1==null)return null;return isc.clone(_1)},isc.A.getCriteriaFields=function isc_c_DataSource_getCriteriaFields(_1,_2,_3){if(_2&&!isc.isA.DataSource(_2))_2=this.get(_2);if(_3||(_2?_2.isAdvancedCriteria(_1):this.isAdvancedCriteria(_1)))
{var _4=[];this.$74s(_1,_4);return _4}
return isc.getKeys(_1)},isc.A.$74s=function isc_c_DataSource__getAdvancedCriteriaFields(_1,_2){if(_1.criteria){for(var i=0;i<_1.criteria.length;i++){isc.DS.$74s(_1.criteria[i],_2)}}else{_2.add(_1.fieldName)}},isc.A.cacheResponse=function isc_c_DataSource_cacheResponse(_1,_2){if(isc.Offline){var _3=isc.Offline.serialize(isc.Offline.trimRequest(_1));var _4=this.$78d.findIndex("requestKey",_3);if(_4!=-1){this.$78d.set(_4,_2)}else{if(this.$78d.length>=this.maxResponsesToCache){this.$78d.removeAt(0)}
this.$78d.add({requestKey:_3,dsResponse:_2})}}},isc.A.getCachedResponse=function isc_c_DataSource_getCachedResponse(_1){if(isc.Offline){var _2=isc.Offline.serialize(isc.Offline.trimRequest(_1));return this.$78d.find("requestKey",_2)}
return null},isc.A.getPathValue=function isc_c_DataSource_getPathValue(_1,_2,_3,_4){return isc.Canvas.$70o(_2,_3,_1,null,true,_4)},isc.A.setPathValue=function isc_c_DataSource_setPathValue(_1,_2,_3,_4){isc.Canvas.$70n(_2,_3,_4,_1,null,true)},isc.A.getCombinedDataSourceFields=function isc_c_DataSource_getCombinedDataSourceFields(_1){var _2=[];for(var i=0;i<_1.length;i++){var _4=_1[i];if(isc.isA.String(_4))_4=isc.DataSource.get(_4);if(_4==null){this.logWarn("getCombinedDataSourceFields() - unable to locate dataSource:"+_1[i]);continue}
var _5=_4.getID(),_6=isc.getKeys(_4.getFields());for(var j=0;j<_6.length;j++){_2[_2.length]=_5+"."+_6[j]}}
return _2},isc.A.getFieldFromDataSources=function isc_c_DataSource_getFieldFromDataSources(_1,_2,_3){var _4=this.getDataSourceForField(_1,_2,_3);if(_4==null){if(!_3){this.logWarn("getFieldFromDataSources() - unable to find dataSource  from combined field ID "+_1)}
return null}
var _5=_1.split("."),_6=_5[0],_7=_5[_5.length-1];var _8=_4.getField(_7);if(!_8)_8=_4.getField(isc.Canvas.$177s(_7));return _8},isc.A.getDataSourceForField=function isc_c_DataSource_getDataSourceForField(_1,_2,_3){var _4=_1.split("."),_5=_4[0],_6=_4[_4.length-1];if(_5==null||_6==null){if(!_3){this.logWarn("getDataSourceForField() passed invalid field ID:"+_1+". Expected format is to use dot-notation to indicate the dataSource plus fieldName - for example 'countryDS.countryCode'")}
return null}
var _7;if(_2==null)_7=isc.DataSource.get(_5);else{if(!isc.isAn.Array(_2))_2=[_2];for(var i=0;i<_2.length;i++){var _9=_2[i];if(_9&&_9.getID()==_5||(_9&&_9.criteriaBasePath&&_1.startsWith(_9.criteriaBasePath)))
{_7=_9;break}
var _10=_1.split(".");if(_9&&_9.criteriaBasePath){var _11=isc.Canvas.$177s(_10[_10.length-1]);var _12=_9.getField(_11);if(_12){if(_12.criteriaPath&&_12.criteriaPath==_1){_7=_9;break}}}}}
return _7},isc.A.$93o=function isc_c_DataSource__getDefaultValueForFieldType(_1){var _2;switch(_1){case"date":case"datetime":case"time":_2=new Date(0);break;case"float":_2=0.0;break;case"integer":_2=0;break;case"boolean":_2=false;break;case"text":default:_2="";break}
return _2},isc.A.$93p=function isc_c_DataSource__getTypedValueAsString(_1,_2,_3){if(_3==null)_3={};if(_1==null){var _4=_3.nullValueText;if(_4!=null)return _4;_1=this.$93o(_2)}
switch(_2){case"date":var _5=_3.dateFormat;return _1.toShortDate(_5);case"datetime":var _5=_3.dateTimeFormat;return _1.toShortDateTime(_5);case"time":var _5=_3.timeFormat;return isc.Time.toShortTime(_1,_5);case"float":case"integer":case"boolean":default:return _1.toString();case"text":return _1}},isc.A.isFlatCriteria=function isc_c_DataSource_isFlatCriteria(_1){if(!_1)return false;var _2=isc.DS.$57z[_1.operator];if(isc.isA.emptyObject(_1)||(_1.fieldName&&_2&&_2.valueType!="criteria"))
{return true}
if(_2&&_2.valueType=="criteria"&&_1.criteria){var _3=_1.criteria;for(var i=0;i<_3.length;i++){var _5=_3[i],_6=_5.operator?isc.DS.$57z[_5.operator]:null,_7=_6&&_6.valueType=="criteria";if(_7){return false}}
return true}
return false},isc.A.flattenCriteria=function isc_c_DataSource_flattenCriteria(_1){if(!_1)return null;var _2=isc.addProperties({},_1);if(_2.criteria){_2.criteria=[];this.$1241(_2.criteria,_1)}
return _2},isc.A.$1241=function isc_c_DataSource__addSubCriteriaToList(_1,_2){if(!_2.criteria){_1.add(isc.addProperties({},_2));return}
var _3=_2.criteria;for(var i=0;i<_3.length;i++){var _5=_3[i];this.$1241(_1,_5)}},isc.A.canFlattenCriteria=function isc_c_DataSource_canFlattenCriteria(_1){if(!_1)return false;if(isc.DataSource.isFlatCriteria(_1))return true;var _2=_1.operator;if(this.$1242(_1,_2))return true;return false},isc.A.$1242=function isc_c_DataSource__criteriaHasSameLogicalOperators(_1,_2){if(!_1.criteria||_1.criteria.isEmpty())return true;if(_1.operator!=_2){if(_1.criteria.length!=1||_1.criteria[0].criteria||_1.operator=="not")return false}
var _3=_1.criteria;for(var i=0;i<_3.length;i++){var _5=_3[i];if(!this.$1242(_5,_2))return false}
return true},isc.A.getAdvancedCriteriaDescription=function isc_c_DataSource_getAdvancedCriteriaDescription(_1,_2,_3){if(!isc.isAn.Array(_2)){if(!isc.isA.DataSource(_2))_2=isc.DS.getDataSource(_2);if(!_2)return"No dataSource"}
var _4="";if(_1.criteria&&isc.isAn.Array(_1.criteria)){var _5=_1.operator,_6=isc.FilterBuilder.getPrototype(),_7=_6["inline"+_5.substring(0,1).toUpperCase()+_5.substring(1,_5.length)+"Title"],_8=_1.criteria;for(var i=0;i<_8.length;i++){var _10=_8[i];if(i>0)_4+=" "+_7+" ";if(_10.criteria&&isc.isAn.Array(_10.criteria)){_4+="("
_4+=isc.DataSource.getAdvancedCriteriaDescription(_10,_2,_3);_4+=")"}else{_4+=isc.DataSource.getCriterionDescription(_10,_2,_3)}}}else{if(_1.fieldName==null){_1=isc.DataSource.convertCriteria(_1)}
_4+=isc.DataSource.getCriterionDescription(_1,_2,_3)}
return _4},isc.A.$1780=function isc_c_DataSource__getFieldOperatorTitle(_1,_2){if(isc.isA.String(_2))_2=isc.DS.$57z[_2];if(!_2)return null;if(isc.isA.String(_1))_1=this.getField(_1);var _3=isc.Operators;if(!_1||!_1.type){if(_2)return _2.titleProperty?_3[_2.titleProperty]:_2.title;return""}
if(isc.SimpleType.inheritsFrom(_1.type,"text")){var _4=_3[_2.textTitleProperty]||_2.textTitle;if(_4)return _4}
return _2.titleProperty?_3[_2.titleProperty]:_2.title},isc.A.getCriterionDescription=function isc_c_DataSource_getCriterionDescription(_1,_2,_3){if(_1==null)return"";var _4=(_3!=null)?_3.ID+".values.":null,_5=_1.fieldName,_6=_1.operator,_7=_1.start,_8=_1.end,_9;if(isc.isAn.Array(_2)){var _10=_2;_2=isc.DataSource.getDataSourceForField(_5,_10);if(!_2&&_3&&!_5.contains(".")&&!_5.contains("/")){var _5=_4+_5;_2=isc.DataSource.getDataSourceForField(_5,_10)}
_9=isc.DataSource.getFieldFromDataSources(_5,[_2])}else{if(!isc.isA.DataSource(_2))_2=isc.DS.getDataSource(_2);if(!_2)return"No DataSource";if(_5){var _11=_5.split("."),_12=_11[0];if(_12==_2.ID)_5=_11[1]}
_9=_2.getField(_5);if(_9==null){_9=_2.getFieldForDataPath(_5)}}
var _13=_2.getSearchOperator(_6,_9),_14=_2.getFieldOperatorMap(_9,true,_13.valueType,false),_15="";if(!_9){if(_1.criteria&&isc.isAn.Array(_1.criteria)){isc.logWarn("DataSource.getCriterionDescription: Passed an AdvancedCriteria - returning through getAdvancedCriteriaDescription.");return isc.DataSource.getAdvancedCriteriaDescription(_1,_2,_3)}
_15=_5+" "+isc.FilterBuilder.missingFieldPrompt+" ";isc.logWarn("DataSource.getCriterionDescription: No such field '"+_5+"' in DataSource '"+_2.ID+"'.")}else{_15=(_9.title?_9.title:_5)+" "}
_15+=(isc.Operators[_13.titleProperty]||_14[_6]||_6);if(_13.valueType!="none"){var _16=_1.valuePath;if(_16!=null){if(_16.startsWith(_4))_16=_16.replace(_4,"");_15+=" value of "+_16}else{var _17=_1.value;if(isc.DateUtil.isRelativeDate(_17)){var _18=_9?_9.type:null,_19=false,_20=isc.SimpleType;if(_20.inheritsFrom(_18,"date")&&!_20.inheritsFrom(_18,"datetime")){_19=true}
_17=isc.DateUtil.getAbsoluteDate(_17,null,null,_19)}
if(_13.valueType=="valueRange"){var _21=isc.FilterBuilder.getPrototype().inlineAndTitle;_15+=" "+_7+" "+_21+" "+_8}else if(_13.valueType=="fieldName"){var _22=_2.getField(_17);_15+=" "+_22.title||_5}else if(_6!="notNull"){_15+=" ";if(isc.isA.Date(_17)){if(_17.isLogicalDate)_15+=_17.toShortDate();else _15+=_17.toShortDatetime()}else _15+=_17&&_17.toString?_17.toString():_17}}}
return _15},isc.A.getLoaderURL=function isc_c_DataSource_getLoaderURL(){return isc.DataSource.loaderURL},isc.A.setLoaderURL=function isc_c_DataSource_setLoaderURL(_1){isc.DataSource.addClassProperties({loaderURL:_1})});isc.B._maxIndex=isc.C+60;isc.A=isc.DataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.addGlobalId=true;isc.A.dataFormat="iscServer";isc.A.callbackParam="callback";isc.A.preventHTTPCaching=true;isc.A.sendExtraFields=true;isc.A.patternSingleWildcard=["?","%"];isc.A.patternMultiWildcard="*";isc.A.patternEscapeChar="\\";isc.A.translatePatternOperators=false;isc.A.transformResponseToJS=true;isc.A.supportsRequestQueuing=true;isc.A.firstGeneratedSequenceValue=0;isc.A.copyLocalResults=true;isc.A.deepCopyLocalResults=false;isc.A.mockDataRows=75;isc.A.criteriaPolicy="dropOnShortening";isc.A.defaultTextMatchStyle="exact";isc.A.ignoreTextMatchStyleCaseSensitive=false;isc.A.showPrompt=true;isc.A.autoDeriveTitles=true;isc.A.canMultiSort=true;isc.A.nullStringValue="";isc.A.nullIntegerValue=0;isc.A.nullFloatValue=0.0;isc.A.nullBooleanValue=false;isc.A.nullDateValue=new Date(0);isc.A.cacheAcrossOperationIds=true;isc.A.cacheMaxAge=60;isc.A.cacheLastFetchTime=0;isc.A.sendParentNode=false;isc.A.autoCacheAllData=false;isc.A.autoConvertRelativeDates=true;isc.A.showFieldsAsTree=false;isc.A.autoDiscoverTree=false;isc.A.$111m={};isc.A.$111n={};isc.A.$111o={};isc.B.push(isc.A.combineCriteria=function isc_DataSource_combineCriteria(_1,_2,_3,_4,_5){return isc.DS.combineCriteria(_1,_2,_3,_4,_5,this)},isc.A.setCacheAllData=function isc_DataSource_setCacheAllData(_1){if(!_1){if(this.cacheAllData==true){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("setCacheAllData(false): clearing the cache and any deferred requests","cacheAllData")}
delete this.$85n;this.invalidateCache();this.cacheAllData=false;this.clearDeferredRequests();if(this.$839==true){delete this.$839;delete this.$175o;if(this.transformServerRequest){this.transformRequest=this.transformServerRequest;delete this.transformServerRequest}
if(this.transformServerResponse){this.transformResponse=this.transformServerResponse;delete this.transformServerResponse}}}}else{if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("setCacheAllData(true): invalidate the cache","cacheAllData")}
this.cacheAllData=true;this.$85n=isc.timestamp();this.invalidateCache()}},isc.A.cacheNeedsRefresh=function isc_DataSource_cacheNeedsRefresh(){var _1=new Date().getTime(),_2=((_1-this.cacheLastFetchTime)/1000),_3=(this.cacheLastFetchTime==0||_2>this.cacheMaxAge);if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("cacheNeedsRefresh returns "+_3,"cacheAllData")}
return _3},isc.A.setCacheData=function isc_DataSource_setCacheData(_1){if(this.cacheAllData||this.clientOnly){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("setCacheData: invalidating the cache","cacheAllData")}
this.invalidateCache();this.clearDeferredRequests();this.cacheData=this.testData=_1;this.cacheLastFetchTime=new Date().getTime();if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("setCacheData: cacheData has been set","cacheAllData")}}},isc.A.setTestData=function isc_DataSource_setTestData(_1,_2){this.setCacheData(_1,_2)},isc.A.clearDeferredRequests=function isc_DataSource_clearDeferredRequests(_1){if(!this.$498)return;_1=_1||"any";if(!isc.isAn.Array(_1))_1=[_1];if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("clearDeferredRequests: "+this.$498.length+" requests, clearing those of type "+isc.echoAll(_1),"cacheAllData")}
if(_1.contains("any"))delete this.$498;else{if(this.$498){var _2=this.$498;for(var i=_2.length;i>=0;i--){var _4=_2[i].operationType||"fetch";if(_1.contains(_4))this.$498.removeAt(i)}
if(this.$498.length==0)delete this.$498}}},isc.A.processDeferredRequests=function isc_DataSource_processDeferredRequests(){if(!this.$498)return;if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("processDeferredRequests: processing "+this.$498.length+" deferred requests","cacheAllData")}
var _1=this.$498;this.clearDeferredRequests();for(var i=0;i<_1.length;i++){this.sendDSRequest(_1[i])}},isc.A.invalidateCache=function isc_DataSource_invalidateCache(){if(!this.cacheAllData&&!this.clientOnly)return;if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("invalidateCache: invalidating client-side cache","cacheAllData")}
delete this.cacheData;delete this.testData;this.cacheLastFetchTime=0;if(this.cacheResultSet){this.cacheResultSet.destroy();delete this.cacheResultSet}},isc.A.setClientOnly=function isc_DataSource_setClientOnly(_1){if(_1){this.clientOnly=true
if(this.cacheAllData){if(this.cacheResultSet){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("setClientOnly: sourcing from client-cache","cacheAllData")}
this.cacheData=this.testData=this.cacheResultSet.getAllRows()}}else{this.clearDeferredRequests();this.invalidateCache();this.performDSOperation("fetch")}}},isc.A.hasAllData=function isc_DataSource_hasAllData(){if(this.cacheResultSet)return this.cacheResultSet.lengthIsKnown();else return false},isc.A.criteriaContainsDates=function isc_DataSource_criteriaContainsDates(_1){var _2=this.getCriteriaFields(_1);if(_2&&_2.length>0){for(var i=0;i<_2.length;i++){var _4=this.getField(_2[i]);if(!_4)continue;if(isc.SimpleType.inheritsFrom(_4.type,"date")||isc.SimpleType.inheritsFrom(_4.type,"datetime")){return true}}}
return false},isc.A.convertRelativeDates=function isc_DataSource_convertRelativeDates(_1,_2,_3,_4){if(!_1)return null;if(!this.criteriaContainsDates(_1)){return _1}
if(!this.isAdvancedCriteria(_1)&&_1.operator==null){return _1}
var _5=isc.clone(_1);_4=_4||new Date();if(_3==null)_3=isc.DateChooser?isc.DateChooser.firstDayOfWeek:0;if(_5.criteria&&isc.isAn.Array(_5.criteria)){var _6=_5.criteria;for(var i=_6.length-1;i>=0;i--){var _8=_6[i];if(!_8){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Removing NULL subCriteria...","relativeDates")}
_5.criteria.removeAt(i)}else{if(_8.criteria&&isc.isAn.Array(_8.criteria)){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Calling convertRelativeDates from convertRelativeDates - data is:\n\n"+isc.echoFull(_8)+"\n\ncriteria is: \n\n"+isc.echoFull(_1),"relativeDates")}
_5.criteria[i]=this.convertRelativeDates(_8,_2,_3,_4);if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Called convertRelativeDates from convertRelativeDates - data is\n\n"+isc.echoFull(_5.criteria[i]),"relativeDates")}}else{_5.criteria[i]=this.mapRelativeDate(_8,_4)}}}}else{_5=this.mapRelativeDate(_5,_4)}
if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Returning from convertRelativeDates - result is:\n\n"+isc.echoFull(_5)+"\n\noriginal criteria is: \n\n"+isc.echoFull(_1),"relativeDates")}
return _5},isc.A.mapRelativeDate=function isc_DataSource_mapRelativeDate(_1,_2){var _3=isc.addProperties({},_1),_4,_5;_2=_2||new Date();var _6=_3.fieldName,_7=_6?this.getField(_6):null,_8=_7?_7.type:null;var _9=isc.SimpleType.inheritsFrom(_8,"date")&&!isc.SimpleType.inheritsFrom(_8,"datetime");if(_3.value&&isc.isAn.Object(_3.value)&&_3.value._constructor=="RelativeDate")
{_5=_3.value.value;var _10=isc.DateUtil.getAbsoluteDate(_5,_2,_3.value.rangePosition,_9||_3.value.logicalDate);if(!_9&&["$yesterday","$today","$tomorrow"].contains(_5)){switch(_3.operator){case"equals":_3.operator="betweenInclusive";_3.start=isc.DateUtil.getStartOf(_10,"D");_3.end=isc.DateUtil.getEndOf(_10,"D");delete _3.value;break;case"notEqual":_3._constructor="AdvancedCriteria";_3.operator="not";_3.criteria=[{operator:"betweenInclusive",fieldName:_3.fieldName,start:isc.DateUtil.getStartOf(_10,"D"),end:isc.DateUtil.getEndOf(_10,"D")}];delete _3.value;delete _3.fieldName;break;case"lessThan":case"greaterOrEqual":_3.value=isc.DateUtil.getStartOf(_10,"D");break;case"greaterThan":case"lessOrEqual":_3.value=isc.DateUtil.getEndOf(_10,"D");break;default:_3.value=_10}}else{_3.value=_10}}else{if(_3.start&&isc.isAn.Object(_3.start)&&_3.start._constructor=="RelativeDate")
{_5=_3.start.value;_3.start=_4=isc.DateUtil.getAbsoluteDate(_5,_2,"start",_9||_3.start.logicalDate)}
if(_3.end&&isc.isAn.Object(_3.end)&&_3.end._constructor=="RelativeDate")
{_5=_3.end.value;_3.end=isc.DateUtil.getAbsoluteDate(_5,_2,"end",_9||_3.end.logicalDate)}}
return _3},isc.A.embedTimezoneInRelativeDates=function isc_DataSource_embedTimezoneInRelativeDates(_1,_2){if(!_1)return null;if(!this.criteriaContainsDates(_1)){return _1}
if(!this.isAdvancedCriteria(_1)&&_1.operator==null){return _1}
var _3=isc.clone(_1);_2=_2||new Date();if(_3.criteria&&isc.isAn.Array(_3.criteria)){var _4=_3.criteria;for(var i=_4.length-1;i>=0;i--){var _6=_4[i];if(!_6){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Removing NULL subCriteria...","relativeDates")}
_3.criteria.removeAt(i)}else{if(_6.criteria&&isc.isAn.Array(_6.criteria)){_3.criteria[i]=this.embedTimezoneInRelativeDates(_6,_2)}else{if(_6.value&&isc.isAn.Object(_6.value)&&_6.value._constructor=="RelativeDate")
{_3.criteria[i].value.browserTZ=isc.Time.getDefaultDisplayTimezone()}}}}}else{if(_3.value&&isc.isAn.Object(_3.value)&&_3.value._constructor=="RelativeDate")
{_3.value.browserTZ=isc.Time.getDefaultDisplayTimezone()}}
if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Returning from embedTimezoneInRelativeDates - result is:\n\n"+isc.echoFull(_3)+"\n\noriginal criteria is: \n\n"+isc.echoFull(_1),"relativeDates")}
return _3});isc.B._maxIndex=isc.C+14;isc.A=isc.DataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.cloneDSRequest=isc.DataSource.$159k;isc.A.cloneDSResponse=isc.DataSource.$135y;isc.A.$110l=200;isc.A.$41v="Action";isc.A.resultBatchSize=150;isc.A.$2j=[];isc.A.emptyExportMessage="You are attempting to export an empty dataset";isc.A.canExport=true;isc.A.defaultTitleFieldNames=["title","label","name","id"];isc.A.textContentProperty="xmlTextContent";isc.A.$dq="Defaults";isc.A.$dr="Properties";isc.A.$192e="dynamicProperties";isc.A.$375="name";isc.A.$1611={type:"required"};isc.A.$45t="type";isc.A.dropUnknownCriteria=true;isc.A.$45y="startsWith";isc.A.$19q="substring";isc.A.$50i="exact";isc.A.$135s="exactCase";isc.A.$50j="iscServer";isc.B.push(isc.A.init=function isc_DataSource_init(){if(this.serverType=="sql")this.dataFormat="iscServer";if(this.dataFormat=="iscServer"&&(this.serviceNamespace!=null||this.recordXPath!=null))this.dataFormat="xml";this.canQueueRequests=(this.dataFormat=="iscServer"||this.clientOnly);if(this.testData&&!this.cacheData)this.cacheData=this.testData;else if(this.clientOnly||this.mockMode){this.cacheData=this.testData=this.cacheData||this.testData}
if(this.ID==null&&this["id"]!=null)this.ID=this["id"];if(this.name==null)this.name=this.ID;var _1=isc.DS.get(this.ID);if(_1&&_1.builtinSchema)return _1;var _2=window[this.ID];if(this.addGlobalId&&this.addGlobalId!=isc.$ae&&(!_2||(!isc.isA.ClassObject(_2)&&isc.isA.DataSource(_2))))
{isc.ClassFactory.addGlobalID(this)}
var _3=this.fields;if(isc.isAn.Array(_3)){if(isc.Canvas.validateFieldNames){isc.Canvas.$1027(_3,this)}
var _4={};for(var i=0;i<_3.length;i++){var _6=_3[i];if(_6.includeFrom!=null){var _7=_6.includeFrom.split(".");if(_7==null||_7.length!=2){this.logWarn("Field has includeFrom specified as :"+_6.includeFrom+" format not understood - clearing this property");_6.includeFrom=null}else{if(_6.name==null)_6.name=_7[1]}}
if(_4[_6.name]!=null){this.logWarn("field.name collision: first field: "+this.echo(_4[_6.name])+", discarded field: "+this.echo(_6));continue}
_6=this.$93t(_6);if(_6.type){var _8=this.getType(_6.type);if(_8){if(_8.fieldProperties){if(_8.fieldProperties.editorProperties!=null&&!isc.isA.Object(_8.fieldProperties.editorProperties))
{_8.fieldProperties.editorProperties={}}
_6=_3[i]=isc.addProperties({},_8.fieldProperties,_6)}
if(!_6.format&&_8.format){_6.format=_8.format}
if(_8.parseInput&&isc.isA.String(_6.defaultValue)&&!isc.SimpleType.inheritsFrom(_6.type,"text")){_6.defaultValue=_8.parseInput(_6.defaultValue,_6,null,null)}}}
_4[_6.name]=_6}
this.fields=_4}
if(this.dataSourceType==isc.DataSource.VIEW)this.initViewSources();isc.DataSource.registerDataSource(this);if(this.realtimeUpdates){if(isc.Messaging){if(!isc.Messaging.getSubscribedChannels().contains("ISC_DataSourceDataChanged")){this.logWarn("registering for realtime datasource updates");isc.Messaging.subscribe("ISC_DataSourceDataChanged",isc.DataSource.onRealtimeUpdate)}}else{if(isc.hasOptionalModule("RealtimeMessaging")){this.logWarn("realtimeUpdates require RealtimeMessaging")}else{this.logWarn("Please load the RealtimeMessaging module to use realtimeUpdates")}}}},isc.A.$93t=function isc_DataSource__prettyField(_1){if(isc.isA.String(_1.validOperators)){_1.validOperators=[_1.validOperators]}
var _2;if((_1.foreignKey)&&(_1.nillable==_2)){_1.nillable=true}
return _1},isc.A.destroy=function isc_DataSource_destroy(){var _1=this.ID,_2=isc.DS;if(this.cacheResultSet){this.cacheResultSet.destroy();this.cacheResultSet=null}
if(_1&&this==window[_1])window[_1]=null;if(_2._dataSources[_1]==this)_2._dataSources[_1]=null;if(_2.$54v[_1]==this)_2.$54v[_1]=null;if(_2.$54w[_1]==this)_2.$54w[_1]=null;this.Super("destroy",arguments)},isc.A.getResultSet=function isc_DataSource_getResultSet(_1){var _2=isc.ClassFactory.getClass(this.resultSetClass||isc.ResultSet);if(!isc.isA.Class(_2)){this.logWarn("getResultSet(): Unrecognized 'resultSetClass' property:"+_2+", returning a standard isc.ResultSet.");_2=isc.ResultSet}
return _2.create(_1,{$31k:true})},isc.A.getResultTree=function isc_DataSource_getResultTree(_1){var _2=isc.ClassFactory.getClass(this.resultTreeClass||isc.ResultTree);if(!isc.isA.Class(_2)){this.logWarn("getResultTree(): Unrecognized 'resultTreeClass' property:"+_2+", returning a standard isc.ResultTree.");_2=isc.ResultTree}
return _2.create(_1,{$31k:true})},isc.A.dataChanged=function(dsResponse,dsRequest){},isc.A.updateCaches=function isc_DataSource_updateCaches(_1,_2){if(_2==null){_2={operationType:_1.operationType,dataSource:this};if(_1.clientContext!=null){_2.clientContext=_1.clientContext}
if(_1.internalClientContext!=null){_2.internalClientContext=_1.internalClientContext}}else{_2.dataSource=_2.dataSource||_1.dataSource||this}
var _3=_1.data,_4=_1.invalidateCache,_5=_1.httpResponseCode;if(!_3&&!_4&&!(_5>=200&&_5<300)){this.logWarn("Empty results returned on '"+_2.operationType+"' on dataSource '"+_2.dataSource+"', unable to update resultSet(s) on DataSource "+this.ID+".  Return affected records to ensure cache consistency.");return}
if(!this.clientOnly&&this.cacheAllData&&this.hasAllData()&&!isc.isAn.Array(_3))
{this.invalidateCache()}
this.dataChanged(_1,_2);if(_1.invalidateCache!=true&&this.clientOnly&&_3){if(_2.clientOnlyDataModified!=true){if(isc.isAn.Array(_3)){_3.forEach(function(_6){_2.data=_6;this.getClientOnlyResponse(_2,null)},this)}else{_2.data=_3;this.getClientOnlyResponse(_2,null)}}}},isc.A.getLegalChildTags=function isc_DataSource_getLegalChildTags(){var _1=this.getFieldNames(),_2=[];for(var i=0;i<_1.length;i++){if(this.fieldIsComplexType(_1[i]))_2.add(_1[i])}
return _2},isc.A.getOperationBinding=function isc_DataSource_getOperationBinding(_1,_2){if(_1==null||this.operationBindings==null)return this;if(isc.isAn.Object(_1)){var _3=_1;_1=_3.operationType;_2=_3.operationId}
var _4;if(_2){var _5=this.operationBindings.find({operationId:_2,operationType:_1});if(_5)return _5}
if(_1){var _6=this.operationBindings.findAll("operationType",_1);if(_6){for(var i=0;i<_6.length;i++){if(!_6[i].operationId||_6[i].operationId.trim()=="")
{return _6[i]}}}}
return this},isc.A.getDataFormat=function isc_DataSource_getDataFormat(_1,_2){return this.getOperationBinding(_1,_2).dataFormat||this.dataFormat},isc.A.shouldBypassCache=function isc_DataSource_shouldBypassCache(_1,_2){var _3=this.getOperationBinding(_1,_2).preventHTTPCaching;if(_3==null)_3=this.preventHTTPCaching;return _3},isc.A.copyRecord=function isc_DataSource_copyRecord(_1){if(_1==null)return null;var _2={},_3=this.getFieldNames(false);for(var i=0;i<_3.length;i++){var _5=_3.get(i),_6=_1[_5],_7=this.getField(_5);if(isc.isA.Date(_6)){var _8=new Date();_8.setTime(_6.getTime());_8.logicalDate=_6.logicalDate;_8.logicalTime=_6.logicalTime;_2[_5]=_8}else if(isc.isAn.Array(_6)&&_7.multiple==true&&_7.type==null)
{var _9=[];for(var j=0;j<_6.length;j++){if(isc.isA.Date(_6[j])){var _8=new Date();_8.setTime(_6[j].getTime());_8.logicalDate=_6[j].logicalDate;_8.logicalTime=_6[j].logicalTime;_9[j]=_8}else{_9[j]=_6[j]}}
_2[_5]=_9}else{_2[_5]=_6}}
return _2},isc.A.copyRecords=function isc_DataSource_copyRecords(_1){if(_1==null)return null;var _2=[];for(var i=0;i<_1.length;i++){var _4=_1[i],_5=this.copyRecord(_4);_2[i]=_5}
return _2},isc.A.transformRequest=function isc_DataSource_transformRequest(_1){return _1.data},isc.A.getUpdatedData=function isc_DataSource_getUpdatedData(_1,_2,_3,_4){var _5=_2.data;if(_3&&_2.status==0&&(_5==null||(isc.isA.Array(_5)&&_5.length==0)||isc.isAn.emptyString(_5)))
{this.logInfo("dsResponse for successful operation of type "+_1.operationType+" did not return updated record[s]. Using submitted request data to update ResultSet cache.","ResultSet");var _6=_1.data;if(_1.data&&isc.isAn.Object(_1.data)){if(_1.operationType=="update"){_5=isc.addProperties({},_1.oldValues);if(isc.isAn.Array(_6)){_5=isc.addProperties(_5,_6[0])}else{_5=isc.addProperties(_5,_6)}
_5=[_5]}else{if(!isc.isAn.Array(_6))_6=[_6];_5=[];for(var i=0;i<_6.length;i++){_5[i]=isc.addProperties({},_6[i])}}
_4=false;if(this.logIsDebugEnabled("ResultSet")){this.logDebug("Submitted data to be integrated into the cache:"+this.echoAll(_5),"ResultSet")}}}
return _4?isc.shallowClone(_5):_5},isc.A.serializeFields=function isc_DataSource_serializeFields(_1,_2){if(!_1&&_2!=null)_1=_2.data;if(!_1)return _1;if(isc.DS.isSimpleTypeValue(_1))return _1;if(isc.isAn.Array(_1)){var _3=[];for(var i=0;i<_1.length;i++){_3[i]=this.serializeFields(_1[i],_2)}
return _3}else if(this.isAdvancedCriteria(_1)){return this.serializeAdvancedCriteria(_1)}
_1=isc.addProperties({},_1);if(_1.__ref){delete _1.__ref;delete _1.__module}
var _5=this.getFields();for(var _6 in _5){if(!isc.isAn.Object(_1[_6]))continue;var _7=_5[_6],_8=_7.type,_9=_8!=null?isc.DataSource.get(_8):null;if(_9&&_9.serializeFields){_1[_6]=_9.serializeFields(_1[_6])}else if(isc.isA.Date(_1[_6])){if(isc.SimpleType.getBaseType(_7.type)=="date"&&!isc.SimpleType.inheritsFrom(_7.type,"datetime"))
{_1[_6].logicalDate=true}else if(isc.SimpleType.getBaseType(_7.type)=="time"){_1[_6].logicalTime=true}}}
return _1},isc.A.serializeAdvancedCriteria=function isc_DataSource_serializeAdvancedCriteria(_1){_1=isc.clone(_1);if(_1.criteria){for(var i=0;i<_1.criteria.length;i++){_1.criteria[i]=this.serializeAdvancedCriteria(_1.criteria[i])}}else{if(isc.isA.Date(_1.value)||isc.isA.Date(_1.start)||isc.isA.Date(_1.end)){var _3=this.getField(_1.fieldName);if(_3!=null){if(isc.SimpleType.getBaseType(_3.type)=="date"&&!isc.SimpleType.inheritsFrom(_3.type,"datetime"))
{if(_1.value)_1.value.logicalDate=true;if(_1.start)_1.start.logicalDate=true;if(_1.end)_1.end.logicalDate=true}else if(isc.SimpleType.getBaseType(_3.type)=="time"){if(_1.value)_1.value.logicalTime=true;if(_1.start)_1.start.logicalTime=true;if(_1.end)_1.end.logicalTime=true}}}}
return _1},isc.A.getDataProtocol=function isc_DataSource_getDataProtocol(_1){if(_1.dataProtocol!=null){return _1.dataProtocol}
var _2=this.getOperationBinding(_1),_3=this.getWebService(_1);return(_2.dataProtocol!=null?_2.dataProtocol:isc.isA.WebService(_3)?"soap":this.clientOnly?"clientOnly":this.dataProtocol||"getParams")},isc.A.$754=function isc_DataSource__storeCustomRequest(_1){if(!this.$624)this.$624={};this.$624[_1.requestId]=_1},isc.A.getServiceInputs=function isc_DataSource_getServiceInputs(_1){var _2=this.getOperationBinding(_1),_3=this.getWebService(_1),_4=this.getWSOperation(_1);this.addDefaultCriteria(_1,_2);_1.originalData=_1.data;this.$754(_1);this.applySendExtraFields(_1);if(!this.clientOnly){if(this.fulfilledFromOffline(_1))return{dataProtocol:"clientCustom"};_1.unconvertedDSRequest=isc.shallowClone(_1)}
if(this.autoConvertRelativeDates==true){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Calling convertRelativeDates from getServiceInputs - data is\n\n"+isc.echoFull(_6))}
var _5=this.convertRelativeDates(_1.data);if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Called convertRelativeDates from getServiceInputs - data is\n\n"+isc.echoFull(_6))}
_1.data=_5}else{_1.data=this.embedTimezoneInRelativeDates(_1.data)}
_1.dataProtocol=this.getDataProtocol(_1);var _6=this.transformRequest(_1);if(_6!==_1){_1.data=_6}
var _7=this.getDataProtocol(_1),_8=_7=="clientCustom";if(_8){return{dataProtocol:"clientCustom"}}else{delete this.$624[_1.requestId]}
if(isc.isA.WebService(_3)){if(_1.wsOperation==null&&isc.isAn.Object(_4)){_1.wsOperation=_4.name}
this.logInfo("web service: "+_3+", wsOperation: "+this.echoLeaf(_4),"xmlBinding")}
_1.$85o=isc.timestamp();var _9=this.getDataURL(_1);_9=_1.actionURL||_1.dataURL||_9;if(_1.useHttpProxy==null){_1.useHttpProxy=this.$du(_2.useHttpProxy,this.useHttpProxy)}
var _10,_11=_2.defaultParams||this.defaultParams,_12=_1.params;if(_11||_12){_10=isc.addProperties({},_11,_12)}
var _13=_7=="getParams"||_7=="postParams";if(_13){_10=isc.addProperties(_10||{},_1.data)}
if(_13){if(_10)_10=this.serializeFields(_10,_1);return{actionURL:_9,httpMethod:_1.httpMethod||(_7=="getParams"?"GET":"POST"),params:_10}}
var _14={actionURL:_9,httpMethod:_1.httpMethod||"POST"};if(_10)_14.params=_10;if(_7=="postMessage"){_14.data=(_1.data||"").toString()}
if(_7=="postXML"||_7=="soap"){var _15=this.getSerializeFlags(_1);var _16=_14.data=this.getXMLRequestBody(_1);_14.contentType=_1.contentType||"text/xml";this.logDebug("XML post requestBody is: "+_16,"xmlBinding")}
if(_7=="soap"){var _17=this.$du(_2.soapAction,_4.soapAction);if(_17==null)_17='""';_14.httpHeaders=isc.addProperties({SOAPAction:_17},_1.httpHeaders);var _18=isc.isA.WebService(_3)&&this.$du(_2.spoofResponses,this.spoofResponses);if(_18){_14.spoofedResponse=_3.getSampleResponse(_4.name);this.logInfo("Using spoofed response:\n"+_14.spoofedResponse,"xmlBinding")}}
if(this.logIsDebugEnabled("xmlBinding")){this.logDebug("serviceInputs are: "+this.echo(_14),"xmlBinding")}
return _14},isc.A.$181i=function isc_DataSource__getCombinedImplicitCriteria(_1){var _2=_1.resultSet||_1.resultTree,_3=isc.DataSource.copyCriteria(_1.dbcImplicitCriteria);if(!_3&&_2&&_2.getImplicitCriteria){_3=_2.getImplicitCriteria()}
if(this.implicitCriteria){_3=this.combineCriteria(_3,isc.DataSource.copyCriteria(this.implicitCriteria),null,_1.textMatchStyle)}
if(_3)_3=isc.DS.compressNestedCriteria(_3);return _3},isc.A.addImplicitCriteria=function isc_DataSource_addImplicitCriteria(_1){if(!_1||_1.operationType!="fetch")return;var _2=this.$181i(_1);var _3=false;if(_2){_1.explicitCriteria=isc.shallowClone(_1.data);_1.data=this.combineCriteria(_1.data,_2,null,_1.textMatchStyle);this.logInfo("Explicit criteria: \n"+isc.echoFull(_1.explicitCriteria)+"\n\nimplicitCriteria: \n"+isc.echoFull(_2)+"\n\nAll criteria: \n"+isc.echoFull(_1.data))}},isc.A.addDefaultCriteria=function isc_DataSource_addDefaultCriteria(_1,_2){var _3=_2.defaultCriteria||this.defaultCriteria;if(!_3)return;_3=isc.addProperties({},_3);if(_3&&_1.operationType=="fetch"){if(this.isAdvancedCriteria(_1.data)){var _4=this.mineCriteriaFieldNames(_1.data);for(var _5 in _3){if(_4.contains(_5))delete _3[_5]}}
if(isc.getValues(_3).length>0){_1.data=this.combineCriteria(_1.data,_3,"and",null,_1.textMatchStyle)}}},isc.A.mineCriteriaFieldNames=function isc_DataSource_mineCriteriaFieldNames(_1){var _2=[];if(!_1.criteria)return _2;for(var i=0;i<_1.criteria.length;i++){if(_1.criteria[i].criteria){_2.addList(this.mineCriteriaFieldNames(_1.criteria[i]))}else{_2.add(_1.criteria[i].fieldName)}}
return _2},isc.A.$190f=function isc_DataSource__removeExtraAdvancedCriteriaFields(_1){var _2=_1.criteria;if(_2){var _3=_1.operator,_4=_3=="or"||_3=="OR";for(var i=0;i<_2.length;i++){if(this.$190f(_2[i])){if(_4){_2.length=0}else{_2.removeAt(i--)}}}
return _2.length==0}else{var _6=_1.fieldName;return!this.getField(_6)}},isc.A.applySendExtraFields=function isc_DataSource_applySendExtraFields(_1){if(this.sendExtraFields)return;var _2=_1.data;if(!isc.isAn.Array(_2))_2=[_2];for(var i=0;i<_2.length;i++){var _4=_2[i];if(!isc.isAn.Object(_4))continue;if(this.isAdvancedCriteria(_4)){this.$190f(_4)}else{for(var _5 in _4){if(!this.getField(_5))delete _4[_5]}}}},isc.A.processResponse=function isc_DataSource_processResponse(_1,_2){var _3=this.$624[_1];if(_3==null){this.logWarn("DataSource.processResponse(): Unable to find request corresponding to ID "+_1+", taking no action.");return}
delete this.$624[_1];if(_2.status==null)_2.status=0;if(_2.status==0){var _4=_2.data;if(_4==null)_2.data=_4=[];if(_2.startRow==null)_2.startRow=_3.startRow||0;if(_2.endRow==null)_2.endRow=_2.startRow+_4.length;if(_2.totalRows==null){_2.totalRows=Math.max(_2.endRow,_4.length)}}
this.$38b(_4,_2,_3)},isc.A.$50e=function isc_DataSource__handleClientOnlyReply(_1,_2,_3){var _4=this.cacheAllData&&!this.clientOnly&&this.cacheResultSet?this.cacheResultSet.getAllRows():null,_5=_3._dsRequest;var _6=function(_7){_1.clientOnlyData=_7?_7.data:null;this.$38b(_2,_7,_5,_1,_3)};if(this.copyLocalResults&&this.getClientOnlyResponse===isc.DataSource.getInstanceProperty("getClientOnlyResponse"))
{this.$110m(_5,_4,_6)}else{var _7=this.getClientOnlyResponse(_5,_4);_6.call(this,_7)}},isc.A.$110m=function isc_DataSource__asyncGetClientOnlyResponse(_1,_2,_3){var _4=_1.operationType,_5={status:0};if(!(_4=="fetch"||_4=="select"||_4=="filter")){_3.apply(this,[this.getClientOnlyResponse(_1,_2)]);return}
_2=_2||this.testData;var _6=this.cacheData,_7=this.testData,_8=false;if(_2&&!this.testData&&this.clientOnly){_6=_7=_2;_8=true}
if(!_2||isc.isA.String(_2)){if(isc.isA.String(_2)){this.logInfo(this.ID+" datasource: using testData property as data");_6=_7=isc.eval(_2);_8=true}else if(window[this.ID+"TestData"]){this.logInfo(this.ID+" datasource: using "+this.ID+"TestData object as data");_6=_7=window[this.ID+"TestData"];_8=true}else{this.logInfo(this.ID+" datasource: testData property and "+this.ID+"TestData object not found, using empty list as data");_6=_7=[];_8=true}
_2=_7}
var _9=this.getClientOnlyFetchResponse(_1,_2,true);_5=_9[0];var _10=_9[1];var _11=function(){_5.data=_10;this.$109x(_5,_4);if(_8){this.cacheData=this.testData=_2}
_3.call(this,_5)};if(this.copyLocalResults){this.$110n(0,_10.length,_10,_11)}else{_11.call(this)}},isc.A.$110n=function isc_DataSource__asyncCopyLocalResults(_1,_2,_3,_4){var _5=_2,_6=isc.Browser.isSGWT;_2=Math.min(_2,_1+this.$110l);for(var i=_1;i<_2;++i){if(this.deepCopyLocalResults){_3[i]=isc.clone(_3[i])}else{_3[i]=isc.addProperties({},_3[i])}
if(_6){_3[i][isc.gwtRef]=null;_3[i][isc.gwtModule]=null}}
if(_2==_5){_4.call(this)}else{this.delayCall("$110n",[_2,_5,_3,_4],0)}},isc.A.$38a=function isc_DataSource__handleCustomReply(_1,_2,_3){var _4={data:_2,startRow:0,endRow:0,totalRows:0,status:0};var _5=_3._dsRequest;this.$38b(_2,_4,_5,_1,_3)},isc.A.$377=function isc_DataSource__handleJSONReply(_1,_2,_3){var _4=_3._dsRequest,_5=this.getOperationBinding(_4).recordXPath||this.recordXPath;if((_1.$38c||_1.$69j)&&this.logIsDebugEnabled("xmlBinding")){this.logDebug("Raw response data: "+this.echoFull(_2),"xmlBinding")}
var _6=_2;if(_2){if(_5){_2=isc.xml.selectObjects(_2,_5);this.logInfo("JSON recordXPath: '"+_5+"', selected: "+this.echoLeaf(_2),"xmlBinding")}
var _7=this.getOperationBinding(_4).responseDataSchema;_2=this.recordsFromObjects(_2,_7);if(this.logIsDebugEnabled("xmlBinding")){this.logDebug("Validated dsResponse.data: "+isc.echoFull(_2),"xmlBinding")}
var _8={data:_2,startRow:_4.startRow||0,status:0};_8.endRow=_8.startRow+Math.max(0,_2.length);_8.totalRows=Math.max(_8.endRow,_2.length)}else{var _9=_1.status;if(_9==0||_9==null)_9=-1;var _8={status:_9,data:_1.data};_6=_1.results}
this.$38b(_6,_8,_4,_1,_3)},isc.A.$69k=function isc_DataSource__handleCSVTextReply(_1,_2,_3){if(_1.status!=0)return;var _4=isc.TextImportSettings.create({hasHeaderLine:true,trim:true});isc.TextImportSettings.$935=true;var _5=this.recordsFromText(_1.data,_4);isc.TextImportSettings.$935=false;_1.$69j=true;this.$377(_1,_5,_3)},isc.A.$379=function(rpcResponse,jsonText,rpcRequest){if(rpcRequest.isRestRequest&&!isc.isA.String(jsonText)){var jsonObjects=jsonText}else{if(rpcResponse.status>=0){var evalText=jsonText;if(rpcRequest.transport!="scriptInclude"&&evalText!=null){var re;if(this.jsonPrefix){re=new RegExp(/^\s*/);evalText=evalText.replace(re,"");if(evalText.startsWith(this.jsonPrefix)){evalText=evalText.substring(this.jsonPrefix.length)}else{if(!rpcResponse.data||rpcResponse.data.length==0){this.logInfo("DataSource specifies jsonPrefix, but empty response returned from server. Processing response anyway.")}else{rpcResponse.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;rpcResponse.data="The server failed to return a formatted response at all.";this.logWarn("DataSource specifies jsonPrefix, but not present in response returned from server. Processing response anyway.");this.$377(rpcResponse,jsonObjects,rpcRequest);return}}}
if(this.jsonSuffix){re=new RegExp(/\s*$/)
evalText=evalText.replace(re,"");if(evalText.endsWith(this.jsonSuffix)){evalText=evalText.substring(0,(evalText.length-this.jsonSuffix.length))}else{if(!rpcResponse.data||rpcResponse.data.length==0){this.logInfo("DataSource specifies jsonSuffix, but empty response returned from server. Processing response anyway.")}else{rpcResponse.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;rpcResponse.data="The server failed to return a formatted response at all.";this.logWarn("DataSource specifies jsonSuffix, but not present in response returned from server. Processing response anyway.");this.$377(rpcResponse,jsonObjects,rpcRequest);return}}}}
var wasInvalid=false;try{var jsonObjects;if(rpcRequest.useStrictJSON){jsonObjects=isc.Class.parseStrictJSON(evalText,rpcRequest.jsonReviver)}else{if(evalText&&evalText.match(/^\s*\{/)){evalText="var evalText = "+evalText+";evalText;"}
jsonObjects=isc.eval(evalText)}}catch(e){rpcResponse.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;rpcResponse.data="Error: server returned invalid JSON response";this.logWarn("Error evaluating JSON: "+e.toString()+", JSON text:\n"+jsonText);wasInvalid=true}
if(jsonObjects==null&&!wasInvalid){rpcResponse.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;rpcResponse.data="Error: server returned invalid JSON response";this.logWarn("Evaluating JSON reply resulted in empty value. JSON text:\n"+this.echo(jsonText));jsonObjects=jsonText}
rpcResponse.$38c=true}}
this.$377(rpcResponse,jsonObjects,rpcRequest)},isc.A.$185y=function isc_DataSource__setCanSkipJSONValidation(_1){var _2=isc.SimpleType.inheritsFrom(_1.type,"text")||isc.SimpleType.inheritsFrom(_1.type,"float")||isc.SimpleType.inheritsFrom(_1.type,"integer")||isc.SimpleType.inheritsFrom(_1.type,"boolean");return(_1.$185z=_2)},isc.A.recordsFromObjects=function isc_DataSource_recordsFromObjects(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];if(this.skipJSONValidation==true||this.skipJSONValidation=="full")return _1;for(var i=0;i<_1.length;i++){_1[i]=this.validateJSONRecord(_1[i],null,_2)}
return _1},isc.A.validateJSONRecord=function isc_DataSource_validateJSONRecord(_1,_2,_3){if(!_1){return null}
if(_3==null){_3=this}
var _4=this.skipJSONValidation=="partial",_5=this.getFieldNames(),_6={};for(var i=0;i<_5.length;i++){var _8=_5[i],_9=_3.getField(_8),_10;if(_9.valueXPath&&!_2&&_9.valueXPath!=_8){_10=isc.xml.selectObjects(_1,_9.valueXPath,true)}else{_10=_1[_8]}
if(_9.getFieldValue){if(!isc.isA.Function(_9.getFieldValue)){isc.Func.replaceWithMethod(_9,"getFieldValue","record,value,field,fieldName")}
_10=_9.getFieldValue(_1,_10,_9,_8)}
var _11;if(_10!==_11){if(_4){var _12=_9.$185z;if(_12==null){_12=this.$185y(_9)}
if(_12){_6[_8]=_10;continue}}
var _13=isc.DS.get(_9.type);if(_13&&!(_13.skipJSONValidation==true||_13.skipJSONValidation=="full"))
{if(isc.isAn.Array(_10)){for(var j=0;j<_10.length;j++){_10[j]=_13.validateJSONRecord(_10[j])}}else{_10=_13.validateJSONRecord(_10)}}
if(_9.multiple&&isc.isAn.Array(_10)){var _15=[];for(var j=0;j<_10.length;j++){_15.push(this.validateFieldValue(_9,_10[j]))}
_6[_8]=_15}else{_6[_8]=this.validateFieldValue(_9,_10)}}}
if(_3.dropExtraFields)return _6;for(var i=0;i<_5.length;i++){var _8=_5[i];_1[_8]=_6[_8]}
return _1},isc.A.getMessageSerializer=function isc_DataSource_getMessageSerializer(_1,_2){var _3=this.getOperationBinding(_1,_2);if(_3.wsOperation){var _4=this.getWebService(_1,_2);return _4.getMessageSerializer(_3.wsOperation)}
return this},isc.A.getXMLRequestBody=function isc_DataSource_getXMLRequestBody(_1,_2){if(isc.$cv)arguments.$cw=this;var _3=isc.SB.create(),_4=this.getDataProtocol(_1);if(_4=="soap"){_3.append(this.getSoapStart(_1),"\n");_3.append(this.getSoapBody(_1,_2));_3.append("\n",this.getSoapEnd(_1))}else{if(this.messageStyle=="template"){_3.append(this.$38d(_1))}else{var _5=this.getMessageSerializer(_1);var _2=this.getSerializeFlags(_1,_2);_3.append(_5.xmlSerialize(_1.data,_2))}}
if(this.logIsDebugEnabled("xmlComm")){this.logDebug("outbound XML message: "+_3,"xmlComm")}
return _3.release(false)},isc.A.$38d=function isc_DataSource__createTemplatedRequestBody(_1){var _2=this.soapBodyTemplate,_3;_3=_2.evalDynamicString(this,_1);return _3},isc.A.getSchemaSet=function isc_DataSource_getSchemaSet(){return isc.SchemaSet.get(this.schemaNamespace)},isc.A.hasWSDLService=function isc_DataSource_hasWSDLService(_1){return isc.isA.WebService(this.getWebService(_1))},isc.A.getWebService=function isc_DataSource_getWebService(_1){var _2=this.getOperationBinding(_1),_3=(_1?_1.serviceNamespace:null)||_2.serviceNamespace||this.serviceNamespace,_4=(_1?_1.serviceName:null)||_2.serviceName||this.serviceName;var _5;if(_1&&_1.$167f){_5=_1.$167f}else if(_4)_5=isc.WebService.getByName(_4,_3);else _5=isc.WebService.get(_3);if((_3!=null||_4!=null)&&_5==null){this.logWarn("Could not find WebService definition: "+(_4?"serviceName: "+_4:"")+(_3?"   serviceNamespace: "+_3:""))}
return _5||this});isc.evalBoundary;isc.B.push(isc.A.getWSOperation=function isc_DataSource_getWSOperation(_1){var _2=this.getOperationBinding(_1),_3=(isc.isAn.Object(_1)?_1.wsOperation:null)||_2.wsOperation||this.wsOperation,_4=this.getWebService(_1);if(_3!=null&&isc.isA.WebService(_4)){var _5=_4.getOperation(_3);if(!_5){isc.logWarn(this+": getWSOperation(): could not retrieve the operation '"+_3+"'")}
return _5}
return this},isc.A.getDataURL=function isc_DataSource_getDataURL(_1){var _2=this.getOperationBinding(_1);if(_2!=this&&_2.dataURL)return _2.dataURL;if(this.dataURL!=null)return this.dataURL;if(this.hasWSDLService(_1)){var _3=this.getWebService(_1);return _3.getDataURL(this.getWSOperation(_1).name)}
return this.dataURL},isc.A.getGlobalNamespaces=function isc_DataSource_getGlobalNamespaces(_1){var _2=this.getWebService(_1),_3=this.globalNamespaces;if(_2&&_2.globalNamespaces){_3=isc.addProperties({},_3,_2.globalNamespaces)}
return _3},isc.A.getSoapStart=function isc_DataSource_getSoapStart(_1){var _2=this.getWebService(_1);if(_2.getSoapStart)return _2.getSoapStart(_1);return isc.SB.concat(isc.DataSource.$37t,isc.xml.$37l(this.getGlobalNamespaces(_1),null,"         "),">",isc.DataSource.$37u,this.getSoapHeader(_1),isc.DataSource.$51y)},isc.A.getSoapHeader=function isc_DataSource_getSoapHeader(_1){var _2=this.getWebService(_1);if(_2.getSoapHeader)return _2.getSoapHeader(_1);var _3=_1.headerData||_2.getHeaderData(_1);if(!_3)return;this.logDebug("headerData is: "+this.echo(_3),"xmlBinding");var _4=_2.getInputHeaderSchema(this.getWSOperation(_1))||isc.emptyObject;var _5="",_6=_1.useFlatHeaderFields;for(var _7 in _3){var _8=_4[_7];if(_8!=null){if(isc.isA.DataSource(_8)){_5+=_8.xmlSerialize(_3[_7],{useFlatFields:_6})}else{_5+="\n     "+this.$38g(_7,_8,_3[_7],_8.partNamespace)}}else{this.logWarn("headerData passed for SOAP header partName: "+_7+", no schema available, not outputting")}}
return _5},isc.A.getSoapBody=function isc_DataSource_getSoapBody(_1,_2){if(isc.$cv)arguments.$cw=this;var _3=isc.SB.create(),_4=this.getWebService(_1),_5=this.getSoapStyle(_1),_6=this.getWSOperation(_1),_7=this.xmlNamespaces?isc.makeReverseMap(this.xmlNamespaces):null,_2=isc.addProperties({nsPrefixes:isc.addProperties({},_7)},_2),_8=_2.generateResponse?_4.getResponseMessage(_6.name):_4.getRequestMessage(_6.name),_9=_2.bodyPartNames||_4.getBodyPartNames(_6.name,_2.generateResponse);_2=this.getSerializeFlags(_1,_2);isc.Comm.omitXSI=_6.inputEncoding!="encoded";var _10=isc.Comm.xmlSchemaMode;isc.Comm.xmlSchemaMode=true;var _11="        ";if(_5=="rpc"){_3.append("\n",_11,isc.Comm.$36u(_6.name,null,_6.inputNamespace,"opNS",true),">");_11+="    "}
this.logInfo("soap:body parts in use: '"+_9+"', soapStyle: "+_5,"xmlSerialize");if(this.logIsDebugEnabled("xmlSerialize")){this.logDebug("SOAP data is: "+this.echoFull(_1.data),"xmlSerialize")}
for(var i=0;i<_9.length;i++){var _13=_9[i];var _14=_9.length<2&&_5=="document"?_1.data:(_1.data?_1.data[_13]:null);var _15=_8.getMessagePart(_13,_14,_2,_11);_3.append("\n"+_11+_15)}
if(_5=="rpc"){_3.append("\n","        ",isc.Comm.$36v(_6.name,_6.inputNamespace,"opNS"))}
isc.Comm.omitXSI=null;isc.Comm.xmlSchemaMode=_10;return isc.SB.concat("    ",isc.DS.$37v,this.outputNSPrefixes(_2.nsPrefixes,"        "),">",_3.release(false),"\n    ",isc.DS.$51z)},isc.A.getMessagePart=function isc_DataSource_getMessagePart(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;var _5=this.getPartField(_1),_6=this.getSchema(_5.type,_5.xsElementRef?"element":null),_7=this.logIsInfoEnabled("xmlSerialize");if(isc.isA.DataSource(_6)){if(_7){this.logInfo("soap:body part '"+_1+"' is complex type with schema: "+_6+" has value: "+(this.logIsDebugEnabled("xmlSerialize")?this.echo(_2):this.echoLeaf(_2)),"xmlSerialize")}
var _8=_5.xsElementRef?null:_1;return _6.xmlSerialize(_2,_3,_4,_8)}else{if(_2!=null&&!isc.DS.isSimpleTypeValue(_2)){_2=_2[_5.name]||_2[_1]||_2}
if(_7){this.logInfo("soap:body part '"+_1+"' is of simple type '"+_5.type+"' has value: '"+this.echoLeaf(_2)+"'","xmlSerialize")}
var _9=this.getType(_5.type),_10=_5.partNamespace;if(!_10&&_9&&_9.schemaNamespace){_10=_9.schemaNamespace}
return this.$38g(_5.name||_1,_5,_2,_10,_3)}},isc.A.getPartField=function isc_DataSource_getPartField(_1){var _2=isc.getValues(this.getFields()).find("partName",_1);if(_2!=null)return _2;return this.getField(_1)},isc.A.getSoapEnd=function isc_DataSource_getSoapEnd(_1){var _2=this.getWebService(_1);if(_2.getSoapEnd)return _2.getSoapEnd(_1);return isc.DataSource.$37w},isc.A.getSoapStyle=function isc_DataSource_getSoapStyle(_1){if(!this.hasWSDLService(_1))return"document";return this.getWebService(_1).getSoapStyle(this.getWSOperation(_1).name)},isc.A.getSerializeFlags=function isc_DataSource_getSerializeFlags(_1,_2){_2=isc.addProperties({soapStyle:this.getSoapStyle(_1)},_2);var _3=this.getOperationBinding(_1);_2.flatData=this.$du(_1.useFlatFields,_3.useFlatFields,this.useFlatFields);_2.recursiveFlatFields=this.$du(_1.recursiveFlatFields,_3.recursiveFlatFields,this.recursiveFlatFields);_2.textContentProperty=this.$du(_1.textContentProperty,_3.textContentProperty);_2.dsRequest=_1;_2.startRowTag=_3.startRowTag||this.startRowTag;_2.endRowTag=_3.endRowTag||this.endRowTag;return _2},isc.A.xmlSerialize=function isc_DataSource_xmlSerialize(_1,_2,_3,_4){if(!_2)_2={};if(_2.useFlatFields)_2.flatData=true;var _5=this.getSchemaSet(),_6=(_2.qualifyAll==null);if(_5&&_5.qualifyAll){_2.qualifyAll=true}
var _7;if(_2.nsPrefixes==null){var _8=this.xmlNamespaces?isc.makeReverseMap(this.xmlNamespaces):null;_2.nsPrefixes=isc.addProperties({},_8);_7=true}
var _9=isc.Comm.xmlSchemaMode;isc.Comm.xmlSchemaMode=true;var _10,_11=null;if(_2.xmlExplicitType){_10=true;_11=isc.Comm.omitXSI;isc.Comm.omitXSI=false}else{if(isc.Comm.omitXSI==null){_10=isc.Comm.omitXSI=true}}
var _12=this.$ew(_1,_2,_3,_4,_7);if(_6)_2.qualifyAll=null;isc.Comm.xmlSchemaMode=_9;if(_10){isc.Comm.omitXSI=_11}
return _12},isc.A.$ew=function isc_DataSource__xmlSerialize(_1,_2,_3,_4,_5){if(isc.$cv)arguments.$cw=this;if(this.logIsDebugEnabled("xmlSerialize")){this.logDebug("schema: "+this+" serializing: "+this.echo(_1)+" with flags: "+this.echo(_2),"xmlSerialize")}
var _6=this.mustQualify||_2.qualifyAll,_4=_4||this.tagName||this.ID;var _7=this.$151z(this.xmlExplicitTypes),_8=(_7?_7:_2.xmlExplicitType);if(!_2.ignoreConstructor){var _9;if(_1!=null&&(_1._constructor||isc.isAn.Instance(_1))){var _9=isc.isAn.Instance(_1)?_1.Class:isc.DS.getNearestSchema(_1._constructor);if(isc.isAn.Object(_9)){_9=_9.type}
if(!_9&&_1._constructor)_9=_1._constructor}}
if(isc.DS.isSimpleTypeValue(_1)){if(isc.isA.String(_1)&&isc.startsWith(_1,"ref:")){var _10=""
if(_3&&_3.length>0){_10="\n"+_3}
return _10+"<"+_4+" ref=\""+_1.substring(4)+"\"/>"}
this.logDebug("simple type value: "+this.echoLeaf(_1)+" passed to xmlSerialize on "+this,"xmlSerialize");return isc.Comm.$ew(_4||this.tagName||this.ID,_1)}
if(isc.isAn.Instance(_1))_1=_1.getSerializeableFields();if(isc.isAn.Array(_1)&&!this.canBeArrayValued)return this.map("xmlSerialize",_1,_2,_3).join("\n");var _11=isc.SB.create(),_3=_3||"";_11.append("\n",_3);var _12;if(_6){_12=(this.isA("XSComplexType")?_2.parentSchemaNamespace:null)||this.schemaNamespace}
var _13;if(_2.xmlExplicitType)_13=null;else _13=this.ID;_11.append(isc.Comm.$36u(_4,_13,_12,_2.nsPrefixes,true));_1=this.serializeAttributes(_1,_11,_2);if(_9&&_4!=_9){if(isc[_9]!=null){_11.append(" constructor=\"",_9,"\"")}else{_11.append(" _constructor=\"",_9,"\"")}}
var _14;if(_1!=null){_14=this.xmlSerializeFields(_1,_2,_3+(!_2||_2.indent!=false?"    ":""))}
if(_5){_11.append(this.outputNSPrefixes(_2.nsPrefixes,_3+(!_2||_2.indent!=false?"     ":""),_2))}
var _15=this.$45z;this.$45z=null;if(_14==null||isc.isAn.emptyString(_14)){_11.append("/>");return _11.release(false)}
_11.append(">",_14,(_15?"":"\n"+_3));_11.append(isc.Comm.$36v(_4,_12,_2.nsPrefixes));return _11.release(false)},isc.A.outputNSPrefixes=function isc_DataSource_outputNSPrefixes(_1,_2,_3){delete _1.$36y;_1=isc.makeReverseMap(_1);var _4=isc.xml.$37l(_1,null,_2+(!_3||_3.indent!=false?"        ":""));return _4},isc.A.serializeAttributes=function isc_DataSource_serializeAttributes(_1,_2,_3){var _4=this.getFieldNames(),_5=true;for(var i=0;i<_4.length;i++){var _7=_4[i],_8=this.getField(_7),_9=_8.xmlAttribute||(_8.xmlAttributeInRuleCriteria&&_3.isRuleCriteria);if(_9&&((_1&&_1[_7]!=null)||_8.xmlRequired)){if(_5){_1=isc.addProperties({},_1);_5=false}
var _10=_1[_7];if(_3&&_3.spoofData)_10=this.getSpoofedData(_8);if(isc.isAn.Instance(_10)){if(_10.ID){_10=_10.ID}else{this.logWarn("Serializing attribute "+_7+" failed to replace object instance with ID")}}
_2.append(" ",_7,"=\"",this.$38f(_8,_10),"\"");delete _1[_7]}}
return _1},isc.A.xmlSerializeFields=function isc_DataSource_xmlSerializeFields(_1,_2,_3){var _4=isc.SB.create(),_2=_2||isc.emptyObject,_5=_2.flatData,_6=_2.spoofData,_3=_3||"",_7=this.$151z(this.xmlExplicitTypes),_8=(_7?_7:_2.xmlExplicitType);;var _1=isc.addProperties({},_1);if(_1.__ref){delete _1.__ref;delete _1.__module}
var _9=this.getFields();for(var _10 in _9){var _11=this.getField(_10),_12=_1[_10],_13=this.fieldIsComplexType(_10);if(_11.skipSerialization){if(!_5&&_1[_10]!=null)delete _1[_10];continue}
var _14=_1[_10];if(_2.startRowTag==_11.name&&_14==null){_14=_2.dsRequest?_2.dsRequest.startRow:null}else if(_2.endRowTag==_11.name&&_14==null){_14=_2.dsRequest?_2.dsRequest.endRow:null}else if(_13&&_5&&_14==null){_14=_1}
var _15=(_11.xmlRequired&&!_11.xmlAttribute)||(_1[_10]!=null||(_6&&!_11.xmlAttribute));if(_5&&_13){var _16=this.getSchema(_11.type),_17=isc.clone(_2.nsPrefixes),_18=_16.xmlSerializeFields(_14,_2);if(_18!=null&&!isc.isAn.emptyString(_18)){_15=true}
_2.nsPrefixes=_17}
if(_15){if(_5&&_13&&_1[_10]!=null&&!isc.DS.isSimpleTypeValue(_1[_10])&&!_2.recursiveFlatFields)
{_2=isc.addProperties({},_2);_2.flatData=false}
var _19=this.$151z(_11.xmlExplicitTypes),_20=(_19?_19:_8);_2=isc.addProperties({},_2,{xmlExplicitType:_20});_4.append(this.xmlSerializeField(_10,_14,_2,_3))}
if(!_5&&_1[_10]!=null)delete _1[_10]}
if(!_5&&!isc.isA.Schema(this)){for(var _10 in _1){_4.append(this.xmlSerializeField(_10,_1[_10],_2,_3))}}
return _4.release(false)},isc.A.xmlSerializeField=function isc_DataSource_xmlSerializeField(_1,_2,_3,_4){var _5=isc.SB.create(),_6=this.getField(_1);if(_6==null&&(_1.startsWith("_")||_1.startsWith("$")))return;var _7=(_6?_6.type:null),_8=_3&&_3.flatData,_9=_3&&_3.spoofData,_4=_4||"";if(_9)_2=this.getSpoofedData(_6);if(this.logIsDebugEnabled("xmlSerialize")){this.logDebug("serializing fieldName: "+_1+" with type: "+_7+" with value: "+this.echo(_2),"xmlSerialize")}
var _10=((_6&&_6.mustQualify)||_3.qualifyAll?this.getSchemaSet().schemaNamespace:null);var _11=_3.textContentProperty||this.textContentProperty,_12=this.getTextContentField();if(_1==_11&&(_12!=null||!this.hasXMLElementFields(_11)))
{this.$45z=true;return this.$38f(_12,_2)}
if(_7==this.$41v&&_2!=null){if(_2.iscAction){_2=_2.iscAction}else if(isc.isA.StringMethod(_2)){_2=_2.value}}
var _13=!_3.xmlExplicitType||this.shouldWriteSchemaType(_6)?this.$38h(_6?_6.type:null,_2):null;var _14,_15=null;if(_3.xmlExplicitType){_14=true;_15=isc.Comm.omitXSI;isc.Comm.omitXSI=false}
var _16=isc.Comm.$36u(_1,_13,_10,_3.nsPrefixes),_17=isc.Comm.$36v(_1,_10,_3.nsPrefixes);var _18=isc.isAn.Array(_2)?_2:[_2];if(!_6&&_3.schema&&_3.schema.getField){_6=_3.schema.getField(_1)}
if(this.fieldIsComplexType(_1)){var _19=_3.parentSchemaNamespace;_3.parentSchemaNamespace=this.schemaNamespace;var _20=this.getFieldDataSource(_6,_6&&_6.xsElementRef?"element":null);if(_6.multiple){_5.append("\n",_4,_16);for(var i=0;i<_18.length;i++){var _22=_20;if(_18[i]!=null&&_18[i]._constructor){_22=isc.DS.get(_18[i]._constructor)||_20}
_5.append(_22.xmlSerialize(_18[i],_3,_4+(!_3||_3.indent!=false?"    ":""),_18[i]==null?_6.childTagName:_18[i].$97p||_6.childTagName))}
_5.append("\n",_4,_17)}else if(_20.canBeArrayValued&&isc.isAn.Array(_2)){_5.append(_20.xmlSerialize(_2,_3,_4,_1))}else if(_18.length==1&&isc.isA.String(_18[0])&&isc.startsWith(_18[0],"ref:")){_16=isc.Comm.$36u(_1,_13,_10,_3.nsPrefixes,true);_5.append("\n",_4);_5.append(_16);_5.append(" ref=\"",_2.substring(4),"\"/>")}else{for(var i=0;i<_18.length;i++){var _2=_18[i];if(_2==null){_5.append("\n",_4);_5.append(_16,_17)}else if(isc.DS.isSimpleTypeValue(_2)){if(isc.isA.String(_2)&&isc.startsWith(_2,"ref:")){_5.append("\n",_4);_5.append(_16);var _23=(_6?_6.childTagName||_6.type:"value");_5.append("<",_23," ref=\"",_2.substring(4),"\"/>");_5.append(_17)}else{this.logWarn("simple type value "+this.echoLeaf(_2)+" passed to complex field '"+_6.name+"'","xmlSerialize");_5.append("\n",_4);_5.append(isc.Comm.xmlSerialize(_1,_2))}}else{if(_6.isRuleCriteria)_3.isRuleCriteria=true;_5.append(_20.xmlSerialize(_2,_3,_4,_1));delete _3.isRuleCriteria}}}
_3.parentSchemaNamespace=_19}else if(_6!=null){if(_6.xsElementRef){var _24=this.getType(_6.type);if(_24&&_24.schemaNamespace)
{_10=_24.schemaNamespace}}
if(_6.multiple){_5.append("\n",_4,_16,"\n");for(var i=0;i<_18.length;i++){_5.append(this.$38g(_6.childTagName,_6,_18[i],_10,_3),"\n",_4)}
_5.append("\n",_4,_17,"\n")}else{for(var i=0;i<_18.length;i++){_5.append("\n",_4,this.$38g(_1,_6,_18[i],_10,_3))}}}else{for(var i=0;i<_18.length;i++){if(_18[i]==null||isc.isAn.emptyObject(_18[i])){_5.append("\n",_4,_16,_17)}else{_5.append("\n",_4,isc.Comm.$ew(_1,_18[i],_4,{isRoot:false}))}}}
if(_14){isc.Comm.omitXSI=_15}
return _5.release(false)},isc.A.shouldWriteSchemaType=function isc_DataSource_shouldWriteSchemaType(_1){if(!_1)return true;if(_1.serializeXMLType!=null)return _1.serializeXMLType;else{return(_1.type==null||_1.type=="any")}},isc.A.$38g=function isc_DataSource__serializeSimpleTypeTag(_1,_2,_3,_4,_5){var _6=_2.type,_5=_5||{};if(isc.isAn.Object(_3)&&!isc.isA.Function(_3.$ew)){return isc.Comm.xmlSerialize(_1||null,_3)}else{var _6=!_5.xmlExplicitType||this.shouldWriteSchemaType(_2)?this.$38h(_6,_3):null;if(_3==null&&_2.nillable){var _7=_1||"value";return isc.Comm.$36u(_7,null,_4,_5.nsPrefixes,true)+" xsi:nil=\"true\"/>"}
if(isc.isA.Date(_3)){_3=_3.toSchemaDate(_2.type,!!this.trimMilliseconds)}else if(_3!=null&&_3.$ew){return _3.$ew(_1,_6,_4)}else{_3=isc.makeXMLSafe(_3)}
return isc.Comm.$ex(_1||"value",_3,_6,_4,_5.nsPrefixes)}},isc.A.$38f=function isc_DataSource__serializeSimpleTypeValue(_1,_2){if(isc.isA.Date(_2)){return _2.toSchemaDate(_1?_1.type:null)}else{return isc.makeXMLSafeAttribute(_2)}},isc.A.$38h=function isc_DataSource__getXMLSchemaType(_1,_2){if(_2!=null&&(_1==null||_1=="any")){if(_2==null)return null;if(isc.isA.Date(_2)){return _2.logicalDate?"date":(_2.logicalTime?"time":"datetime")}else if(isc.isA.Number(_2)){if(parseInt(_2)==_2){return"float"}else{return"integer"}}else if(isc.isA.Boolean(_2)){return"boolean"}else if(isc.isA.String(_2)){return"text"}}
switch(_1){case"integer":return"int";case"number":return"long";default:return _1}},isc.A.$151z=function isc_DataSource__getXmlExplicitTypes(_1){var _2=_1;if(isc.isA.String(_2))_2=(_2=="true");return _2},isc.A.xmlSerializeSample=function isc_DataSource_xmlSerializeSample(){return this.xmlSerialize({},{spoofData:true})},isc.A.getSpoofedData=function isc_DataSource_getSpoofedData(_1){if(!_1)return"textValue";if(this.getSchema(_1.type)!=null)return{};if(_1.multiple){_1={type:_1.type};return[this.getSpoofedData(_1),this.getSpoofedData(_1)]}
if(_1.valueMap){var _2=!isc.isAn.Array(_1.valueMap)?isc.getKeys(_1.valueMap):_1.valueMap;return _2[Math.round(Math.random()*(_2.length-1))]}
var _3=isc.SimpleType.getBaseType(_1.type);switch(_3){case"boolean":return(Math.random()>0.5);case"integer":case"int":case"number":var _4=0,_5=10;if(_1.validators){var _6=_1.validators.find("type","integerRange")||_1.validators.find("_constructor","integerRange");if(_6){this.logWarn(_1.name+" has "+_6.type+" validator  with min "+_6.min+" and max "+_6.max);_4=_6.min||0;_5=_6.max||Math.min(_4,10);if(_4>_5)_4=_5}}
return Math.round(_4+(Math.random()*(_5-_4)));case"float":case"decimal":case"double":var _4=0,_5=10,_7=2;if(_1.validators){var _6=_1.validators.find("type","floatRange")||_1.validators.find("_constructor","floatRange");if(_6){this.logWarn(_1.name+" has "+_6.type+" validator  with min "+_6.min+" and max "+_6.max);_4=_6.min||0;_5=_6.max||Math.min(_4,10);if(_4>_5)_4=_5}
var _8=_1.validators.find("type","floatPrecision")||_1.validators.find("_constructor","floatPrecision");if(_8){_7=_8.precision||2}}
return(_4+(Math.random()*(_5-_4))).toFixed(_7);case"date":case"time":case"datetime":var _9=new Date();if(_1.validators){var _6=_1.validators.find("type","dateRange")||_1.validators.find("_constructor","dateRange");if(_6){this.logWarn(_1.name+" has "+_6.type+" validator  with min "+_6.min+" and max "+_6.max);if(_6.min)_9=_6.min;else if(_6.max)_9=_6.max}}
return _9;default:return"textValue"}},isc.A.getSerializeableFields=function isc_DataSource_getSerializeableFields(_1,_2){var _3=this.Super("getSerializeableFields",arguments);var _4=_3.fields;_4=isc.getValues(_4);for(var i=0;i<_4.length;i++){var _6=_4[i]=isc.addProperties({},_4[i]);var _7=_6.validators;if(_7){_6.validators=_7.findAll("_generated",null);if(_6.validators==null)delete _6.validators}}
_3.fields=_4;return _3},isc.A.getMethods=function isc_DataSource_getMethods(){var _1=this.methods||[];if(this.superDS()!=null){_1.addAll(this.superDS().getMethods())}
return _1},isc.A.getDeclaredMethod=function isc_DataSource_getDeclaredMethod(_1){var _2=this.getMethods();for(var i=0;i<_2.length;i++){if(_2[i].name==_1){return _2[i]}}},isc.A.getStringMethod=function isc_DataSource_getStringMethod(_1,_2){var _3=this.getDeclaredMethod(_1);if(_3){var _4=isc.addProperties({},_3);_4.value=_2;return isc.StringMethod.create(_4)}
var _5=isc.DataSource.getNearestSchemaClass(this),_6;if(_5&&_5._stringMethodRegistry&&_5._stringMethodRegistry[_1]!==_6)
{return isc.StringMethod.create({value:_2})}},isc.A.$378=function isc_DataSource__handleXMLReply(_1,_2,_3,_4){var _5=_1,_6=_4._dsRequest,_7=this.getOperationBinding(_6),_8;if(_3.status<0){_3.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;var _9="The server failed to return a formatted response at all.";var _10=_2;this.$38b(_10,{status:_3.status,data:_9},_6,_3,_4);return}
if(_5){if(_7.wsOperation){var _11=this.getWebService(_6),_8=_11.getOutputNamespaces(_7.wsOperation);_5.addNamespaces(_8)}
_5.addNamespaces(this.xmlNamespaces);_5.addNamespaces(_7.xmlNamespaces)}
var _12=isc.addProperties({},_8,this.xmlNamespaces,_7.xmlNamespaces);this.dsResponseFromXML(_5,_6,_12,{target:this,methodName:"$57b",xmlData:_5,dsRequest:_6,rpcRequest:_4,rpcResponse:_3})},isc.A.$57b=function isc_DataSource__completeHandleXMLReply(_1,_2){this.$38b(_2.xmlData,_1,_2.dsRequest,_2.rpcResponse,_2.rpcRequest)},isc.A.dsResponseFromXML=function isc_DataSource_dsResponseFromXML(_1,_2,_3,_4){if(_1){this.selectRecords(_1,_2,{target:this,methodName:"$57c",dsRequest:_2,callback:_4,xmlData:_1,xmlNamespaces:_3})}else{this.$57c([],_2,_3,_4)}},isc.A.$57c=function isc_DataSource__completeDSResponseFromXML(_1,_2,_3,_4){if(!_4&&_2.callback)_4=_2.callback;if(_2.xmlNamespaces)_3=_2.xmlNamespaces;if(_2.dsRequest)_2=_2.dsRequest;if(_3==null)_3=this.xmlNamespaces;var _5={data:_1,startRow:_2.startRow||0,status:0};_5.endRow=_5.startRow+Math.max(0,_1.length);_5.totalRows=Math.max(_5.endRow,_1.length);var _6=_4.xmlData;if(_6){if(this.totalRowsXPath){_5.totalRows=isc.xml.selectNumber(_6,this.totalRowsXPath,_3,true)}
if(this.startRowXPath){_5.startRow=isc.xml.selectNumber(_6,this.startRowXPath,_3,true);_5.endRow=_5.startRow+Math.max(0,_1.length)}
if(this.endRowXPath){_5.endRow=isc.xml.selectNumber(_6,this.endRowXPath,_3,true);if(!this.startRowXPath){_5.startRow=_5.endRow-Math.max(0,_1.length)}}
if(this.statusXPath){_5.status=parseInt(isc.xml.selectScalar(_6,this.statusXPath,_3,true))}
if(this.errorSchema){_5.errors=this.errorSchema.selectRecords(_6,_2)}}
if(_4)this.fireCallback(_4,"dsResponse",[_5,_4])
return _5},isc.A.selectRecords=function isc_DataSource_selectRecords(_1,_2,_3){var _4=this.selectRecordElements(_1,_2);var _5=this.getOperationBinding(_2),_6=this.getSchema(_5.responseDataSchema)||this;return _6.recordsFromXML(_4,_3)},isc.A.recordsFromXML=function isc_DataSource_recordsFromXML(_1,_2){if(_1&&!isc.isAn.Array(_1)){if(_1.length!=null)_1=isc.xml.$37m(_1);else _1=[_1]}
if(_1&&this.transformResponseToJS){if(_1.length>this.resultBatchSize){var _3={startingRow:0,callback:_2,elements:_1};return this.$57d(_3)}
var _4=this.dropExtraFields?this.getFieldNames():null;_1=isc.xml.toJS(_1,_4,this);if(this.logIsDebugEnabled("xmlBinding")){this.logDebug("transformed response: "+this.echoFull(_1)+"xmlBinding")}}
if(_2){this.fireCallback(_2,"records",[_1,_2])}
return _1},isc.A.$57d=function isc_DataSource__asyncRecordsFromXML(_1){var _2=_1.elements,_3=_1.startingRow,_4=_1.callback,_5=Math.min(_2.length,_3+this.resultBatchSize),_6=this.dropExtraFields?this.getFieldNames():null;if(!_1.$57e){_1.$57e=isc.xml.toJS(_2.slice(_3,_5+1),_6,this)}else{var _7=isc.xml.toJS(_2.slice(_3,_5+1),_6,this);_1.$57e.addList(_7)}
if(_5<_2.length){_1.startingRow=_5+1;this.delayCall("$57d",[_1])}else if(_4){this.fireCallback(_4,"records",[_1.$57e,_4])}},isc.A.selectRecordElements=function isc_DataSource_selectRecordElements(_1,_2){if(isc.isA.String(_1))_1=isc.xml.parseXML(_1);var _3=this.getOperationBinding(_2);var _4=_3==this?null:_3.recordXPath,_5=_3==this?null:_3.recordName,_6=this.recordXPath,_7=this.recordName;if(_4==null&&(_5!=null||(_6==null&&_7!=null))&&this.hasWSDLService(_2))
{var _8=this.getWebService(_2);return _8.selectByType(_1,_3.wsOperation||this.wsOperation,_5||_7)}
var _9=_4||_6,_10;if(_9){_10=isc.xml.selectNodes(_1,_9,this.xmlNamespaces);this.logDebug("applying XPath: "+_9+(this.xmlNamespaces?" with namespaces: "+this.echo(this.xmlNamespaces):"")+" got "+(_10?_10.length:null)+" elements","xmlBinding")}else{_10=[];var _11=_5||_7||this.ID;var _12=_1.getElementsByTagName(_11);for(var i=0;i<_12.length;i++)_10.add(_12[i]);this.logDebug("getting elements of tag name: "+_11+" got "+_10.length+" elements","xmlBinding")}
return _10},isc.A.$38b=function isc_DataSource__completeResponseProcessing(_1,_2,_3,_4,_5){if(!_2){_2={status:_4.status,httpResponseCode:_4.httpResponseCode}}
if(_4!=null&&_5!=null){_2.httpResponseCode=_4.httpResponseCode;_2.httpResponseText=_4.httpResponseText;_2.transactionNum=_4.transactionNum;_2.clientContext=_5.clientContext;_2.internalClientContext=_5.internalClientContext;_2.httpHeaders=_4.httpHeaders}else{_2.clientContext=_3.clientContext;_2.internalClientContext=_3.internalClientContext}
if(this.logIsInfoEnabled("xmlBinding")){this.logInfo("dsResponse is: "+this.echo(_2),"xmlBinding")}
_2.context=_5;if(!_2.operationType){var _6=_3.operation;_2.operationId=_3.operationId||_6&&_6.ID;_2.operationType=_3.operationType||_6&&_6.type}
var _7=this.transformResponse(_2,_3,_1);_2=_7||_2;_2.startRow=this.$52v(_2.startRow,0);var _8=_2.endRow;if(_8==null){if(_2.status<0)_8=0;else if(isc.isAn.Array(_2.data))_8=_2.data.length;else _8=1}
_2.endRow=this.$52v(_8);_2.totalRows=this.$52v(_2.totalRows,_2.endRow);if(!this.cacheAllData&&this.autoCacheAllData&&_3.downloadResult!=true&&_2.operationType=="fetch"&&(_3.data==null||isc.isAn.emptyObject(_3.data))&&_2.startRow==0&&_2.endRow==_2.totalRows)
{if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("Response: switching on cacheAllData","cacheAllData")}
this.cacheAllData=true;this.$85n=isc.timestamp()}
if(this.useOfflineStorage&&_2.status==0&&!this.clientOnly){isc.DataSource.cacheResponse(_3,_2);if(isc.Offline&&!_2.fromOfflineCache){if(_3.unconvertedDSRequest){isc.Offline.storeResponse(_3.unconvertedDSRequest,_2)}else{isc.Offline.storeResponse(_3,_2)}}}
if(_3&&_3.resultSet){if(_2.status==isc.RPCResponse.STATUS_OFFLINE){_3.resultSet.$78c=true}else{_3.resultSet.$78c=false}}else if(_3&&_3.resultTree){if(_2.status==isc.RPCResponse.STATUS_OFFLINE){_3.resultTree.$78c=true}else{_3.resultTree.$78c=false}}
if(this.autoDiscoverTree){var _9=this.discoverTreeSettings||{};if(this.titleField!=null){_9.nameProperty=this.titleField}
var _10;if(this.childrenField)_10=this.childrenField;var _11=this.getFields();for(var _12 in _11){var _13=_11[_12];if(_13.childrenProperty)_10=_12}
if(_10!=null){_9.newChildrenProperty=_10}
isc.Tree.discoverTree(_2.data,_9,null)}
this.fireResponseCallbacks(_2,_3,_4,_5);if(_2.relatedUpdates!=null){for(var i=0;i<_2.relatedUpdates.length;i++){if(_2.relatedUpdates[i].status<0){this.logWarn("DSResponse contained relatedUpdate with failed status="+_2.relatedUpdates[i].status+", ignoring related update.");continue}
if(_2.relatedUpdates[i].operationType==null){_2.relatedUpdates[i].operationType=_2.operationType}
if(_2.relatedUpdates[i].operationType=="fetch"){this.logWarn("DSResponse contained relatedUpdate has \"fetch\" operationType, so will do nothing.")}
var _15=isc.DS.get(_2.relatedUpdates[i].dataSource);if(_15==null){this.logWarn("DSResponse contained relatedUpdate referencing dataSource ID:"+_2.relatedUpdates[i].dataSource+". This dataSource appears not to be present - ignoring related update.")}else{_15.updateCaches(_2.relatedUpdates[i],null)}}}});isc.evalBoundary;isc.B.push(isc.A.fireResponseCallbacks=function isc_DataSource_fireResponseCallbacks(_1,_2,_3,_4){if(!_1.clientContext)_1.clientContext={};if(_1.status>=0){isc.DataSource.handleUpdate(_1,_2)}else if(!_2.willHandleError){isc.RPCManager.$a0(_1,_2);return}
var _5=[_2.$376,_2.afterFlowCallback];for(var i=0;i<_5.length;i++){var _7=_5[i],_8=this.fireCallback(_7,"dsResponse,data,dsRequest",[_1,_1.data,_2]);if(_4&&_4.willHandleError&&_8===false){this.logDebug("performOperationReply: Further processing cancelled by callback");break}
if(_3){var _9=isc.RPCManager.getTransaction(_3.transactionNum);if(_9&&_9.suspended)return}}},isc.A.$52v=function isc_DataSource__parseNumber(_1,_2){if(_1==null)return _2;if(!isc.isA.String(_1))return _1;var _3=parseInt(_1);if(isNaN(_3))return _2!=null?_2:_1;else return _3},isc.A.transformResponse=function isc_DataSource_transformResponse(_1,_2,_3){return _1},isc.A.getFieldValue=function isc_DataSource_getFieldValue(_1,_2,_3){var _4=isc.xml.getFieldValue(_1,_2,_3,this,this.xmlNamespaces);if(!_3.getFieldValue)return _4;if(!isc.isA.Function(_3.getFieldValue)){isc.Func.replaceWithMethod(_3,"getFieldValue","record,value,field,fieldName")}
return _3.getFieldValue(_1,_4,_3,_2)},isc.A.validateFieldValue=function isc_DataSource_validateFieldValue(_1,_2){if(!isc.Validator)return _2;var _3=_1.validators;if(!_3)return _2;if(!isc.isAn.Array(_3)){this.$2j[0]=_3;_3=this.$2j}
var _4=_2;for(var i=0;i<_3.length;i++){var _6=_3[i];var _7=isc.Validator.processValidator(_1,_6,_2,null,null);if(!_7){this.logWarn(this.ID+"."+_1.name+": value: "+this.echoLeaf(_2)+" failed on validator: "+this.echo(_6));return _2}
var _8;if(_6.resultingValue!==_8){_2=_6.resultingValue;_6.resultingValue=_8}
if(!_7&&_6.stopIfFalse)break}
this.$2j.length=0;return _2},isc.A.getCriteriaFields=function isc_DataSource_getCriteriaFields(_1){return isc.DS.getCriteriaFields(_1,this)},isc.A.$74s=function isc_DataSource__getAdvancedCriteriaFields(_1,_2){return isc.DS.$74s(_1,_2)},isc.A.fetchRecord=function isc_DataSource_fetchRecord(_1,_2,_3){var _4={},_5=this.getPrimaryKeyField();if(_5==null){this.logWarn("This datasource has no primary key field. Ignoring fetchRecord call");return}
var _6=_5.name;var _7;if(isc.isAn.Object(_1)&&_1[_6]!==_7){_4=_1}else{_4[_6]=_1}
return this.fetchData(_4,_2,_3)},isc.A.fetchData=function isc_DataSource_fetchData(_1,_2,_3){this.performDSOperation("fetch",_1,_2,_3)},isc.A.filterData=function isc_DataSource_filterData(_1,_2,_3){if(!_3)_3={};_3=isc.DataSource.dupRequest(_3);if(_3.textMatchStyle==null)_3.textMatchStyle="substring";this.performDSOperation("fetch",_1,_2,_3)},isc.A.exportClientData=function isc_DataSource_exportClientData(_1,_2,_3){if(!_2)_2={}
if(_2.operationId){if(!this.operationBindings){this.logWarn("exportClientData() was passed operationId '"+_2.operationId+"', but this DataSource has no operationBindings.  Delegating to the static exportClientData() method");delete _2.operationId}
var _4,_5;for(var i=0;i<this.operationBindings.length;i++){if(this.operationBindings[i].operationId==_2.operationId&&this.operationBindings[i].operationType=="clientExport")
{_4=this.operationBindings[i]}}
if(_4===_5){this.logWarn("exportClientData() was passed operationId '"+_2.operationId+"', but this DataSource has no operationBinding of type 'clientExport' with that name.  Delegating to the static exportClientData() method");delete _2.operationId}}
return isc.DataSource.exportClientData(_1,_2,_3,this)},isc.A.exportData=function isc_DataSource_exportData(_1,_2,_3,_4){var _5="fetch";if(!_2)_2={};_2=isc.DataSource.dupRequest(_2);if(this.canExport==false){isc.logWarn("Exporting is disabled for this DataSource.  Set DataSource.canExport to true to enable it.");return}
if(_2.exportAs&&_2.exportAs.toLowerCase()=="json"&&_2.exportToClient!==false)
{isc.logWarn("Export in JSON format with download to client is not allowed from a client call - either specify exportToClient: false, or set operationBinding.exportAs on your DataSource instead.  The server will reject this attempt.")}
if(_2.textMatchStyle==null)_2.textMatchStyle="substring";var _6=_2.exportAs||"csv";var _7={};_7.exportResults=true;_7.exportAs=_6;_7.exportDelimiter=_2.exportDelimiter||",";_7.exportTitleSeparatorChar=_2.exportTitleSeparatorChar||"";if(_2.operationId!=null){var _8=this.getOperationBinding(_5,_2.operationId);if(_8!=null&&_8.exportAs){_6=_8.exportAs}}
_7.exportFilename=isc.DataSource.addExportFilenameExtension(_2.exportFilename||"Results",_6);_2.exportFilename=_7.exportFilename;_7.exportPath=_2.exportPath;_7.exportDisplay=_2.exportDisplay||"download";_7.lineBreakStyle=_2.lineBreakStyle||"default";_7.exportFields=this.getExportableDSFields(_2.exportFields||this.getVisibleDSFields(),_4);_7.exportHeader=_2.exportHeader;_7.exportHeaderless=_2.exportHeaderless;_7.exportFooter=_2.exportFooter;_7.exportFieldTitles=_2.exportFieldTitles;_7.exportDatesAsFormattedString=_2.exportDatesAsFormattedString;_7.exportNumbersAsFormattedString=_2.exportNumbersAsFormattedString;_7.exportRawValues=_2.exportRawValues;_7.exportCurrencySymbol=isc.NumberUtil.currencySymbol;if(_2.exportValueFields!=null){_7.exportValueFields=_2.exportValueFields}
if(!_7.exportFieldTitles){var _9=_7.exportFields;var _10={};for(var i=0;i<_9.length;i++){var _12=_9[i];var _13;if(isc.isA.String(_12)){_13=_12;_12=this.getField(_13)}
if(_12){if(_12.hidden)continue;_10[_12.name]=_12.exportTitle||_12.title}else{_10[_13]=_13}}
_7.exportFieldTitles=_10}
_7.exportHeaderSpans=_2.exportHeaderSpans;_7.exportOtherFields=_2.exportOtherFields;if(_2.exportHeaderHeight!=null){_7.exportHeaderHeight=_2.exportHeaderHeight}
if(_2.exportFieldPixelWidths!=null){_7.exportFieldPixelWidths=_2.exportFieldPixelWidths;_7.exportWidthScale=_2.exportWidthScale}
_7.exportWrapHeaderTitles=_2.exportWrapHeaderTitles;if(_2.exportStreaming!=null){_7.exportStreaming=_2.exportStreaming}
if(_2.exportAlignments!=null){_7.exportAlignments=_2.exportAlignments}
if(_2.exportPropertyIdentifier!=null){_7.exportPropertyIdentifier=_2.exportPropertyIdentifier}
if(_2.exportTZ!=null){if(this.getDataFormat()=="iscServer"&&(_2.exportAs=="ooxml"||_2.exportAs=="xls")){if(_2.exportTZ=="client"){_2.exportTZ=isc.Time.getDefaultDisplayTimezone()}
_7.exportTZ=_2.exportTZ}else{_2.exportTZ=null}}
_2.downloadResult=(_2.exportToClient!==false);_2.downloadToNewWindow=_2.exportDisplay=="window"?true:false;if(this.implicitCriteria){_1=isc.DS.combineCriteria(isc.DataSource.copyCriteria(this.implicitCriteria),_1)}
if(_2.downloadToNewWindow){if(_7.exportFilename.endsWith(".xml")&&_7.exportAs!="xml"){_7.exportFilename=_7.exportFilename+".txt"}
_2.download_filename=_2.exportFilename;_1=_1||{};_1.download_filename=_2.download_filename}
_2.showPrompt=false;_2.parameters=_7;this.performDSOperation(_5,_1,_3,_2)},isc.A.getVisibleDSFields=function isc_DataSource_getVisibleDSFields(){var _1=[];var _2=this.fields;if(!isc.isAn.Array(_2)){_2=[];for(var _3 in this.fields){_2.add(this.fields[_3])}}
for(var i=0;i<_2.length;i++){var _5=_2.get(i);if(!_5.hidden)_1.add(_5.name)}
return _1},isc.A.getExportableDSFields=function isc_DataSource_getExportableDSFields(_1,_2){var _3=[];if(this.canExport){for(var i=0;i<_1.length;i++){var _5=this.getField(_1[i]);if(!_5&&_2&&_2.getField){_5=_2.getField(_1[i]);if(_5&&_5.includeFrom&&_5.canExport!=false){_3.add(_1[i])}
continue}
if(_5&&_5.canExport!=false)
_3.add(_5.name)}}
return _3},isc.A.getClientOnlyDataSource=function isc_DataSource_getClientOnlyDataSource(_1,_2,_3,_4){var _5=_1,_6=_2,_7=this;if(this.cacheAllData&&this.hasAllData()){var _8=isc.DataSource.create({inheritsFrom:_7,clientOnly:true,useParentFieldOrder:true,testData:this.cacheResultSet.getAllRows()},_4);_7.fireCallback(_6,"dataSource",[_8]);return _8}else{this.fetchData(_5,function(_9,_10){var _8=isc.DataSource.create({inheritsFrom:_7,clientOnly:true,useParentFieldOrder:true,testData:_10},_4);_7.fireCallback(_6,"dataSource",[_8])},isc.addProperties({},_3))}},isc.A.addData=function isc_DataSource_addData(_1,_2,_3){if(isc.Offline&&isc.Offline.isOffline()&&this.contactsServer()){isc.logWarn("Data cannot be saved because you are not online");return}
this.performDSOperation("add",_1,_2,_3)},isc.A.updateData=function isc_DataSource_updateData(_1,_2,_3){if(isc.Offline&&isc.Offline.isOffline()&&this.contactsServer()){isc.logWarn("Data cannot be saved because you are not online");return}
this.performDSOperation("update",_1,_2,_3)},isc.A.removeData=function isc_DataSource_removeData(_1,_2,_3){if(isc.Offline&&isc.Offline.isOffline()&&this.contactsServer()){isc.logWarn("Data cannot be saved because you are not online");return}
var _4=this.getPrimaryKeyFieldNames(),_1=isc.applyMask(_1,_4);this.performDSOperation("remove",_1,_2,_3)},isc.A.contactsServer=function isc_DataSource_contactsServer(){return!this.clientOnly&&this.dataProtocol!="clientCustom"},isc.A.validateData=function isc_DataSource_validateData(_1,_2,_3){if(!_3)_3={};_3=isc.DataSource.dupRequest(_3);_3=isc.addProperties(_3,{willHandleError:true});if(_3.validationMode==null)_3.validationMode="full";return!!this.performDSOperation("validate",_1,_2,_3)},isc.A.performCustomOperation=function isc_DataSource_performCustomOperation(_1,_2,_3,_4){if(!_4)_4={};_4=isc.DataSource.dupRequest(_4);isc.addProperties(_4,{operationId:_1});this.performDSOperation("custom",_2,_3,_4)},isc.A.performClientExportOperation=function isc_DataSource_performClientExportOperation(_1,_2,_3,_4){if(!_4)_4={};_4=isc.DataSource.dupRequest(_4);isc.addProperties(_4,{operationId:_1});this.performDSOperation("clientExport",_2,_3,_4)},isc.A.getFile=function isc_DataSource_getFile(_1,_2,_3){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);this.performDSOperation("getFile",_1,function(_4,_5,_6){if(_4.status>=0&&isc.isAn.Array(_5)&&_5.length>0){_5=_5[0].fileContents}else{_5=null}
this.fireCallback(_2,"dsResponse,data,dsRequest",[_4,_5,_6])},isc.addProperties({willHandleError:true},_3))},isc.A.hasFile=function isc_DataSource_hasFile(_1,_2){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);this.performDSOperation("hasFile",_1,function(_3,_4,_5){if(_3.status>=0){_4=!!(isc.isAn.Array(_4)&&_4.length>0)}else{_4=false}
this.fireCallback(_2,"dsResponse,data,dsRequest",[_3,_4,_5])},{willHandleError:true})},isc.A.listFiles=function isc_DataSource_listFiles(_1,_2){if(!_1)_1={};this.performDSOperation("listFiles",_1,function(_3,_4,_5){if(_3.status<0)_4=null;this.fireCallback(_2,"dsResponse,data,dsRequest",[_3,_4,_5])},{willHandleError:true})},isc.A.saveFile=function isc_DataSource_saveFile(_1,_2,_3,_4){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);var _5=isc.addProperties({fileContents:_2},_1);this.performDSOperation("saveFile",_5,function(_6,_7,_8){if(_6.status<0)_7=null;if(isc.isAn.Array(_7))_7=_7[0];this.fireCallback(_3,"dsResponse,data,dsRequest",[_6,_7,_8])},isc.addProperties({willHandleError:true},_4))},isc.A.renameFile=function isc_DataSource_renameFile(_1,_2,_3,_4,_5){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);if(isc.isA.String(_2))_2=isc.DataSource.makeFileSpec(_2);if(!_2.fileType)_2.fileType=_1.fileType;if(!_2.fileFormat)_2.fileFormat=_1.fileFormat;if(!_2.fileName)_2.fileName=_1.fileName;this.performDSOperation("renameFile",_2,function(_6,_7,_8){if(_6.status<0)_7=null;this.fireCallback(_3,"dsResponse,data,dsRequest",[_6,_7,_8])},{willHandleError:true,oldValues:_1})},isc.A.removeFile=function isc_DataSource_removeFile(_1,_2,_3){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);this.performDSOperation("removeFile",_1,function(_4,_5,_6){if(_4.status<0)_5=null;this.fireCallback(_2,"dsResponse,data,dsRequest",[_4,_5,_6])},{willHandleError:true})},isc.A.listFileVersions=function isc_DataSource_listFileVersions(_1,_2){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);this.performDSOperation("listFileVersions",_1,function(_3,_4,_5){if(_3.status<0)_4=null;this.fireCallback(_2,"dsResponse,data,dsRequest",[_3,_4,_5])},{willHandleError:true})},isc.A.getFileVersion=function isc_DataSource_getFileVersion(_1,_2,_3,_4){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);_1[this.fileVersionField]=_2;this.performDSOperation("getFileVersion",_1,function(_5,_6,_7){if(_5.status>=0&&isc.isAn.Array(_6)&&_6.length>0){_6=_6[0].fileContents}else{_6=null}
this.fireCallback(_3,"dsResponse,data,dsRequest",[_5,_6,_7])},isc.addProperties({willHandleError:true},_4))},isc.A.hasFileVersion=function isc_DataSource_hasFileVersion(_1,_2,_3){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);_1.version=_2;this.performDSOperation("hasFileVersion",_1,function(_4,_5,_6){if(_4.status>=0){_5=!!(isc.isAn.Array(_5)&&_5.length>0)}else{_5=false}
this.fireCallback(_3,"dsResponse,data,dsRequest",[_4,_5,_6])},{willHandleError:true})},isc.A.removeFileVersion=function isc_DataSource_removeFileVersion(_1,_2,_3){if(isc.isA.String(_1))_1=isc.DataSource.makeFileSpec(_1);_1.version=_2;this.performDSOperation("removeFileVersion",_1,function(_4,_5,_6){if(_4.status<0)_5=null;this.fireCallback(_3,"dsResponse,data,dsRequest",[_4,_5,_6])},{willHandleError:true})},isc.A.$625=function isc_DataSource__getNextRequestId(){if(!this.$626)this.$626=[this.getID(),"$627"];this.$626[2]=isc.DataSource.$625();return this.$626.join(isc.emptyString)},isc.A.shouldUseStrictJSON=function isc_DataSource_shouldUseStrictJSON(_1){if(_1&&_1.useStrictJSON!=null)return _1.useStrictJSON;if(this.useStrictJSON!=null)return this.useStrictJSON;if(isc.Browser.isIE&&isc.Browser.version>=9&&isc.RPCManager.useJSONParse_IE9&&this.dataFormat=="iscServer")
{return true}
return null},isc.A.shouldFallbackToEval=function isc_DataSource_shouldFallbackToEval(_1){if(_1==null)_1={};if(_1.fallbackToEval!=null)return _1.fallbackToEval;if(_1.useStrictJSON||this.useStrictJSON)return false;return(isc.Browser.isIE&&isc.Browser.version>=9&&isc.RPCManager.useJSONParse_IE9&&this.dataFormat=="iscServer")},isc.A.execute=function isc_DataSource_execute(_1){this.performDSOperation(_1.operationType||"fetch",_1.data,_1.callback,_1)},isc.A.performDSOperation=function isc_DataSource_performDSOperation(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;if(this.logIsDebugEnabled("dsOperationTrace")){this.logDebug("Perform DS operation of type:"+_1+" Stack:\n"+this.getStackTrace(),"dsOperationTrace")}
_4=isc.DataSource.dupRequest(_4);var _5=isc.addProperties({operationType:_1,dataSource:this.ID,data:_2,callback:_3,requestId:this.$625(),$135x:_4&&_4.useStrictJSON,useStrictJSON:this.shouldUseStrictJSON(_4),$135v:_4&&_4.fallbackToEval,fallbackToEval:this.shouldFallbackToEval(_4),textMatchStyle:this.defaultTextMatchStyle},_4);isc.DataSource.recordTimingData(_5,"UI event to DSRequest creation","start",isc.EH.$117e);isc.DataSource.recordTimingData(_5,"UI event to DSRequest creation","end");isc.DataSource.recordTimingData(_5,"performDSOperation","start");_5.lastClientEventThreadCode=isc.EH.$lc;var _6=isc.EH.getLastEvent();if(_5.sortBy!=null){if(!isc.isAn.Array(_5.sortBy))_5.sortBy=[_5.sortBy];if(isc.isAn.Object(_5.sortBy[0])){_5.sortBy=isc.DS.getSortBy(_5.sortBy)}
for(var i=0;i<_5.sortBy.length;i++){var _8=_5.sortBy[i];if(!isc.isA.String(_8))continue;var _9=this.getField(_8.charAt(0)=="-"?_8.substring(1):_8);if(_9&&_9.canSortClientOnly)_5.sortBy[i]=null}
_5.sortBy.removeEmpty();if(_5.sortBy.length==0)delete _5.sortBy}
if(this.sendParentNode==false){_5.$135w=_5.parentNode;_5.parentNode=null}
return this.sendDSRequest(_5)},isc.A.translatePatternOperatorInAdvancedCriteria=function isc_DataSource_translatePatternOperatorInAdvancedCriteria(_1){if(!this.isAdvancedCriteria(_1)){return _1}
var _2,_3;if(_1.criteria){if(isc.isA.Array(_1.criteria)){for(_2 in _1.criteria){_3=_1.criteria[_2];_1.criteria[_2]=this.translatePatternOperatorInAdvancedCriteria(_3)}}else{_1.criteria=this.translatePatternOperatorInAdvancedCriteria(_1.criteria)}}else{_3=_1;if(_3.operator==="matchesPattern"||_3.operator==="iMatchesPattern"||_3.operator==="containsPattern"||_3.operator==="iContainsPattern")
{var _4=(_3.operator.indexOf('i')===0);var _5=(isc.isA.Array(this.patternMultiWildcard)?this.patternMultiWildcard[0]:this.patternMultiWildcard.substring(0,1));var _6=_3.fieldName;var _7=_3.value;if(isc.isA.Array(this.patternMultiWildcard)){for(var _2=1;_2<this.patternMultiWildcard.length;_2++){_7=_7.replaceAll(this.patternMultiWildcard[_2],_5)}}
var _8=_7.split(_5);var _9;var _10;if(_8.length===1){if(_3.operator==="matchesPattern"||_3.operator==="iMatchesPattern"){_10={fieldName:_6,value:_8[0],operator:_4?"iEquals":"equals"}}else if(_3.operator==='startsWithPattern'||_3.operator==='iStartsWithPattern'){_10={fieldName:_6,value:_8[0],operator:_4?"iStartsWith":"startsWith"}}else if(_3.operator==='endsWithPattern'||_3.operator==='iEndsWithPattern'){_10={fieldName:_6,value:_8[0],operator:_4?"iEndsWith":"endsWith"}}else{_10={fieldName:_6,value:_8[0],operator:_4?"iContains":"contains"}}}else if(_8.length>1){_10={_constructor:"AdvancedCriteria",operator:"and",criteria:[]};for(var _11=0;_11<_8.length;_11++){var _12=_8[_11];if(!_12||_12.length==0){continue}
_9={fieldName:_6,value:_12};var _13=_11>0,_14=_8.length-1>_11;if(_13&&_14||(_3.operator==="containsPattern"||_3.operator==="iContainsPattern")){_9.operator=_4?"iContains":"contains"}if(_3.operator==='startsWithPattern'||_3.operator==='iStartsWithPattern'){_9.operator=_4?"iStartsWith":"startsWith"}if(_3.operator==='endsWithPattern'||_3.operator==='iEndsWithPattern'){_9.operator=_4?"iEndsWith":"endsWith"}else if(_13){_9.operator=_4?"iEndsWith":"endsWith"}else if(_14){_9.operator=_4?"iStartsWith":"startsWith"}
_10.criteria.add(_9)}}
_1=_10}}
return _1},isc.A.sendDSRequest=function isc_DataSource_sendDSRequest(_1){isc.addDefaultsRecursively(_1,this.getOperationBinding(_1.operationType).requestProperties);isc.addDefaultsRecursively(_1,this.requestProperties);var _2=this.getDataFormat(_1);var _3=this.getDataProtocol(_1);if(_2=="iscServer"&&!(this.clientOnly||_3=="clientCustom")&&!isc.hasOptionalModule("SCServer"))
{if(this.dataURL==null&&this.testFileName==null){this.logError("DataSource: "+this.ID+": attempt to use DataSource of type iscServer without SmartClient Server option. Please either set clientOnly: true for one-time fetch against dataURL/testFileName or upgrade to SmartClient Pro, Power or Enterprise");return}
this.logInfo("Switching to clientOnly - no SmartClient Server installed.");this.clientOnly=true}
if(_1.bypassCache==null){_1.$135u=_1.bypassCache;_1.bypassCache=this.shouldBypassCache(_1)}
if(_1.showPrompt==null){_1.showPrompt=_1.downloadResult?false:this.showPrompt}
if(_1.showPrompt!=false&&isc.Hover.preparingHoverComponent){isc.Hover.suppressNextShow=true}
if(!this.cacheAllData&&this.autoCacheAllData&&_1.downloadResult!=true&&_1.operationType=="fetch"&&_1.startRow==null&&_1.endRow==null&&(_1.data==null||isc.isAn.emptyObject(_1.data)))
{if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("sendDSRequest: switching on cacheAllData","cacheAllData")}
this.cacheAllData=true;this.$85n=isc.timestamp()}
this.addImplicitCriteria(_1);if(_1.operationType=="fetch"&&this.fetchingClientOnlyData(_1))return;if(this.logIsDebugEnabled()){this.logDebug("Outbound DSRequest: "+this.echo(_1))}
_1.$376=_1.callback;var _4=_1.operationType;if((_4=="update"||_4=="add")&&(this.sparseUpdates||this.noNullUpdates))
{isc.DataSource.recordTimingData(_1,"Sparse updates processing","start");_1.data=this.$708(_1.data,this);this.$79c(_1.data,_1.oldValues,_4,this);isc.DataSource.recordTimingData(_1,"Sparse updates processing","end")}
if(_2=="iscServer"){this.$754(_1);_1.unconvertedDSRequest=isc.shallowClone(_1);_1.jsonReviver=isc.DataSource.iscServer_strictJSONReviver;if(this.autoConvertRelativeDates==true){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Calling convertRelativeDates from sendDSRequest - data is\n\n"+isc.echoFull(_5))}
var _5=this.convertRelativeDates(_1.data);if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Called convertRelativeDates from sendDSRequest - data is\n\n"+isc.echoFull(_5))}
_1.data=_5}else{_1.data=this.embedTimezoneInRelativeDates(_1.data)}
if(this.translatePatternOperators===true&&this.isAdvancedCriteria(_1.data)){_1.data=this.translatePatternOperatorInAdvancedCriteria(_1.data)}
_1.dataProtocol=_3;var _6=this.transformRequest(_1);if(_6!==_1){_1.data=_6}
var _7=this.getDataProtocol(_1);if(_7=="clientCustom"){if(!this.$175o)return;if(this.$175o(_1)){this.logInfo("sendDSRequest: clientCustom server request - returning","cacheAllData");return}else{this.logInfo("sendDSRequest: clientCustom request using client cache","cacheAllData");delete this.$624[_1.requestId]}}else{delete this.$624[_1.requestId]}
if(_1.shouldUseCache===false||(_1.shouldUseCache!==true)&&!this.clientOnly&&(!this.mockMode||_1.cachingAllData)&&(!this.cacheAllData||_1.downloadResult||_1.cachingAllData||(_1.operationType!=null&&_1.operationType!="fetch")||(_1.operationType=="fetch"&&this.cacheAllOperationId&&this.cacheAcrossOperationIds==false&&_1.operationId!=this.cacheAllOperationId)))
{if(this.logIsInfoEnabled("cacheAllData")&&_1.cachingAllData){this.logInfo("sendDSRequest: processing cacheAllData request","cacheAllData")}
this.addDefaultCriteria(_1,this.getOperationBinding(_1));this.applySendExtraFields(_1);var _8=this.getOperationBinding(_1);if(_8==null)_8={};var _9=_8.defaultParams||this.defaultParams;if(_9){_1.params=isc.addProperties({},_9,_1.params)}
return this.performSCServerOperation(_1,_1.data)}}
var _10=this.getServiceInputs(_1);var _11=_1.shouldUseCache===true||this.mockMode||(this.cacheAllData&&_1.operationType=="fetch"&&!_1.cachingAllData&&!_1.downloadResult&&!(this.cacheAllOperationId&&this.cacheAcrossOperationIds==false&&_1.operationId!=this.cacheAllOperationId));if(_10.dataProtocol=="clientCustom"&&!_11)return;var _12=isc.addProperties({},_1,_10);_12._dsRequest=_1;if(_10.data==null)_12.data=null;if(this.clientOnly||_11){_12.clientOnly=true;_12.callback={target:this,methodName:"$50e"};isc.RPC.sendRequest(_12);return}
var _13=this.getOperationBinding(_1);_12.transport=_13.dataTransport||this.dataTransport;if(_12.transport=="scriptInclude"){_12.callback={target:this,methodName:"$377"};if(!_12.callbackParam){_12.callbackParam=_13.callbackParam||this.callbackParam}
isc.rpc.sendRequest(_12);return}
var _2=this.getDataFormat(_1);if(_2=="xml"){var _14=_12.spoofedResponse;if(!_14){_12.callback={target:this,method:this.$378};isc.xml.getXMLResponse(_12)}else{var _15=this;isc.Timer.setTimeout(function(){_15.$378(isc.xml.parseXML(_14),_14,{status:0,httpResponseCode:200,data:_14},_12)})}}else if(_2=="json"){_12.callback={target:this,method:this.$379};isc.rpc.sendProxied(_12)}else if(_2=="csv"){_12.callback={target:this,method:this.$69k};isc.rpc.sendProxied(_12)}else{_12.serverOutputAsString=true;_12.callback={target:this,method:this.$38a};isc.rpc.sendProxied(_12)}},isc.A.$79c=function isc_DataSource__applySparseAndNoNullUpdates(_1,_2,_3,_4){var _5=_4||this;if(!_5.noNullUpdates){if(!_5.sparseUpdates)return;if(_2==null)return}
var _6={__ref:true,__module:true};for(var _7 in _1){if(isc.isA.Function(_1[_7]))continue;if(_6[_7]==true)continue;if(isc.isAn.Instance(_1[_7])||isc.isA.Class(_1[_7]))continue;var _8=_1[_7];if(_5.noNullUpdates&&_8===null){if(_3=="add"&&_5.omitNullDefaultsOnAdd==true){delete _1[_7]}else{var _9=_5.getField(_7),_10;if(_9&&_9.nullReplacementValue!==_10){_1[_7]=_9.nullReplacementValue}else{var _11=isc.SimpleType.getBaseType(_9.type,_5);if(_11=="integer"){_1[_7]=_5.nullIntegerValue}else if(_11=="float"){_1[_7]=_5.nullFloatValue}else if(_11=="date"||_11=="time"){_1[_7]=_5.nullDateValue}else if(_11=="boolean"){_1[_7]=_5.nullBooleanValue}else{_1[_7]=_5.nullStringValue}}}}else if(_5.sparseUpdates&&_3=="update"){if(_2==null)continue;var _12=_2[_7];if(_12==null&&!(_8==null))continue;if(_5!=null){var _9=_5.getField(_7);if(_9&&_9.primaryKey)continue}
if(isc.isA.Date(_8)&&isc.DateUtil.compareDates(_8,_12)==0){delete _1[_7]}else if(isc.isAn.Array(_8)){for(var i=0;i<_8.length;i++){this.$79c(_8[i],_12[i],_3,_9==null?null:isc.DataSource.get(_9.type));var _14=0;for(var _15 in _8[i])_14++;if(_14==0)delete _8[i]}
var _16=false;for(var i=0;i<_8.length;i++){if(_8[i]!=null){_16=true;break}}
if(!_16)delete _1[_7]}else if(isc.isAn.Object(_8)){this.$79c(_8,_12,_3,_9==null?null:isc.DataSource.get(_9.type));var _14=0;for(var _15 in _8)_14++;if(_14==0)delete _1[_7]}else if(_8==_12){delete _1[_7]}}}},isc.A.$708=function isc_DataSource__cloneValues(_1,_2,_3){if(_1==null)return;var _4=_2?_2.deepCloneOnEdit:this.deepCloneOnEdit,_5=_4==null?isc.DataSource.deepCloneOnEdit:_4;if(isc.isAn.Array(_1)){var _6=[];for(var i=0;i<_1.length;i++){var _8=_1[i];if(isc.isA.Function(_8))continue;if(isc.isAn.Instance(_1[_10])||isc.isA.Class(_1[_10]))continue;if(_8==null||isc.isA.String(_8)||isc.isA.Boolean(_8)||isc.isA.Number(_8))
{_6[_6.length]=_8}else if(isc.isA.Date(_8)){_6[_6.length]=new Date(_8.getTime())}else if(isc.isAn.Object(_8)){_6[_6.length]=this.$708(_8,_2,_3)}}
return _6}
var _6={};if(_1.$42c!=null){_1=isc.JSONEncoder.$42b(_1)}
var _9={__ref:true,__module:true};if(isc.DataSource.cloneValuesSafely){if(!_3)_3=[];if(_3.contains(_1)){_6=_1;return}
_3.add(_1)}
for(var _10 in _1){if(isc.isA.Function(_1[_10]))continue;if(_9[_10]==true)continue;if(isc.isAn.Instance(_1[_10])||isc.isA.Class(_1[_10]))continue;var _11=_1[_10];if(isc.isA.Date(_11)){_6[_10]=_11.duplicate()}else if(isc.isAn.Object(_11)){var _12=_2?_2.getField(_10):null;if(!_12){_6[_10]=_1[_10]}else{if(_12.deepCloneOnEdit==true||(_12.deepCloneOnEdit==null&&_5))
{if(isc.DataSource.cloneValuesSafely){if(_3.contains(_11)){_6[_10]=_1[_10];continue}
_3.add(_11)}
_6[_10]=this.$708(_11,isc.DataSource.get(_12.type))}else{_6[_10]=_1[_10]}}}else{_6[_10]=_1[_10]}}
return _6});isc.evalBoundary;isc.B.push(isc.A.fulfilledFromOffline=function isc_DataSource_fulfilledFromOffline(_1){var _2=_1.unconvertedDSRequest?_1.unconvertedDSRequest:_1;if(this.useOfflineStorage&&isc.Offline){var _3=_1.dataSource+"."+_1.operationType;if(isc.Offline.isOffline()){var _4=isc.Offline.getResponse(_2);this.logInfo("currently offline, for request: "+_3+" found cached response: "+this.echoLeaf(_4),"offline");if(this.useOfflineResponse&&!this.useOfflineResponse(_2,_4)){this.logInfo("User-written useOfflineResponse() method returned false; not using cached response","offline");_4=null}
this.processOfflineResponse(_1,_4);return true}else if(_2.useOfflineCache||_2.useOfflineCacheOnly){var _4=isc.Offline.getResponse(_2);if(_4!=null){this.logInfo("request: "+_3+", returning cached offline response","offline");if(this.useOfflineResponse&&!this.useOfflineResponse(_2,_4)){this.logInfo("User-written useOfflineResponse() method returned false; not using cached response","offline");_4=null}
this.processOfflineResponse(_1,_4);return true}else if(_1.useOfflineCacheOnly){this.logInfo("request: "+_3+": useOfflineCacheOnly: no response available","offline");this.processOfflineResponse(_1);return true}
this.logInfo("request: "+_3+", no cached response, proceeding with network request","offline")}}
return false},isc.A.processOfflineResponse=function isc_DataSource_processOfflineResponse(_1,_2){if(!_2){_2={status:isc.RPCResponse.STATUS_OFFLINE,data:isc.DataSource.offlineMessage}}
_2.clientContext=_1.clientContext;_2.internalClientContext=_1.internalClientContext;_2.isCachedResponse=true;this.fireResponseCallbacks(_2,_1)},isc.A.performSCServerOperation=function isc_DataSource_performSCServerOperation(_1,_2){this.logWarn("Attempt to perform iscServer request requires options SmartClient server support - not present in this build.\nRequest details:"+this.echo(_1));return},isc.A.getSchema=function isc_DataSource_getSchema(_1,_2){var _3=this.getSchemaSet();if(_3!=null){var _4=_3.getSchema(_1,_2);if(_4!=null)return _4}
var _5=this.getWebService();if(isc.isA.WebService(_5))return _5.getSchema(_1,_2);return isc.DS.get(_1,null,null,_2)},isc.A.getTitle=function isc_DataSource_getTitle(){return this.title||this.getAutoTitle(this.ID)},isc.A.getPluralTitle=function isc_DataSource_getPluralTitle(){return this.pluralTitle||(this.getTitle()+"s")},isc.A.getTitleField=function isc_DataSource_getTitleField(){if(this.titleField==null){var _1=isc.getKeys(this.getFields());var _2=_1.callMethod("toLowerCase");for(var i=0;i<this.defaultTitleFieldNames.length;i++){var _4=_2.indexOf(this.defaultTitleFieldNames[i]);if(_4!=-1&&!this.getField(_1[_4]).hidden){this.titleField=_1[_4];break}}
if(this.titleField==null){for(var i=0;i<_1.length;i++){if(this.getField(_1[i]).hidden)continue;this.titleField=_1[i];break}
if(this.titleField==null)this.titleField=_1[0]}}
return this.titleField},isc.A.getIconField=function isc_DataSource_getIconField(){var _1;if(this.iconField===_1){this.iconField=null;var _2=isc.getKeys(this.getFields());var _3=["picture","thumbnail","icon","image","img"];for(var i=0;i<_3.length;i++){var _5=_3[i],_6=this.getField(_5);if(_6&&isc.SimpleType.inheritsFrom(_6.type,"image")){this.iconField=_5}}}
return this.iconField},isc.A.initViewSources=function isc_DataSource_initViewSources(){var _1=this.fields={};for(var _2 in this.sources){var _3=isc.DS.get(_2);if(!_3)continue;var _4=this.sources[_2].fields;for(var _5 in _4){var _6=_4[_5],_7=null;if(_6=="*"){_7=_3.fields[_5]}else if(isc.isA.String(_6)){_7=_3.fields[_6]}else if(isc.isAn.Object(_6)){_7=isc.addProperties({},_3.fields[_3.fields[_6.field]]);isc.addProperties(_7,_6)}
if(_7)_1[_5]=_7}}},isc.A.inheritsSchema=function isc_DataSource_inheritsSchema(_1){if(_1==null)return false;if(isc.isA.String(_1))_1=this.getSchema(_1);if(_1==this||_1==isc.DS.get("Object"))return true;if(!this.hasSuperDS())return false;return this.superDS().inheritsSchema(_1)},isc.A.getInheritedProperty=function isc_DataSource_getInheritedProperty(_1){if(this[_1])return this[_1];var _2=this.superDS();return _2?_2.getInheritedProperty(_1):null},isc.A.hasSuperDS=function isc_DataSource_hasSuperDS(){if(this.inheritsFrom)return true;return false},isc.A.superDS=function isc_DataSource_superDS(){if(this.hasSuperDS())return this.getSchema(this.inheritsFrom);return null},isc.A.getField=function isc_DataSource_getField(_1,_2){if(isc.isAn.Object(_1))_1=_1.name;var _3=this.getFields();var _4=_3?_3[_1]:null;if(_4==null&&_2&&_3!=null){for(var i in _3){if(_3[i]==null)continue;if(_3[i].dataPath==_1){_4=_3[i];break}}}
return _4},isc.A.getFieldForDataPath=function isc_DataSource_getFieldForDataPath(_1){if(isc.isAn.Object(_1))_1=_1.dataPath;if(!_1)return null;var _2=_1.trim(isc.Canvas.$70l).split(isc.Canvas.$70l);var _3=this;for(var i=0;i<_2.length;i++){if(_3==null)return null;var _5=_3.getField(_2[i]);if(!_5)return null;_3=isc.DataSource.get(_5.type)}
return _5},isc.A.getDataSourceForDataPath=function isc_DataSource_getDataSourceForDataPath(_1,_2){if(isc.isAn.Object(_1))_1=_1.dataPath;if(!_1)return null;if(_1==isc.Canvas.$70l)return this;var _3=_1.trim(isc.Canvas.$70l).split(isc.Canvas.$70l);var _4=this;var _5=_2?_3.length:_3.length-1;for(var i=0;i<_5;i++){var _7=_4.getField(_3[i]);if(!_7){this.logInfo("getDataSourceForDataPath() - unable to find nested field:"+_3[i]+" from dataSource:"+_4+". Orginal dataPath:"+_1,"dataBinding");return null}
var _8=_4;_4=isc.DataSource.get(_7.type);if(_4==null){this.logInfo("getDataSourceForDataPath() - unable to find nested dataSource for field:"+_7.name+" of type:"+_7.type+" on dataSource:"+_8+". Original dataPath:"+_1,"dataBinding");break}}
return _4},isc.A.getFieldByTitle=function isc_DataSource_getFieldByTitle(_1){var _2=isc.getValues(this.getFields());for(var i=0;i<_2.length;i++){var _4=_2[i],_5=_4.title||isc.DS.getAutoTitle(_2[i].name);if(_5==_1)return _4}
return null},isc.A.getDisplayValue=function isc_DataSource_getDisplayValue(_1,_2){var _3=this.getField(_1);if(_3==null)return _2;if(isc.isAn.Object(_3.valueMap)&&!isc.isAn.Array(_3.valueMap)&&isc.propertyDefined(_3.valueMap,_2))
{return _3.valueMap[_2]}
return _2},isc.A.getFieldNames=function isc_DataSource_getFieldNames(_1){if(isc.$cv)arguments.$cw=this;if(!_1)return isc.getKeys(this.getFields());var _2=this.getFields(),_3=[],_4=0;for(var _5 in _2){if(_2[_5]!=null&&!_2[_5].hidden){_3[_4++]=_5}}
return _3},isc.A.getLocalFields=function isc_DataSource_getLocalFields(_1){if(this.$38k)return this.fields;if(_1)return this.fields;this.$38l();this.$63p();this.$38k=true;return this.fields},isc.A.getFields=function isc_DataSource_getFields(){if(isc.$cv)arguments.$cw=this;if(this.mergedFields)return this.mergedFields;if(!this.hasSuperDS()||this==this.superDS()){return this.mergedFields=this.getLocalFields()}
if(!this.superDS()){this.logWarn("DataSource "+this.ID+" inheritsFrom "+this.inheritsFrom+", but there is no DataSource of that name currently loaded. Ignoring the inheritsFrom declaration.");return this.mergedFields=this.getLocalFields()}
var _1=this.superDS();if(this.showLocalFieldsOnly||this.restrictToLocalFields){this.useParentFieldOrder=false}
var _2=isc.addProperties({},this.getLocalFields()),_3;if(!this.useParentFieldOrder){_3=_2}else{_3={}}
var _4=(this.restrictToLocalFields?isc.getKeys(this.getLocalFields()):_1.getFieldNames());for(var i=0;i<_4.length;i++){var _6=_4[i],_7=_2[_6];if(_7!=null){var _8=_1.getField(_6);if(_8.hidden&&_7.hidden==null&&!_7.inapplicable&&!this.autoDeriveSchema&&!this.schemaBean)
{_7.hidden=false}
if(_8.visibility!=null&&_7.visibility==null&&!_7.inapplicable&&!_7.hidden&&_8.visibility=="internal")
{_7.visibility="external"}
var _9=isc.addProperties({},_7);_3[_6]=_1.combineFieldData(_7,null,true);if(_9.$76s)_3[_6].title=_8.title}else{if(this.showLocalFieldsOnly){_3[_6]=isc.addProperties({},_1.getField(_6));_3[_6].hidden="true"}else{_3[_6]=_1.getField(_6)}}
if(this.useParentFieldOrder)delete _2[_6]}
if(this.useParentFieldOrder)isc.addProperties(_3,_2);if(this.restrictToLocalFields&&isc.Schema&&isc.isA.Schema(this)){var _10=_1.getFieldNames();for(var i=0;i<_10.length;i++){var _6=_10[i],_11=_1.getField(_6);if(_11.xmlAttribute){_3[_6]=_3[_6]||_11}}}
return this.mergedFields=_3},isc.A.hasFields=function isc_DataSource_hasFields(){if(this.fields)return true;else if(this.inheritsFrom){var _1=this;while(_1.inheritsFrom){_1=isc.DataSource.get(this.inheritsFrom);if(_1.fields)return true}}
return false},isc.A.getFlattenedFields=function isc_DataSource_getFlattenedFields(_1,_2,_3){_1=_1||{};var _4=this.getFieldNames();for(var i=0;i<_4.length;i++){var _6=_4[i],_7=this.getField(_6);if(!this.fieldIsComplexType(_6)){if(_1[_6]==null){_7.sourceDS=this.ID;if(_2){_7=isc.addProperties({},_7);_7[_3]=_2+"/"+_6}
_1[_6]=_7}}else{var _8=this.getFieldDataSource(_7);if(_2!=null)_2=(_2?_2+"/":"")+_6;_8.getFlattenedFields(_1,_2,_3)}}
return _1},isc.A.fieldIsComplexType=function isc_DataSource_fieldIsComplexType(_1){var _2=this.getField(_1);if(_2==null)return false;return(_2.type!=null&&!_2.xmlAttribute&&this.getSchema(_2.type)!=null)||this.fieldIsAnonDataSource(_2)},isc.A.fieldIsAnonDataSource=function isc_DataSource_fieldIsAnonDataSource(_1){if(!_1.fields)return false;var _2=isc.isAn.Array(_1.fields)?_1.fields:isc.getValues(_1.fields);return _2.length>0&&isc.isAn.Object(_2.get(0))},isc.A.getFieldDataSource=function isc_DataSource_getFieldDataSource(_1,_2){if(!_1)return null;if(this.fieldIsAnonDataSource(_1)){if(!_1.$67z){var _3=isc.DataSource.create({"class":"DataSource",fields:_1.fields});_1.$67z=_3}
return _1.$67z}
return _1.type!=null?this.getSchema(_1.type,_2):null},isc.A.findTagOfType=function isc_DataSource_findTagOfType(_1,_2,_3){var _4=this.getFieldNames();for(var i=0;i<_4.length;i++){var _6=_4[i],_7=this.getField(_6);if(_7.type==_1)return[this,_6,_2,_3];if(this.fieldIsComplexType(_6)){var _8=this.getFieldDataSource(_7),_9=_8.findTagOfType(_1,this,_6);if(_9)return _9}}},isc.A.getTextContentField=function isc_DataSource_getTextContentField(){return this.getField(this.textContentProperty)},isc.A.hasXMLElementFields=function isc_DataSource_hasXMLElementFields(_1){_1=_1||this.textContentProperty;var _2=this.getFieldNames();for(var i=0;i<_2.length;i++){if(_2[i]==_1)continue;if(this.getField(_2[i]).xmlAttribute)continue;return true}
return false},isc.A.getGroups=function isc_DataSource_getGroups(){var _1=this;while(_1.groups==null&&_1.hasSuperDS())_1=_1.superDS();return _1.groups},isc.A.getObjectField=function isc_DataSource_getObjectField(_1,_2,_3){if(!_1)return null;var _4=this.getLocalFields(),_5=isc.getKeys(_4).reverse();var _6=isc.DataSource.getNearestSchema(_1),_7=isc.DataSource.getNearestSchemaClass(_6);if(_3==null)_3={};var _8=-1,_9=null;for(var i=0;i<_5.length;i++){var _11=_5[i],_12=_4[_11],_13;if(_11!=this.$192e&&(isc.endsWith(_11,this.$dr)||isc.endsWith(_11,this.$dq)))
{continue}
if(!_2&&(_3[_11]||_12.advanced||_12.inapplicable||_12.hidden||(_12.visibility!=null&&_12.visibility=="internal")))
{_3[_11]=_11;continue}
if(!_7&&_12.type==_1)return _11;if(_7&&_7.isA(_12.type)){_13=isc.DS.getInheritanceDistance(_12.type,_1);if(_9==null||_13<_8){_9=_11;_8=_13}}}
if(_9!=null){if(_8==0||!this.hasSuperDS()){return _9}else{var _14=this.superDS().getObjectField(_1,_2,_3);if(_14){var _15=this.getField(_14).type,_16=isc.DS.getInheritanceDistance(_15,_1)}
return(_14&&(_16<_8))?_14:_9}}else if(this.hasSuperDS()){return this.superDS().getObjectField(_1,_2,_3)}
return null},isc.A.getLocalPrimaryKeyFields=function isc_DataSource_getLocalPrimaryKeyFields(){if(!this.primaryKeys){this.primaryKeys={};var _1=this.getLocalFields();for(var _2 in _1){var _3=_1[_2];if(_3.primaryKey){this.primaryKeys[_2]=_3}}}
return this.primaryKeys},isc.A.filterPrimaryKeyFields=function isc_DataSource_filterPrimaryKeyFields(_1){var _2=this.getPrimaryKeyFields();return isc.applyMask(_1,isc.getKeys(_2))},isc.A.filterDSFields=function isc_DataSource_filterDSFields(_1){var _2=this.getFields();return isc.applyMask(_1,isc.getKeys(_2))},isc.A.recordHasAllKeys=function isc_DataSource_recordHasAllKeys(_1){var _2=this.getPrimaryKeyFields();for(var _3 in _2){if(_1[_3]==null)return false}
return true},isc.A.getForeignKeysByRelation=function isc_DataSource_getForeignKeysByRelation(_1,_2){var _3=this.getForeignKeyFields(_2);if(!_3)return{};var _4={};for(var _5 in _3){var _6=_3[_5];var _7=isc.DataSource.getForeignFieldName(_6);var _8=_1[_7];if(_8||_8===0)_4[_5]=_8}
return _4},isc.A.getPrimaryKeyFields=function isc_DataSource_getPrimaryKeyFields(){if(!this.mergedPrimaryKeys){this.mergedPrimaryKeys={};if(this.hasSuperDS()){isc.addProperties(this.mergedPrimaryKeys,this.superDS().getPrimaryKeyFields())}
isc.addProperties(this.mergedPrimaryKeys,this.getLocalPrimaryKeyFields())}
return this.mergedPrimaryKeys},isc.A.getForeignKeyFields=function isc_DataSource_getForeignKeyFields(_1){if(isc.isA.DataSource(_1))_1=_1.ID;var _2=this.getFields();if(!_2)return null;var _3={};for(var _4 in _2){var _5=_2[_4];if(_5.foreignKey){if(_1){var _6=isc.DataSource.getForeignDSName(_5,(_1||this));if(_6!=_1)continue}
_3[_5.name]=_5}}
return _3},isc.A.getLocalPrimaryKeyFieldNames=function isc_DataSource_getLocalPrimaryKeyFieldNames(){var _1=this.getLocalPrimaryKeyFields();var _2=[];for(var _3 in _1){_2.add(_3)}
return _2},isc.A.getPrimaryKeyFieldNames=function isc_DataSource_getPrimaryKeyFieldNames(){return isc.getKeys(this.getPrimaryKeyFields())},isc.A.getPrimaryKeyField=function isc_DataSource_getPrimaryKeyField(){var _1=this.getPrimaryKeyFields();for(var _2 in _1){return _1[_2]}},isc.A.getPrimaryKeyFieldName=function isc_DataSource_getPrimaryKeyFieldName(){return this.getPrimaryKeyFieldNames()[0]},isc.A.addChildDataSource=function isc_DataSource_addChildDataSource(_1){var _2=this.$38m=(this.$38m||[]);_2.add(_1)},isc.A.getChildDataSources=function isc_DataSource_getChildDataSources(){return this.$38m},isc.A.getChildDataSource=function isc_DataSource_getChildDataSource(_1){var _2=this.getChildDataSources();if(_2==null)return null;var _3;for(var i=0;i<_2.length;i++){if(!_2[i]||(_1&&_2[i]==this))continue;if(!_3){_3=_2[i]}else if(_3!=_2[i]){this.logInfo("getChildDatasource(): This DataSource has multiple child DataSources defined making getChildDataSource() ambiguous. Returning the first child dataSource only - call getChildDataSources() to retrieve a complete list.");break}}
return _3},isc.A.getTreeRelationship=function isc_DataSource_getTreeRelationship(_1,_2,_3){if(isc.isA.String(_1))_1=this.getSchema(_1);var _4,_5;if(_3&&_1){_4=[];_5=[]}
var _6=this.getFields();if(_2==null){for(var _7 in _6){var _8=_6[_7];if(_8.foreignKey!=null){if((_1||this).getID()==isc.DataSource.getForeignDSName(_8,this))
{if(!_2)_2=_7;if(_4)_4.add(_7);else break}}}}
var _9;if(_2==null&&_1){_2=_9=isc.getKeys(this.fields).intersect(isc.getKeys(_1.fields))[0];this.logInfo("no foreign key declaration, guessing tree relationship is on field name: "+_2+" which occurs in both DataSources");if(_4)_4[0]=_5[0]=_9}
var _10;if(_2)_10=_6[_2];if(_10==null){this.logDebug("getTreeRelationship(): Unable to find foreignKeyField.foreignKeyFieldName specified as:"+_2)}
if(!_1){if(!_10)_1=this;else{var _11=isc.DataSource.getForeignDSName(_10,this);_1=this.getSchema(_11)}}
if(!_9){_9=_10?isc.DataSource.getForeignFieldName(_10):null;if(_4)for(var i=0;i<_4.length;i++){var _10=_6[_4[i]];_5.add(_10?isc.DataSource.getForeignFieldName(_10):null)}}
if(_9==null){var _13=_1.getPrimaryKeyFieldNames();if(_4){if(isc.isAn.Array(_13)){if(_13.length==_4.length)_5=_13.duplicate()}else{if(_4.length==1)_5[0]=_13}}
if(isc.isAn.Array(_13)){if(_13.length>1&&!_4){this.logWarn("getTreeRelationship: dataSource '"+_1.ID+"' has multi-field primary key, which is not supported for tree viewing.  Using field '"+_13[0]+"' as the only primary key field")}
_13=_13[0]}
_9=_13}
var _14;var _15;if(this.childrenField)_15=this.childrenField;for(var _7 in _6){var _10=_6[_7];if(_10.isFolderProperty)_14=_7;if(_10.childrenProperty)_15=_7;if(_15==_7&&(_10.multiple==null)){_10.multiple=true}}
var _16={childDS:this,parentDS:_1,isFolderProperty:_14}
if(_2){_16.parentIdField=_2;_16.idField=_9}
if(_15)_16.childrenProperty=_15;if(_4){_16.parentIdFields=_4;_16.idFields=_5}
if(_15==null&&_2==null){this.logInfo("getTreeRelationship(): No specified foreignKeyField or childrenProperty.")}
if(_1==this){var _17=_2?this.getField(_2).rootValue:null;if(_17==null)_16.rootValue=null;else _16.rootValue=_17}
return _16},isc.A.combineFieldOrders=function isc_DataSource_combineFieldOrders(_1,_2,_3){var _4=[];this.$38n(_2,0,_1,_4,_3);for(var _5 in _1){var _6=_1[_5],_7=_2.findIndex(this.$375,_5);if(_7!=-1){var _8=_2[_7],_9=this.combineFieldData(_8);if(_3==null||_3(_9,this,true))_4.add(_9);this.$38n(_2,_7+1,_1,_4,_3)}else{if(_3==null||_3(_6,this)){var _9=isc.addProperties({},_6);if(_9.hidden)delete _9.hidden;_4.add(_9)}}}
return _4},isc.A.$38n=function isc_DataSource__addNonDSFields(_1,_2,_3,_4,_5){for(var i=_2;i<_1.length;i++){var _7=_1[i];if(_7.name!=null&&_3[_7.name]!=null)return;if(_5==null||!_5(_7,this,true))continue;isc.SimpleType.addTypeDefaults(_7);_4.add(_7)}},isc.A.combineFieldData=function isc_DataSource_combineFieldData(_1,_2,_3,_4){var _5;if(isc.isAn.Object(_2))_5=_2;else _5=this.getField(_2||_1.name);return isc.DataSource.combineFieldData(_1,_5,_3,_4)},isc.A.$38l=function isc_DataSource__addTypeDefaults(_1){if(_1==null)_1=this.fields;for(var _2 in _1){var _3=_1[_2];if(_3&&_3.required==null&&_3.xmlRequired!=null&&_3.xmlNonEmpty!=null)
{_3.required=_3.xmlRequired&&_3.xmlNonEmpty}
if(_3&&(_3.childrenProperty||_3.name==this.childrenField)){if(!_3.type)_3.type=this.ID}
if(!_3.type&&this.hasSuperDS()){if(this.superDS().fields&&this.superDS().fields[_2]){_3.type=this.superDS().fields[_2].type}}
isc.SimpleType.addTypeDefaults(_3,this);this.$75f(_3)}},isc.A.$75f=function isc_DataSource__addFieldValidators(_1){if(_1.required){var _2=isc.addProperties({},this.$1611),_3=_1.requiredMessage||this.requiredMessage;if(_3!=null)_2.errorMessage=_3;this.$1612(_1,_2)}},isc.A.$1612=function isc_DataSource__addValidatorToField(_1,_2){if(!_1.validators){_1.validators=[_2]}else{if(!isc.isAn.Array(_1.validators)){_1.validators=[_1.validators]}
if(_1.validators.$69){_1.validators=_1.validators.duplicate()}
for(var i=_1.validators.length-1;i>=0;i--){if(_1.validators[i].type==_2.type){if(!_1.validators[i].errorMessage){_1.validators[i].errorMessage=_2.errorMessage}
return}}
_1.validators.add(_2)}},isc.A.$63p=function isc_DataSource__autoDeriveTitles(){if(!this.autoDeriveTitles)return;for(var _1 in this.fields){var _2=this.fields[_1];if(_2.title!=null)continue;_2.title=this.getAutoTitle(_1);_2.$76s=true}},isc.A.getAutoTitle=function isc_DataSource_getAutoTitle(_1){return isc.DataSource.getAutoTitle(_1)},isc.A.getType=function isc_DataSource_getType(_1){if(this.schemaNamespace){var _2=isc.SchemaSet.get(this.schemaNamespace),_3=_2.getSimpleType(_1);if(_3)return _3}
var _3=isc.SimpleType.getType(_1);if(_3!=null)return _3;if(this.types&&this.types[_1])return this.types[_1];return null},isc.A.firstCacheAllDataRequest=function isc_DataSource_firstCacheAllDataRequest(_1){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("firstCacheAllDataRequest: refreshing cache","cacheAllData")}
this.$498=[_1];if(this.$839==null){var _2=this.transformRequest,_3=this.transformResponse,_4=this.$ba;if(_4){if(_4.transformRequest){_2=this[isc.$ah+"transformRequest"]}
if(_4.transformResponse){_3=this[isc.$ah+"transformResponse"]}}
this.transformServerRequest=_2;this.transformServerResponse=_3;this.addMethods({$175o:function(_1){return _1.cachingAllData||(this.cacheAcrossOperationIds&&(_1.operationType&&_1.operationType!="fetch"))||(this.cacheAcrossOperationIds===false&&this.cacheAllOperationId!=(_1.operationId||_1.operation))},transformRequest:function(_1){if(!this.$175o(_1))return _1;return this.transformServerRequest(_1)},transformResponse:function(_8,_1,_9){if(!this.$175o(_1)){var _5=this.$85n,_6=_1.$85o;if(!_5||!_6||_6>=_5)
return _8}
return this.transformServerResponse(_8,_1,_9)}});this.$839=true}
this.cacheResultSet=isc.ResultSet.create({dataSource:this,fetchMode:"local",fetchOperation:this.cacheAllOperationId,allRows:this.cacheData?this.cacheData:null,cachingAllData:true,componentId:"(cacheAllData fetch)",componentContext:"(from: "+_1.componentId+(_1.componentContext?" &lt;"+_1.componentContext+"&gt;)":")"),dataArrived:function(_8,_9){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("cacheAllData - cacheResultSet.dataArrived: startRow/endRow: "+_8+"/"+_9)}
if(this.lengthIsKnown()){var _7=this.getDataSource();if(_7.cacheResultSet==null)return;_7.cacheLastFetchTime=new Date().getTime();if(_7.clientOnly||_7.mockMode){if(_7.clientOnly)_7.testData=_7.cacheData=this.getAllRows();else if(_7.mockMode)_7.testData=_7.cacheData=this.getAllLoadedRows()}
_7.processDeferredRequests()}}});if(!this.cacheData){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("firstCacheAllDataRequest: issuing fetch","cacheAllData")}
this.cacheResultSet.get(0);return true}else{if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("firstCacheAllDataRequest: updating last fetch time","cacheAllData")}
this.cacheLastFetchTime=new Date().getTime();if(this.clientOnly)this.testData=this.cacheData;this.processDeferredRequests();return true}},isc.A.getCacheData=function isc_DataSource_getCacheData(){if(this.cacheResultSet!=null){if(this.cacheResultSet.allRows)return this.cacheResultSet.allRows}
if(this.cacheData!=null){return this.cacheData}
if(this.testData!=null){return this.testData}},isc.A.fetchingClientOnlyData=function isc_DataSource_fetchingClientOnlyData(_1){if(_1.cachingAllData){if(this.mockMode){if(this.mockDataRows!=null){_1.startRow=0;_1.endRow=this.mockDataRows}
_1.data=this.mockDataCriteria}
return false}
if(_1.downloadResult){return false}
var _2=(this.useTestDataFetch==null?this.shouldUseTestDataFetch():this.useTestDataFetch);if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("fetchingClientOnlyData: useTestDataFetch is "+_2,"cacheAllData")}
if(this.clientOnly){_1.clientOnly=true;if(this.testData&&!this.cacheData)this.cacheData=this.testData;else if(this.cacheData&&!this.testData)this.testData=this.cacheData}
if(this.$498){this.$498.add(_1);return true}
var _3=this.cacheNeedsRefresh();if(_2==false&&this.clientOnly&&this.hasTestData())
_2=true;if(!_2&&((this.cacheAllData&&_3)||(this.clientOnly&&!this.testData&&this.hasTestData())||(this.mockMode&&!this.cacheData)))
{return this.firstCacheAllDataRequest(_1)}else{if((this.clientOnly||this.mockMode)&&!this.testData&&(this.testFileName||this.dataURL)||(this.cacheAllData&&_3)||(this.mockMode&&!this.cacheData)){if(this.logIsInfoEnabled("cacheAllData")){this.logInfo("fetchingClientOnlyData: issuing oneTimeDS fetch","cacheAllData")}
this.$498=[_1];var _4=this.dataURL||this.testFileName;var _5=this.getDataFormat(_1);if(_5=="iscServer")_5=_4.match(/\.xml$/i)?"xml":"json";var _6=this.getOperationBinding(_1);var _7=this.transformRequest,_8=this.transformResponse,_9=this.$ba;if(_9){if(_9.transformRequest){_7=this[isc.$ah+"transformRequest"]}
if(_9.transformResponse){_8=this[isc.$ah+"transformResponse"]}}
var _10=_6.recordName||this.recordName||(this.inheritsFrom?(isc.isA.String(this.inheritsFrom)?this.inheritsFrom:this.inheritsFrom.ID):this.ID);var _11=isc[this.Class].create({ID:this.ID+"$499",inheritsFrom:this.ID,dataURL:_4,dataFormat:_5,recordXPath:this.recordXPath,$175o:this.$175o,transformRequest:_7,transformResponse:_8,recordName:_10,showPrompt:this.showPrompt});this.logInfo("clientOnly datasource performing one-time "+_5+" fetch via: "+_4);this.addProperties({transformRequest:isc.DataSource.getInstanceProperty("transformRequest"),transformResponse:isc.DataSource.getInstanceProperty("transformResponse")});var _12=this;if(this.cacheAllData){_11.cacheAllData=false}
_11.sendDSRequest({operationType:"fetch",willHandleError:true,componentId:_1.componentId,componentContext:_1.componentContext,callback:function(_14,_15){var _13;if(_14.status!=isc.DSResponse.STATUS_SUCCESS){_12.logWarn("one-time fetch failed with status: "+_14.status+" and messsage: "+(_15?_15:"N/A")+".  Initializing an empty Array as testData.");_13=[]}else{_12.logInfo("One-time fetch complete: "+(_15?_15.length:"null")+" records");_13=_12.initializeSequenceFields(_15)}
if(_12.cacheAllData){_12.cacheLastFetchTime=new Date().getTime();_12.cacheResultSet=isc.ResultSet.create({dataSource:_12.ID,fetchMode:"local",allRows:_13});_12.cacheLastFetchTime=new Date().getTime()}
if(_12.clientOnly){_12.cacheData=_12.testData=_13}
_12.processDeferredRequests();_11.destroy()}});return true}}});isc.evalBoundary;isc.B.push(isc.A.shouldUseTestDataFetch=function isc_DataSource_shouldUseTestDataFetch(){return this.clientOnly==true&&this.cacheAllData!=true&&(this.dataURL!=null||this.testFileName!=null)},isc.A.hasTestData=function isc_DataSource_hasTestData(){return this.dataURL!=null||this.testFileName!=null},isc.A.getClientOnlyResponse=function isc_DataSource_getClientOnlyResponse(_1,_2){_2=_2||this.testData;var _3=false;if(_1.clientOnlyDataModified!=true){_1.clientOnlyDataModified=true;_3=true}
if(_2&&!this.testData&&this.clientOnly)
this.cacheData=this.testData=_2;if(!_2||isc.isA.String(_2)){if(isc.isA.String(_2)){this.logInfo(this.ID+" datasource: using testData property as data");this.cacheData=this.testData=isc.eval(_2)}else if(window[this.ID+"TestData"]){this.logInfo(this.ID+" datasource: using "+this.ID+"TestData object as data");this.cacheData=this.testData=window[this.ID+"TestData"]}else{this.logInfo(this.ID+" datasource: testData property and "+this.ID+"TestData object not found, using empty list as data");this.cacheData=this.testData=[]}
_2=this.testData}
var _4=_1.operationType,_5={status:0};switch(_4){case"fetch":case"select":case"filter":var _6=this.getClientOnlyFetchResponse(_1,_2,false);_5=_6[0];var _7=_6[1];if(this.copyLocalResults){var _8=isc.Browser.isSGWT;for(var i=0;i<_7.length;i++){if(this.deepCopyLocalResults){_7[i]=isc.clone(_7[i])}else{_7[i]=isc.addProperties({},_7[i])}
if(_8){_7[i][isc.gwtRef]=null;_7[i][isc.gwtModule]=null}}}
_5.data=_7;break;case"remove":case"delete":if(this.isMissingPrimaryKeys(_1.data)){_5.data="clientOnly remove operation failed for DataSource "+this.ID+": missing primaryKey values(s) "+this.getMissingPrimaryKeys(_1.data);_5.data="clientOnly remove operation failed: missing primaryKey value(s): "+this.getMissingPrimaryKeys(_1.data);_5.status=-1}else{var _10=this.findByKeys(_1.data,_2);if(_10==-1&&_3){this.logWarn("clientOnly remove operation: Unable to find record matching criteria:"+this.echo(_1.data));_5.data="clientOnly remove operation failed: unable to find matching record"
_5.status=-1}else{if(_3){_2.removeAt(_10)}
_5.data=isc.addProperties({},_1.data)}}
break;case"add":case"insert":var _11=isc.addProperties({},_1.data);if(_11.__ref){delete _11.__ref;delete _11.__module}
_11=this.applySequenceFields(_11);var _10=this.findByKeys(_11,_2);if(_10!=-1&&_3){this.logWarn("clientOnly add operation: Duplicate key: "+isc.echoAll(_11)+this.getStackTrace());_5.data="clientOnly add operation failed for DataSource "+this.ID+": Duplicate key in record "+isc.echoAll(_11)+"<br><br>"+this.getStackTrace();_5.status=-1}else{if(_3){_2.add(_11)}
_5.data=isc.addProperties({},_11)}
break;case"replace":case"update":if(this.isMissingPrimaryKeys(_1.data)){this.logWarn("clientOnly update operation: Missing primaryKey values: "+this.getMissingPrimaryKeys(_1.data));_5.data="clientOnly update operation failed for DataSource "+this.ID+": missing primaryKey values(s) "+this.getMissingPrimaryKeys(_1.data);_5.status=-1}else{var _10=this.findByKeys(_1.data,_2);if(_10==-1){this.logWarn("clientOnly update operation: Unable to find record matching criteria:"+this.echo(_1.data));_5.data="clientOnly update operation failed: unable to find matching record. Did you supply all primaryKeys?"
_5.status=-1}else{var _11=_2[_10];if(_3!=true){_11=isc.addProperties({},_11)}
for(var _12 in _1.data){if(_12=="__ref"||_12=="__module")continue;var _13=this.getField(_12);isc.Canvas.$70n(_12,null,_1.data[_12],_11,null,true)}
_5.data=isc.addProperties({},_11)}}
break;case"validate":default:break}
this.$109x(_5,_4);return _5},isc.A.getClientOnlyFetchResponse=function isc_DataSource_getClientOnlyFetchResponse(_1,_2,_3){var _4=_1.data;if(isc.isAn.Array(_4))_4=_4[0];var _5=this.applyFilter(_2,_4,_1),_6=_5,_7={status:0};if(_1.startRow!=null){var _8=_1.startRow,_9=_1.endRow,_10=_5.length;var _11=isc.shallowClone(_1.sortBy);if(_11){if(!isc.isAn.Array(_11))_11=[_11];if(isc.isAn.Object(_11[0])){_11=isc.DS.getSortBy(_11)}
var _12=[],_13=null;var _14=_11.length;if(_3==true){_12=new Array(_14);_13=new Array(_14)}
for(var i=0;i<_14;i++){var _16=true;if(_11[i].startsWith("-")){_11[i]=_11[i].substring(1);_16=false}
_12[i]=_16;if(_3==true)_13[i]=this}
if(_3==true)_5.sortByProperties(_11,_12,null,_13);else _5.sortByProperties(_11,_12)}
_9=Math.min(_9,_10);_6=_5.slice(_8,_9);_7.startRow=_8;_7.endRow=_9;_7.totalRows=_10}
return[_7,_6]},isc.A.$109x=function isc_DataSource__trackClientOnlyChanges(_1,_2){var _3=this.getPrimaryKeyFieldName();switch(_2){case'add':if(!this.$109y)this.$109y={};this.$109y[_1.data[_3]]=_1.data;break;case'update':if(!this.$109z)this.$109z={};if(this.$109y&&this.$109y[_1.data[_3]]){this.$109y[_1.data[_3]]=_1.data}else{this.$109z[_1.data[_3]]=_1.data}
break;case'remove':if(!this.$1090)this.$1090={};if(this.$109y&&this.$109y[_1.data[_3]]){this.$109y[_1.data[_3]]=null}
if(this.$109z&&this.$109z[_1.data[_3]]){this.$109z[_1.data[_3]]=null}
this.$1090[_1.data[_3]]=_1.data}},isc.A.getChanges=function isc_DataSource_getChanges(){var _1=new Array();var _2=this.getPrimaryKeyFieldName();if(this.$109y){for(var _3 in this.$109y){if(this.$109y[_3]!=null&&isc.isA.Object(this.$109y[_3])){this.$109y[_3][_2]=null;var _4={data:this.$109y[_3],operationType:'add'};_1.push(_4)}}}
if(this.$109z){for(var _3 in this.$109z){if(this.$109z[_3]!=null&&isc.isA.Object(this.$109z[_3])){var _4={data:this.$109z[_3],operationType:'update'};_1.push(_4)}}}
if(this.$1090){for(var _3 in this.$1090){if(this.$1090[_3]!=null&&isc.isA.Object(this.$1090[_3])){var _4={data:this.$1090[_3],operationType:'remove'};_1.push(_4)}}}
if(this.$109y)this.$109y=null;if(this.$109z)this.$109z=null;if(this.$1090)this.$1090=null;return _1},isc.A.getNextSequenceValue=function isc_DataSource_getNextSequenceValue(_1){var _2=this.testData,_3=0;for(var i=0;i<_2.length;i++){var _5=_2[i][_1.name];if(_5!=null&&_5>_3)_3=_5}
return _3+1},isc.A.applySequenceFields=function isc_DataSource_applySequenceFields(_1){if(this.contactsServer()){return _1}
var _2=this.getFields();for(var _3 in _2){var _4=_2[_3];if((_4.type=="sequence"||_4.primaryKey)&&_1[_3]==null){var _5=isc.SimpleType.getType(_4.type);while(_5&&_5.inheritsFrom){_5=isc.SimpleType.getType(_5.inheritsFrom)}
if(_5=="date"||_5=="time"){this.logWarn("clientOnly dataSource encountered a primaryKey of date or time type for which no value was supplied for an 'add' request.  Defaulting to the epoch (midnight on 1 Jan 1970)");_1[_3]=new Date(0)}else{_1[_3]=this.getNextSequenceValue(_4);if(_4.type!="sequence"){this.logWarn("clientOnly dataSource found a missing value for primaryKey field '"+_3+"' during an add request. Derived value "+_1[_3]+" from sequence processing")}}}}
return _1},isc.A.initializeSequenceFields=function isc_DataSource_initializeSequenceFields(_1){if(!isc.isAn.Array(_1))return;var _2=this.getFields();var _3=[];for(var _4 in _2){if(_2[_4].type=="sequence"||_2[_4].primaryKey)_3.add(_4)}
var _5=this.firstGeneratedSequenceValue;for(var i=0;i<_1.length;i++){for(var j=0;j<_3.length;j++){var _4=_3[j];if(_1[i][_4]==null)_1[i][_4]=i+_5}}
return _1},isc.A.isMissingPrimaryKeys=function isc_DataSource_isMissingPrimaryKeys(_1){return this.getMissingPrimaryKeys(_1).length>0},isc.A.getMissingPrimaryKeys=function isc_DataSource_getMissingPrimaryKeys(_1){var _2=_1;if(isc.isAn.Array(_1))_2=_1[0];var _3=this.getPrimaryKeyFieldNames(),_4=[],_5;if(!isc.isAn.Object(_2))return _3;for(var i=0;i<_3.length;i++){if(_2[_3[i]]==_5){_4.add(_3[i])}}
return _4},isc.A.findByKeys=function isc_DataSource_findByKeys(_1,_2,_3,_4){var _5=_1;if(isc.isAn.Array(_1))_5=_1[0];if(_2==null||_5==null||!isc.isAn.Object(_5))return-1;var _6=this.getPrimaryKeyFieldNames(),_7={},_8=false;if(isc.ResultSet&&isc.isA.ResultSet(_2))_2=_2.localData;for(var i=0;i<_6.length;i++){_7[_6[i]]=_5[_6[i]];var _10=this.getField(_6[i]).type;if(isc.SimpleType.inheritsFrom(_10,"date")||isc.SimpleType.inheritsFrom(_10,"time"))
{_8=true}}
var _11,_12=isc.DataSource.getPrototype()["applyFilter"]==this.applyFilter;if(_12){if(!_8)return _2.findByKeys(_5,this,_3,_4);_11=this.recordIndicesMatchingFilter(_2,_7,{},_3,_4)}else{_11=this.applyFilter(_2,_7,{},_3,_4)}
if(!_11||_11.length==0)return-1;if(_11.length>1){this.logWarn("Searching by primaryKey, found "+_11.length+" records when there should only be one - returning the first.  PrimaryKey set was: "+isc.echoAll(_7))}
return _12?_11[0]:_2.indexOf(_11[0],_3,_4)},isc.A.applyFilter=function isc_DataSource_applyFilter(_1,_2,_3,_4,_5){var _6=[];if(!_1||_1.length==0)return _6;if(this.autoConvertRelativeDates==true&&this.autoConvertRelativeDatesMode!="server")
{if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Calling convertRelativeDates from applyFilter - data is\n\n"+isc.echoFull(_2))}
_2=this.convertRelativeDates(_2);if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Called convertRelativeDates from applyFilter - data is\n\n"+isc.echoFull(_2))}}
if(this.isAdvancedCriteria(_2)){var _7=this.normalizeAdvancedCriteria(_2);return this.recordsMatchingAdvancedFilter(_1,_7,_3,_4,_5)}
return this.recordsMatchingFilter(_1,_2,_3,_4,_5)},isc.A.$1859=function isc_DataSource__hasMatches(_1,_2,_3){var _4=this.applyFilter(_1,_2,_3);return _4!=null&&_4.length>0},isc.A.recordIndicesMatchingFilter=function isc_DataSource_recordIndicesMatchingFilter(_1,_2,_3,_4,_5){return this.recordsMatchingFilter(_1,_2,_3,_4,_5,true)},isc.A.recordsMatchingFilter=function isc_DataSource_recordsMatchingFilter(_1,_2,_3,_4,_5,_6){var _7=isc.getKeys(_2),_8=_7.length,_9=[],_10,_11,_12,_13,_14,j;_4=_4||0;_5=_5||_1.length;if(_3&&_3.operation&&this.operationBindings){var _16=_3.operation;if(_16.ID==_16.dataSource+"_"+_16.type){var _17=this.operationBindings.find({operationId:null,operationType:_16.type})}else{var _17=this.operationBindings.find({operationId:_3.operation.ID,operationType:_16.type})}
if(_17){var _18=_17.customCriteriaFields;if(isc.isA.String(_18)){_18=_18.split(",");for(var k=0;k<_18.length;k++){_18[k]=_18[k].replace(/^\s+|\s+$/g,'')}}}}
for(var i=_4;i<_5;i++){_10=_1[i];if(_10==null)continue;_11=true;for(j=0;j<_8;j++){_12=_7[j];if(_12==null)continue;var _21=this.getField(_12,true);if(_21==null)_21=this.getFieldForDataPath(_12);if(this.dropUnknownCriteria&&!_21){continue}
var _22=false;if(isc.isA.List(_18)&&_18.contains(_12)){_22=true}
if(!_22&&_21&&_21.customSQL)continue;_13=isc.DataSource.getPathValue(_10,_12,_21,"filter");_14=_2[_12];if(!this.fieldMatchesFilter(_13,_14,_3,(_21?_21.ignoreTextMatchStyle:null)))
{_11=false;break}}
if(_11)_9.add(_6?i:_10)}
return _9},isc.A.recordMatchesFilter=function isc_DataSource_recordMatchesFilter(_1,_2,_3){return this.applyFilter([_1],_2,_3).length>0},isc.A.fieldMatchesFilter=function isc_DataSource_fieldMatchesFilter(_1,_2,_3,_4){var _5;if(_4){_5=this.ignoreTextMatchStyleCaseSensitive?this.$135s:this.$50i}else if(_3){_5=_3.textMatchStyle}
if(isc.isAn.Array(_2)||isc.isAn.Array(_1)){if(!isc.isAn.Array(_1)){_1=[_1]}
if(!isc.isAn.Array(_2)){_2=[_2]}
var _6=isc.isA.Date(_2[0]);if(_5==this.$50i||_5==this.$135s||_6){if(_6){return _2.intersectDates(_1).length>0}else if(_5==this.$135s){return _2.intersect(_1).length>0}else{return _2.intersectSubstring(_1,true,this.$50i).length>0}}else{return _2.intersectSubstring(_1,true,_5).length>0}}
if(isc.isA.Date(_1)&&isc.isA.Date(_2)){if(_2.logicalDate||_1.logicalDate)
return(isc.DateUtil.compareLogicalDates(_1,_2)==0);return(isc.DateUtil.compareDates(_1,_2)==0)}
if(!isc.isA.String(_1)&&!isc.isA.String(_2)){if(this.logIsDebugEnabled()){this.logDebug("Direct compare: "+_1+"=="+_2)}
return(_1==_2)}
if(_2==null)_2=isc.emptyString;if(_1==null)_1=isc.emptyString;if(!isc.isA.String(_1))_1=_1.toString();if(!isc.isA.String(_2))_2=_2.toString();if(_5!=this.$135s&&this.filterIsCaseSensitive!==true){_1=_1.toLocaleLowerCase();_2=_2.toLocaleLowerCase()}
if(!this.supportsTextMatchStyle(_5)){if(!this.$63c)this.$63c={};if(!this.$63c[_5]){this.logWarn("Text match style specified as '"+_5+"': This is not supported for this dataSource - performing a substring match instead");this.$63c[_5]=true}
_5=this.getTextMatchStyle(_5)}
if(_5==this.$45y){return isc.startsWith(_1,_2)}else if(_5==this.$19q){return isc.contains(_1,_2)}else{return _1==_2}},isc.A.supportsTextMatchStyle=function isc_DataSource_supportsTextMatchStyle(_1,_2){if(!this.clientOnly&&(this.dataFormat!=this.$50j))return true;return(_1==null||_1==this.$19q||_1==this.$50i||_1==this.$45y||_1==this.$135s)},isc.A.getTextMatchStyle=function isc_DataSource_getTextMatchStyle(_1){if(_1==null)_1=this.$50i;if(!this.supportsTextMatchStyle(_1)){_1=this.$19q}
return _1},isc.A.compareTextMatchStyle=function isc_DataSource_compareTextMatchStyle(_1,_2){_1=this.getTextMatchStyle(_1);_2=this.getTextMatchStyle(_2);if(_1==_2)return 0;if(_1==this.$135s)return 1;if(_2==this.$135s)return-1;if(_2==this.$19q)return 1;if(_1==this.$19q)return-1;if(_1==this.$50i&&_2==this.$45y)return 1;return-1},isc.A.compareCriteria=function isc_DataSource_compareCriteria(_1,_2,_3,_4){if(this.logIsInfoEnabled()){this.logInfo("Comparing criteria, oldCriteria:\n"+this.echo(_2)+"\nnewCriteria:\n"+this.echo(_1)+", policy: "+(_4||this.criteriaPolicy))}
if(_2==null)_2={};var _5=this.getTextMatchStyle(_3?_3.textMatchStyle:null);if(this.isAdvancedCriteria(_1)||this.isAdvancedCriteria(_2)){var _6,_7;if(this.isAdvancedCriteria(_1)){if(this.isAdvancedCriteria(_2)){_7=this.compareAdvancedCriteria(_1,_2,_3)}else{var j=0;for(var i in _2){j++;break}
if(j==0)_7=1}
if(_7==_6){_2=isc.DataSource.convertCriteria(_2,_5);_7=this.compareAdvancedCriteria(_1,_2,_3)}}else{var j=0;for(var i in _1){j++;break}
if(j==0){_7=-1}else{_1=isc.DataSource.convertCriteria(_1,_5);_7=this.compareAdvancedCriteria(_1,_2,_3)}}
if(_7==_6)_7=-1;_4=_4||this.criteriaPolicy;if(_4=="dropOnShortening"){return _7}else{return _7==0?0:-1}}
_4=_4||this.criteriaPolicy;if(_4=="dropOnShortening"){if(_5==this.$50i||_5==this.$135s){return this.dropOnFieldChange(_1,_2,_3)}else{return this.dropOnShortening(_1,_2,_3)}}else{return this.dropOnChange(_1,_2,_3)}},isc.A.getFieldCriterion=function isc_DataSource_getFieldCriterion(_1,_2){var _3;if(_1.fieldName==_2)return _1;if(_1.criteria){var _4=_1.criteria.getProperty("fieldName").getUniqueItems();if(_4.length==1&&_4[0]==_2)return _1;for(var i=0;i<_1.criteria.length;i++){_3=this.getFieldCriterion(_1.criteria[i],_2);if(_3)return _3}}
return null},isc.A.dropOnChange=function isc_DataSource_dropOnChange(_1,_2,_3){if(isc.getKeys(_2).length!=isc.getKeys(_1).length)return-1;for(var _4 in _2){var _5=_2[_4],_6=_1[_4];if(isc.isAn.Array(_5)){if(!isc.isAn.Array(_6))return-1;if(_5.length!=_6.length)return-1;if(_5.intersect(_6).length!=_5.length)
{return-1}}else if(isc.isA.Date(_5)&&isc.isA.Date(_6))
{if(_5.getTime()!=_6.getTime())return-1}else if(_5!=_6){return-1}}
return 0},isc.A.dropOnFieldChange=function isc_DataSource_dropOnFieldChange(_1,_2,_3){var _4=isc.getKeys(_1),_5=isc.getKeys(_2),_6=_4.length-_5.length;if(_6<0)return-1;for(var _7 in _2){var _8=_2[_7],_9=_1[_7];if(_9==null)return-1;if(isc.isAn.Array(_8)){if(!isc.isAn.Array(_9))return-1;if(_8.length!=_9.length)return-1;if(_8.intersect(_9).length!=_8.length)
{return-1}}else if(isc.isA.Date(_8)&&isc.isA.Date(_9))
{if(_8.getTime()!=_9.getTime())return-1}else if(_8!=_9){return-1}}
if(_6>0){_4.removeList(_5);for(var i=0;i<_4.length;i++){if(this.getField(_4[i])==null)return-1}
return 1}
return 0},isc.A.dropOnShortening=function isc_DataSource_dropOnShortening(_1,_2,_3){var _4=isc.getKeys(_1),_5=isc.getKeys(_2),_6=_4.length-_5.length;if(_6<0)return-1;var _7=0;for(var _8 in _2){var _9=_2[_8],_10=_1[_8];if(_10==null)return-1;if((this.getField(_8)==null||this.getField(_8).ignoreTextMatchStyle)&&_9!=_10)
{return-1}
if(isc.isAn.Array(_9)){if(!isc.isAn.Array(_10))return-1;if(_9.length!=_10.length)return-1;if(_9.intersect(_10).length!=_9.length)
{return-1}}else if(isc.isA.String(_9)){if(!isc.isA.String(_10))return-1;if(_10.indexOf(_9)==-1)return-1;if(_9.length>_10.length)return-1;if(_9.length<_10.length)_7=1}else if(isc.isA.Date(_9)&&isc.isA.Date(_10))
{if(_9.getTime()!=_10.getTime())return-1}else if(_9!=_10){return-1}}
if(_6>0){_4.removeList(_5);for(var i=0;i<_4.length;i++){if(this.getField(_4[i])==null)return-1}
return 1}
return _7},isc.A.compareDates=function isc_DataSource_compareDates(_1,_2,_3,_4){var _5=this.getFieldForDataPath(_3),_6=_4?this.getFieldForDataPath(_4):null;if((_5&&isc.SimpleType.inheritsFrom(_5.type,"datetime"))||(_6&&isc.SimpleType.inheritsFrom(_6.type,"datetime")))
{return isc.DateUtil.compareDates(_1,_2,true)}else if((_5&&isc.SimpleType.inheritsFrom(_5.type,"time"))||(_6&&isc.SimpleType.inheritsFrom(_6.type,"time")))
{return isc.Time.compareLogicalTimes(_1,_2)}else{return isc.DateUtil.compareLogicalDates(_1,_2,true)}},isc.A.compareValues=function isc_DataSource_compareValues(_1,_2,_3,_4){if(isc.DateUtil.mapsToDate(_1)&&isc.DateUtil.mapsToDate(_2)){return this.compareDates(_1,_2,_3)}else{var _5=_4&&_1.toLowerCase?_1.toLowerCase():_1,_6=_4&&_2.toLowerCase?_2.toLowerCase():_2;if(_5==null&&_6!=null)return 1;if(_5!=null&&_6==null)return-1;return _5>_6?-1:(_5<_6?1:(_5==_6?0:2))}},isc.A.recordsAreEqual=function isc_DataSource_recordsAreEqual(_1,_2){var _3=this.getFieldNames();for(var i=0;i<_3.length;i++){if(this.compareValues(_1[_3[i]],_2[_3[i]],_3[i])!=0){return false}}
return true},isc.A.convertDataSourceCriteria=function isc_DataSource_convertDataSourceCriteria(_1,_2){return isc.DataSource.convertCriteria(_1,_2,this)});isc.B._maxIndex=isc.C+209;isc.A=isc.DataSource;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$628=0;isc.A.$135t={exact:"equals",exactCase:"iEquals",substring:"iContains",startsWith:"iStartsWith"};isc.A.criteriaConversion_OperatorKeepNullValue={"equals":true,"notEqual":true,"iEquals":true,"iNotEqual":true};isc.A.$71l={sum:function(_1,_2,_3){var _4=0;for(var i=0;i<_2.length;i++){var _6=_1[_2[i].name],_7=parseFloat(_6);if(isc.isA.Number(_7)&&_7==_6){_4+=_7}else{if(_6!=null&&_6!=isc.emptyString){return null}}}
return _4},avg:function(_1,_2,_3){var _4=0,_5=0;for(var i=0;i<_2.length;i++){var _7=_1[_2[i].name],_8=parseFloat(_7);if(isc.isA.Number(_8)&&(_8==_7)){_5+=1;_4+=_8}else{if(_7!=null&&_7!=isc.emptyString){return null}}}
return _5>0?_4/_5:null},max:function(_1,_2,_3){var _4,_5;for(var i=0;i<_2.length;i++){var _7=_1[_2[i].name];if(isc.isA.Date(_7)){if(_5)return null;if(_4==null)_4=_7.duplicate();else if(_4.getTime()<_7.getTime())_4=_7.duplicate()}else{_5=true;var _8=parseFloat(_7);if(isc.isA.Number(_8)&&(_8==_7)){if(_4==null)_4=_8;else if(_4<_7)_4=_8}else{if(_7!=null&&_7!=isc.emptyString){return null}}}}
return _4},min:function(_1,_2,_3){var _4,_5
for(var i=0;i<_2.length;i++){var _7=_1[_2[i].name];if(isc.isA.Date(_7)){if(_5)return null;if(_4==null)_4=_7.duplicate();if(_7.getTime()<_4.getTime())_4=_7.duplicate()}else{if(_7==null||_7==isc.emptyString)continue;_5=true;var _8=parseFloat(_7);if(isc.isA.Number(_8)&&(_8==_7)){if(_4==null)_4=_8;else if(_4>_7)_4=_8}else{return null}}}
return _4},multiplier:function(_1,_2,_3){var _4=0;for(var i=0;i<_2.length;i++){var _6=_1[_2[i].name],_7=parseFloat(_6);if(isc.isA.Number(_7)&&(_7==_6)){if(i==0)_4=_7;else _4=(_4*_7)}else{return null}}
return _4}};isc.A.exportFormatToFileExtensionMap={xml:"xml",json:"json",csv:"csv",xls:"xls",ooxml:"xlsx"};isc.B.push(isc.A.onRealtimeUpdate=function isc_c_DataSource_onRealtimeUpdate(_1){if(isc.isA.String(_1)){_1=eval("var foo = "+_1+";foo;")}
var _2=isc.DS.get(_1.dataSourceName);if(!_2)return;_2.onRealtimeUpdate(_1)},isc.A.applyFilter=function isc_c_DataSource_applyFilter(_1,_2){var _3=[];if(!_1||_1.length==0)return _3;if(this.$901==null){this.$901=isc.DataSource.create({fields:[{name:"$902"}],dropUnknownCriteria:false,clientOnly:true})}
var _4=this.$901.applyFilter(_1,_2);return _4},isc.A.addSearchOperator=function isc_c_DataSource_addSearchOperator(_1){if(!_1||!_1.ID){isc.logWarn("Attempted to add null search operator, or operator with no ID");return}
if(!isc.DataSource.$57z)isc.DataSource.$57z={};var _2=isc.DataSource.$57z,_3;if(_2[_1.ID]!==_3){isc.logWarn("Attempted to add existing operator "+_1.ID+" - replacing")}
if(!_1.getCriterion){_1.getCriterion=function(_4,_5,_6){return _5&&_5.getCriterion(_3,_6)}}
isc.DataSource.$57z[_1.ID]=_1},isc.A.getSearchOperators=function isc_c_DataSource_getSearchOperators(){return isc.DataSource.$57z},isc.A.getTypeOperators=function isc_c_DataSource_getTypeOperators(_1,_2){_1=_1||"text";var _3=[],_4=isc.SimpleType.getType(_1),_5=_2&&_2.$570;if(_5){while(_4&&!_5[_4.name]){if(!_4||!_4.inheritsFrom)break;_4=isc.SimpleType.getType(_4.inheritsFrom,_2)}
if(_4){var _6=_5.$170k,_7=_6&&_6[_4.name]!=false;if(_5[_4.name]){_3.addList(_5[_4.name])}
_3.addList(_5["_all_"]);if(!_7&&_3.length>0){var _8=isc.SimpleType.getValidOperators(_4.name);if(_8){_3=_3.intersect(_8)}
return _3}}}
_5=isc.DataSource.$570;_4=isc.SimpleType.getType(_1);while(_4&&!_5[_4.name]){if(!_4||!_4.inheritsFrom)break;_4=isc.SimpleType.getType(_4.inheritsFrom,_2)}
if(_4&&_5[_4.name]){_3.addList(_5[_4.name])}
_3.addList(_5["_all_"]);if(_4){var _9=isc.SimpleType.getValidOperators(_4.name);if(_9){_3=_3.intersect(_9)}}
_3=_3.getUniqueItems();return _3},isc.A.setTypeOperators=function isc_c_DataSource_setTypeOperators(_1,_2){if(!_2)return;if(!isc.isAn.Array(_2))_2=[_2];if(!isc.DataSource.$570)isc.DataSource.$570={};isc.DataSource.$570[_1||"_all_"]=_2},isc.A.$625=function isc_c_DataSource__getNextRequestId(){return this.$628++},isc.A.getAutoTitle=function isc_c_DataSource_getAutoTitle(_1,_2){_2=_2||new RegExp("[_\$]","g");if(!_1)return"";if(!isc.isA.String(_1))_1=_1.toString();var _3;_4=_1.replace(_2," ");var _4=_4.replace(/^\s+|\s+$/g,"");if(_4==_4.toUpperCase()||_4==_4.toLowerCase()){_4=_4.toLowerCase();var _5=true;_3="";for(var i=0;i<_4.length;i++){var _7=_4.substr(i,1);if(_5){_7=_7.toUpperCase();_5=false}
if(_7==' ')_5=true;_3=_3+_7}}else{_3=_4.substr(0,1).toUpperCase();var _8=_4.substr(0,1)==_4.substr(0,1).toUpperCase();var _9=false;var _10=false;for(var i=1;i<_4.length;i++){var _7=_4.substr(i,1);if(_9&&_7==_7.toLowerCase()){_9=false;_3=_3.substr(0,_3.length-1)+" "+_3.substr(_3.length-1)}
if(_8&&_7==_7.toUpperCase()){_9=true}
if(!_8&&_7==_7.toUpperCase()){_3=_3+" "}
_8=_7==_7.toUpperCase();if(_10)_7=_7.toUpperCase();_10=_7==" ";_3=_3+_7}}
return _3},isc.A.convertCriteria=function isc_c_DataSource_convertCriteria(_1,_2,_3){var _4={_constructor:"AdvancedCriteria",operator:"and"}
if(!_2&&_3)_2=this.$135t[_3.defaultTextMatchStyle];var _5=[];for(var _6 in _1){var _7=_3==null?null:_3.getField(_6),_8=_3==null?null:this.$135t[_3.defaultTextMatchStyle],_9=null;if(_7!=null){if(_7.ignoreTextMatchStyle){_9=_3.ignoreTextMatchStyleCaseSensitive?"equals":"iEquals"}}
if(isc.isAn.Array(_1[_6])){var _10={_constructor:"AdvancedCriteria",operator:"or",criteria:[]}
for(var i=0;i<_1[_6].length;i++){var _12=_1[_6][i];if(!_9)_9=this.getCriteriaOperator(_12,_2,_8);if(_12==null&&!this.criteriaConversion_OperatorKeepNullValue[_9]){continue}
_10.criteria.add({fieldName:_6,operator:_9,value:_12})}
if(_10.criteria.length>0){_5.add(_10)}}else{var _12=_1[_6];if(!_9)_9=this.getCriteriaOperator(_12,_2,_8);if(_12==null&&!this.criteriaConversion_OperatorKeepNullValue[_9]){continue}
_5.add({fieldName:_6,operator:_9,value:_1[_6]})}}
_4.criteria=_5;return _4},isc.A.getCriteriaOperator=function isc_c_DataSource_getCriteriaOperator(_1,_2,_3){var _4;if(isc.isA.Number(_1)||isc.isA.Date(_1)||isc.isA.Boolean(_1)){_4="equals"}else if(_2=="exactCase"){_4="equals"}else if(_2=="equals"||_2=="exact"){_4="iEquals"}else if(_2=="startsWith"){_4="iStartsWith"}else if(_2=="substring"){_4="iContains"}else{_4=_3||"iContains"}
return _4},isc.A.combineCriteria=function isc_c_DataSource_combineCriteria(_1,_2,_3,_4,_5,_6){if(!_1||isc.isAn.emptyObject(_1))return _2;if(!_2||isc.isAn.emptyObject(_2))return _1;if(!_3)_3="and";if(_3!="and"&&_3!="or"){isc.logWarn("combineCriteria called with invalid outerOperator '"+_3+"'");return null}
var _7,_8;if(!_5&&_1._constructor!="AdvancedCriteria"&&_2._constructor!="AdvancedCriteria"&&_3=="and")
{for(var _9 in _1){if(_2[_9]!=_7){_8=true;break}}}else{_8=true}
if(!_8){return isc.addProperties({},_1,_2)}
var _10,_11;if(_5||_1._constructor=="AdvancedCriteria"||(_1.fieldName&&_1.operator&&isc.DS.$57z[_1.operator])){_10=_1}else{_10=isc.DataSource.convertCriteria(_1,_4,_6)}
if(_5||_2._constructor=="AdvancedCriteria"||(_2.fieldName&&_2.operator&&isc.DS.$57z[_2.operator])){_11=_2}else{_11=isc.DataSource.convertCriteria(_2,_4,_6)}
var _12={operator:_3};if(!_5){_12._constructor="AdvancedCriteria"}
if(_10.operator==_3&&_11.operator==_3){_12.criteria=[];_12.criteria.addAll(_10.criteria);_12.criteria.addAll(_11.criteria);_12.criteria.removeEmpty()}else{_12.criteria=[_10,_11]}
return _12},isc.A.simplifyAdvancedCriteria=function isc_c_DataSource_simplifyAdvancedCriteria(_1,_2){if(!this.isAdvancedCriteria(_1)){return _1}
_1=this.$79a(_1,_2);if(_1==null)return null;_1._constructor="AdvancedCriteria";return _1},isc.A.$79a=function isc_c_DataSource__simplifyAdvancedCriteria(_1,_2){var _3=_1.operator;if(_3=="and"||_3=="or"){var _4=_1.criteria;if(_4==null||_4.length==0){if(_2)return null;return _1}
if(_4.length==1){_1=_4[0];return this.$79a(_1,true)}
var _5=[];for(var i=0;i<_4.length;i++){var _7=_4[i];_7=this.$79a(_7,true);if(_7!=null){if(_7.operator==_3){_5.addList(_7.criteria)}else{_5.add(_7)}}}
if(_5.length==0&&_2)return null;if(_5.length==1)return _5[0];_1.criteria=_5;return _1}else{return _1}},isc.A.compressNestedCriteria=function isc_c_DataSource_compressNestedCriteria(_1,_2,_3){if(!_1||isc.isAn.emptyObject(_1))return null;if(!_1.criteria||_1.criteria.length==0)return _1;_2=_2||_1.operator||"and";if(_1.criteria.length==1){var c=_1.criteria[0];if(_3&&!c.criteria&&_1.operator!="not")return c;if(c.criteria&&(_1.operator!="not"||c.criteria.length==1)){if(_1.operator=="not"){c=isc.addProperties({},c);c.operator=c.operator=="not"?"and":"not"}
_1=c}}
if(_3&&isc.DS.canFlattenCriteria(_1)){_1=isc.DS.flattenCriteria(_1)}
var _5=_1.criteria;if(_5){_5.removeEmpty();for(var i=0;i<_5.length;i++){var _7=_5[i];if(!_7)continue;if(!_7.criteria){if(_7.fieldName&&_7.operator&&_7._constructor=="AdvancedCriteria")
delete _7._constructor;_5[i]=_7}else{_5[i]=this.compressNestedCriteria(_7,_2,true)}}
_5.removeEmpty();if(_5.length==1){var _8=_5[0];if(_8.criteria&&_8.operator==_1.operator){_1=_5[0]}}}
if(_1.fieldName&&!_1.criteria&&_1._constructor=="AdvancedCriteria"){delete _1._constructor}
return _1},isc.A.resolveDynamicCriteria=function isc_c_DataSource_resolveDynamicCriteria(_1,_2){if(_1==null)return null;if(!isc.DS.isAdvancedCriteria(_1)){return _1}
if(!isc.DS.$167l(_1)){return _1}
_1=isc.clone(_1);isc.DS.$167m(_1,_2);return _1},isc.A.$167l=function isc_c_DataSource__criteriaHasValuePath(_1){var _2=false,_3=_1.operator;if(_3=="and"||_3=="or"||_3=="not"){var _4=_1.criteria||[];if(!isc.isAn.Array(_4))_4=[_4];for(var i=0;i<_4.length;i++){var c=_4[i];if(isc.DataSource.$167l(_4[i])){_2=true;break}}}if(_1.valuePath!=null){_2=true}
return _2},isc.A.$167m=function isc_c_DataSource__resolveCriteriaValuePaths(_1,_2){var _3=_1.operator;if(_3=="and"||_3=="or"||_3=="not"){var _4=_1.criteria;if(!isc.isAn.Array(_4))_4=[_4];for(var i=0;i<_4.length;i++){isc.DS.$167m(_4[i],_2)}}if(_1.valuePath!=null){var _6=_1.valuePath.replace(/\./g,"/");_1.value=isc.Canvas.$70o(_6,null,_2)}},isc.A.removeCriteriaForField=function isc_c_DataSource_removeCriteriaForField(_1,_2){var _3=isc.isAn.Object(_2)?_2.name:_2;if(_1.criteria){for(var i=0;i<_1.criteria.length;i++){if(_1.criteria[i].criteria){this.removeCriteriaForField(_1.criteria[i],_2)}else{if(_1.criteria[i].fieldName==_3)_1.criteria.removeAt(i)}}}else{if(_1.fieldName==_3)_1=null}
return _1},isc.A.validateCriteria=function isc_c_DataSource_validateCriteria(_1,_2,_3,_4){if(this.isAdvancedCriteria(_1)){var _5=isc.addProperties({},_1);if(isc.isAn.Array(_5.criteria)){for(var i=0;i<_5.criteria.length;i++){_5.criteria[i]=this.validateCriteria(_5.criteria[i],_2,_3,_4)}}else if(isc.isAn.Object(_5.criteria)){_5.criteria=this.validateCriteria(_5.criteria,_2,_3,_4)}else{if(_5.valuePath){var _7=_4.call(_2,_5.valuePath,_3);if(_7){this.processTypeValidators(_5,_7)}}
var _7=_4.call(_2,_5.fieldName,_3);if(_7){this.processTypeValidators(_5,_7)}}
return _5}else{var _5=isc.addProperties({},_1);for(var _8 in _5){var _7=_4.call(_2,_8,_3);if(_7){var _9={value:_5[_8]};this.processTypeValidators(_9,_7);_5[_8]=_9.value}}
return _5}},isc.A.processTypeValidators=function isc_c_DataSource_processTypeValidators(_1,_2){var _3=_2.validators||[];var _4=true;for(var i=0;i<_3.length&&_4;i++){if(_3[i].$174l){var _6={value:_1.value};_4=_4&&isc.Validator.processValidator(null,_3[i],_1.value,null,_6);if(_4&&_3[i].resultingValue!=null){_1.value=_3[i].resultingValue}}}},isc.A.combineFieldData=function isc_c_DataSource_combineFieldData(_1,_2,_3,_4){if(_2==null)return _1;if(_4!=null&&_2[_4]!=null){_2=isc.addProperties({},_2,_2[_4])}
for(var _5 in _2){if(_5=="validators"&&_2.validators!=_1.validators){if(_2.validators.$69){if(isc.SimpleType.getBaseType(_1.type)!=isc.SimpleType.getBaseType(_2.type))
{continue}}
for(var i=0;i<_2.validators.length;i++){var _7=_2.validators[i];if(_7.$174l)continue;if(_1.validators==null)_1.validators=[];if(!_1.validators.contains(_7)){if(_1.validators.$69){_1.validators=_1.validators.duplicate()}
_1.validators.add(_7)}}
continue}
if(!this.dontDuplicateEditorProperties){if(_5=="editorProperties"){_1.editorProperties=isc.addProperties({},_2.editorProperties,_1.editorProperties);continue}}
if(_5=="editorType"&&_1.editorType=="FormItem"){delete _1.editorType}
if(isc.propertyDefined(_1,_5))continue;if(_5=="name")continue;if(!_3&&_5=="hidden")continue;_1[_5]=_2[_5]}
return _1},isc.A.applyRecordSummaryFunction=function isc_c_DataSource_applyRecordSummaryFunction(_1,_2,_3,_4){if(!_2||!_3)return;if(isc.isA.String(_1)){if(this.$71l[_1]){_1=this.$71l[_1]}else{_1=isc.Func.expressionToFunction("record,fields,summaryField",_1)}}
if(isc.isA.Function(_1))return _1(_2,_3,_4)},isc.A.registerRecordSummaryFunction=function isc_c_DataSource_registerRecordSummaryFunction(_1,_2){if(isc.isA.String(_2)){_2=isc.Func.expressionToFunction("record,fields,summaryField",_2)}
this.$71l[_1]=_2},isc.A.addExportFilenameExtension=function isc_c_DataSource_addExportFilenameExtension(_1,_2){if(_2=="custom")return _1;if(!_2)_2="csv";if(!this.$162n){this.$162n=isc.getValues(this.exportFormatToFileExtensionMap)}
var _3=this.exportFormatToFileExtensionMap[_2];if(!_3)return _1;var _4=_1.lastIndexOf(".");if(_4==-1){_1=_1+"."+_3}else{var _5=_1.substring(_4+1).toLowerCase();if(_5!=_3){if(this.$162n.contains(_5)){var _6=_1.substring(0,_4+1)+_3;this.logWarn("Extension specified in fileName: "+_1+" is incorrect for exportFormat: '"+_2+"'. Changing fileName to: "+_6);_1=_6}else{_1=_1+"."+_3}}}
return _1},isc.A.exportClientData=function isc_c_DataSource_exportClientData(_1,_2,_3,_4){if(!_2)_2={}
_2=isc.DataSource.dupRequest(_2);var _5=_2.exportContext||_2||{},_6=_5&&_5.exportAs?_5.exportAs:"csv",_7=_5&&_5.exportDisplay?_5.exportDisplay:"download",_8=_5.downloadToNewWindow!=null?_5.downloadToNewWindow:(_7=="window");var _9=_6;if(_2.operationId!=null){var _10=_4.getOperationBinding("clientExport",_2.operationId);if(_10!=null&&_10.exportAs){_9=_10.exportAs}}
var _11=this.addExportFilenameExtension(_5&&_5.exportFilename?_5.exportFilename:"export",_9);var _12={showPrompt:false,transport:_5.exportToClient===false?"xmlHttpRequest":"hiddenFrame",exportResults:true,exportDisplay:_7,targetMainWindow:_5.targetMainWindow,downloadResult:!(_5.exportToClient===false),downloadToNewWindow:_8,download_filename:(_7=="window"?_11:null),params:_5.params};var _13={exportAs:_6,exportClientData:true,exportDisplay:_7,exportFilename:_11,exportPath:_5.exportPath,exportToClient:_5.exportToClient,exportToFilesystem:_5.exportToFilesystem,exportDelimiter:_5.exportDelimiter,exportFields:_5.exportFields,exportHeader:_5.exportHeader,exportHeaderless:_5.exportHeaderless,exportFooter:_5.exportFooter,exportDatesAsFormattedString:_5.exportDatesAsFormattedString,exportNumbersAsFormattedString:_5.exportNumbersAsFormattedString,exportTitleSeparatorChar:_5.exportTitleSeparatorChar,exportDefaultBGColor:_5.exportDefaultBGColor,exportAlternateRowBGColor:_5.exportAlternateRowBGColor,exportRowBGColors:_5.exportRowBGColors,exportColumnBGColors:_5.exportColumnBGColors,exportRawValues:_5.exportRawValues,exportCurrencySymbol:isc.NumberUtil.currencySymbol,lineBreakStyle:_5.lineBreakStyle};if(_5.headerSpans)_13.headerSpans=_5.headerSpans;if(_5.exportHeaderSpans)_13.exportHeaderSpans=_5.exportHeaderSpans;if(_5.exportOtherFields)_13.exportOtherFields=_5.exportOtherFields;if(_5.exportShowHeaderSpanTitles!=null){_13.exportShowHeaderSpanTitles=_5.exportShowHeaderSpanTitles}
if(_5.exportSpanTitleSeparator!=null){_13.exportSpanTitleSeparator=_5.exportSpanTitleSeparator}
if(!_13.exportFieldTitles&&_4){var _14=_13.exportFields||_4.getFieldNames();var _15={};for(var i=0;i<_14.length;i++){var _17=_14[i];var _18;if(isc.isA.String(_17)){_18=_17;_17=_4.getField(_18)}
if(_17){if(_17.hidden)continue;_15[_17.name]=_17.exportTitle||_17.title}else{_15[_18]=_18}}
_13.exportFieldTitles=_15}
if(_5.formulaFields)_13.formulaFields=_5.formulaFields;if(_5.formulaRemap)_13.formulaRemap=_5.formulaRemap;if(_5.exportHeaderHeight!=null){_13.exportHeaderHeight=_5.exportHeaderHeight}
if(_5.exportFieldPixelWidths){_13.exportFieldPixelWidths=_5.exportFieldPixelWidths;_13.exportWidthScale=_5.exportWidthScale}
_13.exportWrapHeaderTitles=_5.exportWrapHeaderTitles;if(_5.exportAlignments){_13.exportAlignments=_5.exportAlignments}
if(_5.exportStreaming!=null){_13.exportStreaming=_5.exportStreaming}
if(_5.exportPropertyIdentifier){_13.exportPropertyIdentifier=_5.exportPropertyIdentifier}
var _19=_2.operationId;if(_4==null||_19==null){isc.DMI.callBuiltin({methodName:"downloadClientExport",arguments:[_1,_6,_11,_7,_13],requestParams:_12,callback:_3})}else{isc.addProperties(_12,{parameters:_13});_4.performClientExportOperation(_19,_1,_3,_12)}},isc.A.getSimpleErrors=function isc_c_DataSource_getSimpleErrors(_1){var _2=_1?_1.errors:null;if(isc.isAn.Array(_2)){if(_2.length>1){this.logWarn("getSimpleErrors() passed an array of error blocks - dropping all but the first set of errors.")}
_2=_2[0]}
if(_2==null)return null;var _3={};for(var _4 in _2){var _5=_2[_4];if(_4=="recordPath"&&!isc.isAn.Object(_5))continue;var _6=[];if(!isc.isAn.Array(_5))_5=[_5];for(var i=0;i<_5.length;i++){var _8=_5[i];if(isc.isAn.Object(_8)){_6.add(_8.errorMessage)}else if(_8!=null){_6.add(_8)}}
if(_6.length>0){_3[_4]=_6}}
return _3},isc.A.recordTimingData=function isc_c_DataSource_recordTimingData(_1,_2,_3,_4){if(!isc.Log.logIsInfoEnabled("RpcTabTiming")||!_1)return;if(_4==null)_4=isc.timeStamp();var _5;if(_1.clientTimingStack){_5=_1.clientTimingStack[_1.clientTimingStack.length-1]}else{_5=_1.clientTiming={name:"Client processing",start:_4,children:[]};_1.clientTimingStack=[];_1.clientTimingStack.add(_1.clientTiming)}
if(!_5){isc.logWarn("Unexpected failure to find stack entry logging timing data: description: '"+_2+"', type: "+_3);return}
if(_3=="start"){var _6={start:_4,name:_2,children:[]};_5.children.add(_6);_1.clientTimingStack.add(_6)}else if(_3=="end"){_5.end=_4;_1.clientTimingStack.removeAt(_1.clientTimingStack.length-1)}else{_5.children.add({millis:_4,name:_2})}});isc.B._maxIndex=isc.C+27;isc.A=isc.DataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.onRealtimeUpdate=function isc_DataSource_onRealtimeUpdate(_1){var _2=eval("var x = "+_1.data+";x;");var _3={dataSource:this,httpResponseCode:200,data:_2};var _4={operationId:_1.operationId,operationType:_1.operationType,dataSource:this}
this.updateCaches(_3,_4)},isc.A.supportsAdvancedCriteria=function isc_DataSource_supportsAdvancedCriteria(){if(this.clientOnly||this.cacheData)return true;if(this.allowAdvancedCriteria===false)return false;if(this.willHandleAdvancedCriteria===false)return false;return true},isc.A.isAdvancedCriteria=function isc_DataSource_isAdvancedCriteria(_1){return isc.DS.isAdvancedCriteria(_1,this)},isc.A.normalizeAdvancedCriteria=function isc_DataSource_normalizeAdvancedCriteria(_1,_2){var _3={};if(!_2){_3._constructor="AdvancedCriteria";if(_1.strictSQLFiltering)_3.strictSQLFiltering=true}
if(_1.criteria){if(!isc.isAn.Array(_1.criteria)){_1.criteria=[_1.criteria]}
_3.operator=_1.operator;_3.criteria=[];for(var i=0;i<_1.criteria.length;i++){_3.criteria.add(this.normalizeAdvancedCriteria(_1.criteria[i],true))}}else{if(!isc.isAn.Array(_1.value)){isc.addProperties(_3,_1)}else{var _5=this.getSearchOperator(_1.operator);if(!_5||!_5.canNormalize){isc.addProperties(_3,_1)}else{_3.operator=_5.negate?"and":"or";_3.criteria=[];for(var i=0;i<_1.value.length;i++){_3.criteria.add({fieldName:_1.fieldName,operator:_1.operator,value:_1.value[i]})}}}}
if(!_3.operator&&_3.fieldName&&_3.value)_3.operator="equals";return _3},isc.A.addSearchOperator=function isc_DataSource_addSearchOperator(_1,_2){if(!_1||!_1.ID){isc.logWarn("Attempted to add null search operator, or operator with no ID");return}
isc.DataSource.addSearchOperator(_1);if(!this.$570)this.$570={};if(!this.$570.$170k)this.$570.$170k={};if(_2){for(var _3=0;_3<this.$570.length;_3++){this.$570[_3].remove(_1.ID)}
for(var _3=0;_3<_2.length;_3++){if(!this.$570[_2[_3]]){this.$570[_2[_3]]=[_1.ID]}
if(!this.$570[_2[_3]].contains(_1.ID)){this.$570[_2[_3]].add(_1.ID)}
this.$570.$170k[_2[_3]]=true}}else{if(!this.$570["_all_"]){this.$570["_all_"]=[_1.ID]}
if(!this.$570["_all_"].contains(_1.ID)){this.$570["_all_"].add(_1.ID)}}},isc.A.getSearchOperator=function isc_DataSource_getSearchOperator(_1){return isc.DataSource.$57z[_1]},isc.A.getTypeOperators=function isc_DataSource_getTypeOperators(_1){return isc.DataSource.getTypeOperators(_1,this)},isc.A.setTypeOperators=function isc_DataSource_setTypeOperators(_1,_2){if(!_2)return;if(!isc.isAn.Array(_2))_2=[_2];if(!this.$570)this.$570={};this.$570[_1||"_all_"]=_2;if(!this.$570.$170k)this.$570.$170k={};this.$570.$170k[_1]=false},isc.A.getFieldOperators=function isc_DataSource_getFieldOperators(_1){if(isc.isA.String(_1))_1=this.getField(_1);if(!_1)return[];if(_1&&_1.validOperators)return _1.validOperators;var _2=isc.SimpleType.getType(_1.type);var _3=_1.type||"text";if(!_2)_3="text";return this.getTypeOperators(_3)},isc.A.getFieldDefaultOperator=function isc_DataSource_getFieldDefaultOperator(_1){if(isc.isA.String(_1))_1=this.getField(_1);if(!_1)return null;if(_1&&_1.defaultOperator)return _1.defaultOperator;var _2=isc.SimpleType.getType(_1.type);var _3=_1.type||"text";if(!_2)_3="text";return isc.SimpleType.getDefaultOperator(_3)},isc.A.getFieldOperatorMap=function isc_DataSource_getFieldOperatorMap(_1,_2,_3,_4,_5){if(isc.isA.String(_1))_1=this.getField(_1);var _6={},_5=_5||this.getFieldOperators(_1);_2=_2||_1.validOperators!=null;for(var _7=0;_7<_5.length;_7++){var _8=_5[_7];var _9=this.getSearchOperator(_8);if(!_9)continue;if(_9.hidden&&!_2&&(!isc.isAn.Array(_1.validOperators)||!_1.validators.contains(_8)))continue;if(!_3||(_9.valueType==_3)==!_4){_6[_5[_7]]=isc.DS.$1780(_1,_9)}}
return _6},isc.A.getTypeOperatorMap=function isc_DataSource_getTypeOperatorMap(_1,_2,_3,_4){var _5={},_6=this.getTypeOperators(_1);for(var _7=0;_7<_6.length;_7++){var _8=this.getSearchOperator(_6[_7]);if(_8&&(!_8.hidden||_2)){if(!_3||(_8.valueType==_3)==!_4)
_5[_6[_7]]=_8.titleProperty==null?_8.title:isc.Operators[_8.titleProperty]}}
return _5},isc.A.recordsAsText=function isc_DataSource_recordsAsText(_1,_2){if(!isc.isA.TextExportSettings(_2)){_2=isc.TextExportSettings.create(_2)}
var i,_4;var _5=[];var _6=_2.fieldList;if(!_6)_6=this.getFieldNames();for(i=0;i<_6.length;i++){var _7=_6[i];_4=this.fields[_7];if(_4)_5.add(_4);else _5.add(_7)}
var _8="";for(i=0;i<_1.length;i++){if(i>0)_8+=_2.lineSeparator;_8+=this.$93q(_1[i],_5,_2)}
return _8},isc.A.$93q=function isc_DataSource__recordAsText(_1,_2,_3){var _4,_5;var _6=_3.forceText;var _7=_3.getEscapingModeEscapeChar();for(var i=0,_9="";i<_2.length;i++,_9+=_4){if(i>0)_9+=_3.fieldSeparator;var _10=_2[i];if(isc.isA.String(_10)){_4=_1[_10];_5="text"}else{_5=_10.type;_4=_1[_10.name];if(_10.exportForceText){_6=_10.exportForceText}}
var _11=false;if(_3.useDisplayValue&&_10.name!=null){_4=this.getDisplayValue(_10.name,_4);if(_4!=null){_4=_4.toString();_11=true}}
if(!_11){_4=isc.DataSource.$93p(_4,_5,_3)}
if(_5=="text")switch(_6){case"leadingSpace":_4=" "+_4;break;case"formula":_4="="+_4}
_4=_4.replace(/(\")/g,_7+"$1");if(_3.quoteValues)_4="\""+_4+"\""}
return _9},isc.A.recordsFromText=function isc_DataSource_recordsFromText(_1,_2){if(!_1)return[];if(!isc.isA.TextImportSettings(_2)){_2=isc.TextImportSettings.create(_2)}
_1=_2.addFinalLineSeparatorIfNotPresent(_1);var _3=_2.fieldList;if(!_3)_3=this.getFieldNames();if(_2.hasHeaderLine){_3=[];_1=this.$93u(_1,_2,_3)}
if(_3.length==0)return[];var _4=this,_5=[];var _6={},_7=0;var _8=function(_10){if(_7<_3.length){_6[_3[_7++]]=_10}};var _9=function(){if(!isc.TextImportSettings.$935){isc.Validator.$93n=true;_4.validateJSONRecord(_6,true);isc.Validator.$93n=false}
_5.add(_6);_6={};_7=0;return false};_2.parseTextAndApplyFunctions(_1,_8,_9);return _5},isc.A.$93u=function isc_DataSource__processAndRemoveHeaderLine(_1,_2,_3){var _4={},_5={};if(!isc.TextImportSettings.$935){var _6=this.getFieldNames();for(var i=0;i<_6.length;i++){var _8=this.getField(_6[i]);if(_8.name!=null)_5[_8.name.toUpperCase()]=_8;if(_8.title!=null)_4[_8.title.toUpperCase()]=_8}}
var _9=function(_12){var _10=_12.toUpperCase().replace(/^(\s)*/,"").replace(/(\s)*$/,"");if(_4[_10])_3.add(_4[_10].name);else if(_5[_10])_3.add(_5[_10].name);else _3.add(_12)};var _11=function(){return true};return _2.parseTextAndApplyFunctions(_1,_9,_11)});isc.B._maxIndex=isc.C+16;isc.A=isc.DataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.evaluateCriterion=function isc_DataSource_evaluateCriterion(_1,_2){if(_2.requiresServer==true)return true;var _3=this.getSearchOperator(_2.operator);if(_3==null){isc.logWarn("Attempted to use unknown operator "+_2.operator);return false}
var _4=this.getField(_2.fieldName);var _5=isc.DataSource.getPathValue(_1,_2.fieldName,_4,"filter");var _6=_4&&isc.SimpleType.inheritsFrom(_4.type,"date");var _7=_4&&isc.SimpleType.inheritsFrom(_4.type,"enum");if(_7||_6||(_4&&isc.SimpleType.inheritsFrom(_4.type,"time"))){if(_3.ID=="iEquals"){_3=this.getSearchOperator("equals")}else if(_3.ID=="iNotEqual"){_3=this.getSearchOperator("notEqual")}}
var _8=true;if(this.$908){for(var i=0;i<this.$909.length;i++){if(this.$909[i]==_2){_8=false;if(this.$91a[i]==true){return true}}}}
if(_8){var _10;if(this.$908){_10=this.$909.length;this.$909[_10]=_2}
if(_2.fieldName){var _11=this,_4=this.getField(_2.fieldName);if(_4==null){_11=this.getDataSourceForDataPath(_2.fieldName);_4=this.getFieldForDataPath(_2.fieldName);if(_11==null){_11=this}
_6=_4&&isc.SimpleType.inheritsFrom(_4.type,"date");_7=_4&&isc.SimpleType.inheritsFrom(_4.type,"enum")}
if(_4==null){if(this.dropUnknownCriteria){this.logInfo("evaluateCriterion passed criterion for field not explicitly listed in this dataSource:"+_2.fieldName+" - dropping this filter","AdvancedCriteria");if(this.$908){this.$91a[_10]=true}
return true}else{this.logInfo("evaluateCriterion passed criterion for field not explicitly listed in this dataSource:"+_2.fieldName+" - continuing with filter","AdvancedCriteria")}}else{var _12=_11.getFieldOperators(_4.name);if(!_12.contains(_3.ID)&&!(_3.ID=="isNull"||_3.ID=="notNull")){this.logWarn("Operator "+_3.ID+" is not valid for field "+_2.fieldName+". Continuing anyway.")}}}}
var _13=function(_20){if(_6&&!isc.isA.Date(_20)&&isc.DateUtil.isRelativeDate(_20)){return isc.DateUtil.getAbsoluteDate(_20)}
return _20}
var _14={value:_13(_2.value),start:_13(_2.start),end:_13(_2.end)};if(_3.valueType==="fieldName"){var _15=this.getField(_14.value);var _16=isc.DataSource.getPathValue(_1,_14.value,_15,"filter");_14.otherValue=_13(_16)}else if(_3.valueType==="criteria"){_14.criterion=_2;_14.record=_1}
if(isc.isA.Boolean(_5)&&isc.isA.String(_14.value)){if(_14.value=="true")_14.value=true;else if(_14.value=="false")_14.value=false}
var _17=false;if(_4&&_4.multiple){if(isc.isAn.Array(_5)&&!isc.isAn.Array(_14.otherValue)){var _18=isc.DataSource.get(_4.type);for(var i=0;i<_5.length;i++){var _19=_5[i];if(isc.isA.Object(_19)&&_18){if(_19[_18.getPrimaryKeyFieldName()]){_19=_19[_18.getPrimaryKeyFieldName()]}else{isc.logWarn("The field '"+_2.fieldName+"' being tested is a multiple valuefield with a DataSource type but either the DataSource does not existor it does not have a primary key field. Skipping criterion.");break}}
_17=_3.condition(_2.fieldName,_19,_14,this,_6);if(_17){break}}}else{if(isc.isAn.Array(_5)&&isc.isAn.Array(_14.otherValue)&&_3.ID!=="equalsField"&&_3.ID!=="iEqualsField"&&_3.ID!=="notEqualField"&&_3.ID!=="iNotEqualField")
{isc.logWarn("Only 'equalsField', 'iEqualsField', 'notEqualField' and'iNotEqualField' are valid operators when comparing two multiple: truefields. Ignoring criterion with operator '"+_2.operator+"'.");_17=true}else{_17=_3.condition(_2.fieldName,_5,_14,this,_6)}}}else{_17=_3.condition(_2.fieldName,_5,_14,this,_6)}
return(_3.negate?!_17:_17)},isc.A.recordsMatchingAdvancedFilter=function isc_DataSource_recordsMatchingAdvancedFilter(_1,_2,_3,_4,_5){var _6=[];_4=_4||0;_5=_5||_1.length;this.$59u=false;this.$59v=_2.strictSQLFiltering;if(this.$59v==null)this.$59v=this.strictSQLFiltering;var _7=false;if(!this.$908){this.$91b()}else{_7=true}
for(var _8=_4;_8<_5;_8++){if(!_2.operator||this.evaluateCriterion(_1[_8],_2)){_6.add(_1[_8])}}
if(!_7)this.$91c();return _6},isc.A.$91b=function isc_DataSource__startApplyingCriteriaToList(){this.$908=true;this.$909=[];this.$91a=[]},isc.A.$91c=function isc_DataSource__endApplyingCriteriaToList(){delete this.$909;delete this.$91a;delete this.$908},isc.A.compareAdvancedCriteria=function isc_DataSource_compareAdvancedCriteria(_1,_2,_3){_1=isc.DataSource.simplifyAdvancedCriteria(_1,true);_2=isc.DataSource.simplifyAdvancedCriteria(_2,true);if(_2==null)return _1==null?0:1;if(_1==null)return-1;_1=this.normalizeAdvancedCriteria(_1);_2=this.normalizeAdvancedCriteria(_2);var _4=this.getSearchOperator(_2.operator);var _5=this.getSearchOperator(_1.operator);if(!_4&&!_5){return 0}
if(_4!=_5){var _6=-1;if(_4&&_4.ID=="or"){var _7={operator:"or",criteria:[_1]};_6=_4.compareCriteria(_7,_2,_4,this)}
if(_6!=-1)return _6;if(_5&&_5.ID=="and"){var _7={operator:"and",criteria:[_2]};return _5.compareCriteria(_1,_7,_5,this)}
return-1}
return _4.compareCriteria(_1,_2,_4,this)},isc.A.splitCriteria=function isc_DataSource_splitCriteria(_1,_2){var _3={},_4=_1,_5=false;if(_1==null||_2==null)return _3;if(this.isAdvancedCriteria(_1)){_4=this.$867(_1);_5=true}
if(_4==null)return _3;for(var i=0;i<_2.length;i++){var _7=_2[i];if(_4[_7]!=null){_3[_7]=_4[_7];if(!_5){delete _1[_7]}else{if(_1.fieldName){delete _1.fieldName;delete _1.value}else{for(var c=0;c<_1.criteria.length;c++){var _9=_1.criteria[c];if(_9.fieldName==_7){_1.criteria.removeAt(c);break}}}}}}
if(_5&&_1.criteria&&_1.criteria.length==0){delete _1.criteria;delete _1.operator;delete _1._constructor}
return _3},isc.A.$867=function isc_DataSource__convertAdvancedCriteriaToSimple(_1){var _2={};if(_1.fieldName){if(_1.operator!="equals"){isc.logWarn("splitCriteria: advanced criteria operator, "+_1.operator+", not supported.");return null}
_2[_1.fieldName]=_1.value;return _2}
if(_1.operator!="and"){isc.logWarn("splitCriteria: advanced criteria top-level operator, "+_1.operator+", not supported.");return null}
for(var i=0;i<_1.criteria.length;i++){var _4=_1.criteria[i];if(_4.operator!="equals"){isc.logWarn("splitCriteria: advanced criteria second-level operator, "+_1.operator+", not supported.");return null}
_2[_4.fieldName]=_4.value}
return(isc.isAn.emptyObject(_2)?null:_2)});isc.B._maxIndex=isc.C+7;isc.DataSource.registerStringMethods({transformRequest:"dsRequest",transformResponse:"dsResponse,dsRequest,data"});isc.$571=function(){var _1=function(_55,_90,_91,_92,_93){if(_92.$59v){if(_90==null||_91.value==null){return(this.negate?!_92.$59u:_92.$59u)}}
if(isc.isA.Date(_91.value)&&isc.isA.Date(_90)){return(_92.compareDates(_91.value,_90,_55)==0)}else{return(_91.value==_90)}};var _2=function(_55,_90,_91,_92,_93,_94){var _3=_91.start||_91.value;var _4=_91.end||_91.value;if(_92.$59v){if(_90==null||(this.lowerBounds&&_3==null)||(this.upperBounds&&_4==null)){return _92.$59u}}
var _5=true;var _6=true;var _7=isc.isA.Date(_90);var _8=isc.isA.Number(_90);var _9=isc.isA.String(_90);if(this.lowerBounds&&_3&&((_8&&isNaN(_3))||(_3&&_7&&(!isc.isA.Date(_3)))||(_3&&_9&&(!isc.isA.String(_3)&&!isc.isA.Number(_3))))){return false}
if(this.upperBounds&&_4&&((_8&&isNaN(_4))||(_4&&_7&&(!isc.isA.Date(_4)))||(_4&&_9&&(!isc.isA.String(_4)&&!isc.isA.Number(_4))))){return false}
var _10;if(!_94){if(_3===null||_3===_10){_5=false}
if(_4===null||_4===_10){_6=false}
if(_7&&!isc.isA.Date(_3))_5=false;if(_7&&!isc.isA.Date(_4))_6=false}
_7=isc.isA.Date(_3)||isc.isA.Date(_4);_8=isc.isA.Number(_3)||isc.isA.Number(_4);_9=isc.isA.String(_3)||isc.isA.String(_4);var _11=_9&&this.caseInsensitive;if(_90===null||_90===_10){if(_7){_90=new Date(-8640000000000000)}else if(_8){_90=-Number.MAX_VALUE}else{_90=""}}else{if(_8&&isNaN(_90)){_3=""+_3;_4=""+_4}
if(_7&&!isc.isA.Date(_90)){return false}}
if(this.lowerBounds&&_5){if(_92.compareValues(_3,_90,_55,_11)<=(this.inclusive?-1:0)){return false}}
if(this.upperBounds&&_6){if(_92.compareValues(_4,_90,_55,_11)>=(this.inclusive?1:0)){return false}}
return true};var _12=function(_55,_90,_91,_92,_93){var _13=_92?_92.getField(_55):null;var _14=_91.value||"";if(_13&&(_13.type=="number"||_13.type=="integer"||_13.type=="sequence"||_13.type=="float"))
{if(_90!=null){var _15=_90-0;if(!isNaN(_15))_90=_15}
if(_91.value!=null){_15=_14-0;if(!isNaN(_15))_14=_15}}
if(isc.isA.Number(_90)){_90=""+_90}
if(isc.isA.Boolean(_90)){isc.logWarn("Attempt to compare a Boolean as String, testing value "+_91.value+" with operator "+this.ID+". This is an invalid comparison, so we are returning FALSE.");return false}
if(isc.isA.Date(_90)){isc.logWarn("Attempt to compare a Date as String, testing value "+_91.value+" with operator "+this.ID+". This is an invalid comparison, so we are returning FALSE.");return false}
if(_90!=null&&!isc.isA.String(_90)){return true}
if(_90==null){if(_92.$59v){if(_13&&(_13.type=="number"||_13.type=="integer"||_13.type=="sequence"||_13.type=="float")){if(_91.value==null||isc.isA.Number(_91.value)||isc.isA.Date(_91.value)){return(this.negate?!_92.$59u:_92.$59u)}else{return false}}else{return(this.negate?!_92.$59u:_92.$59u)}}else{return false}}
if(isc.isA.Number(_14)){_14=""+_14}
if(!isc.isA.String(_14)||!isc.isA.String(_90)){return false}
if(this.caseInsensitive){_90=_90.toLowerCase();_14=_14.toLowerCase()}
var _16=false;if(this.startsWith){_16=isc.startsWith(_90,_14)}else if(this.endsWith){_16=isc.endsWith(_90,_14)}else if(this.equals){_16=(_90==_14)}else{_16=isc.contains(_90,_14)}
return _16};var _17=function(_55,_90,_91,_92,_93){var _13=_92.getField(_55);if(_13&&(_13.type=="number"||_13.type=="integer"||_13.type=="float"||_13.type=="date"||_13.type=="time"||_13.type=="datetime"||_13.type=="boolean"||_13.type=="sequence"||_13.type=="binary"||_13.type=="imageFile")){return(_90==null)}
return(_90==null||_90=="")};var _18=function(_55,_90,_91,_92,_93){return(_90==null)};var _19=function(_55,_90,_91,_92,_93){if(!_91.value){return false}
if(isc.isA.Date(_91.value)||isc.isA.Date(_90)||isc.DateUtil.isRelativeDate(_91.value))
{return false}
var _20;if(this.caseInsensitive){_20=new RegExp(_91.value,"im")}else{_20=new RegExp(_91.value,"m")}
return _20.test(_90)};var _21=function(_55,_90,_91,_92,_93,_76){if(!_92.patternEscapeChar||_92.patternEscapeChar.length>1){throw"dataSource.patternEscapeChar cannot be null or undefined"}
var _22=isc.isA.Array(_92.patternSingleWildcard)?_92.patternSingleWildcard:[_92.patternSingleWildcard||"?","%"];var _23=isc.isA.Array(_92.patternMultiWildcard)?_92.patternMultiWildcard:[_92.patternMultiWildcard||"*"];var _24=false;var _25="";var _26=_91.value;for(var i=0;i<_26.length;i++){if(_26[i]===_92.patternEscapeChar){_24=true;continue}
if(_24){_25+=_26[i].replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");_24=false}else{if(_23.contains(_26[i])){_25+=".*";continue}
if(_22.contains(_26[i])){_25+=".";continue}
_25+=_26[i]}}
if(_76){_91.value="^.*"+_25+".*$"}else{_91.value="^"+_25+"$"}
return _19.apply(this,[_55,_90,_91,_92,_93])};var _28=function(_55,_90,_91,_92,_93,_76){if(!_92.patternEscapeChar||_92.patternEscapeChar.length>1){throw"dataSource.patternEscapeChar cannot be null or undefined"}
var _22=isc.isA.Array(_92.patternSingleWildcard)?_92.patternSingleWildcard:[_92.patternSingleWildcard||"?","%"];var _23=isc.isA.Array(_92.patternMultiWildcard)?_92.patternMultiWildcard:[_92.patternMultiWildcard||"*"];var _24=false;var _25="";var _26=_91.value;for(var i=0;i<_26.length;i++){if(_26[i]===_92.patternEscapeChar){_24=true;continue}
if(_24){_25+=_26[i].replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");_24=false}else{if(_23.contains(_26[i])){_25+=".*";continue}
if(_22.contains(_26[i])){_25+=".";continue}
_25+=_26[i]}}
_91.value="^"+_25+".*$";return _19.apply(this,[_55,_90,_91,_92,_93])};var _29=function(_55,_90,_91,_92,_93,_76){if(!_92.patternEscapeChar||_92.patternEscapeChar.length>1){throw"dataSource.patternEscapeChar cannot be null or undefined"}
var _22=isc.isA.Array(_92.patternSingleWildcard)?_92.patternSingleWildcard:[_92.patternSingleWildcard||"?","%"];var _23=isc.isA.Array(_92.patternMultiWildcard)?_92.patternMultiWildcard:[_92.patternMultiWildcard||"*"];var _24=false;var _25="";var _26=_91.value;for(var i=0;i<_26.length;i++){if(_26[i]===_92.patternEscapeChar){_24=true;continue}
if(_24){_25+=_26[i].replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");_24=false}else{if(_23.contains(_26[i])){_25+=".*";continue}
if(_22.contains(_26[i])){_25+=".";continue}
_25+=_26[i]}}
_91.value="^.*"+_25+"$";return _19.apply(this,[_55,_90,_91,_92,_93])};var _30=function(_55,_90,_91,_92,_93){return _21.apply(this,[_55,_90,_91,_92,_93,true])};var _31=function(_55,_90,_91,_92,_93){var _26=_91.value||[];if(!isc.isAn.Array(_26)){_26=[_26]}
if(isc.isA.Date(_90)){for(var i=0;i<_26.length;i++){var _7=isc.isA.Date(_26[i]);if(_93&&!_7&&isc.DateUtil.isRelativeDate(_26[i])){_26[i]=isc.DateUtil.getAbsoluteDate(_26[i])}
if(isc.isA.Date(_26[i])&&_92.compareDates(_26[i],_90,_55)==0)
{return true}}}else{return _26.contains(_90)}};var _32=function(_55,_90,_91,_92,_93){if(_91.value==null){return true}
var _33=false;if(isc.isAn.Array(_90)&&isc.isAn.Array(_91.otherValue)){_33=_90.equals(_91.otherValue)}else{_33=(_91.otherValue==_90)}
if(isc.isA.Date(_91.otherValue)&&isc.isA.Date(_90)){_33=(_92.compareDates(_91.otherValue,_90,_55,_91.value)==0)}
return _33};var _34=function(_55,_90,_91,_92,_93){if(_91.value==null){return true}
_91.value=_91.otherValue;return _12.apply(this,[_55,_90,_91,_92,_93])};var _35=function(_55,_90,_91,_92,_93){if(_91.value==null){return true}
_91.value=_91.otherValue;return _2.apply(this,[_55,_90,_91,_92,_93,true])};var _36=function(_55,_90,_91,_92,_93){var _37=_91.criterion;var _38=_91.record;var _39;if(!_37.criteria){_37.criteria=[]}
if(!isc.isAn.Array(_37.criteria)){isc.logWarn("AdvancedCriteria: found boolean operator where subcriteria was not an array.  Subcriteria was: "+isc.echoFull(_37.criteria));return false}
if(this.isNot){_92.$59u=!_92.$59u}
for(var _40=0;_40<_37.criteria.length;_40++){var _41=_92.evaluateCriterion(_38,_37.criteria[_40]);if(this.isAnd&&!_41){_39=false}
if(this.isNot&&_41){_39=false}
if(this.isOr&&_41){_39=true}
if(_39!=null){break}}
if(_39==null){_39=!this.isOr}
if(this.isNot){_92.$59u=!_92.$59u}
return _39};var _42=function(_90,_91,_92,_93){if(!_91.criteria)_91.criteria=[];if(!isc.isAn.Array(_91.criteria)){isc.logWarn("AdvancedCriteria: boolean compareCriteria found where old subcriteria was not an array");return-1}
if(!_90.criteria)_90.criteria=[];if(!isc.isAn.Array(_90.criteria)){isc.logWarn("AdvancedCriteria: boolean compareCriteria found where new subcriteria was not an array");return-1}
var _43,_44=0,_45=_91.criteria.length,_46=_90.criteria.length;if(_46>_45&&_92.isOr){return-1}
var _47=isc.clone(_91.criteria);var _48=isc.clone(_90.criteria);for(var i=0;i<_45;i++){var _49=_47[i];var _50=i>_46?null:_48[i];if(!_50||(_50&&_50.fieldName!=_49.fieldName||_50.operator!=_49.operator||_50.processed==true)){_50=null;for(var j=0;j<_46;j++){if(_48[j].processed)continue;if(_48[j].fieldName==_49.fieldName&&_48[j].operator==_49.operator){_50=_48[j];break}}}
if(_50&&_49){_50.processed=true;_43=_93.compareAdvancedCriteria(_50,_49)}else{if(_49&&!_50){if(_92.isOr)_43=1;if(_92.isAnd)_43=-1;if(_92.isNot)_43=-1}}
if(_92.isAnd&&_43==-1)return-1;if(_92.isOr&&_43==-1)return-1;if(_92.isNot&&_43==1)return-1;if(_43!=0)_44=1}
for(var i=0;i<_46;i++){if(!_48[i].processed){if(_92.isOr)return-1;if(_92.isAnd)return 1;if(_92.isNot)return-1}}
return _44};var _52=function(_90,_91,_92,_93){if(_90.fieldName==_91.fieldName){var _53=_93.compareValues(_90.value,_91.value,_90.fieldName)==0;if(_53){return 0}}
return-1};var _54=function(_90,_91,_92,_93){var _55=_90.fieldName;if(_90.fieldName==_91.fieldName){if(_92.upperBounds&&_92.lowerBounds){if(_93.compareValues(_90.start,_91.start,_55)==0){if(_93.compareValues(_90.end,_91.end,_55)==0){return 0}}}else{if(_93.compareValues(_90.value,_91.value,_55)==0){return 0}}
var _56=_90.start==null?_90.value:_90.start,_57=_91.start==null?_91.value:_91.start,_58=_90.start==null?_90.value:_90.end,_59=_91.start==null?_91.value:_91.end;var _7,_60;var _61=true,_62=true,_63=true,_64=true;if(_57==null)_61=false;if(_59==null)_62=false;if(_56==null)_63=false;if(_58==null)_64=false;if(_92.lowerBounds&&!_92.upperBounds&&!_63&&!_61){return 0}
if(_92.lowerBounds&&!_92.upperBounds){if(_63&&!_61){return 1}
if(_61&&!_63){return-1}
var _65=_93.compareValues(_56,_57,_55);if(_65==-1){return 1}else if(_65==0){return 0}}
if(_92.upperBounds&&!_92.lowerBounds&&!_64&&!_62){return 0}
if(_92.upperBounds&&!_92.lowerBounds){if(_64&&!_62){return 1}
if(_62&&!_64){return-1}
var _65=_93.compareValues(_56,_57,_55);if(_65==1){return 1}else if(_65==0){return 0}}
if(_92.lowerBounds&&_92.upperBounds){if(_93.compareValues(_56,_57,_55)<=0&&_93.compareValues(_56,_59,_55)>=0&&_93.compareValues(_58,_59,_55)>=0&&_93.compareValues(_58,_57,_55)<=0)
{return 1}
if((_63&&!_61)||(_64&&!_62)){return 1}
if(!_63&&!_61&&!_64&&!_61){return 0}}}
return-1};var _66=function(_90,_91,_92,_93){var _67=_91.value;var _68=_90.value;var _13=_93&&_93.getField(_90.fieldName);if(_13&&(_13.type=="number"||_13.type=="integer"||_13.type=="sequence"||_13.type=="float"))
{if(_67!=null){var _15=_67-0;if(!isNaN(_15))_67=_15}
if(_68!=null){_15=_68-0;if(!isNaN(_15))_68=_15}}
if(isc.isA.Number(_67))_67=""+_67;if(isc.isA.Number(_68))_68=""+_68;if(!isc.isA.String(_67)||!isc.isA.String(_68))return-1;if(_92.caseInsensitive){_67=_67.toLowerCase();_68=_68.toLowerCase()}
if(_90.fieldName==_91.fieldName&&_90.value==_91.value&&!_92.equals)
{return 0}
if(_92.equals){return _67==_68?0:-1}
if(_92.startsWith&&!_92.negate&&_68.length>_67.length&&isc.startsWith(_68,_67))
{return 1}
if(_92.startsWith&&_92.negate&&_67.length>_68.length&&isc.startsWith(_67,_68))
{return 1}
if(_92.endsWith&&!_92.negate&&_68.length>_67.length&&isc.endsWith(_68,_67))
{return 1}
if(_92.endsWith&&_92.negate&&_67.length>_68.length&&isc.endsWith(_67,_68))
{return 1}
if(!_92.startsWith&&!_92.endsWith&&!_92.negate&&_68.length>_67.length&&isc.contains(_68,_67))
{return 1}
if(!_92.startsWith&&!_92.endsWith&&_92.negate&&_67.length>_68.length&&isc.contains(_67,_68))
{return 1}
return-1};var _69=function(_90,_91,_92){if(_90.fieldName==_91.fieldName){return 0}
return-1};var _70=function(_90,_91,_92){if(_90.fieldName==_91.fieldName){return 0}
return-1};var _71=function(_90,_91,_92){if(_90.value==_91.value&&_90.fieldName==_91.fieldName){return 0}
return-1};var _72=function(_90,_91,_92,_93){var _73=_91.value,_74=_90.value,_75=_92.ID.replace("Pattern",""),_11=_75.startsWith("i"),_76=_75.contains("ontains"),_77=!_76&&_75.contains("atches"),_78=!_76&&!_77&&_75.contains("artsWith"),_79=!_76&&!_77&&!_78,_80="*",_81=true;if(!_91.value.contains(_80)&&!_90.value.contains(_80)){if(_77){_75=_11?"iEquals":"equals"}
var _82=isc.DataSource.$57z[_75];var _16=_82.compareCriteria(_90,_91,_82,_93);if(_81){isc.logWarn(_90.value+" is "+(_16==0?"equal to":(_16>0?"more":"less")+" restrictive than")+" "+_91.value)}
return _16}
if(_76){if(!_73.startsWith(_80))_73=_80+_73;if(!_74.startsWith(_80))_74=_80+_74;if(!_73.endsWith(_80))_73+=_80;if(!_74.endsWith(_80))_74+=_80}else if(_78){if(!_73.endsWith(_80))_73+=_80;if(!_74.endsWith(_80))_74+=_80}else if(_79){if(!_73.startsWith(_80))_73=_80+_73;if(!_74.startsWith(_80))_74=_80+_74}
if(_11){_73=_73.toLowerCase();_74=_74.toLowerCase()}
if(_90.fieldName==_91.fieldName&&_73==_74){return 0}
var _83=_73.split("*"),_84=_74.split("*");if(_77){if(_84[0]!=_83[0]&&!_84[0].startsWith(_83[0])||(_84[_84.length-1]!=_83[_83.length-1]&&!_84[_84.length-1].startsWith(_83[_83.length-1])))
{return-1}}
if(_84[0]!=_83[0]){if(_84[0].startsWith(_83[0])){if(_81)isc.logWarn("More restrictive - new initial string starts with old initial string");return 1}else{if(_81)isc.logWarn("Less restrictive - different initial string");return-1}}
if(!_76&&_84[_84.length-1]!=_83[_83.length-1]){if(_81)isc.logWarn("Less restrictive - different end string");return-1}
if(!_76&&_83.length<3&&_84.length>_83.length){if(_81)isc.logWarn("More restrictive - old value has no inner strings but new value does end string");return 1}
if(_83.length>1){var _85=_83.getRange(1,_83.length-1),_86=_84.getRange(1,_84.length-1);if(_76){if(_86[0].startsWith(_85[0])&&_86[_86.length-1].startsWith(_85[_85.length-1]))
{if(_86.length>=_85.length)return 1;else return-1}}else if(_78){if(_86[_86.length-1]==_85[_85.length-1]){if(_86.length>=_85.length)return 1;else return-1}}
for(var i=0;i<_85.length;i++){if(!_86[i]||!_86[i].startsWith(_85[i])){if(_81)isc.logWarn("Less restrictive - different interior strings");return-1}}
if(_81){isc.logWarn("More restrictive - for each old internal string, there is a new internal string that startsWith the old string")}
return 1}
if(_81)isc.logWarn("Less restrictive - default return value");return-1};var _87=function(_90,_91,_92){if(_90.fieldName==_91.fieldName){if(!isc.isAn.Array(_91.value)||!isc.isAn.Array(_90.value)){return-1}
if(_90.value.equals(_91.value)){return 0}
if(!_92.negate&&_91.value.containsAll(_90.value)){return 1}
if(_92.negate&&_90.value.containsAll(_91.value)){return 1}}
return-1};var _88=function(_90,_91,_92){if(_90.value==_91.value&&_90.fieldName==_91.fieldName){return 0}
return-1};var _89=[{ID:"equals",titleProperty:"iEqualsTitle",textTitleProperty:"equalsTitle",negate:false,valueType:"fieldType",condition:_1,compareCriteria:_52,symbol:"==",wildCard:"*",canNormalize:true,getCriterion:function(_55,_90){var _16={fieldName:_55,operator:this.ID};if(isc.isA.RelativeDateItem(_90))
_16.value=_90.getRelativeDate()||_90.getValue();else _16.value=_90.getValue();return _16}},{ID:"notEqual",titleProperty:"iNotEqualTitle",textTitleProperty:"notEqualTitle",negate:true,valueType:"fieldType",condition:_1,compareCriteria:_52,symbol:"!",wildCard:"*",canNormalize:true,getCriterion:function(_55,_90){var _16={fieldName:_55,operator:this.ID};if(isc.isA.RelativeDateItem(_90))
_16.value=_90.getRelativeDate()||_90.getValue();else _16.value=_90.getValue();return _16}},{ID:"greaterThan",titleProperty:"greaterThanTitle",lowerBounds:true,valueType:"fieldType",condition:_2,compareCriteria:_54,symbol:">",getCriterion:function(_55,_90){var _16={fieldName:_55,operator:this.ID};if(isc.isA.RelativeDateItem(_90))
_16.value=_90.getRelativeDate()||_90.getValue();else _16.value=_90.getValue();return _16}},{ID:"lessThan",titleProperty:"lessThanTitle",upperBounds:true,valueType:"fieldType",condition:_2,compareCriteria:_54,symbol:"<",getCriterion:function(_55,_90){var _16={fieldName:_55,operator:this.ID};if(isc.isA.RelativeDateItem(_90))
_16.value=_90.getRelativeDate()||_90.getValue();else _16.value=_90.getValue();return _16}},{ID:"greaterOrEqual",titleProperty:"greaterOrEqualTitle",lowerBounds:true,inclusive:true,valueType:"fieldType",condition:_2,compareCriteria:_54,symbol:">=",getCriterion:function(_55,_90){var _16={fieldName:_55,operator:this.ID};if(isc.isA.RelativeDateItem(_90))
_16.value=_90.getRelativeDate()||_90.getValue();else _16.value=_90.getValue();return _16}},{ID:"lessOrEqual",titleProperty:"lessOrEqualTitle",upperBounds:true,inclusive:true,valueType:"fieldType",condition:_2,compareCriteria:_54,symbol:"<=",getCriterion:function(_55,_90){var _16={fieldName:_55,operator:this.ID};if(isc.isA.RelativeDateItem(_90))
_16.value=_90.getRelativeDate()||_90.getValue();else _16.value=_90.getValue();return _16}},{ID:"between",titleProperty:"iBetweenTitle",textTitleProperty:"betweenTitle",lowerBounds:true,upperBounds:true,hidden:true,symbol:"...",valueType:"valueRange",condition:_2,compareCriteria:_54,getCriterion:function(_55,_90){var _16={fieldName:_55,operator:this.ID};if(isc.isA.RelativeDateItem(_90))
_16.value=_90.getRelativeDate()||_90.getValue();else _16.value=_90.getValue();return _16}},{ID:"iBetween",titleProperty:"iBetweenTitle",lowerBounds:true,upperBounds:true,symbol:"...",valueType:"valueRange",condition:_2,caseInsensitive:true,compareCriteria:_54,getCriterion:function(_55,_90){var _16={fieldName:_55,operator:this.ID};if(isc.isA.RelativeDateItem(_90))
_16.value=_90.getRelativeDate()||_90.getValue();else _16.value=_90.getValue();return _16}},{ID:"betweenInclusive",titleProperty:"iBetweenInclusiveTitle",textTitleProperty:"betweenInclusiveTitle",lowerBounds:true,upperBounds:true,valueType:"valueRange",inclusive:true,hidden:true,condition:_2,compareCriteria:_54,symbol:"...",getCriterion:function(_55,_90){var _16={fieldName:_55,operator:this.ID};if(isc.isA.RelativeDateItem(_90))
_16.value=_90.getRelativeDate()||_90.getValue();else _16.value=_90.getValue();return _16}},{ID:"iBetweenInclusive",titleProperty:"iBetweenInclusiveTitle",lowerBounds:true,upperBounds:true,valueType:"valueRange",inclusive:true,condition:_2,compareCriteria:_54,symbol:"...",caseInsensitive:true,getCriterion:function(_55,_90){var _16={fieldName:_55,operator:this.ID};if(isc.isA.RelativeDateItem(_90))
_16.value=_90.getRelativeDate()||_90.getValue();else _16.value=_90.getValue();return _16}},{ID:"iEquals",titleProperty:"iEqualsTitle",equals:true,hidden:true,caseInsensitive:true,valueType:"fieldType",condition:_12,symbol:"==",wildCard:"*",canNormalize:true,compareCriteria:_66},{ID:"iContains",titleProperty:"iContainsTitle",caseInsensitive:true,valueType:"fieldType",condition:_12,symbol:"~",canNormalize:true,compareCriteria:_66},{ID:"iStartsWith",titleProperty:"iStartsWithTitle",startsWith:true,caseInsensitive:true,valueType:"fieldType",condition:_12,symbol:"^",canNormalize:true,compareCriteria:_66},{ID:"iEndsWith",titleProperty:"iEndsWithTitle",endsWith:true,caseInsensitive:true,valueType:"fieldType",condition:_12,symbol:"|",canNormalize:true,compareCriteria:_66},{ID:"startsWith",titleProperty:"iStartsWithTitle",textTitleProperty:"startsWithTitle",startsWith:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"^",canNormalize:true,compareCriteria:_66},{ID:"endsWith",titleProperty:"iEndsWithTitle",textTitleProperty:"endsWithTitle",endsWith:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"|",canNormalize:true,compareCriteria:_66},{ID:"iNotEqual",titleProperty:"iNotEqualTitle",caseInsensitive:true,equals:true,negate:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"!",wildCard:"*",canNormalize:true,compareCriteria:_66},{ID:"iNotContains",titleProperty:"iNotContainsTitle",caseInsensitive:true,negate:true,valueType:"fieldType",condition:_12,symbol:"!~",canNormalize:true,compareCriteria:_66},{ID:"iNotStartsWith",titleProperty:"iNotStartsWithTitle",startsWith:true,caseInsensitive:true,negate:true,valueType:"fieldType",condition:_12,symbol:"!^",canNormalize:true,compareCriteria:_66},{ID:"iNotEndsWith",titleProperty:"iNotEndsWithTitle",endsWith:true,caseInsensitive:true,negate:true,valueType:"fieldType",condition:_12,symbol:"!@",canNormalize:true,compareCriteria:_66},{ID:"contains",titleProperty:"iContainsTitle",textTitleProperty:"containsTitle",hidden:true,valueType:"fieldType",condition:_12,symbol:"~",canNormalize:true,compareCriteria:_66},{ID:"notContains",titleProperty:"iNotContainsTitle",textTitleProperty:"notContainsTitle",negate:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"!~",canNormalize:true,compareCriteria:_66},{ID:"notStartsWith",titleProperty:"iNotStartsWithTitle",textTitleProperty:"notStartsWithTitle",startsWith:true,negate:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"!^",canNormalize:true,compareCriteria:_66},{ID:"notEndsWith",titleProperty:"iNotEndsWithTitle",textTitleProperty:"notEndsWithTitle",endsWith:true,negate:true,hidden:true,valueType:"fieldType",condition:_12,symbol:"!@",canNormalize:true,compareCriteria:_66},{ID:"isBlank",titleProperty:"isBlankTitle",valueType:"none",condition:_17,symbol:"$",compareCriteria:_69},{ID:"notBlank",titleProperty:"notBlankTitle",negate:true,valueType:"none",condition:_17,symbol:"!$",compareCriteria:_69},{ID:"isNull",titleProperty:"isNullTitle",valueType:"none",hidden:true,condition:_18,symbol:"#",compareCriteria:_70},{ID:"notNull",titleProperty:"notNullTitle",negate:true,valueType:"none",hidden:true,condition:_18,symbol:"!#",compareCriteria:_70},{ID:"regexp",titleProperty:"iregexpTitle",textTitleProperty:"regexpTitle",hidden:true,valueType:"custom",condition:_19,symbol:"/regex/",compareCriteria:_71},{ID:"iregexp",titleProperty:"iregexpTitle",hidden:true,caseInsensitive:true,valueType:"custom",condition:_19,symbol:"/regex/",compareCriteria:_71},{ID:"matchesPattern",titleProperty:"iMatchesPatternTitle",textTitleProperty:"matchesPatternTitle",hidden:true,valueType:"custom",symbol:"==i~",wildcard:"*",condition:_21,compareCriteria:_72},{ID:"iMatchesPattern",titleProperty:"iMatchesPatternTitle",hidden:true,caseInsensitive:true,valueType:"custom",symbol:"==~",wildcard:"*",condition:_21,compareCriteria:_72},{ID:"startsWithPattern",titleProperty:"iStartsWithPatternTitle",textTitleProperty:"startsWithPatternTitle",hidden:true,valueType:"custom",wildcard:"*",condition:_28,compareCriteria:_72},{ID:"iStartsWithPattern",titleProperty:"iStartsWithPatternTitle",hidden:true,caseInsensitive:true,valueType:"custom",wildcard:"*",condition:_28,compareCriteria:_72},{ID:"endsWithPattern",titleProperty:"iEndsWithPatternTitle",textTitleProperty:"endsWithPatternTitle",hidden:true,valueType:"custom",wildcard:"*",condition:_29,compareCriteria:_72},{ID:"iEndsWithPattern",titleProperty:"iEndsWithPatternTitle",hidden:true,caseInsensitive:true,valueType:"custom",wildcard:"*",condition:_29,compareCriteria:_72},{ID:"containsPattern",titleProperty:"iContainsPatternTitle",textTitleProperty:"containsPatternTitle",hidden:true,valueType:"custom",symbol:"=i~",wildcard:"*",condition:_30,compareCriteria:_72},{ID:"iContainsPattern",titleProperty:"iContainsPatternTitle",hidden:true,caseInsensitive:true,valueType:"custom",symbol:"=~",wildcard:"*",condition:_30,compareCriteria:_72},{ID:"inSet",titleProperty:"inSetTitle",valueType:"valueSet",condition:_31,compareCriteria:_87,symbol:"=(",closingSymbol:")",valueSeparator:"|",processValue:function(_26,_90){if(_26==null)return null;return(""+_26).split(this.valueSeparator)}},{ID:"notInSet",titleProperty:"notInSetTitle",negate:true,valueType:"valueSet",condition:_31,compareCriteria:_87,symbol:"!=(",closingSymbol:")",valueSeparator:"|",processValue:function(_26,_90){if(_26==null)return null;return(""+_26).split(this.valueSeparator)}},{ID:"equalsField",titleProperty:"iEqualsFieldTitle",textTitleProperty:"equalsFieldTitle",valueType:"fieldName",condition:_32,symbol:"=.",canNormalize:true,compareCriteria:_88,processValue:function(_26,_90){if(!_90)return _26;var _13=_90.getField(_26);if(_13)return _26;_13=_90.getFieldByTitle(_26);if(_13)return _13.name;return null}},{ID:"notEqualField",titleProperty:"iNotEqualFieldTitle",textTitleProperty:"notEqualFieldTitle",negate:true,valueType:"fieldName",condition:_32,canNormalize:true,compareCriteria:_88},{ID:"iEqualsField",titleProperty:"iEqualsFieldTitle",equals:true,caseInsensitive:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"iNotEqualField",titleProperty:"iNotEqualFieldTitle",equals:true,caseInsensitive:true,negate:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"greaterThanField",titleProperty:"greaterThanFieldTitle",lowerBounds:true,valueType:"fieldName",condition:_35,compareCriteria:_88},{ID:"lessThanField",titleProperty:"lessThanFieldTitle",upperBounds:true,valueType:"fieldName",condition:_35,compareCriteria:_88},{ID:"greaterOrEqualField",titleProperty:"greaterOrEqualFieldTitle",lowerBounds:true,inclusive:true,valueType:"fieldName",condition:_35,compareCriteria:_88},{ID:"lessOrEqualField",titleProperty:"lessOrEqualFieldTitle",upperBounds:true,inclusive:true,valueType:"fieldName",condition:_35,compareCriteria:_88},{ID:"containsField",titleProperty:"iContainsFieldTitle",textTitleProperty:"containsFieldTitle",hidden:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"startsWithField",titleProperty:"iStartsWithFieldTitle",textTitleProperty:"startsWithFieldTitle",startsWith:true,hidden:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"endsWithField",titleProperty:"iEndsWithFieldTitle",textTitleProperty:"endsWithFieldTitle",endsWith:true,hidden:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"iContainsField",titleProperty:"iContainsFieldTitle",hidden:true,caseInsensitive:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"iStartsWithField",titleProperty:"iStartsWithFieldTitle",startsWith:true,hidden:true,caseInsensitive:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"iEndsWithField",titleProperty:"iEndsWithFieldTitle",endsWith:true,hidden:true,caseInsensitive:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"notContainsField",titleProperty:"iNotContainsFieldTitle",textTitleProperty:"notContainsFieldTitle",hidden:true,negate:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"notStartsWithField",titleProperty:"iNotStartsWithFieldTitle",textTitleProperty:"notStartsWithFieldTitle",startsWith:true,hidden:true,negate:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"notEndsWithField",titleProperty:"iNotEndsWithFieldTitle",textTitleProperty:"notEndsWithFieldTitle",endsWith:true,hidden:true,negate:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"iNotContainsField",titleProperty:"iNotContainsFieldTitle",hidden:true,caseInsensitive:true,negate:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"iNotStartsWithField",titleProperty:"iNotStartsWithFieldTitle",startsWith:true,hidden:true,caseInsensitive:true,negate:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"iNotEndsWithField",titleProperty:"iNotEndsWithFieldTitle",endsWith:true,hidden:true,caseInsensitive:true,negate:true,valueType:"fieldName",condition:_34,canNormalize:true,compareCriteria:_88},{ID:"and",titleProperty:"andTitle",isAnd:true,valueType:"criteria",condition:_36,symbol:" and ",compareCriteria:_42},{ID:"not",titleProperty:"notTitle",isNot:true,valueType:"criteria",condition:_36,compareCriteria:_42},{ID:"or",titleProperty:"orTitle",isOr:true,valueType:"criteria",condition:_36,symbol:" or ",compareCriteria:_42}];for(var _40=0;_40<_89.length;_40++){isc.DataSource.addSearchOperator(_89[_40])}
isc.DataSource.setTypeOperators(null,["equals","notEqual","equalsField","notEqualField","isBlank","notBlank","between","betweenInclusive","isNull","notNull","and","or","not"]);isc.DataSource.setTypeOperators("text",["regexp","iregexp","contains","startsWith","endsWith","iEquals","iNotEqual","lessThan","greaterThan","lessOrEqual","greaterOrEqual","iBetween","iBetweenInclusive","iContains","iStartsWith","iEndsWith","notContains","notStartsWith","notEndsWith","iNotContains","iNotStartsWith","iNotEndsWith","containsField","startsWithField","endsWithField","greaterThanField","lessThanField","greaterOrEqualField","lessOrEqualField","iEqualsField","iNotEqualField","iContainsField","iStartsWithField","iEndsWithField","notContainsField","notStartsWithField","notEndsWithField","iNotContainsField","iNotStartsWithField","iNotEndsWithField","matchesPattern","iMatchesPattern","containsPattern","iContainsPattern","inSet","notInSet","iStartsWithPattern"]);isc.DataSource.setTypeOperators("integer",["lessThan","greaterThan","contains","lessOrEqual","greaterOrEqual","iBetween","iBetweenInclusive","greaterThanField","lessThanField","greaterOrEqualField","lessOrEqualField","inSet","notInSet"]);isc.DataSource.setTypeOperators("float",["lessThan","greaterThan","contains","lessOrEqual","greaterOrEqual","iBetween","iBetweenInclusive","greaterThanField","lessThanField","greaterOrEqualField","lessOrEqualField","inSet","notInSet"]);isc.DataSource.setTypeOperators("date",["lessThan","greaterThan","lessOrEqual","greaterOrEqual","iBetween","iBetweenInclusive","greaterThanField","lessThanField","greaterOrEqualField","lessOrEqualField"]);isc.DataSource.setTypeOperators("time",["lessThan","greaterThan","lessOrEqual","greaterOrEqual","iBetween","iBetweenInclusive","greaterThanField","lessThanField","greaterOrEqualField","lessOrEqualField"])};isc.$571();isc.DataSource.create({ID:"Object",fields:{},addGlobalId:false});isc.DataSource.create({ID:"ValueMap",addGlobalId:false,builtinSchema:true,canBeArrayValued:true,fields:{},$cp:"ID",$450:"id",xmlToJS:function(_1,_2){if(_1==null||isc.xml.elementIsNil(_1))return null;var _3=isc.xml.getElementChildren(_1),_4=isc.xml.getAttributes(_1),_5=!isc.isAn.emptyObject(_4);for(var i=0;i<_3.length;i++){var _7=_3[i],_8=_7.getAttribute(this.$cp)||_7.getAttribute(this.$450),_9=isc.xml.getElementText(_7);if(_8!=null&&_9!=null){_5=true;_4[_8]=_9}else if(_8!=null){_4[_8]=_8}else if(_9!=null){_4[_9]=_9}else{_4[isc.emptyString]=isc.emptyString}}
if(_5)return _4;return isc.getValues(_4)},xmlSerializeFields:function(_1,_2,_3){if(_1==null||isc.DS.isSimpleTypeValue(_1)){return this.Super("xmlSerializeFields",arguments)}
var _4=isc.SB.create(),_3=(_3||"")+(!_2||_2.indent!=false?"    ":"");if(isc.isAn.Array(_1)){for(var i=0;i<_1.length;i++){var _6=_1[i];_4.append("\n",_3,"<value>",isc.makeXMLSafe(_6),"</value>")}}else{for(var _7 in _1){var _6=_1[_7];_4.append("\n",_3,"<value id=\"",isc.makeXMLSafe(_7),"\">",isc.makeXMLSafe(_6),"</value>")}}
return _4.release(false)}});isc.DataSource.create({ID:"Point",addGlobalId:false,builtinSchema:true,canBeArrayValued:true,$135o:"x",$135p:"y",xmlToJS:function(_1,_2){if(_1==null||isc.xml.elementIsNil(_1))return null;var _3=isc.xml.getAttributes(_1);if(_3&&_3.x&&_3.y){return[parseInt(_3.x),parseInt(_3.y)]}
var _4=isc.xml.getElementChildren(_1),_5=[];for(var i=0;i<_4.length;i++){var _7=_4[i],_8=isc.xml.getElementText(_7);if(_7.nodeName==this.$135o){_5[0]=(_8!=null?parseInt(_8):null)}else if(_7.nodeName==this.$135p){_5[1]=(_8!=null?parseInt(_8):null)}}
return _5},serializeAttributes:function(_1,_2,_3){if(isc.isAn.Array(_1)&&_1.length==2){_2.append(" ","x=\"",this.$38f(null,_1[0]),"\"");_2.append(" ","y=\"",this.$38f(null,_1[1]),"\"");return null}
return this.Super("serializeAttributes",arguments)}});isc.ClassFactory.defineInterface("DataModel");isc.DataModel.addInterfaceMethods({getDataSource:function(){if(isc.isA.String(this.dataSource))this.dataSource=isc.DS.get(this.dataSource);return this.dataSource},getOperationId:function(_1){var _2=this.getOperation(_1);return _2==null?null:(isc.isA.String(_2)?_2:_2.ID)},getOperation:function(_1){var _2=isc.rpc.getDefaultApplication(),_3,_4;var _5=_1+"$224c";if(this[_5])return this[_5];var _6=_1+"Operation";if(this[_6]){_3=this[_6];if(isc.isAn.Object(_3)){this[_6]=_3.ID;this[_5]=_3;return _3}
_4=_3}
if(_4==null||isc.isA.String(_4)){var _7=this.getDataSource();if(_7==null){this.logWarn("can't getOperation for type: "+_1+", no "+_6+" specified, and no dataSource to create an auto-operation");return null}
this.logInfo("creating auto-operation for operationType: "+_1);_3=isc.DataSource.makeDefaultOperation(_7,_1,_4);_4=_3.ID;this[_6]=_4}
return _3}});isc.defineClass("XJSONDataSource","DataSource");isc.A=isc.XJSONDataSource.getPrototype();isc.A.dataFormat="json";isc.A.dataTransport="scriptInclude";isc.defineClass("Schema","DataSource");isc.A=isc.Schema.getPrototype();isc.A.dataFormat="xml";isc.A.dropNamespaceDeclarations=true;isc.A.addGlobalId=false;isc.defineClass("WSDLMessage","Schema");isc.A=isc.WSDLMessage.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getWSOperation=function isc_WSDLMessage_getWSOperation(_1){var _2=this.getWebService(_1);if(_1&&_1.wsOperation)return _2.getOperation(_1.wsOperation);else return _2.getOperationForMessage(this.ID.substring(8))});isc.B._maxIndex=isc.C+1;isc.defineClass("XSElement","Schema");isc.defineClass("XSComplexType","Schema");isc.defineClass("SchemaSet").addMethods({init:function(){this.ns.ClassFactory.addGlobalID(this);var _1=this.schemaNamespace,_2=isc.SchemaSet.schemaSets,_3=_2[_1];if(_3==null||((_3.schema==null&&_3.schema.length==0)&&(this.schema!=null&&this.schema.length!=0)))
{_2[_1]=this}
var _4=this.serviceNamespace;if(this.schema){this.$530={};this.$531={};this.$693={};for(var i=0;i<this.schema.length;i++){var _6=this.schema[i];_6.serviceNamespace=_4;_6.schemaNamespace=_1;_6.location=this.location;if(isc.isA.SimpleType(_6)){if(_6.inheritsFrom&&_6.inheritsFrom==_6.name&&_6.xmlSource=="XSElement")continue;this.$693[_6.name]=_6}else if(_6.ID){if(isc.isAn.XSElement(_6)){this.$531[_6.ID]=_6}else{this.$530[_6.ID]=_6}}}}
isc.SchemaSet.$37r=this},getSchema:function(_1,_2,_3){if(!_3)_3=[this];else _3.add(this);var _4;if(_2==isc.DS.$532)_4=this.$531[_1];else if(_2==isc.DS.$45t)_4=this.$530[_1];if(_2==null){_4=this.$530[_1]||this.$531[_1];if(_4!=null)return _4}
if(!this.$70w){isc.SchemaSet.findLoadedImports(this);this.$70w=true}
var _5=this.$38q;if(_5!=null){for(var i=0;i<_5.length;i++){var _7=_5[i];if(_3.contains(_7))continue;_4=_7.getSchema(_1,_2,_3);if(_4!=null)return _4}}},getSimpleType:function(_1,_2){if(!_2)_2=[this];else _2.add(this);var _3;if(this.$693){_3=this.$693[_1];if(_3)return _3}
if(this.$38q!=null){for(var i=0;i<this.$38q.length;i++){var _5=this.$38q[i];if(_2.contains(_5))continue;_3=_5.getSimpleType(_1,_2);if(_3!=null)return _3}}},setLocation:function(_1){this.location=_1;if(!this.schema)return;for(var i=0;i<this.schema.length;i++){var _3=this.schema[i];_3.location=_1}},loadImports:function(_1){isc.SchemaSet.loadImports(_1,this)},loadImport:function(_1,_2,_3,_4){return isc.SchemaSet.loadImport(_1,_2,_3,_4,this)},doneImporting:function(){this.fireCallback(this.$69o)},addImportXMLSource:function(_1,_2){this.importSources=this.importSources||[];this.importSources.add({xmlText:_1,location:_2})},addSchemaSet:function(_1,_2){this.$69n=this.$69n||[];this.$69n.add(_1)}});isc.A=isc.SchemaSet;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.schemaSets={};isc.A.$69p=["http://www.w3.org/2001/xml.xsd","http://www.w3.org/2001/XMLSchema","http://www.w3.org/XML/1998/namespace"];isc.A.$69q=[];isc.B.push(isc.A.get=function isc_c_SchemaSet_get(_1){return this.schemaSets[_1]},isc.A.findLoadedImports=function isc_c_SchemaSet_findLoadedImports(_1){var _2=this.getAllImports(_1);if(!_2)return;var _3=_1.$38q=_1.$38q||[];var _4=_1.$70x=_1.$70x||[];for(var i=0;i<_2.length;i++){var _6=_2[i],_7=_6.isWSDL,_8=_6.namespace;if(this.$69p.contains(_8))continue;if((_7&&_4.find("serviceNamespace",_8))||(!_7&&_3.find("schemaNamespace",_8)))
continue;var _9=_7?isc.WebService.get(_8):isc.SchemaSet.get(_8);if(_9==null){var _10;if(isc.isA.WebService(_1)){_10="WebService with targetNamespace '"+_1.serviceNamespace}else{_10="SchemaSet with targetNamespace '"+_1.schemaNamespace}
var _11=_6.location?"logWarn":"logInfo";_1[_11](_10+"' could not find "+(_7?"webService":"SchemaSet")+" for namespace: '"+_8+"'. Pass autoLoadImports to loadWSDL()/loadXMLSchema() or separately load via loadWSDL/loadXMLSchema jsp tag or method","schemaLoader");continue}
if(_9.location==null)_9.setLocation(_1.location);_7?_4.add(_9):_3.add(_9)}},isc.A.getAllImports=function isc_c_SchemaSet_getAllImports(_1){var _2=_1.schemaImports;if(_1.wsdlImports){_1.wsdlImports.setProperty("isWSDL",true);_2=_2||[];_2=_2.concat(_1.wsdlImports)}
return _2},isc.A.loadImports=function isc_c_SchemaSet_loadImports(_1,_2){_2.$69o=_1;var _3=this.getAllImports(_2);if(!_3)return _2.doneImporting();_2.$69r=0;for(var i=0;i<_3.length;i++){var _5=_3[i],_6=_5.namespace;if(_6){var _7=(_5.isWSDL?isc.WebService.get(_6):isc.SchemaSet.get(_6));if(_7!=null){_2.logDebug("import already loaded: "+_6+", skipping","schemaLoader");continue}}
if(_5.location&&_5.location!=_2.location){var _8=_2.loadImport(_6,_5.location,function(_9){if(isc.isA.WebService(_9)){_2.addWebService(_9,_6)}else{_2.addSchemaSet(_9,_6)}
_2.$69r--;_2.logInfo(_2+" loaded import: "+_9+" as namespace: "+_6+", remaining imports: "+_2.$69r,"schemaLoader");if(_2.$69r==0)_2.doneImporting()},_5.isWSDL);if(_8)_2.$69r++}}
if(_2.$69r==0)_2.doneImporting()},isc.A.loadImport=function isc_c_SchemaSet_loadImport(_1,_2,_3,_4,_5){var _6=_5.location.substring(0,_5.location.lastIndexOf("/"));if(!_6.endsWith("/"))_6+="/";var _7=isc.Page.combineURLs(_6,_2);if(_7==_5.location){_5.logDebug("skipping self-reference import: "+_7,"schemaLoader");return false}
if(this.$69p.contains(_7)){_5.logDebug("skipping pedantic import: "+_7,"schemaLoader");return false}
if(this.$69q.contains(_7)){_5.logDebug("skipping redundant import: "+_7,"schemaLoader");return false}
this.$69q.add(_7);_5.logInfo("loading import from: "+_7+"\nschema/service base dir: "+_6+"\nimport location: "+_2,"schemaLoader");var _8=_4?"loadWSDL":"loadXMLSchema";isc.xml[_8](_7,function(_9){_5.fireCallback(_3,"schemaSet",[_9])},null,true,{initiator:_5.initiator||_5,captureXML:_5.captureXML});return true});isc.B._maxIndex=isc.C+5;isc.SchemaSet.getPrototype().toString=function(){return"["+this.Class+" ns="+this.echoLeaf(this.schemaNamespace)+(this.location?" location="+isc.Page.getLastSegment(this.location):"")+"]"};isc.defineClass("WebService").addMethods({init:function(){var _1=this.serviceNamespace;if(this.messages){for(var i=0;i<this.messages.length;i++){this.messages[i].serviceNamespace=_1}}
this.logInfo("registered service with serviceNamespace: "+_1+" service name: "+this.name);isc.WebService.services.add(this);isc.WebService.$37r=this},loadImports:function(_1){isc.SchemaSet.loadImports(_1,this)},loadImport:function(_1,_2,_3,_4){return isc.SchemaSet.loadImport(_1,_2,_3,_4,this)},doneImporting:function(){this.fireCallback(this.$69o)},addSchemaSet:function(_1,_2){this.$38q=this.$38q||[];this.$38q.add(_1)},addWebService:function(_1,_2){this.$70x=this.$70x||[];this.$70x.add(_1)},addImportXMLSource:function(_1,_2){this.importSources=this.importSources||[];this.importSources.add({xmlText:_1,location:_2})},getOperation:function(_1,_2){if(isc.isAn.Object(_1))return _1;if(!this.$70w){isc.SchemaSet.findLoadedImports(this);this.$70w=true}
var _3=this.getBindingOperation(_1,_2);var _4=this.getPortTypeOperation(_1,_2);if(!_3&&!_4){this.logWarn(this+": no such operation: '"+_1+"'"+(_2?" in portType: '"+_2+"'":""));return null}
return isc.addProperties({},_4,_3)},findOperation:function(_1,_2,_3,_4){if(!_3)return;if(_2)_3=_3.findAll("portTypeName",_2);if(!_3)return;if(this.$70x){for(var i=0;i<this.$70x.length;i++){var _6=this.$70x[i],_7=_4?"getPortTypeOperation":"getBindingOperation",_8=_6[_7](_1,_2);if(_8!=null)return _8}}
for(var i=0;i<_3.length;i++){var _9=_3[i].operation;if(!isc.isAn.Array(_9))_9=[_9];var _8=_9.find("name",_1);if(_8!=null)return _8}},getPortTypeOperation:function(_1,_2){return this.findOperation(_1,_2,this.portTypes,true)},getBindingOperation:function(_1,_2){return this.findOperation(_1,_2,this.bindings)},getOperationForMessage:function(_1){var _2=this.getOperations();if(!_2)return;var _3=_2.find("inputMessage",_1);if(_3)return _3;_3=_2.find("outputMessage",_1);if(_3)return _3},getOperationNames:function(){var _1=this.operationNames;if(_1)return _1;if(!this.$70w){isc.SchemaSet.findLoadedImports(this);this.$70w=true}
_1=this.operationNames=[];if(this.bindings){for(var i=0;i<this.bindings.length;i++){var _3=this.bindings[i],_4=_3.operation;if(!isc.isAn.Array(_4))_4=[_4];_1.addList(_4.getProperty("name"));for(var j=0;j<_1.length;j++){var _6=this.getPortTypeOperation(_1[j],_3.portTypeName);if(_6)_6.hasBinding=true}}}
if(this.portTypes){for(var i=0;i<this.portTypes.length;i++){var _7=this.portTypes[i],_4=_7.operation;if(!isc.isAn.Array(_4))_4=[_4];var _8=_4.findAll("hasBinding",true);if(_8){_4=_4.duplicate();_4.removeAll(_8)}
_1.addList(_4.getProperty("name"))}}
return(this.operationNames=_1)},getOperations:function(_1){var _2=this.getOperationNames(),_3=[];for(var i=0;i<_2.length;i++){var _5=this.getOperation(_2[i]);if(_1&&!_5.hasBinding)continue;_3.add(_5)}
return _3},getSchema:function(_1,_2){if(!this.$70w){isc.SchemaSet.findLoadedImports(this);this.$70w=true}
var _3=this.$38q;if(_3!=null){for(var i=0;i<_3.length;i++){var _5=_3[i];var _6=_5.getSchema(_1,_2);if(_6)return _6}}
return isc.DS.get(_1,null,null,_2)},getRequestMessage:function(_1){var _2=this.getOperation(_1);return this.getMessage(_2.inputMessage)},getResponseMessage:function(_1){var _2=this.getOperation(_1);return this.getMessage(_2.outputMessage)},getMessage:function(_1){var _2=this.messages.find("ID","message:"+_1);if(_2)return _2;if(!this.$70w){isc.SchemaSet.findLoadedImports(this);this.$70w=true}
if(this.$70x){for(var i=0;i<this.$70x.length;i++){var _4=this.$70x[i];_2=_4.getMessage(_1);if(_2)return _2}}},getBodyPartNames:function(_1,_2){var _3=this.getOperation(_1),_4=_2?_3.outputParts:_3.inputParts;if(_4==null||isc.isAn.emptyString(_4)){var _5=_2?this.getResponseMessage(_1):this.getRequestMessage(_1);return _5.getFieldNames()}else{return _4.split(" ")}},globalNamespaces:{xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},callOperation:function(_1,_2,_3,_4,_5){var _6=this.getOperation(_1);if(_6==null){this.logWarn("No such operation: "+_1);return}
_5=_5||isc.emptyObject;var _7=isc.addProperties({actionURL:this.getDataURL(_1),httpMethod:"POST",contentType:"text/xml",data:_2,serviceNamespace:this.serviceNamespace,serviceName:this.name,wsOperation:_1},_5);_7.httpHeaders=isc.addProperties({},{SOAPAction:_6.soapAction||'""'},_5.httpHeaders);_7.headerData=_5.headerData||this.getHeaderData(_7);_7.data=this.getSoapMessage(_7);_7.internalClientContext={$38r:_4,$38s:_1,$38u:_3,$38v:_5.xmlResult};if(this.spoofResponses){var _8=this.getSampleResponse(_1);if(this.logIsDebugEnabled("xmlBinding")){this.logDebug("spoofed response:\n"+_8,"xmlBinding")}
this.delayCall("$38w",[isc.xml.parseXML(_8),_8,{status:0,internalClientContext:_7.internalClientContext,httpResponseCode:200,httpResponseText:_8},_7]);return}
_7.callback={target:this,methodName:"$38w"};isc.xml.getXMLResponse(_7)},$38w:function(_1,_2,_3,_4){var _5=_4.internalClientContext,_6=_5.$38s,_7=_5.$38u;if(_3.status<0){this.fireCallback(_5.$38r,"data,xmlDoc,rpcResponse,wsRequest",[_3.data,_1,_3,_4]);return}
_1.addNamespaces(this.getOutputNamespaces(_6));if(_4.xmlNamespaces){_1.addNamespaces(_4.xmlNamespaces)}
var _8=(_7!=null&&_7.contains("/")),_9=(_8?_7:null),_10;if(_8){_10=_1.selectNodes(_9)}else if(_7){_10=this.selectByType(_1,_6,_7)}else{_10=_1.selectNodes("//s:Body/*",{s:"http://schemas.xmlsoap.org/soap/envelope/"});if(_10.length==1)_10=_10[0]}
if(this.logIsDebugEnabled()){this.logDebug("selected response data is: "+this.echoFull(_10))}
if(_5.$38v){this.fireCallback(_5.$38r,"data,xmlDoc,rpcResponse,wsRequest",[_10,_1,_3,_4]);return}
var _11;if(_8){_11=null}else if(_7){_11=this.getSchema(_5.$38u)}else{var _12=this.getSchema("message:"+this.getOperation(_6).outputMessage);if(this.getSoapStyle(_6)!="document"){_11=_12}else{var _13=_12.getFieldNames().first();_11=_12.getSchema(_12.getField(_13).type)}}
_10=isc.xml.toJS(_10,null,_11);this.fireCallback(_5.$38r,"data,xmlDoc,rpcResponse,wsRequest",[_10,_1,_3,_4])},getOutputNamespaces:function(_1,_2){var _3=this.getDefaultOutputDS(_1);return isc.addProperties({"default":_3.schemaNamespace||this.serviceNamespace,schema:_3.schemaNamespace,service:this.serviceNamespace},_2)},getDataURL:function(_1){var _2=this.getOperation(_1);if(_2&&_2.dataURL)return _2.dataURL;return this.dataURL},getMessageSerializer:function(_1,_2){var _3=_2?this.getResponseMessage(_1):this.getRequestMessage(_1);if(_3==null){this.logWarn("no "+(_2?"response":"request")+" message definition found for operation: '"+_1+"'");return}
if(this.getSoapStyle(_1)!="document")return _3;var _4=_3.getFieldNames();if(_4.length==1&&_3.fieldIsComplexType(_4[0])){var _5=_3.getField(_4[0]);_3=_3.getSchema(_5.type,_5.xsElementRef?"element":null);if(_3==null){this.logWarn("can't find schema: "+_5.type+", part of "+(_2?"response":"request")+" message for operation '"+_1+"'")}}
return _3},useSimplifiedInputs:function(_1,_2){var _3=_2?this.getResponseMessage(_1):this.getRequestMessage(_1);return this.getMessageSerializer(_1,_2)!=_3},getSoapMessage:function(_1,_2){_1.serviceNamespace=_1.serviceNamespace||this.serviceNamespace;var _3=_1.wsOperation;if(this.getOperation(_3)==null){this.logWarn("no such operation: '"+_3+"' in service: "+this.serviceNamespace);return""}
var _4=this.getMessageSerializer(_1.wsOperation,_2&&_2.generateResponse);if(_4==null)return"";_1.$167f=this;return _4.getXMLRequestBody(_1,_2)},getSampleResponse:function(_1,_2,_3,_4){return this.getSoapMessage({wsOperation:_1,data:_2||{}},isc.addProperties({spoofData:true,generateResponse:!_4},_3))},getSampleRequest:function(_1,_2,_3){return this.getSampleResponse(_1,_2,_3,true)},getSoapStyle:function(_1){return this.getOperation(_1).soapStyle||this.soapStyle},getInputDS:function(_1){return this.getMessageSerializer(_1)},getHeaderSchema:function(_1,_2){var _3=this.getOperation(_1),_4=_2?_3.inputHeaders:_3.outputHeaders;if(!_4)return null;var _5={};for(var i=0;i<_4.length;i++){var _7=_4[i].part,_8=this.getSchema("message:"+_4[i].message);var _9=_8.getPartField(_7);_5[_7]=this.getSchema(_9.type)||_9}
return _5},getInputHeaderSchema:function(_1){return this.getHeaderSchema(_1,true)},getOutputHeaderSchema:function(_1){return this.getHeaderSchema(_1,false)},getHeaderData:function(_1){},selectByType:function(_1,_2,_3){var _4=this.getOperation(_2),_5=this.getSchema("message:"+_4.outputMessage),_6=this.getSchema(_3);if(_6==null){this.logWarn("selectByType: type '"+_3+"' not present in schema for message: "+_4.outputMessage);return null}
var _7=_5.findTagOfType(_6.ID);if(_7==null){this.logWarn("selectByType: no tag of type '"+_3+"' could be found in message: "+_4.outputMessage);return null}
var _8=_7[0],_9=_7[1],_10=_7[2],_11=_7[3],_12=_8.getField(_9);_9=_9||_6.ID;var _13=_6.mustQualify,_14=_6.schemaNamespace,_15="//"+(_13?"ns0:":"")+_9;if(_12&&_12.multiple)_15=_15+"/*";var _16=isc.xml.selectNodes(_1,_15,{ns0:_14});if(this.logIsDebugEnabled("xmlBinding")){this.logDebug("selecting type: '"+_6+"' within message '"+_4.outputMessage+" via XPath: "+_15+(_13?" using ns0: "+_6.schemaNamespace:"")+" got "+_16.length+" elements","xmlBinding")}
return _16},getDefaultOutputDS:function(_1){var _2=this.getResponseMessage(_1);if(!_2)return null;var _3=_2.getFieldNames();if(_3.length==1&&_2.fieldIsComplexType(_3[0])){return _2.getSchema(_2.getField(_3[0]).type)}
return _2},getFetchDS:function(_1,_2,_3){if(_2==null)_2=this.getDefaultOutputDS(_1);_2=isc.isA.Object(_2)?_2.ID:_2;if(_2!=null&&this.getSchema(_2)==null){this.logWarn("getFetchDS: resultType: '"+_2+"' not present in web service - missing XML files?")}
var _4=isc.DS.create({serviceNamespace:this.serviceNamespace,inheritsFrom:_2,operationBindings:[isc.addProperties({operationType:"fetch",wsOperation:_1,recordName:_2},_3)]});return _4},setLocation:function(_1,_2){if(_2)this.getBindingOperation(_2).dataURL=_1;else this.dataURL=_1}});isc.A=isc.WebService;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.services=[];isc.B.push(isc.A.get=function isc_c_WebService_get(_1){return this.services.find("serviceNamespace",_1)},isc.A.getByName=function isc_c_WebService_getByName(_1,_2){if(_1=="")_1=null;if(_2!=null){return this.services.find({name:_1,serviceNamespace:_2})}else{return this.services.find("name",_1)}});isc.B._maxIndex=isc.C+2;isc.WebService.getPrototype().toString=function(){return"["+this.Class+" ns="+this.echoLeaf(this.serviceNamespace)+(this.location?" location="+isc.Page.getLastSegment(this.location):"")+"]"};isc.ClassFactory.defineClass("RPCManager");isc.RPC=isc.rpc=isc.RPCManager;isc.Page.observe(isc,"goOffline","isc.rpc.goOffline()");isc.Page.observe(isc,"goOnline","isc.rpc.goOnline()");isc.ClassFactory.defineClass("LoadScreenCallback");isc.A=isc.LoadScreenCallback.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.execute=function isc_LoadScreenCallback_execute(){});isc.B._maxIndex=isc.C+1;isc.ClassFactory.defineClass("RPCResponse");isc.A=isc.RPCResponse;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.create=function isc_c_RPCResponse_create(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13){this.logWarn("RPCResponses shouldn't be created directly. Instances of this class are automatically created and optionally passed to you in the callback you specify as part of your RPCRequest.");return isc.addProperties({},_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13)});isc.B._maxIndex=isc.C+1;isc.A=isc.RPCResponse;isc.A.errorCodes={STATUS_SUCCESS:0,STATUS_OFFLINE:1,STATUS_FAILURE:-1,STATUS_AUTHORIZATION_FAILURE:-3,STATUS_VALIDATION_ERROR:-4,STATUS_LOGIN_INCORRECT:-5,STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED:-6,STATUS_LOGIN_REQUIRED:-7,STATUS_LOGIN_SUCCESS:-8,STATUS_UPDATE_WITHOUT_PK_ERROR:-9,STATUS_TRANSACTION_FAILED:-10,STATUS_MAX_FILE_SIZE_EXCEEDED:-11,STATUS_MAX_POST_SIZE_EXCEEDED:-12,STATUS_FILE_REQUIRED_ERROR:-15,INVALID_RESPONSE_FORMAT:-16,STATUS_TRANSPORT_ERROR:-90,STATUS_UNKNOWN_HOST_ERROR:-91,STATUS_CONNECTION_RESET_ERROR:-92,STATUS_SERVER_TIMEOUT:-100};isc.RPCResponse.addClassProperties(isc.RPCResponse.errorCodes)
isc.addGlobal("DSResponse",isc.RPCResponse);isc.A=isc.RPCManager;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.maxErrorMessageLength=1000;isc.A.maxLogMessageLength=25000;isc.A.defaultTimeout=240000;isc.A.defaultPrompt="Contacting server...";isc.A.timeoutErrorMessage="Operation timed out";isc.A.removeDataPrompt="Deleting record(s)...";isc.A.saveDataPrompt="Saving form...";isc.A.validateDataPrompt="Validating...";isc.A.promptStyle=isc.Dialog?"dialog":"cursor";isc.A.useCursorTracker=false;isc.A.cursorTrackerConstructor="Img";isc.A.cursorTrackerDefaults={src:"[SKINIMG]shared/progressCursorTracker.gif",size:16,offsetX:12,offsetY:0,$38x:function(_1){var _2=(isc.EH.getX()+this.offsetX),_3=(isc.EH.getY()+this.offsetY);if(_2+this.size>=isc.Page.getWidth()||_3+this.size>=isc.Page.getHeight()){this.hide();return}
if(isNaN(_2))_2=0;if(isNaN(_3))_3=0;this.setLeft(_2);this.setTop(_3);if(!_1&&!this.isVisible())this.show()},initWidget:function(){this.Super("initWidget",arguments);this.$38x(true);this.$38y=isc.Page.setEvent("mouseMove",this.getID()+".$38x()");this.$69s=isc.Page.setEvent("mouseOut",this.getID()+".hide()");this.bringToFront()},destroy:function(){isc.Page.clearEvent("mouseMove",this.$38y);isc.Page.clearEvent("mouseOut",this.$69s);this.Super("destroy",arguments)}};isc.A.promptCursor="progress";isc.A.fetchDataPrompt="Finding records that match your criteria...";isc.A.getViewRecordsPrompt="Loading record...";isc.A.showPrompt=false;isc.A.promptDelay=300;isc.A.neverShowPrompt=false;isc.A.actionURL="[ISOMORPHIC]/IDACall";isc.A.screenLoaderURL="[ISOMORPHIC]/screenLoader";isc.A.ALL_GLOBALS="-ALL_GLOBALS";isc.A.defaultTransport="xmlHttpRequest";isc.A.httpProxyURL="[ISOMORPHIC]/HttpProxy";isc.A.dataEncoding="XML";isc.A.preserveTypes=true;isc.A.credentialsURL=isc.Page.getIsomorphicDir()+"login/loginSuccessMarker.html";isc.A.loginWindowSettings="WIDTH=550,HEIGHT=250";isc.A.maxLoginPageLength=1048576;isc.A.$38z=[];isc.A.$452=0;isc.A.$410=[];isc.A.pendingRpcs=0;isc.B.push(isc.A.setActionURL=function isc_c_RPCManager_setActionURL(_1){this.actionURL=_1;for(var i=0;i<this.$38z.length;i++){var _3=this.$38z[i];if(_3.suspended&&_3.$185v){_3.URL=_3.$185w?this.addPathToURL(_1,_3.$185w):_1}}},isc.A.getTransactions=function isc_c_RPCManager_getTransactions(){return this.$38z},isc.A.getActiveTransactions=function isc_c_RPCManager_getActiveTransactions(){return this.$410});isc.B._maxIndex=isc.C+3;isc.A=isc.RPCManager;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.allowCrossDomainCalls=false;isc.A.$380=0;isc.A.onLine=!isc.isOffline();isc.A.$89f="text/xml";isc.A.loginStatusCodeMarker="<SCRIPT>//'\"]]>>isc_";isc.A.loginRequiredMarker="<SCRIPT>//'\"]]>>isc_loginRequired";isc.A.loginSuccessMarker="<SCRIPT>//'\"]]>>isc_loginSuccess";isc.A.maxLoginAttemptsExceededMarker="<SCRIPT>//'\"]]>>isc_maxLoginAttemptsExceeded";isc.A.$89j="<responses>";isc.A.$89k="</responses>";isc.A.$89l="<response>";isc.A.$89m="</response>";isc.A.allowIE9Leak=true;isc.A.useJSONParse_IE9=true;isc.A.$1613="\nSet rpcRequest.willHandleError:true on your request to handle this error yourself, or add a custom handleError to RPCManager to change system-wide default error reporting";isc.A.$143q="<HTML><SCRIPT>setInterval(function () {window.opener.isc.Timer.firePendingTimeouts()},1);</SCRIPT></HTML>";isc.A.$113o="return";isc.A.$1873="window";isc.B.push(isc.A.xmlHttpRequestAvailable=function isc_c_RPCManager_xmlHttpRequestAvailable(){if(isc.Browser.isIE)return(isc.Comm.createXMLHttpRequest()!=null);return true},isc.A.send=function isc_c_RPCManager_send(_1,_2,_3){var _4=(_3||{});isc.addProperties(_4,{data:_1,callback:_2});return this.sendRequest(_4)},isc.A.$383=function isc_c_RPCManager__warnIfXmlHttpRequestUnavailable(_1){if(this.xmlHttpRequestAvailable()||!this.logIsWarnEnabled())return false;var _2="Feature "+_1+" requires the xmlHttpRequest transport which is not currently available because ActiveX is disabled. Please see the 'Features requiring ActiveX or Native support' topic in the client-side reference under Client Reference/System for more information.";this.logWarn(_2);return true},isc.A.sendProxied=function isc_c_RPCManager_sendProxied(_1,_2){_1.serverOutputAsString=_1.transport!="scriptInclude";if(!_1.isRestRequest)_1.sendNoQueue=true;var _3=_1.actionURL||isc.RPCManager.actionURL;var _4=(_1.useHttpProxy!=null?_1.useHttpProxy:(isc.RPCManager.useHttpProxy&&_3.startsWith("http")&&!this.isLocalURL(_3)));if(!isc.RPCManager.allowCrossDomainCalls){if(!_4&&_3.startsWith("http")&&!this.isLocalURL(_3)){isc.warn("SmartClient can't directly contact URL '"+_3+"' due to browser same-origin policy.  Remove the host and port number (even if localhost) to avoid this problem, or use XJSONDataSource for JSONP protocol (which allows cross-site calls), or use the server-side HttpProxy included with SmartClient Server.<BR>This warning may be suppressed by setting <b>RPCManager.allowCrossDomainCalls</b> to true.")}}
if(!_4)
{if(!_2)_1.useSimpleHttp=true}else{var _5=_1.httpProxyURL||isc.XMLTools.httpProxyURL||isc.RPCManager.httpProxyURL;var _6=isc.addProperties({},_1,{actionURL:_5,isProxied:true,useSimpleHttp:true,proxiedURL:_3,params:{data:null},transport:_1.transport=="scriptInclude"?"scriptInclude":"xmlHttpRequest",httpMethod:null,data:null,contentType:null});isc.Comm.$850=true;_6.params.data=isc.Comm.xmlSerialize("data",{url:_3,httpMethod:_1.httpMethod,params:this.encodeObject(_1.params),contentType:_1.contentType,requestBody:_1.data,username:_1.username,password:_1.password,httpHeaders:_1.httpHeaders,uploadFileName:_1.uploadFileName,callbackParam:_1.transport=="scriptInclude"?_1.callbackParam:null});isc.Comm.$850=null;_1=_6}
return isc.rpc.sendRequest(_1)},isc.A.$59w=function isc_c_RPCManager__getHostAndPort(_1){var _2=isc.Page.getProtocol(_1),_3=_1.indexOf("/",_2.length),_4=_1.substring(_2.length,_3),_5;var _6=_4.indexOf(":");if(_6!=-1){_5=_4.substring(_6+1);_4=_4.substring(0,_6)}
return[_4,_5]},isc.A.isLocalURL=function isc_c_RPCManager_isLocalURL(_1){var _2=this.$59w(_1),_3=_2[0],_4=_2[1];if(_4==null||_4=="")_4=80;var _5=this.getWindow().location,_6=_5.hostname,_7=_5.port;if(_7==null||_7=="")_7=80;return(_3=="localhost"||_3==_6)&&_4==_7},isc.A.sendRequest=function isc_c_RPCManager_sendRequest(_1){if((this.$454||!this.$453)&&!_1.doNotTrackRPC){try{_1.$138k=this.getStackTrace()}catch(e){_1.$138k="N/A due to: "+e}}
if(_1.useHttpProxy&&!_1.isProxied)return this.sendProxied(_1);if(_1.canDropOnDelay&&this.delayingTransactions)return;_1=isc.addProperties({},_1);if(_1.suppressAutoDraw!==false)_1.suppressAutoDraw=true;_1.$185x=_1.actionURL||_1.url||_1.URL;_1.actionURL=isc.Page.getURL(_1.$185x||this.actionURL);var _2=_1.transport;if(!_2){if(_1.useXmlHttpRequest!=null||this.useXmlHttpRequest!=null){if(_1.useXmlHttpRequest==null){if(this.useXmlHttpRequest!=null){_1.transport=this.useXmlHttpRequest?"xmlHttpRequest":"hiddenFrame"}else{_1.transport=this.defaultTransport}}else{_1.transport=_2=_1.useXmlHttpRequest?"xmlHttpRequest":"hiddenFrame"}}else{_1.transport=this.defaultTransport}}
this.checkTransportAvailable(_1,(_2!=null));if(_1.useSimpleHttp==null)_1.useSimpleHttp=_1.paramsOnly;isc.addDefaults(_1,{showPrompt:this.showPrompt,promptStyle:this.promptStyle,promptCursor:this.promptCursor,useCursorTracker:this.useCursorTracker,cursorTrackerConstructor:this.cursorTrackerConstructor});_1.cursorTrackerProperties=isc.addProperties({},this.cursorTrackerDefaults,this.cursorTrackerProperties,_1.cursorTrackerProperties);if(_1.cursorTrackerProperties==null)
_1.cursorTrackerProperties=this.cursorTrackerProperties;if(!_1.operation){_1.operation={ID:"custom",type:"rpc"}}
var _3=this.transformRequest(_1);if(_3!==_1){_1.data=_3}
this.incrementPendingRpcs(_1);if(this.canQueueRequest(_1,(_2!=null))){if(!this.currentTransaction)this.currentTransaction=this.$385(_1.doNotTrackRPC);this.$386(_1,this.currentTransaction);if(!this.queuing)return this.sendQueue();return _1}else{return this.sendNoQueue(_1)}},isc.A.checkTransportAvailable=function isc_c_RPCManager_checkTransportAvailable(_1,_2){var _3=this.xmlHttpRequestAvailable();var _4=_1.transport||this.defaultTransport;if(!_3){if(_4=="xmlHttpRequest"){if(_2){this.logWarn("RPC/DS request specifically requesting the xmlHttpRequest transport, but xmlHttpRequest not currently available - switching transport to hiddenFrame.")}else{this.logWarn("RPCManager.defaultTransport specifies xmlHttpRequest, but xmlHttpRequest not currently available - switching transport to hiddenFrame.")}}
_1.transport="hiddenFrame"}},isc.A.canQueueRequest=function isc_c_RPCManager_canQueueRequest(_1,_2){if(_1.doNotTrackRPC)return false;if(_1.ignoreTimeout)_1.sendNoQueue=true;var _3=_1.transport;if(_1.containsCredentials){return false}
if(_1.sendNoQueue||_1.transport=="scriptInclude")return false;var _4=this.currentTransaction,_5=_4&&_4.requestData.operations.length,_6=_4&&_5>0;if(_6&&(_1.actionURL!=_4.URL)){this.logWarn("RPCRequest specified (or defaulted to) URL: "+_1.actionURL+" which is different than the URL for which the RPCManager is currently queuing: "+_4.URL+" - sending this request to server and continuing to queue");return false}
if(_6&&(!!_1.useStrictJSON!=!!_4.useStrictJSON))
{this.logWarn("Attempt to queue request specified 'useStrictJSON:"+_1.useStrictJSON+". This conflicts with this setting for other queued requests - sending the request to server and continuing to queue.");return false}
if(_6&&_4.transport!=_1.transport){this.logWarn("RPCRequest with conflicting transport while queuing, sending request to server and continuing to queue.");return false}
if(_6&&_1.clientOnly){this.logWarn("Attempt to queue a client-only request with a pending transaction containing server-bound requests (URL: "+_4.URL+") - the client-only request will be sent immediately outside the queue and the queue preserved");return false}
if(!_1.clientOnly&&_4&&_5==0){this.logWarn("Attempt to queue an RPCRequest to the server (URL: "+_1.actionURL+") with client-only requests in the queue - the client-only requests will be sent immediately, clearing the transaction, and making the queue available for this (and subsequent) server-bound requests");this.sendQueue();this.startQueue()}
var _7=_1.submitForm;if(_7&&_7.$209u&&_7.$209u()){var _4=this.currentTransaction;if(_4&&_4.$209v){this.logWarn("Only one upload can be added to a transaction, and the current transaction already has one.  The current transaction will be sent immediately and then a new one started for the new request.");this.sendQueue();this.startQueue()}}
return true},isc.A.sendNoQueue=function isc_c_RPCManager_sendNoQueue(_1){var _2=this.currentTransaction;var _3=this.queuing;this.currentTransaction=this.$385(_1.doNotTrackRPC);this.$386(_1,this.currentTransaction);var _4=this.sendQueue();this.queuing=_3;this.currentTransaction=_2;return _4},isc.A.$385=function isc_c_RPCManager__createTransaction(_1){var _2=this.$452++;var _3={timeout:this.defaultTimeout,transactionNum:_2,operations:[],responses:[],requestData:{transactionNum:_2,operations:[]},prompt:this.defaultPrompt,showPrompt:false,doNotTrackRPC:_1,pushedToDebugMaster:false,changed:function(){if(isc.RPCManager.$38z)isc.RPCManager.$38z.dataChanged();if(!this.doNotTrackRPC)isc.RPCManager.pushRPCUpdate(_3)}};this.$38z.add(_3);_3.changed();return _3},isc.A.$386=function isc_c_RPCManager__addRequestToTransaction(_1,_2){_2.URL=_1.actionURL;_2.$185v=!_1.$185x;if(_1.containsCredentials)_2.containsCredentials=true;if(!_2.download_filename){_2.download_filename=_1.download_filename}
if(((_1.downloadResult||_1.downloadToNewWindow)&&_1.download_filename)||_1.$38j)
{_2.download_filename=_1.download_filename;if(_1.download_filename){_2.$185w="/"+encodeURIComponent(_1.download_filename);_2.URL=this.addPathToURL(_2.URL,_2.$185w)}
_2.ignoreError=true}else if(_1.exportFilename){_2.$185w="/"+encodeURIComponent(_1.exportFilename);_2.URL=this.addPathToURL(_2.URL,_2.$185w)}
if(_1.prompt&&!_2.customPromptIsSet){this.logDebug("Grabbed prompt from first request that defined one: "+_1.prompt);_2.prompt=_1.prompt;_2.customPromptIsSet=true}
if(_1.componentId){if(!_2.componentIds)_2.componentIds=Array.newInstance({sortUnique:true});_2.componentIds.add(_1.componentId)}
if(_1.showPrompt&&!_2.showPrompt&&!this.neverShowPrompt){_1.showedPrompt=true;isc.addProperties(_2,{showPrompt:true,promptStyle:_1.promptStyle,promptCursor:_1.promptCursor,useCursorTracker:_1.useCursorTracker,cursorTrackerConstructor:_1.cursorTrackerConstructor,cursorTrackerProperties:_1.cursorTrackerProperties})}
if(_1.isProxied){isc.addProperties(_2,{isProxied:true,proxiedURL:_1.proxiedURL})}
_2.transport=_1.transport;_2.useStrictJSON=_2.useStrictJSON||_1.useStrictJSON;if(_2.useStrictJSON!=null){_2.requestData.useStrictJSON=_2.useStrictJSON;if(_2.useStrictJSON){_2.jsonReviver=_1.jsonReviver||(isc.DataSource?isc.DataSource.iscServer_strictJSONReviver:null)}}
if(_1.ignoreReloginMarkers)_2.ignoreReloginMarkers=true;var _3=_1.submitForm;if(_3&&_3.$209u&&_3.$209u()){_2.$209v=_1}
_2.operations.add(_1);var _4=_1.data;if(_4==null)_4="__ISC_NULL__";else if(_4==="")_4="__ISC_EMPTY_STRING__";if(!_1.clientOnly)_2.requestData.operations.add(_4);if(_2.omitNullMapValuesInResponse!==false&&_1.omitNullMapValuesInResponse!=null){_2.omitNullMapValuesInResponse=_2.requestData.omitNullMapValuesInResponse=_1.omitNullMapValuesInResponse}else{_2.omitNullMapValuesInResponse=false}
if(_1.ignoreTimeout)_2.$387=true;_1.transactionNum=_2.transactionNum;if(_1.timeout||_1.timeout===0)_2.timeout=_1.timeout;_2.changed()},isc.A.startQueue=function isc_c_RPCManager_startQueue(_1){var _2=this.queuing;this.queuing=(_1==null?true:_1);return _2},isc.A.doShowPrompt=function isc_c_RPCManager_doShowPrompt(_1,_2,_3){if(this.$380++!=0)return;var _4=_1.promptStyle=="component"&&_1.componentIds;var _5=this.unmaskedTargets;if(_3&&!this.$113i&&!_4){isc.EH.showClickMask(null,"hard",_5?_5.duplicate():null,"blockingRPC");this.$113i=true}
var _6=this;var _7=function(){if(_1.promptStyle=="dialog"&&_2!=null){isc.showPrompt(_2);_6.$388=true;if(_6.$113i){isc.EH.hideClickMask("blockingRPC");_6.$113i=null}}else if(_4){_1.componentIds.map(function(_9){var _8=window[_9];if(_8&&_8.showComponentPrompt)_8.fireCallback("showComponentPrompt")});_1.showedComponentPrompt=true}else{if(!_6.$113i){isc.EH.showClickMask(null,"hard",_5?_5.duplicate():null,"blockingRPC");_6.$113i=true}
if(_1.useCursorTracker){_6.$389=isc.ClassFactory.getClass(_1.cursorTrackerConstructor,true).create(_1.cursorTrackerProperties);_6.$389.show()}else{isc.EH.$m8.setCursor(_1.promptCursor)}}};if(_3){this.$113j=isc.Timer.setTimeout(_7,_3)}else{_7()}},isc.A.doClearPrompt=function isc_c_RPCManager_doClearPrompt(_1){if(this.$113j){isc.Timer.clear(this.$113j);this.$113j=null}
if(_1.clearedPrompt)return;_1.clearedPrompt=true;if(_1.showedComponentPrompt){_1.componentIds.map(function(_3){var _2=window[_3];if(_2&&_2.clearComponentPrompt)_2.fireCallback("clearComponentPrompt")})}
if(--this.$380!=0){if(this.$380<0)this.$380=0;return}
if(this.$388){isc.clearPrompt()}else{if(this.$389){this.$389.destroy();this.$389=null}else{if(isc.EH.$m8)isc.EH.$m8.setCursor(isc.Canvas.DEFAULT)}}
this.$388=null;if(this.$113i){isc.EH.hideClickMask("blockingRPC");this.$113i=null}},isc.A.hasCurrentTransactionQueued=function isc_c_RPCManager_hasCurrentTransactionQueued(){return!!this.getQueueTransactionId()},isc.A.getCurrentTransactionId=function isc_c_RPCManager_getCurrentTransactionId(){return this.getQueueTransactionId()},isc.A.getQueueTransactionId=function isc_c_RPCManager_getQueueTransactionId(){return this.currentTransaction?this.currentTransaction.transactionNum:null},isc.A.cancelQueue=function isc_c_RPCManager_cancelQueue(_1){if(_1==null){_1=this.currentTransaction}
var _2=this.getTransaction(_1);if(_2==null)return;else if(_2==this.currentTransaction)this.currentTransaction=null;if(_2.showPrompt)this.doClearPrompt(_2);if(_2.transportRequest&&_2.transportRequest.abort){_2.transportRequest.abort()}
_2.cancelled=true;this.clearTransaction(_2.transactionNum)},isc.A.getTransaction=function isc_c_RPCManager_getTransaction(_1){if(_1==null)return null;if(_1.location&&_1.document){var _2=_1;var _3=isc.HiddenFrame.$h6;for(var i=0;i<_3.length;i++){if(_2==_3[i].getHandle()){_1=_3[i].transactionNum;break}}
if(_1==_2){this.logDebug("Can't find transactionNum in getTransaction from iframe");return null}}
if(isc.isA.Number(_1)||isc.isA.String(_1)){_1=this.$38z.find({transactionNum:_1})}
if(_1&&_1.cleared)return null;return _1},isc.A.getCurrentTransaction=function isc_c_RPCManager_getCurrentTransaction(){return this.currentTransaction},isc.A.getLastSubmittedTransaction=function isc_c_RPCManager_getLastSubmittedTransaction(){return this.$38z[this.$38z.length-1]},isc.A.clearTransaction=function isc_c_RPCManager_clearTransaction(_1,_2){var _3=this.getTransaction(_1);if(_3==null){this.logWarn("clearTransaction: no such transaction: "+this.echo(_1));return}
this.clearTransactionTimeout(_3);if(!this.$453&&isc.Page.isLoaded()){var _4=isc.LogViewer.getGlobalLogCookie();this.setTrackRPC(_4?_4.trackRPC:false);this.$453=true}
if(!_2)this.clearTransactionPendingRpcs(_3);_3.cleared=true;if(!this.$454&&this.$453)this.$38z.remove(_3);else _3.changed();isc.RPCManager.$410.remove(_3.transactionNum)},isc.A.setTrackRPC=function isc_c_RPCManager_setTrackRPC(_1){this.$454=_1;isc.LogViewer.setGlobalLogCookieValue("trackRPC",_1);var _2=this.getTransactions();if(!_1)this.removeClearedRPC()},isc.A.pushRPCUpdate=function isc_c_RPCManager_pushRPCUpdate(_1){if(!this.$454||_1.doNotTrackRPC)return;if(isc.debugTarget)isc.debugTarget.pushRPCUpdate(_1);if(_1.pushedToDebugMaster&&_1.cleared)this.$38z.remove(_1)},isc.A.pushBufferedTransactionsToDebugMaster=function isc_c_RPCManager_pushBufferedTransactionsToDebugMaster(){var _1=this.$38z.findAll("pushedToDebugMaster",false);if(!_1)return;for(var i=0;i<_1.length;i++){this.pushRPCUpdate(_1[i])}},isc.A.removeClearedRPC=function isc_c_RPCManager_removeClearedRPC(){var _1=this.$38z.findAll("cleared",true);if(_1)this.$38z.removeList(_1)},isc.A.delayAllPendingTransactions=function isc_c_RPCManager_delayAllPendingTransactions(){this.delayingTransactions=true;for(var i=0;i<this.$38z.length;i++){var _2=this.$38z[i];this.delayTransaction(_2)}},isc.A.suspendTransaction=function isc_c_RPCManager_suspendTransaction(_1){var _2=this.getTransaction(_1)||this.getCurrentTransaction();if(_2==null){this.logWarn("No transaction to suspend");return}
if(_2.suspended)return;_2.suspended=true;if(_2.$66n)_2.abortCallbacks=true;this.clearTransactionTimeout(_2);if(_2.showPrompt)this.doClearPrompt(_2);_2.changed()},isc.A.delayTransaction=function isc_c_RPCManager_delayTransaction(_1){_1=this.getTransaction(_1);if(_1.delayed)return;_1.delayed=true;this.clearTransactionTimeout(_1);_1.changed()},isc.A.goOffline=function isc_c_RPCManager_goOffline(){this.logInfo("Going offline...");this.onLine=false},isc.A.goOnline=function isc_c_RPCManager_goOnline(){this.logInfo("Going online...");this.offlinePlayback=true;this.playbackNextOfflineTransaction()},isc.A.offlineTransactionPlaybackComplete=function isc_c_RPCManager_offlineTransactionPlaybackComplete(){},isc.A.playbackNextOfflineTransaction=function isc_c_RPCManager_playbackNextOfflineTransaction(){var _1=this.offlineTransactionLog?this.offlineTransactionLog.removeAt(0):null;if(_1==null){this.logInfo("Offline transaction playback complete");this.offlinePlayback=false;this.onLine=!isc.isOffline();this.offlineTransactionPlaybackComplete();return}
this.resubmitTransaction(_1)},isc.A.offlineTransaction=function isc_c_RPCManager_offlineTransaction(_1){if(_1.offline)return;_1=this.getTransaction(_1);_1.offline=true;this.clearTransactionTimeout(_1);if(!this.offlineTransactionLog){this.offlineTransactionLog=[];this.offlineTransactionLog.sortByProperty("timestamp",Array.ASCENDING)}
this.offlineTransactionLog.add(_1);_1.changed();var _2=_1.operations;for(var i=0;i<_2.length;i++){var _4=_2[i];var _5=this.createRPCResponse(_1,_4,{httpResponseCode:200,offlineResponse:true});this.delayCall("fireReplyCallbacks",[_4,_5],0)}},isc.A.resendTransaction=function isc_c_RPCManager_resendTransaction(_1){this.resendTransactionsFlagged(_1,"suspended")},isc.A.resendDelayedTransactions=function isc_c_RPCManager_resendDelayedTransactions(){this.delayingTransactions=false;this.resendTransactionsFlagged(null,"delayed")},isc.A.resendTransactionsFlagged=function isc_c_RPCManager_resendTransactionsFlagged(_1,_2){var _3=_1?[this.getTransaction(_1)]:this.$38z;for(var i=0;i<_3.length;i++){_1=_3[i];if(_1[_2]){delete _1[_2];this.resubmitTransaction(_1)}}},isc.A.getTransactionRequests=function isc_c_RPCManager_getTransactionRequests(_1){return this.getTransaction(_1).operations},isc.A.$39a=function isc_c_RPCManager__setTransactionTimeoutTimer(_1){_1=this.getTransaction(_1);var _2=_1.timeout;if(!_2&&_2!==0)_2=this.defaultTimeout;if(_2==0)return;_1.timeoutTimer=isc.Timer.setTimeout("isc.RPCManager.$39b("+_1.transactionNum+")",_2)},isc.A.clearTransactionTimeout=function isc_c_RPCManager_clearTransactionTimeout(_1){_1=this.getTransaction(_1)||this.getCurrentTransaction()||this.getLastSubmittedTransaction();if(!_1)return;isc.Timer.clear(_1.timeoutTimer)},isc.A.$39b=function isc_c_RPCManager__timeoutTransaction(_1){_1=this.getTransaction(_1);if(_1.$387){this.clearTransaction(_1);return}
if(!this.onLine){this.offlineTransaction(_1);return}
_1.results=this.$39c(_1,{data:isc.RPCManager.timeoutErrorMessage,status:isc.RPCResponse.STATUS_SERVER_TIMEOUT});this.$39d(_1.transactionNum)},isc.A.$39c=function isc_c_RPCManager__makeErrorResults(_1,_2){var _3=[];for(var i=0;i<_1.operations.length;i++){if(_1.operations[i].dataFormat=="xml"){_3[i]=isc.Comm.xmlSerialize("response",_2)}else{_3[i]={response:isc.clone(_2)}}}
return _3},isc.A.resubmitTransaction=function isc_c_RPCManager_resubmitTransaction(_1){_1=this.getTransaction(_1)||this.getLastSubmittedTransaction();_1.status=null;var _2=this.currentTransaction;this.currentTransaction=_1;if(_1!=null){this.logInfo("Resubmitting transaction number: "+_1.transactionNum);delete _1.suspended;delete _1.clearedPrompt;var _3=_1.$76k||isc.emptyObject;this.sendQueue(_3.callback,_3.prompt,_3.URL)}else{this.logWarn("No transaction to resubmit: transaction number "+_1+" does not exist")}
this.currentTransaction=_2},isc.A.retryOperation=function isc_c_RPCManager_retryOperation(_1){this.logDebug("Server-initiated operation retry for commFrameID: "+_1);var _2=window[_1];if(!_2){this.logError("comm operation retry failed - can't locate object: "+_1);return}
_2.sendData(true)},isc.A.transactionAsGetRequest=function isc_c_RPCManager_transactionAsGetRequest(_1,_2,_3){if(!_1.cleared){_1=this.getTransaction(_1)||this.getCurrentTransaction()}
_2=isc.Page.getURL(_2||_1.URL||this.actionURL);if(!_3)_3={};_3._transaction=this.serializeTransaction(_1);return this.addParamsToURL(this.markURLAsRPC(_2),_3)},isc.A.encodeObject=function isc_c_RPCManager_encodeObject(_1){if(!_1)return{};var _2={};for(var _3 in _1){var _4=_1[_3];if(isc.isA.Date(_4)){isc.Comm.xmlSchemaMode=true;_4=_4.toSchemaDate();isc.Comm.xmlSchemaMode=null}
if(!isc.isA.String(_4)){_4=isc.JSON.encode(_4,{prettyPrint:false})}
_2[_3]=_4}
return _2},isc.A.encodeParameter=function isc_c_RPCManager_encodeParameter(_1,_2){if(isc.isA.Date(_2)){isc.Comm.xmlSchemaMode=true;_2=_2.toSchemaDate();isc.Comm.xmlSchemaMode=null}else if(isc.isA.Array(_2)){if(_2.length==0)return null;var _3=isc.SB.create();for(var i=0;i<_2.length;i++){_3.append(this.encodeParameter(_1,_2[i]));if(i<_2.length-1)_3.append("&")}
return _3.release(false)}if(!isc.isA.String(_2)){_2=isc.JSON.encode(_2,{prettyPrint:false})}
return isc.SB.concat(encodeURIComponent(_1),"=",encodeURIComponent(_2))},isc.A.addParamsToURL=function isc_c_RPCManager_addParamsToURL(_1,_2){var _3=_1;if(!_2)return _1;for(var _4 in _2){var _5=_2[_4],_6=this.encodeParameter(_4,_5);if(_6!=null){_3+=_3.contains("?")?"&":"?";_3+=_6}}
return _3},isc.A.addPathToURL=function isc_c_RPCManager_addPathToURL(_1,_2){var _3;var _4=_1.indexOf("?");if(_4==-1){_3=_1+_2}else{_3=_1.substring(0,_4)+_2+_1.substring(_4)}
return _3},isc.A.serializeTransaction=function isc_c_RPCManager_serializeTransaction(_1){var _2;if(isc.Browser.isSGWT){window.SmartGWT.warnOnSerializeError=true;window.SmartGWT.serializeErrorMessage="Object is part of a request being serialized for transmission to the server. See SmartClient documentation of RPCRequest.data for a table of Java types that can be converted automatically."}
if(this.dataEncoding=="JS"){isc.Comm.$ev=true;if(isc.isAn.Array(_1.operations)){var _3=isc.DataSource.get(_1.operations[0].dataSource);if(_3){isc.Comm.$136q=!!_3.trimMilliseconds}}
_2=isc.Comm.serialize(_1.requestData);isc.Comm.$136q=null;isc.Comm.$ev=null}else{isc.Comm.$850=true;if(isc.isAn.Array(_1.operations)){var _3=isc.DataSource.get(_1.operations[0].dataSource);if(_3){isc.Comm.$136q=!!_3.trimMilliseconds}}
_2=isc.Comm.xmlSerialize("transaction",_1.requestData);isc.Comm.$136q=null;isc.Comm.$850=null}
if(isc.Browser.isSGWT){window.SmartGWT.warnOnSerializeError=false;window.SmartGWT.serializeErrorMessage=null}
return _2},isc.A.markURLAsRPC=function isc_c_RPCManager_markURLAsRPC(_1){if(!_1.contains("isc_rpc="))_1+=(_1.contains("?")?"&":"?")+"isc_rpc=1&isc_v="+isc.versionNumber;return _1},isc.A.markURLAsXmlHttp=function isc_c_RPCManager_markURLAsXmlHttp(_1){if(!_1.contains("isc_xhr="))_1+=(_1.contains("?")?"&":"?")+"isc_xhr=1";return _1},isc.A.addDocumentDomain=function isc_c_RPCManager_addDocumentDomain(_1){if(!_1.contains("isc_dd="))_1+=(_1.contains("?")?"&":"?")+"isc_dd="+document.domain;return _1},isc.A.registerUnmaskedTarget=function isc_c_RPCManager_registerUnmaskedTarget(_1){if(!this.unmaskedTargets)this.unmaskedTargets=[];this.unmaskedTargets.add(_1)},isc.A.unregisterUnmaskedTarget=function isc_c_RPCManager_unregisterUnmaskedTarget(_1){if(this.unmaskedTargets)this.unmaskedTargets.remove(_1)},isc.A.sendQueue=function isc_c_RPCManager_sendQueue(_1,_2,_3,_4){var _5=this.currentTransaction;this.currentTransaction=null;this.queuing=false;if(!_5){this.logInfo("sendQueue called with no current queue, ignoring");return false}
if(_4)this.delayCall("$84s",[_1,_2,_3,_5]);else return this.$84s(_1,_2,_3,_5)},isc.A.$84s=function isc_c_RPCManager__sendQueue(_1,_2,_3,_4){var _5=_4.operations[0];if(_4.$209v){_5=_4.$209v;if(this.logIsInfoEnabled()&&_5!=_4.operations[0]){this.logInfo("Using the upload request as the definitive request in the current transaction since for file upload, the request's form must be submitted")}}
if(((!isc.Page.isLoaded()&&_5.transport!="xmlHttpRequest")||this.delayingTransactions)&&!_5.$38j){_4.$76k={callback:_1,prompt:_2,URL:_3};if(!this.delayingTransactions){isc.Page.setEvent("load",this,isc.Page.FIRE_ONCE,"resendDelayedTransactions");this.delayingTransactions=true}
this.delayTransaction(_4);return _5}
_4.timestamp=new Date().getTime();if(!this.onLine&&!this.offlinePlayback){this.offlineTransaction(_4);return _5}
var _6=true;for(var i=0;i<_4.operations.length;i++){if(!_4.operations[i].clientOnly){_6=false;break}}
if(_6){_4.allClientOnly=true;_4.sendTime=isc.timeStamp();if(_1!=null){_4.$40c=_1}
this.delayCall("$39d",[_4.transactionNum],0);return _5}
_3=_4.URL=isc.Page.getURL(_3||_4.URL||this.actionURL);if(_5.doNotTrackRPC)_3=this.addParamsToURL(_3,{isc_noLog:"1"});if(_5.$175j)_3=this.addParamsToURL(_3,{isc_rctx:_5.$175j});else if(this.$175j)_3=this.addParamsToURL(_3,{isc_rctx:this.$175j});if(_5.$1760)_3=this.addParamsToURL(_3,{isc_delay:_5.$1760});var _8=false;if(!_5.useSimpleHttp&&_4.transport!="scriptInclude"){_3=this.markURLAsRPC(_3);if(_4.transport=="xmlHttpRequest"){_3=this.markURLAsXmlHttp(_3);_8=true}else{_3=this.addParamsToURL(_3,{isc_tnum:_4.transactionNum})}
if(document.domain!=location.hostname)_3=this.addDocumentDomain(_3)}
_2=_4.prompt=((_4.showPrompt==null||_4.showPrompt)?(_2||_4.prompt||this.defaultPrompt):null);if(_2)this.doShowPrompt(_4,_2,_4.promptDelay||this.promptDelay);var _9={};var _10=false;for(var i=0;i<_4.operations.length;i++){var _11=_4.operations[i];var _12=_11.params,_13=_12!=null;if(_8){_12=_12||{};_12.isc_tnum=_4.transactionNum}
var _14=_11.queryParams;var _15=_12;if(_14&&isc.isAn.Object(_14)){_3=_4.URL=this.addParamsToURL(_3,_14)}
if(_13&&_10){this.logWarn("Multiple RPCRequests with params attribute in one transaction - merging")}
if(_12){if(isc.isA.String(_12)){if(window[_12])_12=window[_12];else if(isc.Canvas.getForm(_12))_12=isc.Canvas.getForm(_12);else{this.logWarn("RPCRequest: "+isc.Log.echo(_11)+" was passed a params value: "+_12+" which does not resolve to a component or a native form - request to server will not include these params");_12=null}}
if(isc.isA.Class(_12)){if(_12.getValues)_12=_12.getValues();else{this.logWarn("RPCRequest: "+isc.Log.echo(_11)+" was passed an instance of class "+_12.getClassName()+" (or a global ID that resolved to this class) - this class does not support the getValues() method - request to server will not include these params")}}
if(_12&&!isc.isAn.Object(_12)){this.logWarn("params value: "+_15+" for RPCrequest: "+isc.Log.echo(_11)+" resolved to non-object: "+isc.Log.echo(_12)+" - request to server will not include these params");_12=null}
if(_12){isc.addProperties(_9,_12);_10=true}}}
if(this.logIsInfoEnabled()){this.logInfo("sendQueue["+_4.transactionNum+"]: "+_4.operations.length+" RPCRequest(s); transport: "+_4.transport+"; target: "+_3)}
if(isc.DataSource){for(var i=0;i<_4.operations.length;i++){var _11=_4.operations[i];isc.DataSource.recordTimingData(_11,"performDSOperation","end");isc.DataSource.recordTimingData(_11,"Marshall and send request","start")}}
_4.changed();_4.callback="isc.RPCManager.performTransactionReply(transactionNum,results,wd)";if(_1)_4.$40c=_1;var _12=_9;var _16=_4.transport,_17="send"+(_16.substring(0,1).toUpperCase())+_16.substring(1);if(isc.Comm[_17]==null){this.logWarn("Attempt to send transaction with specified transport '"+_4.transport+"' failed - unsupported transaction type.");return}
this.$39a(_4);var _18;var _19=[]
for(var i=0;i<_4.operations.length;i++){if(_4.operations[i].isRestRequest){_19.push(_4.operations[i])}}
if(_19.length>1){if(_19[0].contentType==this.$89f){_18="<transaction transactionNum=\""+_4.transactionNum+"\">";_18+="<operations>"
for(var i=0;i<_19.length;i++){_18+=_19[i].data}
_18+="</operations>";_18+="</transaction>"}else{_18="{ \"transaction\": { \"transactionNum\": "+_4.transactionNum+", ";_18+="\"operations\": [";for(var i=0;i<_19.length;i++){if(i>0)_18+=", ";var _20=_19[i].data||_19[i].params;if(!isc.isA.String(_20)){_20=isc.JSON.encode(_20)}
_18+=_20}
_18+="]}}"}}else if(_19.length==1){_18=_19[0].data}else if(_5.useSimpleHttp){_18=_5.data}
isc.RPCManager.$410.add(_4.transactionNum);_4.transactionRequest=isc.Comm[_17]({URL:_3,httpMethod:_5.httpMethod,contentType:_5.contentType,httpHeaders:_5.httpHeaders,bypassCache:_5.bypassCache,data:_18,fields:_12,target:_5.target,callbackParam:_5.callbackParam,transport:_4.transport,blocking:_5.blocking,useSimpleHttp:_5.useSimpleHttp,withCredentials:_5.withCredentials,transactionNum:_4.transactionNum,transaction:_4,xmlHttpRequestResponseType:_5.xmlHttpRequestResponseType});if(isc.isA.Function(this.queueSent))this.queueSent(_4.operations);_4.sendTime=isc.timeStamp();if(isc.DataSource){for(var i=0;i<_4.operations.length;i++){var _11=_4.operations[i];isc.DataSource.recordTimingData(_11,"Marshall and send request","end");isc.DataSource.recordTimingData(_11,"Client processing","end")}}
return _5});isc.evalBoundary;isc.B.push(isc.A.performTransactionReply=function isc_c_RPCManager_performTransactionReply(_1,_2,_3){var _4=this.getTransaction(_1);if(!_4){this.logWarn("performTransactionReply: No such transaction "+_1);return false}
delete _4.$66n;delete _4.abortCallbacks;_4.receiveTime=isc.timeStamp();_4.changed();isc.RPCManager.$410.remove(_1);this.logInfo("transaction "+_1+" arrived after "+(_4.receiveTime-_4.sendTime)+"ms");if(_2==null){this.logFatal("No results for transaction "+_1);return false}
if(_4.transport=="xmlHttpRequest"){var _5=_2;_4.xmlHttpRequest=_5;_2="response"in _5?_5.response:_5.responseText;var _6;try{_6=_5.status}catch(e){this.logWarn("Unable to access XHR.status - network cable unplugged?");_6=-1}
if(_6==1223)_6=204;if(_6==0&&(location.protocol=="file:"||location.protocol=="app-resource:"))
_6=200;_4.httpResponseCode=_6;try{_4.httpResponseText=_5.responseText}catch(e){}
_4.httpResponse=_5.response;if(_6!=-1&&!_4.ignoreReloginMarkers&&_4.httpResponseText!=null&&this.processLoginStatusText(_5,_1))
{return}
if(_6!=-1&&this.responseRequiresLogin(_5,_1)){this.handleLoginRequired(_1);return}
if(_6!=-1&&this.responseIsRelogin(_5,_1)){this.handleLoginRequired(_1);return}
if(_6==12030&&isc.Browser.isIE){this.logWarn("Received HTTP status code 12030, resubmitting request");this.resubmitTransaction(_1);return}
var _7=_4.URL;var _8;if(_4.isProxied){_7=_4.proxiedURL+" (via proxy: "+_7+")";var _9=this.getHttpHeaders(_5,_4);var _10;if(_9){for(var _11 in _9){if(_11.toLowerCase()=="x-isc-httpproxy-status"){_10=_9[_11];break}}}
if(_10&&_10=="-91")_8=-91;if(_10&&_10=="-92")_8=-92}
if(_8)_6=500;if(_6>299||_6<200){_2=this.$39c(_4,{data:"Transport error - HTTP code: "+_6+" for URL: "+_7+(_6==302?" This error is likely the result of a redirect to a server other than the origin server or a redirect loop.":""),status:_8?_8:isc.RPCResponse.STATUS_TRANSPORT_ERROR});this.logDebug("RPC request to: "+_7+" returned with http response code: "+_6+". Response text:\n"+_4.httpResponseText);_4.status=_8?_8:isc.RPCResponse.STATUS_TRANSPORT_ERROR;_4.$66n=true;if(false==this.handleTransportError(_1,_4.status,_4.httpResponseCode,_4.httpResponseText))
{this.cancelDefaultErrorHandling(_4)}
if(_4.suspended||_4.abortCallbacks){delete _4.abortCallbacks;delete _4.$66n
return}
delete _4.$66n}
if(_4.httpResponseText!=null&&_4.httpResponseText.contains("parent.isc.RPCManager.handleMaxPostSizeExceeded(window.name);"))
{this.$1327(_1);return}}else if(_4.transport=="hiddenFrame"){if(!_4.ignoreReloginMarkers&&this.processLoginStatusText(_2,_1))
{return}}
if(this.$454||!this.$1614){if(isc.isA.String(_2)){_4.serializedCommResults=_2}else{_4.serializedCommResults=isc.JSON.encode(_2,{prettyPrint:true,strictQuoting:false,serializeInstances:"short",skipInternalProperties:false});_4.serializedCommResultsAreFormatted=true}}
_4.results=_2;this.$39d(_1);return true},isc.A.$1327=function isc_c_RPCManager__handleMaxPostSizeExceeded(_1){var _2=this.getTransaction(_1);var _3=this.$39c(_2,{data:"The server did not receive the data that was sent to it.  Please see the documentation for isc.RPCResponse.STATUS_MAX_POST_SIZE_EXCEEDED",status:isc.RPCResponse.STATUS_MAX_POST_SIZE_EXCEEDED});_2.status=isc.RPCResponse.STATUS_MAX_POST_SIZE_EXCEEDED
_2.results=_3;this.$39d(_1)},isc.A.handleMaxPostSizeExceeded=function isc_c_RPCManager_handleMaxPostSizeExceeded(_1){var _2=window[_1];if(!_2){this.logError("Unable to handle max post size exceeded - can't locate object: "+_1);return}
var _3=this.getTransaction(_2);if(!_3){this.logError("Unable to find transaction for comm frame id: "+_1);return}
this.$1327(_3.transactionNum)},isc.A.handleRequestAborted=function isc_c_RPCManager_handleRequestAborted(_1){var _2=this.getTransaction(_1);var _3=this.$39c(_2,{data:"The server was unable to complete the request as delivered. This may be caused by attempting to upload an unusually large file, for example.  Please check the server log for details of the failure.",status:isc.RPCResponse.STATUS_FAILURE});_2.status=isc.RPCResponse.STATUS_FAILURE;_2.results=_3;this.$39d(_1)},isc.A.responseIsRelogin=function isc_c_RPCManager_responseIsRelogin(_1,_2){var _3=_1.status;if(document.domain!=location.hostname&&((_3==302&&this.treatRedirectAsRelogin)||(_3==0)||(_3==200&&_1.getAllResponseHeaders()==isc.emptyString&&_1.responseText==isc.emptyString)))
{this.logDebug("Detected document.domain 302 relogin condition - status: "+_3);return true}
return false},isc.A.processLoginStatusText=function isc_c_RPCManager_processLoginStatusText(_1,_2){var _3=_1.responseText||_1;if(_3&&_3.length<this.maxLoginPageLength){if(this.loginSuccessMarker.indexOf(this.loginStatusCodeMarker)!=0||this.maxLoginAttemptsExceededMarker.indexOf(this.loginStatusCodeMarker)!=0||this.loginRequiredMarker.indexOf(this.loginStatusCodeMarker)!=0){}else{var _4=_3.indexOf(this.loginStatusCodeMarker);if(_4==-1)return false}
if(_3.indexOf(this.loginRequiredMarker,_4)!=-1){this.handleLoginRequired(_2);return true}else if(_3.indexOf(this.loginSuccessMarker,_4)!=-1){this.handleLoginSuccess(_2);return true}else if(_3.indexOf(this.maxLoginAttemptsExceededMarker,_4)!=-1){this.handleMaxLoginAttemptsExceeded(_2);return true}}
return false},isc.A.processLoginStatusCode=function isc_c_RPCManager_processLoginStatusCode(_1,_2){if(_1.status==isc.RPCResponse.STATUS_LOGIN_REQUIRED){this.handleLoginRequired(_1.transactionNum);return true}else if(_1.status==isc.RPCResponse.STATUS_LOGIN_SUCCESS){this.handleLoginSuccess(_1.transactionNum);return true}else if(_1.status==isc.RPCResponse.STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED){this.handleMaxLoginAttemptsExceeded(_1.transactionNum);return true}
return false},isc.A.responseRequiresLogin=function isc_c_RPCManager_responseRequiresLogin(_1,_2){return false},isc.A.createRPCResponse=function isc_c_RPCManager_createRPCResponse(_1,_2,_3){var _4=isc.addProperties({operationId:_2.operation.ID,clientContext:_2.clientContext,internalClientContext:_2.internalClientContext,context:_2,transactionNum:_1.transactionNum,httpResponseCode:_1.httpResponseCode,httpResponseText:_1.httpResponseText,xmlHttpRequest:_1.xmlHttpRequest,transport:_1.transport,status:_1.status,clientOnly:_2.clientOnly},_3);if(_1.transport=="xmlHttpRequest"){isc.addProperties(_4,{httpHeaders:this.getHttpHeaders(_1.xmlHttpRequest,_1)})}
return _4},isc.A.getHttpHeaders=function isc_c_RPCManager_getHttpHeaders(_1,_2){if(_2.allClientOnly){return}
if(!_1){this.logWarn("getHttpHeaders called with a null XmlHttpRequest object");return}
if(!isc.Browser.isIE&&!_1.getAllResponseHeaders){return null}
var _3;try{_3=_1.getAllResponseHeaders()}catch(e){this.logWarn("Exception thrown by xmlHttpRequest.getAllResponseHeaders(): "+e)}
if(!_3){this.logWarn("xmlHttpRequest.getAllResponseHeaders() returned null");return null}
var _4=_3.split('\n');var _5={};for(var i=0;i<_4.length;i++){if(_4[i].replace(/^\s+|\s+$/g,'')=="")continue;var _7=_4[i].indexOf(':');if(_7==-1){this.logWarn("GetAllResponseHeaders string had malformed entry at line "+1+".  Line reads "+_4[i]);continue}
var _8=_4[i].substring(0,_7);_5[_8]=_4[i].substring(_7+1).replace(/^\s+|\s+$/g,'');if(_5[_8]=="true")_5[_8]=true;if(_5[_8]=="false")_5[_8]=false}
if(_5["X-Proxied-Set-Cookie"]!=null){_5["Set-Cookie"]=_5["X-Proxied-Set-Cookie"]}
return _5},isc.A.$89o=function isc_c_RPCManager__stripXMLTransactionTags(_1){var _2=_1.indexOf(this.$89j);if(_2!=-1){return _1.substring(_2+this.$89j.length,_1.lastIndexOf(this.$89k))}
return _1},isc.A.$89g=function isc_c_RPCManager__getXMLResponses(_1){_1=this.$89o(_1);var _2=[];var _3=0;if(_1){while(true){var _4=_1.indexOf(this.$89l,_3);if(_4==-1)break;_3=_1.indexOf(this.$89m,_4);if(_3==-1)break;_2.add(_1.substring(_4,_3+this.$89m.length))}}
return _2},isc.A.$89n=function isc_c_RPCManager__stripRestTags(_1,_2){if(!_1||!_2)return _1;var _3=_2.jsonPrefix?_1.indexOf(_2.jsonPrefix):0,_4=_2.jsonPrefix?_2.jsonPrefix.length:0,_5=_2.jsonSuffix?_1.lastIndexOf(_2.jsonSuffix):_1.length;if(_3==-1){this.logWarn("DataSource "+_2.ID+": REST response did not contain the jsonPrefix configured for this DataSource ('"+_2.jsonPrefix+"'). Response evaluation may well fail as a result. Check your server logic and/or DataSource definition.");_3=0}
if(_5==-1){this.logWarn("DataSource "+_2.ID+": REST response did not contain the jsonSuffix configured for this DataSource ('"+_2.jsonSuffix+"'). Response evaluation may well fail as a result. Check your server logic and/or DataSource definition.");_3=_1.length}
return _1.substring(_3+_4,_5)},isc.A.$39d=function isc_c_RPCManager__performTransactionReply(_1){var _2=this.getTransaction(_1);this.clearTransactionTimeout(_1);if(!_2)return;if(this.logIsDebugEnabled()){this.logDebug("Result string for transaction "+_1+": "+isc.Log.echoAll(_2.results))}
var _3;var _4=false;var _5=false,_6=false,_7=null;if(_2.operations[0]&&_2.operations[0].allowIE9Leak!=null)
{_5=_2.operations[0].allowIE9Leak}else if(isc.RPCManager.allowIE9Leak){_5=true}
if(_2.operations[0]&&_2.operations[0].useStrictJSON!=null){_6=_2.operations[0].useStrictJSON;_7=_2.operations[0].jsonReviver||_2.jsonReviver}else if(_2.useStrictJSON!=null){_6=_2.useStrictJSON;_7=_2.jsonReviver}
if(isc.Log.logIsInfoEnabled("RpcTabTiming")){_2.parseOrEvalResponseStart=isc.timeStamp()}
if(_2.transport=="scriptInclude"){}else if(isc.isAn.Array(_2.results)){_3=true}else if(_2.allClientOnly){_2.results={status:0};_2.receiveTime=isc.timeStamp()}else{var _8=_2.operations[0];if(_8&&_8.isRestRequest){var _9=isc.DataSource.get(_8.dataSource);if(_9){if(_8&&_8.dataFormat=="json"&&_9.jsonPrefix==null)
{_3=true}else{var _10=_2.results?_2.results.indexOf(_9.jsonPrefix):-1;_3=_10!=-1}
if(_3){var _11=_2.results;_11=this.$89n(_11,_9);try{if(_6){_2.results=isc.Class.parseStrictJSON(_11,_7)}else{_2.results=isc.eval("("+_11+")",(_5?false:true))}}catch(e){this.logWarn("Error evaling REST RPC response: "+e+" response text: "+_11)}}}}
if(!_3){var _12=isc.isAn.Array(_2.operations)?_2.operations[0]:null;if(_12&&_12.isRestRequest&&_2.operations.length>1){if(_12.dataFormat=="json"){this.logWarn("Found a REST request that appears to be in JSON format, but the response was not wrapped as configured by the jsonPrefix and jsonSuffix properties - aborting")
_4=true}else{_2.results=this.$89g(_2.results);_3=_2.results!=null}}}}
if(isc.Log.logIsInfoEnabled("RpcTabTiming")){_2.parseOrEvalResponseEnd=isc.timeStamp()}
var _13=_2.results;if(_3&&!isc.isAn.Array(_13))_13=[_13];var _14=_2.operations,_15=[];_2.$66n=true;this.$210b=_2.transactionNum;for(var i=0,j=0;i<_14.length;i++){var _8=_14[i];var _18;if(_3&&_8.clientOnly){_18=isc.addProperties(this.createRPCResponse(_2,_8),{isStructured:false})}else{_18=isc.addProperties(this.createRPCResponse(_2,_8),{isStructured:_3,callbackArgs:_2.transport=="scriptInclude"?_13:null,results:_3?_13[j]:_13});if(_3&&_8.isRestRequest){isc.addProperties(_18,{data:_13[j]})}
j++}
if(_4){_18.status=isc.DSResponse.INVALID_RESPONSE_FORMAT;_18.data="The server failed to return a formatted response at all."}
if(_2.$1774)_18.$1774=true;if(_18.status==null)_18.status=0;if(_18.isStructured){if(_18.results&&_18.results.errors){var _19=_18.results.errors;if(isc.isAn.Array(_19)&&_19.length==1){_19=_19[0]}}
if(_18.results&&!_8.isRestRequest){if(!_18.results.response){isc.addProperties(_18,_18.results)}else{isc.addProperties(_18,_18.results.response)}}}
_15[i]=_18;_2.responses[i]=_18}
_2.changed();if(_2.showPrompt)this.doClearPrompt(_2);var _20=0;while(_20<_14.length&&!_2.suspended&&!_2.abortCallbacks)
{var _8=_14[_20],_18=_15[_20];if(isc.DataSource){isc.DataSource.recordTimingData(_18,"Parse/eval response","start",_2.parseOrEvalResponseStart);isc.DataSource.recordTimingData(_18,"Parse/eval response","end",_2.parseOrEvalResponseEnd);isc.DataSource.recordTimingData(_18,"performOperationReply","start")}
this.performOperationReply(_8,_18);if(isc.DataSource){isc.DataSource.recordTimingData(_18,"performOperationReply","end")}
_20++}
if(!_2.suspended&&!_2.abortCallbacks){if(this.transactionComplete!=null){this.clearTransactionPendingRpcs(_2);this.transactionComplete(_2);this.clearTransaction(_1,true)}else{this.clearTransaction(_1)}}
delete _2.abortCallbacks;delete _2.$66n;delete this.$210b;if(_2.offline)this.playbackNextOfflineTransaction();if(isc.DataSource){var _21=isc.timeStamp();var _20=0;while(_20<_14.length&&!_2.suspended&&!_2.abortCallbacks)
{isc.DataSource.recordTimingData(_15[_20++],"User callback invoked","start",_21)}}
if(_2.$40c){var _22=_8.application?_8.application:this.getDefaultApplication();if(isc.isA.String(_22))_22=window[_22];_22.fireCallback(_2.$40c,"responses",[_2.responses])}
if(isc.DataSource){var _23=isc.timeStamp();var _20=0;while(_20<_14.length&&!_2.suspended&&!_2.abortCallbacks)
{isc.DataSource.recordTimingData(_15[_20],"User callback invoked","end",_23);isc.DataSource.recordTimingData(_15[_20++],"Client processing","end",_23)}}},isc.A.performOperationReply=function isc_c_RPCManager_performOperationReply(_1,_2){var _3=_2.results,_4=_1.operation;if(this.logIsInfoEnabled()){this.logInfo("rpcResponse(unstructured) results -->"+isc.Log.echoAll(_3)+"<--")}
var _5=isc.RPC.transformResponse(_2,_1,_1.data);_2=_5||_2;if(this.processLoginStatusCode(_2,_2.transactionNum))return;if(_2.isStructured&&(!_3||(_3.status<0&&_1.willHandleError!=true)||(_3.status==null&&_2.status<0&&_1.willHandleError!=true)))
{return this.$a0(_2,_1)}
return this.fireReplyCallbacks(_1,_2)},isc.A.fireReplyCallback=function isc_c_RPCManager_fireReplyCallback(_1,_2,_3,_4){var _5=_2.application?_2.application:this.getDefaultApplication();if(isc.isA.String(_5))_5=window[_5];var _6=_5.fireCallback(_1,"rpcResponse,data,rpcRequest",[_3,_4,_2]);return _6},isc.A.evalResult=function isc_c_RPCManager_evalResult(_1,_2,_3){var _4=_1.evalVars;this.logDebug("evaling result"+(_4?" with evalVars: "+isc.Log.echo(_4):""));var _5=isc.Canvas.getInstanceProperty("autoDraw");if(_1.suppressAutoDraw)isc.Canvas.setInstanceProperty("autoDraw",false);if(_3.match(/^\s*\{/)){_3="var evalText="+_3+";evalText;"}
var _6=isc.Class.evalWithVars(_3,_4);if(_1.suppressAutoDraw)isc.Canvas.setInstanceProperty("autoDraw",_5);return _6},isc.A.fireReplyCallbacks=function isc_c_RPCManager_fireReplyCallbacks(_1,_2){var _3=_1.operation,_4=_2.results,_5=_1.evalResult&&_1.transport!="scriptInclude"?this.evalResult(_1,_2,_4):null;var _6;_6=(_1.evalResult?_5:_4);_2.data=_6;var _7=this.getTransaction(_2.transactionNum);var _8=_1.callback;if(_8!=null){this.fireReplyCallback(_8,_1,_2,_6)}},isc.A.$a0=function isc_c_RPCManager__handleError(_1,_2){if(_1.ignoreError)return;if(_2.dataSource){var _3=isc.DataSource.get(_2.dataSource);if(_3&&_3.handleError){var _4=_3.handleError(_1,_2);if(_4==false)return}}
return _1.$1774?false:this.handleError(_1,_2)},isc.A.handleError=function isc_c_RPCManager_handleError(_1,_2){return this.runDefaultErrorHandling(_1,_2)},isc.A.runDefaultErrorHandling=function isc_c_RPCManager_runDefaultErrorHandling(_1,_2){var _3=(_1.context?_1.context:{}),_4;if(isc.isA.String(_1.data)){_4=_1.data;if(isc.isA.String(_4)){var _5=_4;if(_5.length>this.maxErrorMessageLength){var _6=_5.length-this.maxErrorMessageLength;_5=_5.substring(0,this.maxErrorMessageLength)+"<br><br>...("+_6+" bytes truncated - set isc.RPCManager.maxErrorMessageLength > "+this.maxErrorMessageLength+" to see more or check the Developer Console for full error)..."}
this.reportError(_5)}}else{var _7=isc.getKeyForValue(_1.status,isc.RPCResponse.errorCodes);if(isc.isA.String(_7)){if(_7.startsWith("STATUS_"))_7=_7.substring(7)}else{_7=(_1.status!=null?"error code: "+_1.status:"unknown error code")}
var _8=_1.operationId||_1.operationType,_9=_2.data,_4="",_10="";if(_9&&_9.is_ISC_RPC_DMI){if(_9.appID=="isc_builtin"){_4="Builtin RPC: "+_9.methodName+": "}else{_4="RPCDMI: appId: '"+_9.appID+"', className: '"+_9.className+"', methodName: '"+_9.methodName+"': "}}
if(_7=="MAX_FILE_SIZE_EXCEEDED"){_4+=isc.DataSource.maxFileSizeExceededMessage.evalDynamicString(this,{maxFileSize:_1.maxFileSize,uploadedFileName:String(_1.uploadedFileName).asHTML(),uploadedFileSize:_1.uploadedFileSize});_10=this.$1613}else if(_7=="FILE_REQUIRED_ERROR"){_4+=isc.DataSource.requiredFileMessage.evalDynamicString(this,{uploadedFileName:String(_1.uploadedFileName).asHTML()});_10=this.$1613}else if(_7=="VALIDATION_ERROR"){_4+="Server returned validation errors: "+String(isc.echoFull(_1.errors)).asHTML();_10=this.$1613}else{_4+="Server returned "+_7+" with no error message"+(_8?" performing operation '"+_8+"'.":".")}
this.reportError(_4,_1.stacktrace)}
this.logWarn(_4+(_10?_10:"")+" - response: "+this.echo(_1));return false},isc.A.handleTransportError=function isc_c_RPCManager_handleTransportError(_1,_2,_3,_4){},isc.A.cancelDefaultErrorHandling=function isc_c_RPCManager_cancelDefaultErrorHandling(_1){if(!_1)return;_1.$1774=true;this.logInfo("Canceled error handling for transaction #"+_1.transactionNum)},isc.A.handleLoginRequired=function isc_c_RPCManager_handleLoginRequired(_1){if(this.$39j&&this.$39j==_1)return;var _2=this.getTransaction(_1);if(_2==null)return;_1=_2.transactionNum;this.clearTransactionTimeout(_2);var _3=_2.operations[0],_4=this.createRPCResponse(_2,_3);this.logInfo("loginRequired for transaction: "+_1+(_2.containsCredentials?", transaction containsCredentials":""));if(_2.containsCredentials){if(_3.callback){_4.status=isc.RPCResponse.STATUS_LOGIN_INCORRECT;this.fireReplyCallbacks(_3,_4);this.clearTransaction(_2);return}
this.clearTransaction(_2)}
this.suspendTransaction(_2);if(this.loginRequired){_4.status=isc.RPCResponse.STATUS_LOGIN_REQUIRED;this.loginRequired(_1,_3,_4);return}
var _5=this.addParamsToURL(this.credentialsURL,{ts:new Date().getTime()});this.$39j=window.open(_5,this.loginWindowSettings)},isc.A.handleLoginSuccess=function isc_c_RPCManager_handleLoginSuccess(_1){var _2=this.getTransaction(_1);if(_2&&_2.containsCredentials){this.clearTransactionTimeout(_2);var _3=_2.operations[0];if(_3.callback){var _4=this.createRPCResponse(_2,_3,{status:isc.RPCResponse.STATUS_SUCCESS});this.fireReplyCallbacks(_3,_4);this.clearTransaction(_2);return}
this.clearTransaction(_2)}
if(this.$39j)this.$39j.close();if(this.loginSuccess&&this.loginSuccess()===false)return;this.resendTransaction()},isc.A.handleMaxLoginAttemptsExceeded=function isc_c_RPCManager_handleMaxLoginAttemptsExceeded(_1){var _2=this.getTransaction(_1);if(_2&&_2.containsCredentials){this.clearTransactionTimeout(_2);var _3=_2.operations[0];if(_3.callback){var _4=this.createRPCResponse(_2,_3,{status:isc.RPCResponse.STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED});this.fireReplyCallbacks(_3,_4);this.clearTransaction(_2);return}
this.clearTransaction(_2)}
if(this.$39j)this.$39j.close();if(this.maxLoginAttemptsExceeded)this.maxLoginAttemptsExceeded();else{var _5="Max login attempts exceeded.";if(isc.warn)isc.warn(_5);else alert(_5)}},isc.A.exportContent=function isc_c_RPCManager_exportContent(_1,_2){if(_2==null)_2={};var _3=isc.Page.getSkinDir(),_4=_3.trim("/").split("/").last(),_5=_2.exportDisplay,_6=_5==this.$1873;var _7={pdfName:_2.exportFilename||_2.pdfName||"export",skinName:_2.skinName||_4,exportCSS:_2.exportCSS,defaultSkinName:_3,exportDisplay:_5};var _8=isc.addProperties({showPrompt:false,transport:"hiddenFrame",exportResults:true,downloadResult:true,downloadToNewWindow:_6,download_filename:_5==this.$1873?_7.pdfName:null},_2);delete _8.pdfName;delete _8.skinName;delete _8.exportCSS;if(isc.Browser.isMobileSafari&&_8.downloadToNewWindow==true){var _9=_8.newDownloadWindow=_8.download_filename||"request_"+isc.timeStamp();window.open(null,_9).document.write(this.$143q)}
var _10=function(_12){isc.DMI.callBuiltin({methodName:"getPdfObject",arguments:[_12,_7],requestParams:_8})};var _11=isc.Canvas.getPrintHTML(_1,{printForExport:true},_10)},isc.A.exportImage=function isc_c_RPCManager_exportImage(_1,_2,_3){var _4=_2||{},_5=_4.exportDisplay,_6=_5!=this.$113o,_7=_5==this.$1873;var _8={downloadResult:_6,downloadToNewWindow:_7};isc.DMI.callBuiltin({methodName:"exportImage",arguments:[_1,_2],requestParams:_8,callback:function $113p(_9,_10,_11){if(_3){isc.Class.fireCallback(_3,"imageData",[_10.base64])}}})},isc.A.reportError=function isc_c_RPCManager_reportError(_1){isc.warn(_1.asHTML())},isc.A.transformResponse=function isc_c_RPCManager_transformResponse(_1,_2,_3){return _1},isc.A.transformRequest=function isc_c_RPCManager_transformRequest(_1){return _1.data},isc.A.loadScreen=function isc_c_RPCManager_loadScreen(_1,_2,_3,_4,_5){if(!_1){this.logWarn("No screen names passed in.");this.fireCallback(_2,"data",[null]);return}
if(!isc.isAn.Array(_1))_1=[_1];if(_1.length<=0){this.logWarn("No screen names passed in.");this.fireCallback(_2,"data",[null]);return}
if(!_3)_3=[];if(!isc.isAn.Array(_3))_3=[_3];var _6={};if(_5)isc.addProperties(_6,_5);if(_6.params==null)_6.params={};_6.params.screenName=_1.join(",");if(_4){isc.addProperties(_6.params,{locale:_4})}
if(_5&&_5.mockMode!=null){isc.addProperties(_6.params,{mockMode:_5.mockMode})}
if(!_6.actionURL)_6.actionURL=this.screenLoaderURL;_6.useSimpleHttp=true;var _7=this;_6.callback=function(_8,_9,_10){_7.$112r(_8,_9,_10,function(_3,_11,_12){_7.fireCallback(_2,"globals,error,idsToFree",[_3,_11,_12])},_3)};this.sendRequest(_6)},isc.A.createScreen=function isc_c_RPCManager_createScreen(_1,_2){if(!_1){this.logWarn("No screen names passed in.");return null}
if(!_2)_2=[];if(!isc.isAn.Array(_2))_2=[_2];var _3=this;var _4=_3.$112s[_1];if(!_4){return null}
return this.$112r(null,_4,null,null,_2)},isc.A.$112r=function isc_c_RPCManager__makeScreen(_1,_2,_3,_4,_5){if(!_3){_3={}};var _6=isc.Canvas.getInstanceProperty("autoDraw"),_7=_3.suppressAutoDraw==null?true:_3.suppressAutoDraw;if(_7)isc.Canvas.setInstanceProperty("autoDraw",false);var _8,_9=this;isc.$171i=true;if(_5.length==1&&_5[0]==_9.ALL_GLOBALS){_8=isc.Class.globalEvalWithCapture(_2,function(_5,_17){if(_17!=null)isc.Log.$am(_17,null,null,null,"Error when executing loaded screen");var _10=isc.Canvas.$112q(_5);var _11={};if(_7)isc.Canvas.setInstanceProperty("autoDraw",_6);_9.fireCallback(_4,"screen,rpcResponse,suppressedGlobals",[_10,_1,_11])},null,false)}else{_8=isc.Class.globalEvalAndRestore(_2,_5,function(_5,_17,_11){if(_17!=null)isc.Log.$am(_17,null,null,null,"Error when executing loaded screen");var _10=isc.Canvas.$112q(_5);if(_7)isc.Canvas.setInstanceProperty("autoDraw",_6);var _12={};var _13=isc.getKeys(_11)
for(var i=0;i<_13.length;i++){var _15=_13[i];var _16=window[_15];if(_16&&(isc.isA.Canvas(_16)||isc.isA.FormItem(_16))){_12[_15]=_16}}
_11=_12;_9.fireCallback(_4,"screen,rpcResponse,suppressedGlobals",[_10,_1,_11])},null,false,true)}
delete isc.$171i;return isc.Canvas.$112q(_8.globals)});isc.evalBoundary;isc.B.push(isc.A.cacheScreens=function isc_c_RPCManager_cacheScreens(_1,_2,_3,_4){if(!_1){this.logWarn("No screen names passed in.");this.fireCallback(_2,"data",[null]);return}
if(!isc.isAn.Array(_1))_1=[_1];if(_1.length<=0){this.logWarn("No screen names passed in.");this.fireCallback(_2,"data",[null]);return}
var _5=(_4?_4.mockMode:null);var _6={};if(_4)isc.addProperties(_6,_4);if(_6.params==null)_6.params={};_6.params.screenName=_1.join(",");if(_3){isc.addProperties(_6.params,{locale:_3})}
if(_4&&_4.mockMode!=null){isc.addProperties(_6.params,{mockMode:_4.mockMode})}
isc.addProperties(_6.params,{structuredResponse:true});if(!_6.actionURL)_6.actionURL=this.screenLoaderURL;_6.useSimpleHttp=true;var _7=this;_6.callback=function(_10,_11,_12){isc.Class.globalEvalWithCapture(_11,function(_13,_14){if(_14!=null)isc.Log.$am(_14,null,null,null,"Error when executing cache screen");if(!_7.$112s){_7.$112s={}}
var _8=isc.Class.evaluate(_11);for(var i=0;i<_8.length;i++){if(_7.$112s[_8[i].screenName]){_7.logWarn("Screen "+_8[i].screenName+" is already cached. Replacing.")}
_7.$112s[_8[i].screenName]=_8[i].source}
_7.fireCallback(_2,"data,rpcResponse",[_8,_10])},null,false)};this.sendRequest(_6)},isc.A.incrementPendingRpcs=function isc_c_RPCManager_incrementPendingRpcs(_1){if(_1.downloadResult||_1.exportResults||_1.exportToClient||(_1.exportToFileSystem&&_1.exportToClient!==false))
{return}
this.pendingRpcs++;if(_1.componentId){_1.$166l=window[_1.componentId];if(_1.$166l)_1.$166l.$166g++}},isc.A.decrementPendingRpcs=function isc_c_RPCManager_decrementPendingRpcs(_1){if(_1.downloadResult||_1.exportResults||_1.exportToClient||(_1.exportToFileSystem&&_1.exportToClient!==false))
{return}
if(_1.$166l)_1.$166l.$166g--;this.pendingRpcs--},isc.A.clearTransactionPendingRpcs=function isc_c_RPCManager_clearTransactionPendingRpcs(_1){var _2=_1.operations||[];for(var i=0;i<_2.length;i++)this.decrementPendingRpcs(_2[i])},isc.A.requestsArePending=function isc_c_RPCManager_requestsArePending(){return this.pendingRpcs!=0});isc.B._maxIndex=isc.C+97;isc.RPCManager.rpc_logMessage=isc.RPCManager.logMessage;isc.RPCManager.logMessage=function(_1,_2,_3,_4){if(this.logIsEnabledFor(_1,_3)){if(isc.isA.String(_2)&&_2.length>this.maxLogMessageLength&&!this.logIsEnabledFor(_1,"RPCManagerResponse"))
{var _5=_2.length-this.maxLogMessageLength;_2=_2.substring(0,this.maxLogMessageLength)+"\n...("+_5+" bytes truncated).  Enable RPCManagerResponse log at same threshold to see full message."}}
this.rpc_logMessage(_1,_2,_3,_4)};isc.addGlobal("InstantDataApp",isc.RPCManager);isc.isA.InstantDataApp=isc.isA.RPCManager;isc.A=isc.InstantDataApp;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.addDefaultOperation=function isc_c_InstantDataApp_addDefaultOperation(_1,_2,_3){if(!_1)_1={};_1.operation=isc.DataSource.makeDefaultOperation(_2,_3,_1.operation);return _1},isc.A.setDefaultApplication=function isc_c_InstantDataApp_setDefaultApplication(_1){isc.InstantDataApp.defaultApplication=_1},isc.A.getDefaultApplication=function isc_c_InstantDataApp_getDefaultApplication(){if(this.defaultApplication==null){this.create({ID:"builtinApplication",dataSources:[],operations:{},pointersToThis:[{object:this,property:"defaultApplication"}]})}
return this.defaultApplication},isc.A.app=function isc_c_InstantDataApp_app(){return this.getDefaultApplication()});isc.B._maxIndex=isc.C+4;isc.A=isc.InstantDataApp.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.init=function isc_InstantDataApp_init(){if(this.ID!="builtinApplication")isc.ClassFactory.addGlobalID(this);if(isc.rpc.defaultApplication==null||isc.rpc.defaultApplication.getID()=="builtinApplication")
{isc.rpc.setDefaultApplication(this)}});isc.B._maxIndex=isc.C+1;isc.defineInterface("IRPCStatusListener").addInterfaceProperties({initInterface:function(){this.observe(isc.RPCManager.$38z,"dataChanged","observer.transactionsChanged()");if(isc.Messaging){this.observe(isc.Messaging,"connectionUp","observer.messagingStatusChanged()");this.observe(isc.Messaging,"connectionDown","observer.messagingStatusChanged()")}},destroyInterface:function(){this.ignore(isc.RPCManager.$38z,"dataChanged");if(isc.Messaging){this.ignore(isc.Messaging,"connectionUp");this.ignore(isc.Messaging,"connectionDown")}},transactionsChanged:function(){},messagingStatusChanged:function(){},getActiveTransactions:function(){var _1=[];var _2=isc.RPCManager.getTransactions();for(var i=0;i<_2.length;i++){var _4=_2[i];if(_4&&!_4.cleared&&_4.operations){var _5=true;for(var j=0;j<_4.operations.length;j++){var _7=_4.operations[j];if(_7.downloadResult||_7.$38j){_5=false;break}}
if(_5)_1.add(_4)}}
return _1},haveActiveTransactions:function(){return this.getActiveTransactions().length>0}});isc.defineInterface("IRPCUnmaskedTarget").addInterfaceProperties({initInterface:function(){isc.RPCManager.registerUnmaskedTarget(this)},destroyInterface:function(){isc.RPCManager.unregisterUnmaskedTarget(this)}});isc.defineClass("UnmaskedTargetLandingPad","Canvas");isc.A=isc.UnmaskedTargetLandingPad.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.overflow="visible";isc.A.height=1;isc.A.width=1;isc.A.observationHooks=["draw","clear","moved","parentMoved","parentResized","parentVisibilityChanged"];isc.B.push(isc.A.initWidget=function isc_UnmaskedTargetLandingPad_initWidget(){this.Super("initWidget",arguments);for(var i=0;i<this.observationHooks.length;i++){this.observe(this,this.observationHooks[i],"observer.manageUnmaskedTarget()")}
this.setUnmaskedTarget(this.unmaskedTarget)},isc.A.setUnmaskedTarget=function isc_UnmaskedTargetLandingPad_setUnmaskedTarget(_1){this.unmaskedTarget=_1;if(this.unmaskedTarget){this.observe(this.unmaskedTarget,"resized","observer.manageUnmaskedTarget()")}},isc.A.manageUnmaskedTarget=function isc_UnmaskedTargetLandingPad_manageUnmaskedTarget(){if(!this.unmaskedTarget)return;if(this.isVisible()&&this.isDrawn()){if(this.getVisibleWidth()<this.unmaskedTarget.getVisibleWidth())this.setWidth(this.unmaskedTarget.getVisibleWidth());if(this.getVisibleHeight()<this.unmaskedTarget.getVisibleHeight())this.setHeight(this.unmaskedTarget.getVisibleHeight());var _1=this.getPageLeft(),_2=this.getPageTop();this.unmaskedTarget.moveTo(_1,_2);this.unmaskedTarget.bringToFront();this.unmaskedTarget.show()}else{this.unmaskedTarget.hide()}},isc.A.destroy=function isc_UnmaskedTargetLandingPad_destroy(){for(var i=0;i<this.obsevationHooks.length;i++){this.ignore(this,this.observationHooks[i])}
if(this.unmaskedTarget)this.ignore(this.unmaskedTarget,"resized");this.Super("destroy",arguments)});isc.B._maxIndex=isc.C+4;isc.defineClass("RPCStatusControl","UnmaskedTargetLandingPad");isc.A=isc.RPCStatusControl.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.statusIndicatorDefaults={_constructor:"RPCStatusMenuButton"};isc.B.push(isc.A.initWidget=function isc_RPCStatusControl_initWidget(){this.Super("initWidget",arguments);this.statusIndicator=this.createAutoChild("statusIndicator",{canCancelQueue:this.canCancelQueue,showMessagingStatus:this.showMessagingStatus});this.setUnmaskedTarget(this.statusIndicator)});isc.B._maxIndex=isc.C+1;if(isc.MenuButton){isc.defineClass("RPCStatusMenuButton","MenuButton",["IRPCStatusListener","IRPCUnmaskedTarget"]);isc.A=isc.RPCStatusMenuButton.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.width=40;isc.A.height=20;isc.A.defaultPrompt="Idle";isc.A.progressImageProperties={src:"[SKINIMG]loadingSmall.gif",width:16,height:16,extraStuff:"title='Waiting for server response'"};isc.A.noProgressImageProperties={src:"[SKINIMG]loadingSmallFrozen.gif",width:16,height:16,extraStuff:"title='No outstanding server requests'"};isc.A.messagingUpImageProperties={src:"[SKINIMG]actions/accept.png",width:16,height:16,extraStuff:"title='Real-time data streaming: UP'"};isc.A.messagingDownImageProperties={src:"[SKINIMG]actions/exclamation.png",width:16,height:16,extraStuff:"title='Real-time data streaming: DOWN'"};isc.A.canCancelQueue=false;isc.A.confirmCancelQueue=true;isc.A.cancelQueueConfirmationMessage="Cancelling a request may have unintended consequences.  You should only do this if you requested data that is taking too long to load, but not if you are saving data.<br><br> Are you sure you want to cancel this request?";isc.B.push(isc.A.cancelQueue=function isc_RPCStatusMenuButton_cancelQueue(){var _1=this.getActiveTransactions();for(var i=0;i<_1.length;i++){this.logWarn("cancel queue: "+i+" with value: "+isc.echoFull(_1[i].transactionNum));isc.RPCManager.cancelQueue(_1[i])}},isc.A.initWidget=function isc_RPCStatusMenuButton_initWidget(){if(this.showMessagingStatus)this.width+=20;this.Super("initWidget",arguments);var _1=[];_1.add({title:isc.RPCManager.defaultPrompt,isPrompt:true,enabled:false});if(this.canCancelQueue){var _2=this;_1.add({title:"Cancel all requests",icon:"[SKINIMG]actions/close.png",click:function(){if(_2.confirmCancelQueue){isc.confirm(_2.cancelQueueConfirmationMessage,function(_3){if(_3)_2.cancelQueue()})}else{_2.cancelQueue()}}})}
this.menu=isc.Menu.create({data:_1});this.menuButton=this.createAutoChild("menuButton",{menu:this.menu});this.updateState();this.addAutoChildren(this.autoChildren)},isc.A.updateState=function isc_RPCStatusMenuButton_updateState(){var _1=this.getActiveTransactions();var _2=isc.RPCManager.getTransaction(_1[_1.length-1]);var _3="";var _4=this.menu.data.find("isPrompt",true);if(_2){_3+=isc.Canvas.getImgHTML(this.progressImageProperties);if(_4)this.menu.setItemTitle(_4,_2.prompt);this.setDisabled(false)}else{_3+=isc.Canvas.getImgHTML(this.noProgressImageProperties);if(_4)this.menu.setItemTitle(_4,this.defaultPrompt);this.setDisabled(true)}
if(isc.Messaging&&this.showMessagingStatus){if(isc.Messaging.connected()){_3+=isc.Canvas.getImgHTML(this.messagingUpImageProperties)}else{_3+=isc.Canvas.getImgHTML(this.messagingDownImageProperties)}}
this.setTitle(_3)},isc.A.transactionsChanged=function isc_RPCStatusMenuButton_transactionsChanged(){this.updateState()},isc.A.messagingStatusChanged=function isc_RPCStatusMenuButton_messagingStatusChanged(){this.updateState()});isc.B._maxIndex=isc.C+5}
isc.defineClass("DMI").addClassProperties({actionURL:isc.RPCManager.actionURL,call:function(_1,_2,_3){var _4=[];for(var i=0;i<arguments.length;i++)_4[_4.length]=arguments[i];var _6={};if(isc.isAn.Object(_1)&&_4.length==1){var _7=isc.clone(_1);if(_7.requestParams){isc.addProperties(_6,this.requestParams,_7.requestParams);delete _7.requestParams;if(_7.downloadResult==true){_7.showPrompt=false;_7.transport="hiddenFrame"}}
_6.callback=_7.callback;delete _7.callback;_6.data=_7}else{_6.data={appID:_1,className:_2,methodName:_3,arguments:_4.slice(3,_4.length-1)};_6.callback=_4[_4.length-1]}
_4=_6.data.arguments;if(!isc.isAn.Array(_4)){if(_4==null)_4=[];else _4=[_4]}
_6.data.arguments=_4;_6.data.is_ISC_RPC_DMI=true;if(this.addMetaDataToQueryString){if(!_6.queryParams)_6.queryParams={};isc.addProperties(_6.queryParams,{dmi_appID:_6.data.appID,dmi_class:_6.data.className,dmi_method:_6.data.methodName})}
return isc.RPCManager.sendRequest(_6)},getURL:function(_1,_2,_3){var _4=[];for(var i=0;i<arguments.length;i++)_4[_4.length]=arguments[i];var _6={};if(isc.isAn.Object(_1)&&_4.length==1){var _7=isc.clone(_1);if(_7.requestParams){isc.addProperties(_6,this.requestParams,_7.requestParams);delete _7.requestParams;if(_7.downloadResult==true){_7.showPrompt=false;_7.transport="hiddenFrame"}}
_6.data=_7}else{_6.data={appID:_1,className:_2,methodName:_3,arguments:_4.slice(3,_4.length)}}
_4=_6.data.arguments;if(!isc.isAn.Array(_4)){if(_4==null)_4=[];else _4=[_4]}
_6.data.arguments=_4;_6.data.is_ISC_RPC_DMI=true;_6.$38j=true;_6.showPrompt=false;return isc.RPCManager.sendRequest(_6)},callTemplate:"(function(){var x = function (firstArg) { var isCall = ${isCall};var obj = {};obj.requestParams=this.requestParams;if(isc.isAn.Object(firstArg) && arguments.length == 1){isc.addProperties(obj,{appID:'${appID}',className:'${className}',methodName:'${methodName}'},firstArg);} else {var args = [];for (var i = 0; i < arguments.length; i++) args[args.length] = arguments[i];isc.addProperties(obj,{appID:'${appID}',className:'${className}',methodName:isCall?firstArg:'${methodName}',arguments:args.slice(isCall ? 1 : 0,args.length-1),callback:args[args.length-1]});}isc.DMI.call(obj);};return x})()",bind:function(_1,_2,_3,_4){if(!isc.isAn.Array(_3))_3=[_3];_4=isc.addProperties({},this.requestParams,_4);var _5={appID:_1,className:_2,methodName:"firstArg",isCall:true};var _6=isc[_2]||isc.defineClass(_2);_6.addClassProperties({requestParams:_4,call:isc.eval(this.callTemplate.evalDynamicString(this,_5))});var _7={};for(var i=0;i<_3.length;i++){var _9={appID:_1,className:_2,methodName:_3[i],isCall:false};_7[_3[i]]=isc.eval(this.callTemplate.evalDynamicString(this,_9))}
_6.addClassProperties(_7);window[_2]=_6;return _6},makeDMIMethod:function(_1,_2,_3,_4){var _5={appID:_1,className:_2,isCall:_3,methodName:_3?"firstArg":_4};return isc.eval(this.callTemplate.evalDynamicString(this,_5))},$131a:function(_1,_2,_3,_4){this.call({appID:"isc_builtin",className:"com.isomorphic.rpc.BuiltinRPC",methodName:_1,callback:_2,arguments:_3||["SmartClientLog"],requestParams:{showPrompt:false,willHandleError:true,queryParams:{isc_noLog:"1"}}})}});isc.DMI.callBuiltin=isc.DMI.makeDMIMethod("isc_builtin","builtin",true);if(isc.Browser.seleniumPresent){if(isc.Browser.isFirefox){document.addEventListener("IscSeleniumConfigureServerLogsEvent",function(_1){var _2=_1.target.getAttribute("arguments");isc.DMI.$131a("setTemporaryLogThreshold",null,_2.split(/,\s*/))},false);document.addEventListener("IscSeleniumClearServerLogsEvent",function(_1){isc.DMI.$131a("clearLogEntries")},false);document.addEventListener("IscSeleniumRequestServerLogsEvent",function(_1){var _2=_1.target.ownerDocument;isc.DMI.$131a("getLogEntries",function(_7){var _3=[],_4=_7.data;if(_4&&_4.length>0)_3=_4.getProperty("logMessage");var _5=_2.createElement("IscSeleniumCaptureLogs");_5.setAttribute("logMessages",_3.join(""));_2.documentElement.appendChild(_5);var _6=_2.createEvent("HTMLEvents");_6.initEvent("IscSeleniumServerLogsCapturedEvent",true,false);_5.dispatchEvent(_6)});isc.DMI.$131a("revertTemporaryLogThresholds")},false)}
isc.A=isc.DMI;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.configureServerLogs=function isc_c_DMI_configureServerLogs(){this.$131a("setTemporaryLogThreshold",null,arguments);return true},isc.A.clearServerLogs=function isc_c_DMI_clearServerLogs(){this.$131a("clearLogEntries");return true},isc.A.requestServerLogs=function isc_c_DMI_requestServerLogs(){delete this.$192i;this.$131a("getLogEntries",function(_2){var _1=_2.data;isc.DMI.$192i=_1&&_1.length>0?_1.getProperty("logMessage"):[]});this.$131a("revertTemporaryLogThresholds")},isc.A.receivedServerLogs=function isc_c_DMI_receivedServerLogs(){return this.$192i!=null},isc.A.getServerLogs=function isc_c_DMI_getServerLogs(){return this.$192i});isc.B._maxIndex=isc.C+5}
isc.ClassFactory.defineClass("ResultSet",null,["List","DataModel"]);isc.A=isc.ResultSet;isc.A.UNKNOWN_LENGTH=1000;isc.A.$121g=["fetchAhead","fetchMode","resultSize","fetchDelay","dataSource","criteriaPolicy","useClientSorting","useClientFiltering","updateCacheFromRequest","dropCacheOnUpdate","dropCacheOnLengthChange","disableCacheSync","progressiveLoading","shouldReorderAllRows","neverDropUpdatedRows","updatePartialCache","transformUpdateResponses"];isc.A=isc.ResultSet;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getLoadingMarker=function isc_c_ResultSet_getLoadingMarker(){return Array.LOADING},isc.A.$97o=function isc_c_ResultSet__removeNullsAndLoadings(_1){var i=0,n=0,_4=_1.length,_5=Array.LOADING;for(;i<_4;++i){var a=_1[i];if(a==null||a===_5){++n}else if(n>0){_1.splice(i-n,n);i-=n;_4-=n;n=0}}
if(n>0){_1.splice(i-n,n)}
return _1},isc.A.$121h=function isc_c_ResultSet__prepareSparseData(_1){var _2=Array.LOADING,_3=true;for(var i=_1.length;i--;){if(_1[i]==_2){_1[i]=null}else{_3=false}}
return _3});isc.B._maxIndex=isc.C+3;isc.A=isc.ResultSet.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.cachedRows=0;isc.A.fetchAhead=true;isc.A.resultSize=75;isc.A.fetchDelay=0;isc.A.useClientSorting=true;isc.A.useClientFiltering=true;isc.A.updateCacheFromRequest=true;isc.A.shouldReorderAllRows=true;isc.A.updatePartialCache=true;isc.A.alwaysRequestVisibleRows=false;isc.B.push(isc.A.addAt=function isc_ResultSet_addAt(){isc.logWarn('ResultSets are readonly. This operation (addAt) will be ignored.')},isc.A.set=function isc_ResultSet_set(){isc.logWarn('ResultSets are readonly. This operation (set) will be ignored.')},isc.A.removeAt=function isc_ResultSet_removeAt(){isc.logWarn('ResultSets are readonly. This operation (removeAt) will be ignored.')},isc.A.getImplicitCriteria=function isc_ResultSet_getImplicitCriteria(){if(!this.implicitCriteria&&!this.dbcImplicitCriteria)return null;return isc.DS.compressNestedCriteria(isc.DS.combineCriteria(isc.DataSource.copyCriteria(this.dbcImplicitCriteria),isc.DataSource.copyCriteria(this.implicitCriteria)))},isc.A.shouldUseClientSorting=function isc_ResultSet_shouldUseClientSorting(){if(!isc.RPCManager.onLine)return true;return this.useClientSorting},isc.A.shouldUseClientFiltering=function isc_ResultSet_shouldUseClientFiltering(){if(!isc.RPCManager.onLine)return true;return this.useClientFiltering},isc.A.shouldNeverDropUpdatedRows=function isc_ResultSet_shouldNeverDropUpdatedRows(){if(!isc.RPCManager.onLine)return true;return this.neverDropUpdatedRows},isc.A.shouldUpdatePartialCache=function isc_ResultSet_shouldUpdatePartialCache(){if(!isc.RPCManager.onLine)return true;return this.updatePartialCache});isc.B._maxIndex=isc.C+8;isc.A=isc.ResultSet.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.dynamicDSFieldValues=false;isc.A.$39r=0;isc.A.allMatchingRowsFetchTimeout=isc.Browser.useHighPerformanceGridTimings?200:500;isc.A.notifyOnUnchangedCache=false;isc.B.push(isc.A.init=function isc_ResultSet_init(){isc.ClassFactory.addGlobalID(this);if(this.operation!=null)this.fetchOperation=this.operation;var _1=this.getOperation("fetch");var _2=_1.dataSource;if(!isc.isAn.Array(_2))_2=[_2];for(var i=0;i<_2.length;i++){var _4=isc.DS.get(_2[i]);this.observe(_4,"dataChanged","observer.dataSourceDataChanged(dsRequest,dsResponse)");if(!this.$39s)this.$39s=[];this.$39s.add(_4);if(!this.dataSource)this.dataSource=_4}
if(!this.getDataSource()){this.logError("Invalid dataSource: "+this.echoLeaf(this.dataSource)+", a ResultSet must be created with a valid DataSource")}
this.context=isc.addProperties({},this.context,this.requestProperties);var _5=this.context;this.resultSize=_5&&_5.dataPageSize>0?_5.dataPageSize:this.resultSize;if(this.allRows){this.fetchMode="local"}else{this.fetchMode=(_5&&_5.dataFetchMode!=null?_5.dataFetchMode:this.fetchMode||"paged")}
if(this.dropCacheOnUpdate==null){this.dropCacheOnUpdate=this.$du(_1.dropCacheOnUpdate,this.getDataSource().dropCacheOnUpdate)}
this.context=this.context||{};this.$1317=[];var _6=this.criteria||this.filter||{};if(this.$121j){this.criteria=_6;this.$39t=(isc.getKeys(_6).length==0)}else{this.criteria=null;this.setCriteria(_6)}
if(this.initialData){isc.ResultSet.$121h(this.initialData);this.fillCacheData(this.initialData);this.setFullLength(this.initialLength||this.totalRows||this.initialData.length);if(this.sortSpecifiers)this.setSort(this.sortSpecifiers,true);if(this.sortBy)this.setSort(isc.DS.getSortSpecifiers(this.sortBy),true)}else if(this.isPaged()){this.$121k([])}
this.observe(isc,"goOffline",function(){this.goOffline()});this.observe(isc.RPCManager,"offlineTransactionPlaybackComplete",function(){this.offlinePlaybackComplete()})},isc.A.goOffline=function isc_ResultSet_goOffline(){},isc.A.offlinePlaybackComplete=function isc_ResultSet_offlinePlaybackComplete(){if(this.haveOfflineRecords){this.invalidateCache();this.haveOfflineRecords=false}},isc.A.destroy=function isc_ResultSet_destroy(){this.ignore(isc,"goOffline");this.ignore(isc.RPCManager,"offlineTransactionPlaybackComplete");if(this.$39s!=null){for(var i=0;i<this.$39s.length;i++){var _2=this.$39s[i];if(_2){this.ignore(_2,"dataChanged")}}}
isc.ClassFactory.dereferenceGlobalID(this);this.Super("destroy",arguments)},isc.A.getFirstUsedIndex=function isc_ResultSet_getFirstUsedIndex(){if(!this.lengthIsKnown()){return 0}else{var _1=this.localData,_2=this.$1317,_3=_2.length,k=this.$1318(0),_5=(k%2!=0),j=(k+1<_3?_2[++k]:-1);for(var i=0,_8=_1.length;i<_8;++i){if(i==j){_5=!_5;j=(k+1<_3?_2[++k]:-1)}
if(_1[i]!=null&&_5){return i}}
return 0}},isc.A.isPaged=function isc_ResultSet_isPaged(){return this.fetchMode=="paged"},isc.A.isBasic=function isc_ResultSet_isBasic(){return this.fetchMode=="basic"},isc.A.isLocal=function isc_ResultSet_isLocal(){return this.fetchMode=="local"},isc.A.allMatchingRowsCached=function isc_ResultSet_allMatchingRowsCached(_1){return(this.allRows!=null&&(!this.allRowsCriteria||this.$505))||((_1?this.localData!=null:this.lengthIsKnown())&&(!this.isPaged()||(this.allRows!=null||(this.cachedRows==this.totalRows))))},isc.A.allRowsCached=function isc_ResultSet_allRowsCached(_1){if(_1==null)_1=this.$39t;return((this.allRows!=null&&(!this.allRowsCriteria||this.$505))||(this.allMatchingRowsCached()&&_1))},isc.A.isEmpty=function isc_ResultSet_isEmpty(){if(this.isPaged()){if(this.allMatchingRowsCached()){return this.getLength()==0}else if(this.cachedRows>0)return false}
return!this.lengthIsKnown()||this.getLength()<=0},isc.A.canSortOnClient=function isc_ResultSet_canSortOnClient(){return this.shouldUseClientSorting()&&(this.allMatchingRowsCached()||(isc.Offline&&isc.Offline.isOffline()))},isc.A.canFilterOnClient=function isc_ResultSet_canFilterOnClient(){return this.shouldUseClientFiltering()&&this.allRowsCached()},isc.A.getLength=function isc_ResultSet_getLength(){var _1=this.unknownLength||isc.ResultSet.UNKNOWN_LENGTH;if(!this.lengthIsKnown())return _1;return(this.isPaged()&&!this.allRows?this.totalRows:this.localData.length)},isc.A.$121l=function isc_ResultSet__getCachedLength(){if(this.lengthIsKnown()){return this.getLength()}else if(this.localData!=null){return this.localData.length}else{return 0}},isc.A.$137f=function isc_ResultSet__getCachedRows(){return this.cachedRows},isc.A.indexOf=function isc_ResultSet_indexOf(_1,_2,_3){if(this.localData==null)return-1;if(Array.isLoading(_1))return-1;var _4=this.localData.fastIndexOf(_1,_2,_3);if(_4!=-1)return _4;return this.getDataSource().findByKeys(_1,this.localData,_2,_3)},isc.A.fastIndexOf=function isc_ResultSet_fastIndexOf(_1,_2,_3,_4){return this.indexOf(_1,_2,_3,_4)},isc.A.slideList=function isc_ResultSet_slideList(_1,_2){if(!this.allMatchingRowsCached()&&!this.shouldUpdatePartialCache()){isc.logWarn('updatePartialCache is disabled: record position will not be shifted.');return}
var _3=[],i;if(_2<0)_2=0;var _5=this.$1317,_6=_5.length,k=this.$1318(0),_8=(k%2==0),j=(k+1<_6?_5[++k]:-1);var _10=this.localData;for(i=0;i<_2;++i){if(i==j){_8=!_8;j=(k+1<_6?_5[++k]:-1)}
var _11=this.localData[i];if(_11==null&&_8){isc.logWarn('Sliding from a row position that has not yet been loaded, ignoring');return}
if(!_1.contains(_11)){_3.add(_11)}}
for(i=0;i<_1.length;++i){_3.add(_1[i])}
var _12=_10.length;for(i=_2;i<_12;++i){if(i==j){_8=!_8;j=(k+1<_6?_5[++k]:-1)}
var _11=_10[i];if(_11==null&&_8){isc.logWarn('Sliding into a row position that has not yet been loaded, ignoring');return}
if(!_1.contains(_11)){_3.add(_11)}}
this.$121k(_3);if(this.shouldUpdatePartialCache()){this.invalidateRowOrder()}
if(this.shouldReorderAllRows)this.reorderAllRows();this.dataChanged()},isc.A.reorderAllRows=function isc_ResultSet_reorderAllRows(){var i,_2=this.localData;if(!this.allRowsCached()||!this.lengthIsKnown())return;for(i=0;i<_2.length;i++)_2[i].$100o=i;var _3=0,_4=this.allRows,_5=_4.getLength();for(i=0;i<_5;i++){var _6=_4.get(i);if(_6.$100o!=null){_4.set(i,_2[_3++]);delete _6.$100o}}},isc.A.get=function isc_ResultSet_get(_1){if(!isc.isA.Number(_1)||_1<0){this.logWarn("get: invalid index "+_1);return null}
if(this.localData!=null){var _2=this.localData[_1];if(_2!=null){return _2}else if(this.$1319(_1)){return isc.ResultSet.getLoadingMarker()}}
if(this.fetchStartRow!=null&&_1>=this.fetchStartRow&&_1<=this.fetchEndRow){return Array.LOADING}
return this.getRange(_1,_1+1)[0]},isc.A.getRange=function isc_ResultSet_getRange(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;if(_1==null){this.logWarn("getRange() called with no specified range - ignoring.");return}
if(_2==null)_2=_1+1;if(this.isPaged()){return this.$39u(_1,_2,_3,_4)}
if(this.localData==null){this.$121k([]);this.setRangeLoading(_1,_2);this.$121m()}
var _5=this.localData.slice(_1,_2);var _6=isc.ResultSet.getLoadingMarker(),_7=this.$1317,_8=_7.length,k=this.$1318(_1),_10=(k%2==0),j=(k+1<_8?_7[++k]:-1);for(var i=_1;i<_2;++i){if(i==j){_10=!_10;j=(k+1<_8?_7[++k]:-1)}
if(_5[i]==null&&_10){_5[i]=_6}}
return _5},isc.A.getAllRows=function isc_ResultSet_getAllRows(){if(!this.lengthIsKnown())return[];return this.getRange(0,this.getLength())},isc.A.getAllLoadedRows=function isc_ResultSet_getAllLoadedRows(){if(!this.lengthIsKnown())return[];var _1=[];for(var i=0;i<this.getLength();i++){if(this.rowIsLoaded(i))_1.add(this.localData[i])}
return _1},isc.A.getAllVisibleRows=function isc_ResultSet_getAllVisibleRows(){if(!this.lengthIsKnown()){return null}else{return isc.ResultSet.$97o(this.localData.duplicate())}},isc.A.usingFilteredData=function isc_ResultSet_usingFilteredData(){return(this.shouldUseClientFiltering()&&this.allMatchingRowsCached()&&this.localData&&this.allRows&&(this.localData.length<this.allRows.length))},isc.A.getAllCachedRows=function isc_ResultSet_getAllCachedRows(){if(!this.lengthIsKnown()){return null}else if(!this.allRows){return this.getAllVisibleRows()}else{var _1=this.allRows.duplicate();return _1}},isc.A.getFieldValue=function isc_ResultSet_getFieldValue(_1,_2,_3,_4,_5){if(this.dynamicDSFieldValues){return this.getDataSource().getFieldValue(_1,_2,_3)}else{return isc.Canvas.$70o(_2,_3,_1,_4,true,_5)}},isc.A.duplicate=function isc_ResultSet_duplicate(){var _1=isc.ResultSet.$121g,_2={};for(var i=_1.length;i--;){var _4=_1[i];_2[_4]=this[_4]}
if(isc.isAn.Array(this.sortSpecifiers)){var _5=this.dataSource,_6=_2.sortSpecifiers=new Array(this.sortSpecifiers.getLength());for(var i=_6.length;i--;){_6[i]=isc.DataSource.getSortBy(this.sortSpecifiers[i])}}
_2.fetchOperation=this.getOperationId("fetch");_2.context=isc.addProperties({},this.context);var _7=this.localData&&this.localData.duplicate(),_8=this.allRows&&this.allRows.duplicate();_2.localData=_7;_2.totalRows=this.totalRows;_2.cachedRows=this.cachedRows;_2.$212q=this.$212q;_2.allRows=_8;_2.allRowsCriteria=isc.DataSource.copyCriteria(this.allRowsCriteria);_2.criteria=isc.DataSource.copyCriteria(this.criteria);if(this.implicitCriteria){_2.implicitCriteria=isc.DataSource.copyCriteria(this.implicitCriteria)}
_2.$121j=true;var _9=isc.ResultSet.create(_2);delete _9.$121j;return _9},isc.A.$1318=function isc_ResultSet__getLoadingRangesIndex(_1){var _2=this.$1317;var i=0,j=_2.length-1;while(i+1<j){var k=Math.floor((i+j)/2),v=_2[k];if(_1<v){j=k}else if(_1>v){i=k}else{return k}}
if(j==-1||_1<_2[i]){return i-1}else if(_1==_2[i]||_1<_2[j]){return i}else{return j}},isc.A.$1319=function isc_ResultSet__rowIsLoading(_1){return(this.$1318(_1)%2==0)},isc.A.$132a=function isc_ResultSet__firstLoadingRow(_1,_2,_3){if(!(_1<_2)){return-1}
var _4=this.$1317,j=this.$1318(_1);if(_3==(j%2==0)){return _1}else if(j+1<_4.length&&_4[j+1]<_2){return _4[j+1]}else{return-1}},isc.A.$132b=function isc_ResultSet__lastLoadingRow(_1,_2,_3){if(!(_1<_2)){return-1}
var _4=this.$1317,j=this.$1318(_2-1);if(_3==(j%2==0)){return _2-1}else if(0<=j&&_1<=_4[j]-1){return _4[j]-1}else{return-1}},isc.A.$132c=function isc_ResultSet__setRangeLoading(_1,_2,_3){if(!(0<=_1&&_1<_2)){return}
var _4=this.$1317,i=this.$1318(_1),j=this.$1318(_2-1);var _7=(_3!=(i%2==0)),_8=(_3!=(j%2==0)),_9=(_7&&0<=i&&_1==_4[i]),_10=(_8&&j+1<_4.length&&_2==_4[j+1]),_11=(!_9&&_7),_12=(!_10&&_8),_13=i+(_9?0:1),_14=(j-i+(_9?1:0)+(_10?1:0));if(_11&&_12){_4.splice(_13,_14,_1,_2)}else if(_11){_4.splice(_13,_14,_1)}else if(_12){_4.splice(_13,_14,_2)}else{_4.splice(_13,_14)}},isc.A.lengthIsKnown=function isc_ResultSet_lengthIsKnown(){return this.localData!=null&&(this.isPaged()?this.totalRows!=null:this.$212q||this.allRows!=null)},isc.A.fetchIsPending=function isc_ResultSet_fetchIsPending(){return this.$39v!=null||this.pendingActionOnPause("fetchRemoteData")||this.pendingActionOnPause("invalidateAllRowsCache")},isc.A.rowIsLoaded=function isc_ResultSet_rowIsLoaded(_1){return(this.localData!=null&&this.localData[_1]!=null)},isc.A.getCachedRow=function isc_ResultSet_getCachedRow(_1){var _2=this.localData[_1];if(_2!=null){return _2}else{return null}},isc.A.rangeIsLoaded=function isc_ResultSet_rangeIsLoaded(_1,_2){var _3=this.localData;if(_3==null){return false}
for(var i=_1;i<_2;i++){if(_3[i]==null){return false}}
return true},isc.A.findLastCached=function isc_ResultSet_findLastCached(_1,_2){if(!this.rowIsLoaded(_1))return null;var _3=this.localData;if(_2){var i=_1;while(i>=0&&_3[i]!=null){--i}
return i+1}else{var _5=this.getLength(),i=_1;while(i<_5&&_3[i]!=null){++i}
return i-1}},isc.A.getCachedRange=function isc_ResultSet_getCachedRange(_1){if(_1==null)_1=this.lastRangeStart;if(_1==null)_1=0;if(!this.rowIsLoaded(_1))return null;var _2=this.getLength();if(this.allMatchingRowsCached())return[0,_2-1];var _3=this.findLastCached(_1,true),_4=this.findLastCached(_1);return[_3,_4]},isc.A.setRangeLoading=function isc_ResultSet_setRangeLoading(_1,_2){if(this.localData==null){this.$121k([])}
this.$132c(_1,_2,true)},isc.A.fillRangeLoading=function isc_ResultSet_fillRangeLoading(_1,_2){var _3=isc.ResultSet.getLoadingMarker();for(var i=0;i<_2;i++){if(_1[i]==null){_1[i]=_3}}
return _1},isc.A.getCombinedCriteria=function isc_ResultSet_getCombinedCriteria(){return isc.DS.compressNestedCriteria(isc.DS.combineCriteria(this.getImplicitCriteria(),isc.DataSource.copyCriteria(this.criteria)))},isc.A.getServerFilter=function isc_ResultSet_getServerFilter(){if(this.isLocal())return null;return isc.shallowClone(this.criteria)},isc.A.$39w=function isc_ResultSet__fetchRemoteData(){var _1=this.fetchStartRow,_2=this.fetchEndRow;if(_1==null||_2==null)return;this.setRangeLoading(_1,_2);this.fetchStartRow=null;this.fetchEndRow=null;this.logInfo("fetching rows "+[_1,_2]+" from server");return this.fetchRemoteData(this.getServerFilter(),_1,_2)},isc.A.$121m=function isc_ResultSet__fetchAllRemoteData(){this.fetchRemoteData(this.getServerFilter())},isc.A.fetchRemoteData=function isc_ResultSet_fetchRemoteData(_1,_2,_3){if(isc.Offline.isOffline()){this.haveOfflineRecords=true}
this.$39r+=1;var _4=isc.Canvas.getById(this.componentId);var _5;if(_4&&_4.getPromptStyle)_5=_4.getPromptStyle();var _6=isc.addProperties({operationId:this.getOperationId("fetch"),startRow:_2,endRow:_3,sortBy:isc.shallowClone(this.$39x),resultSet:this,componentId:this.componentId||"(created directly)",componentContext:this.componentContext,promptStyle:_5},this.context);var _7={requestIndex:this.$39r};if(this.context&&this.context.internalClientContext){_7=isc.addProperties({},this.context.internalClientContext,_7)}
_6.internalClientContext=_7;if(this.progressiveLoading===true||this.progressiveLoading===false){_6.progressiveLoading=this.progressiveLoading}
_6.internalClientContext.$69t=_6.willHandleError;_6.willHandleError=true;if(this.rowOrderInvalid()){this.logInfo("invalidating rows on fetch due to 'add'/'update' operation  with updatePartialCache");this.invalidateRows()}
if(this.logIsDebugEnabled("fetchTrace")){this.logDebug("ResultSet server fetch with server criteria: "+this.echoFull(_1)+this.getStackTrace(),"fetchTrace")}
if(this.cachingAllData)_6.cachingAllData=true;this.$39v=this.$39r;this.getDataSource().fetchData(_1,{caller:this,methodName:"fetchRemoteDataReply"},_6)},isc.A.fetchRemoteDataReply=function(dsResponse,data,request){var index=dsResponse.internalClientContext.requestIndex;if(!this.$39y)this.$39y=0;if(index!=(this.$39y+1)&&!dsResponse.isCachedResponse){this.logInfo("server returned out-of-sequence response for fetch remote data request  - delaying processing: last processed:"+this.$39y+", returned:"+index);if(!this.$39z)this.$39z=[];this.$39z.add({dsResponse:dsResponse,data:data,request:request});return}
if(this.cachingAllData==true)delete this.cachingAllData;var newData;var hasError=dsResponse.status<0,requestWasInvalidated=index<=this.$122t;if(this.$39v==index){if(!requestWasInvalidated)this.$212q=true;delete this.$39v}
var allRowsCriteria,isAllRowsCritEmpty,context=this.$212j;if(context!=null&&(!requestWasInvalidated||context.request==index)){if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("fetchRemoteDataReply(): handling response to request "+index+" with delayed local filtering context","rsAllRows")}
this.cancelActionOnPause("invalidateAllRowsCache");this.$212j=null;if(context.request==index){if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("fetchRemoteDataReply(): received delayed response to request "+index+" with all matching rows","rsAllRows")}
if(hasError){var errorMessage="fetchRemoteDataReply(): bad all-matching-rows response";if(!requestWasInvalidated){requestWasInvalidated=true;errorMessage+="; invalidating cache";this.invalidateCache()}
this.logInfo(errorMessage,"rsAllRows")}else{if(requestWasInvalidated){if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("fetchRemoteDataReply(): treating all-matching-rows request "+context.request+" as valid and invalidating all pending requests up to "+this.$39r,"rsAllRows")}
requestWasInvalidated=false;this.$122t=this.$39r}else{this.logDebug("fetchRemoteDataReply(): received response for valid all-matching-rows request","rsAllRows")}
allRowsCriteria=context.criteria;isAllRowsCritEmpty=isc.getKeys(context.criteria).length==0}}else{if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("fetchRemoteDataReply(): got response to narrowed fetch request "+index+"; dropping all-matching-rows request "+context.request,"rsAllRows")}}}
if(requestWasInvalidated&&!this.$1283&&this.logIsInfoEnabled()){this.logInfo(request,"The ResultSet's cache was invalidated while the following request was outstanding: "+isc.echoAll(request)+", request data:"+isc.echoAll(request.data))}
if(hasError||requestWasInvalidated||dsResponse.offlineResponse){newData=[]}else{newData=dsResponse.data}
var numResults=newData.length;this.document=dsResponse.document;this.logInfo("Received "+numResults+" records from server");if(dsResponse.startRow==null)dsResponse.startRow=request.startRow;if(dsResponse.endRow==null)dsResponse.endRow=dsResponse.startRow+numResults;if(dsResponse.totalRows==null&&dsResponse.endRow<request.endRow){dsResponse.totalRows=dsResponse.endRow}
if(requestWasInvalidated){dsResponse.startRow=dsResponse.endRow;if(isc.isAn.Object(dsResponse.data))dsResponse.data=[]}
if(this.transformData){var result=this.transformData(newData,dsResponse);newData=result!=null?result:newData;if(newData.length!=numResults){this.logInfo("Transform applied, "+newData.length+" records resulted, from "+dsResponse.startRow+" to "+dsResponse.endRow);dsResponse.endRow=dsResponse.startRow+newData.length;if(dsResponse.totalRows!=null&&dsResponse.totalRows<dsResponse.endRow){dsResponse.totalRows=dsResponse.endRow}}}
if(!isc.isA.List(newData)){this.logWarn("Bad data returned, ignoring: "+this.echo(newData));return}
if(dsResponse.totalRows!=null&&dsResponse.totalRows<dsResponse.endRow){this.logWarn("fetchData callback: dsResponse.endRow set to:"+dsResponse.endRow+". dsResponse.totalRows set to:"+dsResponse.totalRows+". endRow cannot exceed total dataset size. Clamping endRow to the end of the dataset ("+dsResponse.totalRows+").");dsResponse.endRow=dsResponse.totalRows}
var startRow=dsResponse.startRow,endRow=dsResponse.endRow;this.$521();if(!requestWasInvalidated){this.$390(newData,dsResponse,isAllRowsCritEmpty);if(allRowsCriteria||isAllRowsCritEmpty){this.logInfo("fetchRemoteDataReply(): performing delayed local filtering","rsAllRows");this.$78z(this.localData,allRowsCriteria);this.filterLocalData()}}
this.$522(startRow,endRow,hasError);delete this.context.afterFlowCallback;this.$39y=index;if(this.$39z&&this.$39z.length>0){for(var i=0;i<this.$39z.length;i++){var reply=this.$39z[i];if(reply==null)continue;var requestIndex=reply.dsResponse.internalClientContext.requestIndex;if(requestIndex==(this.$39y+1)){this.logInfo("Delayed out of sequence data response being processed now "+requestIndex);this.$39z[i]=null;this.fetchRemoteDataReply(reply.dsResponse,reply.data,reply.request);break}}}
var willHandleError=request.internalClientContext.$69t;if(!willHandleError&&hasError){isc.RPCManager.$a0(dsResponse,request)}},isc.A.$390=function isc_ResultSet__handleNewData(_1,_2,_3){if(this.isLocal()){this.$1317=[];this.$78z(_1.duplicate());this.filterLocalData();return}else if(!this.isPaged()){this.$ed();this.$1317=[];this.$121k(_1.duplicate());if(this.canSortOnClient()){this.$391()}
if(this.allRowsCached(_3)){this.$78z(this.localData,this.criteria)}
this.$ee(_2.operationType);return}
var _4=_2.context;this.$ed()
if(_2.invalidateCache){this.$394()}else if(this.dropCacheOnLengthChange&&this.lengthIsKnown()&&this.totalRows!=_2.totalRows){this.logInfo("totalRows changed from "+this.totalRows+" to "+_2.totalRows+", invalidating cache");this.$394()}
if(this.localData==null){this.$121k([])}
this.setFullLength(_2.totalRows);this.fillCacheData(_1,_2.startRow);var _5=this.localData;var _6,_7;if(_2.context){_6=_2.context.startRow;_7=_2.context.endRow}
var _8=true;if(_6==null||_7==null){_8=false;_6=_2.startRow;_7=this.totalRows}
var _9=this.$1317,_10=_6+_1.length,i=_7;if(_9.length>0){var k=2*Math.ceil(this.$1318(_10)/2);i=Math.min(i,_9[k])}
if(i>_10){this.logInfo("Fetch request returned range "+[_2.startRow,(_2.startRow+_1.length)]+(_8?" differs from requested range "+[_6,_7]+". ":" but we have subsequent 'loading' markers. ")+"Assuming client/server batch size mismatch and clearing loading markers greater than "+(_2.startRow+_1.length));this.$132c(_10,i,false)}
this.logInfo("cached "+_1.getLength()+" rows, from "+_2.startRow+" to "+_2.endRow+" ("+this.totalRows+" total rows, "+this.cachedRows+" cached)");if(this.allMatchingRowsCached()){if(this.allRowsCached()){this.logInfo("Cache for entire DataSource complete")}else{this.logInfo("Cache for current criteria complete")}
if(this.canSortOnClient())this.$391()}
this.$ee(_2.operationType)},isc.A.setContext=function isc_ResultSet_setContext(_1){this.context=_1},isc.A.findByKey=function isc_ResultSet_findByKey(_1){var _2=isc.DataSource.getDataSource(this.dataSource);if(!_2)return;if(!_2.getPrimaryKeyField()||!this.lengthIsKnown())return;var _3;if(isc.isAn.Object(_1)){_3=_1}else{_3={};_3[_2.getPrimaryKeyFieldName()]=_1}
var _4=_2.findByKeys(_3,this.localData);if(_4!=null&&_4!=-1)return this.localData[_4];else return null},isc.A.setCriteria=function isc_ResultSet_setCriteria(_1){if(_1==null)_1={};var _2=this.$780(_1,null,!this.reapplyUnchangedLocalFilter);if(_2==null){if(this.localData==null&&this.allRows!=null)this.filterLocalData();this.logInfo("setCriteria: filter criteria unchanged");return false}
if(!this.getDataSource().isAdvancedCriteria(_1)){_1=isc.clone(_1)}
var _3=this.criteria;this.criteria=_1;this.$39t=(isc.getKeys(_1).length==0);this.$51w=(this.context&&this.context.textMatchStyle)?this.context.textMatchStyle:null;if(this.$212k()){this.logInfo("setCriteria: filter criteria changed with outstanding all-rows fetch; delaying filtering of local data","rsAllRows");if(!this.isLocal())this.$212l(_3)}else if(_2){this.logInfo("setCriteria: filter criteria changed, invalidating cache");this.invalidateCache()}else{this.logInfo("setCriteria: filter criteria changed, performing local filtering");if(this.allRows==null){this.$78z(this.localData,_3)}
this.filterLocalData()}
return true},isc.A.$78z=function isc_ResultSet__setAllRows(_1,_2){this.allRows=_1;var _3=this.getImplicitCriteria();if(_3&&!isc.isAn.emptyObject(_3)){_2=isc.DS.compressNestedCriteria(isc.DS.combineCriteria(_2,_3))}
this.allRowsCriteria=_2||{};this.$505=(isc.getKeys(this.allRowsCriteria).length==0)},isc.A.setFilter=function isc_ResultSet_setFilter(_1){return this.setCriteria(_1)},isc.A.getCriteria=function isc_ResultSet_getCriteria(){return this.criteria},isc.A.compareCriteria=function isc_ResultSet_compareCriteria(_1,_2,_3,_4){return this.getDataSource().compareCriteria(_1,_2,_3?_3:this.context,_4?_4:this.criteriaPolicy)},isc.A.compareSort=function isc_ResultSet_compareSort(_1,_2){if(!_1&&!_2){return true}
if(!isc.isAn.Array(_1)||!isc.isAn.Array(_2)){return false}
if(_1.length!==_2.length){return false}
if(_1.length===0&&_2.length===0){return true}
for(var i=0;i<_1.length;i++){if(_1[i].property!==_2[i].property||_1[i].direction!==_2[i].direction){return false}}
return true},isc.A.compareTextMatchStyle=function isc_ResultSet_compareTextMatchStyle(_1,_2){return this.getDataSource().compareTextMatchStyle(_1,_2)},isc.A.willFetchData=function isc_ResultSet_willFetchData(_1,_2){return(this.$780(_1,_2)==true)},isc.A.$780=function isc_ResultSet__willFetchData(_1,_2,_3){delete this.$212m;if(this.localData==null&&this.allRows==null){return true}
if(_1==null)_1={};var _4=isc.shallowClone(this.criteria||{}),_5=this.$51w,_6=this.getDataSource();var _7=this.getImplicitCriteria();if(_7){_4=isc.DS.compressNestedCriteria(isc.DS.combineCriteria(_4,_7));_1=isc.DS.compressNestedCriteria(isc.DS.combineCriteria(_1,_7))}
if(_2==null){_2=(this.context&&this.context.textMatchStyle)?this.context.textMatchStyle:null}
var _8=this.allRows&&this.shouldUseClientFiltering()&&(_4!=this.allRowsCriteria);var _9=isc.isAn.emptyObject(_4)&&!_8?0:this.compareTextMatchStyle(_2,_5);if(_9>=0){var _10=_8?this.allRowsCriteria:_4;if(_10==null)_10={};if(_6.isAdvancedCriteria(_1)&&!_6.isAdvancedCriteria(_10)){_10=isc.DataSource.convertCriteria(_10,_2)}
if(!_6.isAdvancedCriteria(_1)&&_6.isAdvancedCriteria(_10)){_1=isc.DataSource.convertCriteria(_1,_2)}
var _11=isc.addProperties({},this.context);if(_2!=null)_11.textMatchStyle=_2;var _12=this.compareCriteria(_1,_10,_11);if(_8&&_9==0&&_12>=0){if(_6.isAdvancedCriteria(_1)&&!_6.isAdvancedCriteria(_4)){_4=isc.DataSource.convertCriteria(_4,_2)}
if(this.compareCriteria(_1,_4)==0){if(_12==1&&_3)_12=0}else{if(_12==0)_12=1}}
if(_12!=0)_9=_12}
if(_9==0){return null}else{if(!this.allMatchingRowsCached(true)){return true}
if(this.isLocal()){}else if(_9==-1){var _13=!_4||isc.isAn.emptyObject(_4);if(!_13)return true}else if(_9==1){if(!this.shouldUseClientFiltering())return true}
if(!this.allMatchingRowsCached()){this.$212m=true;if(!this.isLocal())return true}
return false}},isc.A.$212k=function isc_ResultSet__shouldDelayFilterLocalData(){if(!this.$212m)return false;if(!this.isBasic())return this.isLocal();if(this.$39v==null&&this.$212j==null)return false;return this.allMatchingRowsFetchTimeout!=null},isc.A.$212l=function isc_ResultSet__scheduleDelayedCacheInvalidation(_1){if(this.$212j==null){var _2=this.$39v;if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("scheduleDelayedCacheInvalidation(): setting context for delayed filtering of local data, request "+_2,"rsAllRows")}
this.$212j={request:_2,criteria:_1}}
var _3=this.allMatchingRowsFetchTimeout;if(this.logIsDebugEnabled("rsAllRows")){this.logDebug("scheduleDelayedCacheInvalidation(): scheduling cache invalidation after a pause of "+_3+"ms; observing DBCs will fetch data","rsAllRows")}
this.fireOnPause("invalidateAllRowsCache","$212n",_3)},isc.A.$212n=function isc_ResultSet__invalidateAllRowsCache(){var _1=this.$212j;this.logInfo("invalidateAllRowsCache(): executing delayed cache invalidation","rsAllRows");this.invalidateCache();this.$212j=_1},isc.A.sortByProperty=function isc_ResultSet_sortByProperty(_1,_2,_3,_4){if(_3==null){var _5=this.getDataSource().getField(_1);if(_5)_3=_5.type}
if(this.$395==_1&&this.$392==_2&&this.$393==_3)return;var _5;if(_4){_5=_4.getField(_1);if(_5&&_5.displayField&&_5.sortByDisplayField!=false){var _6;if(_5.optionDataSource){_6=isc.DataSource.getDataSource(_5.optionDataSource)}
if(!_6||_6==isc.DataSource.getDataSource(this.dataSource)){_1=_5.displayField}}}
this.$395=_1;this.$392=_2;this.$393=_3;this.$45g=_4;if(this.isPaged()||!this.shouldUseClientSorting()){this.$39x=(this.$392?"":"-")+this.$395}
if(this.canSortOnClient()){this.$121s([_1],[_2],[_3],[_4]);if(this.allRows&&(this.localData!==this.allRows)){this.allRows.sortByProperties([_1],[_2],[_3],[_4])}
delete this.$572;delete this.$175h;delete this.$573;delete this.$574;delete this.$575;delete this.$175g;if(!this.$52z())this.dataChanged();return}
this.invalidateCache()},isc.A.unsort=function isc_ResultSet_unsort(){if(!this.allMatchingRowsCached())return false;this.$73p=[];this.$39x=[];this.$395=null;if(this.localData)this.localData.unsort();return true},isc.A.$391=function isc_ResultSet__doSort(_1){if(this.localData==null)return;if(_1){if(!this.canSortOnClient()){this.invalidateRowOrder();return}}
var _2=this.$73p||[];var _3=[],_4=[],_5=[],_6=[];for(var i=0;i<_2.length;i++){var _8=_2[i];_3[i]=_8.sortByProperty?_8.sortByProperty:_8.property;_4[i]=Array.shouldSortAscending(_8.direction);_5[i]=_8.normalizer;_6[i]=_8.context}
if(this.canSortOnClient()){if(_2&&_2.length>0){this.logInfo("doSort: sorting on properties ["+_3.join(",")+"] : directions ["+_4.join(",")+"] : full cache allows local sort");this.$121s(_3,_4,_5,_6);if(!this.$52z()){this.dataChanged()}}
return}
if(this.$1708){return false}
this.logInfo("doSort: sorting on properties ["+_3.join(",")+"] : directions ["+_4.join(",")+"] : invalidating cache");this.invalidateCache();return true},isc.A.getSort=function isc_ResultSet_getSort(){return this.$73p},isc.A.getDefaultNormalizer=function isc_ResultSet_getDefaultNormalizer(_1){var _2=this.getDataSource(),_3=_2?_2.getField(_1):null;if(_3)return _3.type},isc.A.setSort=function isc_ResultSet_setSort(_1,_2,_3){var _4=[],_5=[],_6;if(_1==null)_1=[];for(var i=0;i<_1.length;i++){var _8=_1[i];if(_8.normalizer==null){_8.normalizer=this.getDefaultNormalizer(_8.sortByProperty?_8.sortByProperty:_8.property)}
if(_8.context&&!isc.isA.String(_8.context)){var _9,_10=this.getDataSource().getField(_8.property),_6=_8.context.getField(_8.property)||_10;var _11=_6&&_6.displayField;if(_11===_9)_11=_10&&_10.displayField;var _12=_6&&_6.sortByDisplayField;if(_12===_9)_12=_10&&_10.sortByDisplayField;if(_11&&(_12!=false)){var _13=(_6&&_6.optionDataSource)||(_10&&_10.optionDataSource);if(_13){_13=isc.DataSource.getDataSource(_13)}
if(!_13||_13==isc.DataSource.getDataSource(this.dataSource)){this.logInfo("Field:"+_6.name+" has displayField:"+_11+" (with optionDataSource:"+_13+"). Sorting by displayField. Set field.sortByDisplayField to false to disable this.","sorting");_8.owningField=_8.property;if(!_8.sortByField&&!_6.sortByField){_8.property=_11}else if(!_8.sortByProperty){_8.sortByProperty=_11}}}}
if(this.isPaged()||!this.shouldUseClientSorting()){if(_8.property){_4[i]=(Array.shouldSortAscending(_8.direction)?"":"-")+_8.property}}
if(!this.$126f){if(this.$73p&&this.$73p.length>0){var _14={property:_8.property,direction:_8.direction};if(_8.normalizer!=null&&_8.normalizer!=this.getDefaultNormalizer(_8.property)&&!_8.normalizer.$249w)
{_14.normalizer=_8.normalizer}
var _15=this.$73p.findIndex(_14);if(_15==i){_5.add(_8)}}}}
if((this.$73p?this.$73p.length:0)==_1.length&&_1.length==_5.length)
{return}
this.$73p=isc.shallowClone(_1);this.$39x=isc.shallowClone(_4);if(!_2)return this.$391(_3)});isc.evalBoundary;isc.B.push(isc.A.resort=function isc_ResultSet_resort(){this.$126f=true;this.setSort(isc.shallowClone(this.$73p));delete this.$126f},isc.A.$521=function isc_ResultSet__startDataArriving(){var _1;if(this.$523===_1)this.$523=0;this.$523++},isc.A.$522=function isc_ResultSet__doneDataArriving(_1,_2,_3){if(--this.$523==0){if(!_3&&this.dataArrived)this.dataArrived(_1,_2)}},isc.A.$524=function isc_ResultSet__isDataArriving(){return(this.$523!=null&&this.$523>0)},isc.A.dataSourceDataChanged=function isc_ResultSet_dataSourceDataChanged(_1,_2){if(this.disableCacheSync)return;if(this.logIsDebugEnabled())this.logDebug("dataSource data changed firing");var _3=this.getDataSource().getUpdatedData(_1,_2,this.updateCacheFromRequest,true);if(this.transformData&&this.transformUpdateResponses!==false){var _4=this.transformData(_3,_2);_3=_4==null?_3:_4}
this.handleUpdate(_1.operationType,_3,_2.invalidateCache,_1)},isc.A.handleUpdate=function isc_ResultSet_handleUpdate(_1,_2,_3,_4){if(isc.$cv)arguments.$cw=this;var _5=(this.allMatchingRowsCached()?", allMatchingRowsCached true":(", cached rows: "+this.cachedRows+", total rows: "+this.totalRows));if(this.dropCacheOnUpdate||_3||(_1!="remove"&&!this.allMatchingRowsCached()&&!this.shouldUpdatePartialCache()))
{this.invalidateCache();return}
this.logInfo("updating cache in place after operationType: "+_1+_5);this.$ed();this.$572=_1;if(isc.isAn.Array(_2)){if(_2.length==1){this.$573=_2[0]}else if(_2.length>0){this.$175h=_2}}else if(_2!=null){this.$573=_2}
this.updateCache(_1,_2,_4);this.$ee();this.$572=this.$573=null},isc.A.$ee=function isc_ResultSet__doneChangingData(_1,_2,_3){var _4;if(!this.notifyOnUnchangedCache&&this.$573&&this.$575==null){_4=true}
var _5,_6;if(!_4&&(this.$573||this.$175g)){_1=this.$572;_5=this.$574;_6=this.$575}
if(--this.$ef==0&&!_4){this.dataChanged(_1,_5,_6,this.$573,_2,_3);delete this.$572;delete this.$175h;delete this.$574;delete this.$575;delete this.$576;delete this.$573
delete this.$175g}},isc.A.updateCache=function isc_ResultSet_updateCache(_1,_2,_3){if(_2==null)return;_1=isc.DS.$372(_1);if(this.dataSource.realtimeUpdates&&_1=="add")_1="replace";if(!isc.isAn.Array(_2))_2=[_2];if(this.logIsInfoEnabled()){var _4=(_3.componentId?" submitted by '"+_3.componentId+"'":" (no componentID) ");this.logInfo("Updating cache: operationType '"+_1+"'"+_4+","+_2.length+" rows update data"+(this.logIsDebugEnabled()?":\n"+this.echoAll(_2):""))}
switch(_1){case"remove":this.removeCacheData(_2,_3);break;case"add":this.addCacheData(_2,_3);break;case"replace":case"update":this.updateCacheData(_2,_3);break}
if(this.shouldUpdatePartialCache()&&_1!="remove"&&!this.allMatchingRowsCached())
{this.invalidateRowOrder()}
var _5=((_1=="remove")||(_1=="update"&&this.$576==null));if(this.allRows&&!this.shouldNeverDropUpdatedRows()){this.filterLocalData()}
var _6=this.$576||this.$574;if(!_5&&_6!=null){var _7=this.indexOf(_6);if(_7==-1){delete this.$575;delete this.$576;delete this.$574}else{this.$575=_7}}},isc.A.updateCacheData=function isc_ResultSet_updateCacheData(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3=this.allRows!=null,_4=(!_3&&this.isPaged()&&this.totalRows!=null),_5=(_3?this.allRows:this.localData),_6=0,_7=0,_8=0,_9=(_5==this.localData&&this.$121p!=null),_10=(_5==this.localData&&this.$121q!=null),_11=(_5==this.localData&&this.$121t!=null),_12=(_5==this.localData&&this.$121u!=null),_13=(_5==this.localData&&this.$121n!=null),_14=(_5==this.localData&&this.$121o!=null);var _15=(_3?this.allRowsCriteria:this.criteria),_16=this.shouldNeverDropUpdatedRows(),_17=this.getDataSource(),_18=_17.getPrimaryKeyFields();var _19=this.getImplicitCriteria();if(_19)_15=isc.DS.combineCriteria(_15,_19);for(var i=0,_21=_1.length;i<_21;++i){var _22=_1[i],_23=isc.applyMask(_22,_18);var _24=_17.findByKeys(_23,_5);var _25=(this.applyFilter([_22],_15,this.context).length>0);if(_24==-1){var _26=_2.data;if(isc.isAn.Array(_26))_26=_26[0];if(_26){_26=isc.applyMask(_26,_18);var _27=this.getDataSource().findByKeys(_26,_5);if(_27!=-1){this.logWarn("Update operation - submitted record with primary key value[s]:"+this.echo(_26)+" returned with modified primary key:"+this.echo(_23)+". This may indicate bad server logic. Updating cache to reflect new primary key.");_7++;var _28=_5.get(_27);if(_11){this.$121t(_28,1,_27)}
_5.removeAt(_27);if(_4){--this.totalRows}
--this.cachedRows;if(_12){this.$121u(_28,1,_27)}
delete this.$573}}
if(_25&&_5!=null){this.logInfo("updated row returned by server doesn't match any cached row,  adding as new row.  Primary key values: "+this.echo(_23)+", complete row: "+this.echo(_22));_8++;var _29=-1;if(_9){if(_5.sortUnique){_29=_5.lastIndexOf(_22)}
if(_29==-1){_5.add(_22);_29=_5.lastIndexOf(_22);_5.remove(_22)}
this.$121p(_22,1,_29)}
_5.add(_22);if(_4){++this.totalRows}
++this.cachedRows;if(_10){if(!_9){_29=_5.lastIndexOf(_22)}
this.$121q(_22,1,_29)}
if(_21==1){this.$576=_22;this.$575=_5.length-1}else{this.$175g=true}}else{}}else{if(_21==1){var _30=_5.get(_24);if(_3){if(this.applyFilter([_30],this.criteria,this.context).length==0&&this.applyFilter(_1,this.criteria,this.context).length==0)
{_30=null}}
this.$574=_30;if(_30){this.$575=this.indexOf(_30)}}else{this.$175g=true}
if(_25||_16){_6++;var _31=_5.get(_24);if(this.applyUpdatesToExistingRecord){isc.addProperties(_31,_22);var _32=this.getDataSource();var _33=_32.getFieldNames();for(var j=0;j<_33.length;j++){var _35=_33[j];if(!_22.hasOwnProperty(_35))delete _31[_35]}}else{if(_13){this.$121n(_31,1,_24,_22,1)}
_5.set(_24,_22);if(_14){this.$121o(_31,1,_24,_22,1)}}}else{if(this.logIsDebugEnabled()){this.logDebug("row dropped:\n"+this.echo(_22)+"\ndidn't match filter: "+this.echoFull(_15))}
_7++;var _31=_5.get(_24);if(_11){this.$121t(_31,1,_24)}
_5.removeAt(_24);if(_4){--this.totalRows}
--this.cachedRows;if(_12){this.$121u(_31,1,_24)}}}}
if(this.logIsDebugEnabled()){this.logDebug("updated cache: "+_8+" row(s) added, "+_6+" row(s) updated, "+_7+" row(s) removed.")}
if(!_3&&(!this.shouldUpdatePartialCache()||this.allMatchingRowsCached())&&this.canSortOnClient())
{this.$391()}},isc.A.removeCacheData=function isc_ResultSet_removeCacheData(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2=this.allRows!=null,_3=_2?this.allRows:this.localData,_4=0;var _5=(_3==this.localData&&this.isPaged()&&this.totalRows!=null);if(_3!=null){var _6=this.getDataSource(),_7=(_3==this.localData&&this.$121t!=null),_8=(_3==this.localData&&this.$121u!=null);var _9=isc.DS.combineCriteria(this.getImplicitCriteria(),this.criteria);for(var i=0,_11=_1.length;i<_11;++i){var _12=_6.findByKeys(_1[i],_3);if(_12!=-1){var _13=_3[_12];if(_11==1){if(!_2||_6.recordMatchesFilter(_13,_9,this.context))
{this.$574=_13;this.$575=this.indexOf(this.$574)}}else{this.$175g=true}
if(_7){this.$121t(_13,1,_12)}
_3.removeAt(_12);if(_5){--this.totalRows}
--this.cachedRows;if(_8){this.$121u(_13,1,_12)}
_4++}else{if(this.allMatchingRowsCached())continue;if(_6.applyFilter([_1[i]],_9,this.context).length>0){if(this.logIsDebugEnabled()){this.logDebug("removed record matches filter criteria: "+this.echo(_1[i]))}
if(this.$574==null)delete this.$573;_4++}else{if(this.logIsDebugEnabled()){this.logIsDebugEnabled("cache sync ignoring 'remove' operation, removed  row doesn't match filter criteria: "+this.echo(_1[i]))}}}}}},isc.A.addCacheData=function isc_ResultSet_addCacheData(_1){var _2;if(_1==null)return;if(!isc.isAn.Array(_1))_1=[_1];var _3;if(this.allRows==null||!this.shouldUseClientFiltering()){_3=this.applyFilter(_1,this.getCombinedCriteria(),this.context)}else{_3=_1;if(this.allRowsCriteria){_3=this.applyFilter(_3,this.allRowsCriteria,this.context)}}
var _4=_3.length,_5=false;if(_4!=_1.length){this.logInfo("Adding rows to cache, "+_4+" of "+_1.length+" rows match filter criteria")}else if(_4==1){_5=true}
var _6=this.allRows||this.localData;if(!_6)return;var _7=(_6==this.localData&&this.$121p!=null),_8=(_6==this.localData&&this.$121q!=null);var _9=(this.isPaged()&&!this.allRows&&this.totalRows!=null);var _10=(!this.allMatchingRowsCached()&&this.shouldUpdatePartialCache()),_11=_10&&this.getCachedRange();if(_11){var _12;if(_11[1]==this.getLength()-1||!this.rowIsLoaded(0)){_12=_11[1]+1}else{_12=0}
if(_7&&_4>0){this.$121p(_3,_3.length,_12)}
_6.addListAt(_3,_12);if(_9){this.totalRows+=_4}
this.cachedRows+=_4;if(_8&&_4>0){this.$121q(_3,_3.length,_12)}
if(_5)this.$575=_12;else if(_4>0)this.$175g=true}else{var _12;if(_7||_8){var _13=_6.sortUnique;for(var i=0,_15=_4;i<_15;++i){var _16=_3[i],_17=-1;if(_7){if(_13){_17=_6.lastIndexOf(_16)}
if(_17==-1){_6.add(_16,_2,true);_17=_6.lastIndexOf(_16);_6.remove(_16)}
this.$121p(_16,1,_17)}
_6.add(_16,_2,true);if(_9){++this.totalRows}
++this.cachedRows;if(_8){if(!_7){_17=_6.lastIndexOf(_16)}
this.$121q(_16,1,_17)}
if(_5){if(_17==-1){_17=_6.lastIndexOf(_16)}
_12=_17}}}else{_6.addList(_3);if(_9){this.totalRows+=_4}
this.cachedRows+=_4;if(_5)_12=_6.lastIndexOf(_3[0])}
if(_5){this.$575=_12}else if(_4>0){this.$175g=true}}
if(this.$575!=null){this.$576=_6[this.$575]}
if(this.canSortOnClient())this.$391()},isc.A.insertCacheData=function isc_ResultSet_insertCacheData(_1,_2,_3){if(!isc.isAn.Array(_1))_1=[_1];if(this.allRows&&this.allRows!=this.localData&&!_3){this.allRows.addListAt(_1,_2)}
var _4=(this.isPaged()&&this.totalRows!=null);var _5=this.localData;if(this.$121p!=null){this.$121p(_1,_1.length,_2)}
_5.addListAt(_1,_2);if(_4){this.totalRows+=_1.length}
for(var i=_1.length;i--;){if(_1[i]!=null&&!Array.isLoading(_1[i])){++this.cachedRows}}
if(this.$121q!=null){this.$121q(_1,_1.length,_2)}},isc.A.addSpecialValueRecords=function isc_ResultSet_addSpecialValueRecords(_1,_2,_3){var _4=this.allRows,_5=this.localData,_6=this.isLocal()?_4:_5,_7=false;if(_6){var _8=0;for(var i=0;i<_3.length;i++){var _10=_3[i][_1],_11=_6.findIndex(_1,_10),_12=true;if(_11>=0){do{var _13=_6.get(_11);if(_13["$128o"]){if(_11==_8){if(_2){_13[_2]=_3[i][_2]}
_8++;_12=false}else{_6.removeAt(_11)}}
_11=_6.findNextIndex(_11+1,_1,_10)}while(_11>=0)}
if(_12){var _14=!_4||_4==_5||_4.find(_1,_10);_3[i]["$128o"]=true;this.insertCacheData(_3[i],_8++,_14);_7=true}}}
return _7},isc.A.$121k=function isc_ResultSet__setLocalData(_1){var _2=this.localData,_3=(_2==null||_2.isEmpty()),_4=(_3?0:_2.length),_5=(this.lengthIsKnown()?this.getLength():_4),_6=(_1==null||_1.isEmpty()),_7=(_6?0:_1.length),_8=this.lengthIsKnown();this.localData=_1;var _9=(this.lengthIsKnown()?this.getLength():_7);this.localData=_2;var _10=_5-_4,_11=_9-_7;var _12=!(_4+_7==0&&_10==_11),_13=_12&&_5==0,_14=_12&&!_13&&_7==0&&_10>=_11,_15=_12&&!_13&&!_14;var _16,_17,_18,_19;if(_13&&(this.$121p!=null||this.$121q!=null)){if(_7==0){_18=null}else if(_11==0){_18=_1}else{_18=_1.duplicate();_18.length=_9;for(var i=_7;i<_9;++i){_18[i]=null}}
if(this.$121p!=null){this.$121p(_18,_9-_5,0)}}else if(_14&&(this.$121t!=null||this.$121u!=null)){_17=_4+_10-_11;if(_4==0){_16=null}else{_16=_2;for(var i=_4;i<_17;++i){_16[i]=null}}
if(this.$121t!=null){this.$121t(_16,_17,0)}}else if(_15&&(this.$121n!=null||this.$121o!=null)){_17=_4+Math.max(0,_10-_11);if(_4==0){_16=null}else if(_10==0){_16=_2}else{_16=_2.duplicate();_16.length=_17;for(var i=_4;i<_17;++i){_16[i]=null}}
_19=_7+Math.max(0,_11-_10);if(_7==0){_18=null}else if(_11==0){_18=_1}else{_18=_1.duplicate();_18.length=_19;for(var i=_7;i<_19;++i){_18[i]=null}}
if(this.$121n!=null){this.$121n(_16,_17,0,_18,_19)}}
this.localData=_1;if(_13&&this.$121q!=null){this.$121q(_18,_9-_5,0)}else if(_14&&this.$121u!=null){this.$121u(_16,_17,0)}else if(_15&&this.$121o!=null){this.$121o(_16,_17,0,_18,_19)}
this.$121r(_8)},isc.A.$121r=function isc_ResultSet__checkLengthIsKnown(_1){if(this.$121v!=null){var _2=this.lengthIsKnown();if(_1!=_2){this.$121v(_1,_2)}}},isc.A.$121s=function isc_ResultSet__sortLocalDataByProperties(_1,_2,_3,_4){var _5;if(isc.Browser.isFirefox&&isc.isA.ResultTree(this.$121z)&&this.$121z.isPaged()){var _6=this.$121z.$27i,_7=this.$121z.$135d,_8=this.$121z.$135e;for(var i=_3.length;i--;){if(_3[i]===_6){if(_5==null){_5=new Array(_3.length)}
_5[i]=(_2[i]?_7:_8)}}}
var _10=(this.$121w!=null),_11=this.localData.sortByProperties(_1,_2,_3,_4,_5,_10,false);if(this.shouldReorderAllRows&&this.allRows!=null)this.reorderAllRows();if(_10){if(_11!=null){var _12=this.localData;for(var i=0,_13=_12.length;i<_13;){var k=_11[i];if(i<k){var j=i+1,l=k;while(j<_13&&_11[j]==1+l){++j;++l}
var n=j-i,_18=(n>1?_12.getRange(i,j):_12[i]);this.$121w(_18,n,k,i);var _19=i-k,_20=n;for(var m=i+n;m<_13;++m){var p=_11[m];if(i<=p&&p<k){_11[m]+=n}}
i+=n}else{++i}}}}},isc.A.findFirstCachedRow=function isc_ResultSet_findFirstCachedRow(_1){for(var i=_1;i>=0;i--){if(this.localData[i]==null)return i+1}
return 0},isc.A.findLastCachedRow=function isc_ResultSet_findLastCachedRow(_1){for(var i=_1;i<this.totalRows;i++){if(this.localData[i]==null)return i-1}
return this.totalRows-1},isc.A.$39u=function isc_ResultSet__getRangePaged(_1,_2,_3,_4){if(this.$397){var _5=(this.ignoreCache?[]:this.localData)||[];return this.fillRangeLoading(_5.slice(_1,_2),_2-_1)}
this.$397=true;var _6=this.getRangePaged(_1,_2,_3,_4);delete this.$397;return _6},isc.A.getRangePaged=function isc_ResultSet_getRangePaged(_1,_2,_3,_4){if(_1<0||_2<0){this.logWarn("getRange("+_1+", "+_2+"): negative indices not supported, clamping start to 0");if(_1<0)_1=0}
if(_2<=_1){this.logDebug("getRange("+_1+", "+_2+"): returning empty list");return[]}
var _5=this.lengthIsKnown();if(!_3&&_5){var _6=this.getLength();if(_1>_6-1&&_1!=0){this.logWarn("getRange("+_1+", "+_2+"): start beyond end of rows, returning empty list");return[]}else if(_2>_6){_2=_6}}
if(this.localData==null){this.$121k([])}
if(_3){this.realCache=this.localData;this.$121k([])}
var _7=this.localData;this.lastRangeStart=_1;this.lastRangeEnd=_2;if(this.parallelFetchesRequireLengthKnown!==false&&!_5){var _8=this.$39v,_9=this.$122t;if(_9==null?_8!=null:_8>_9){if(this.logIsInfoEnabled("fetchTrace")){this.logInfo("getRange("+_1+", "+_2+"): parallel fetches are not allowed before the ResultSet length is known - not fetching")}
return this.fillRangeLoading(_7.slice(_1,_2),_2-_1)}}
var _10=this.$132a(_1,_2,false),_11=false,_12,_13;if(_10==-1){_11=false}else{var _14=_10,_15=1+this.$132b(_1,_2,false);for(var i=_14;i<_15;++i){if(_7[i]==null){_12=i;break}}
_11=(_12!=null);if(_11){for(var i=_15-1;i>=_12;--i){if(_7[i]==null){_13=i;break}}}}
if(!_11){this.logDebug("getRange("+_1+", "+_2+") satisfied from cache");return this.fillRangeLoading(_7.slice(_1,_2),_2-_1)}
var _17,_18;if(this.fetchAhead){var _19=this.$398(_1,_2,_12,_13,_3);_17=_19[0];_18=_19[1]}else{_17=_12;_18=_13+1}
if(this.alwaysRequestVisibleRows){_17=_1;_18=_2}
this.fetchStartRow=_17;this.fetchEndRow=_18;var _20;if(_4||this.fetchDelay==0){this.$39w();_20=this.fillRangeLoading(_7.slice(_1,_2),_2-_1)}else{this.fireOnPause("fetchRemoteData","$39w",this.fetchDelay);_20=this.fillRangeLoading(_7.slice(_1,_2),_2-_1)}
if(_3){this.$121k(this.realCache);this.realCache=null}
return _20},isc.A.$398=function isc_ResultSet__addFetchAhead(_1,_2,_3,_4,_5){var _6=_5?[]:this.localData,_7=_5?Number.MAX_VALUE:this.getLength(),_8=_4-_3+1,_9=Math.floor((this.resultSize-_8)/2),_10=Math.max(0,_3-_9),_11=Math.min(_7,_4+_9);var _12=this.$1317,_13=_12.length,k=this.$1318(_10),_15=(k%2==0),j=(k+1<_13?_12[++k]:-1);for(var i=_10;i<=_3;i++){if(i==j){_15=!_15;j=(k+1<_13?_12[++k]:-1)}
if(_6[i]==null||_15){break}}
_3=i;k=this.$1318(_11);_15=(k%2==0);j=(k>0?_12[--k]:-1);for(var i=_11;i>=_4;i--){if(i==j){_15=!_15;j=(k>0?_12[--k]:-1)}
if(_6[i]==null||_15){break}}
_4=i;this.logDebug("getRange("+[_1,_2]+"), cache check: "+[_10,_11]+" firstMissingRow: "+_3+" lastMissingRow: "+_4);var _18,_19;if(_3==0||(_3>_10&&_4==_11))
{this.logDebug("getRange: guessing forward scrolling");_18=_3;_19=_18+this.resultSize;if(_19<_2)_19=_2}else if(_3==_10&&_4<_11){this.logDebug("getRange: guessing backward scrolling");_19=_4+1;_18=_19-this.resultSize;if(_18<0)_18=0;if(_18>_1)_18=_1}else{this.logDebug("getRange: no scrolling direction detected");_18=_10;_19=_11+1;if(_18>_1)_18=_1;if(_19<_2)_19=_2}
k=this.$1318(_18);_15=(k%2==0);j=(k+1<_13?_12[++k]:-1);for(var i=_18;i<_10;i++){if(i==j){_15=!_15;j=(k+1<_13?_12[++k]:-1)}
if(_6[i]==null||_15)break}
_18=i;k=this.$1318(_19-1);_15=(k%2==0);j=(k>0?_12[--k]:-1);for(var i=_19-1;i>_11;i--){if(i==j){_15=!_15;j=(k>0?_12[--k]:-1)}
if(_6[i]==null||_15)break}
_19=i+1;this.logInfo("getRange("+_1+", "+_2+") will fetch from "+_18+" to "+_19);return[_18,_19]},isc.A.filterLocalData=function isc_ResultSet_filterLocalData(){if(!this.allRowsCached()&&!this.allMatchingRowsCached()){this.logWarn("filterLocalData(): local filtering is not available for this ResultSet - client-side data cache is not complete for the current set of criteria.");return}
var _1=!this.$52z()
if(_1)this.$ed();var _2=[],_3=false,_4=[],_5=this.allRows||this.localData;if(_5!=null){for(var i=0;i<_5.length;i++){if(_5[i].$128o){_3=true;_4.add(_5[i])}else if(!_3){_2=_5;break}else{_2[_2.length]=_5[i]}}}
var _7=this.applyFilter(_2,this.criteria,isc.addProperties({dataSource:this},this.context));if(_3){_7.addListAt(_4,0)}
if(this.allRows==null){this.$78z(_7,this.criteria)}
this.$121k(_7);if(this.localData!=null&&this.allRows!=null){this.logInfo("Local filter applied: "+this.localData.length+" of "+this.allRows.length+" records matched filter:"+this.echoFull(this.criteria),"localFilter")}
if(this.allRows!=null&&this.shouldUseClientSorting())this.$391();if(!this.$524()&&this.dataArrived){this.dataArrived(0,this.localData.length,true)}
if(_1)this.$ee(null,true,true)},isc.A.applyFilter=function isc_ResultSet_applyFilter(_1,_2,_3){return this.getDataSource().applyFilter(_1,_2,_3)},isc.A.getValuesList=function isc_ResultSet_getValuesList(_1){this.logInfo("asked for valuesList for property '"+_1+"'");if(this.isLocal()){if(!this.allRows){this.logWarn("asked for valuesList before data has been loaded");return[]}
var _2=this.allRows.getProperty(_1);if(!_2)return[];return _2.getUniqueItems()}
var _3=this.getCachedRange(),_4=[];for(var i=_3[0];i<=_3[1];i++){var _6=this.get(i);if(!_4.contains(_6[_1]))_4[_4.length]=_6[_1]}
return _4},isc.A.fillCacheData=function isc_ResultSet_fillCacheData(_1,_2){var _3=(this.$121v!=null),_4=_3&&this.lengthIsKnown();if(_2==null)_2=0;this.logDebug("integrating "+_1.length+" rows into cache at position "+_2);var _5=(this.localData==null);if(_5){this.$121k([])}
var _6=this.localData.length,_7=this.$121l(),_8=_1.length;this.$132c(_2,_2+_8,false);if(_8==0){_2=0}
var _9=Math.max(_7,_2+_8),_10=Math.max(0,_2-Math.min(_6,_7)),_11=Math.max(0,_9-Math.max(_6,_2+_8)),_12=_10+_11,_13=(_8>0&&_6<=_7&&_6<=_2),_14=(_8>0&&!_13);if(_12>0){var _15=Math.min(_6,_7)+_12,_16=(_14&&(this.$121n!=null||this.$121o!=null)&&this.localData.slice(_7,_6));if(_13&&this.$121p!=null){this.$121p(null,_12,_6)}else if(_14&&this.$121n!=null){this.$121n(_16,_6-_7,_7,null,_12)}
if(_5||_6<_15){this.localData.length=_15}else if(_6!=_15){this.localData=this.localData.slice(0,_7);this.localData.length=_15}
if(_13&&this.$121q!=null){this.$121q(null,_12,_6)}else if(_14&&this.$121n!=null){this.$121o(_16,_6-_7,_7,null,_12)}
_5=false;_13=_13||_14;_14=false;_6=_15;_7+=_12}
var _17=Math.min(_2,_7),_18=Math.min(_8,Math.max(0,_6-_17)),_16=(_14&&(this.$121n!=null||this.$121o!=null)&&this.localData.slice(_17,_17+_18));if(_13&&this.$121p!=null){this.$121p(_1,_8,_2)}else if(_14&&this.$121n!=null){this.$121n(_16,_18,_17,_1,_8)}
if(_5||_6<_7){this.localData.length=_9}else if(_6!=_7){this.localData=this.localData.slice(0,_7);this.localData.length=_9}
for(var i=0;i<_8;i++){var _20=_2+i,_21=this.localData[_20],_22=_1[i];if(_22!=null){++this.cachedRows}
if(_21!=null&&!Array.isLoading(_21)){--this.cachedRows}
this.localData[_20]=_22}
if(_13&&this.$121q!=null){this.$121q(_1,_8,_2)}else if(_14&&this.$121o!=null){this.$121o(_16,_18,_17,_1,_8)}
if(_3){var _23=this.lengthIsKnown();if(_4!=_23){this.$121v(_4,_23)}}
this.$212q=true;if(this.allRowsCached()){this.$78z(this.localData,this.criteria)}},isc.A.setFullLength=function isc_ResultSet_setFullLength(_1){if(!isc.isA.Number(_1))return;this.logDebug("full length set to: "+_1);var _2=this.$1317;if(_2.length>0){this.$132c(_1,_2.last(),false)}
var _3=this.isPaged(),_4=(this.localData&&this.localData.length)||0,_5=this.lengthIsKnown(),_6=(_5?Math.max(_4,this.getLength()):_4);if(_1<_6){var _7=(this.$121t!=null||this.$121u!=null),_8;if(_7&&_1<_4){_8=this.localData.slice(_1,_4);for(var i=_4;i<_6;++i){_8[i]=null}}else{_8=null}
if(this.$121t!=null){this.$121t(_8,_6-_1,_1)}
if(_3){this.totalRows=_1}
if(this.localData){this.localData=this.localData.slice(0,_1)}
if(this.$121u!=null){this.$121u(_8,_6-_1,_1)}}else{var _7=_1>_6;if(_7&&this.$121p!=null){this.$121p(null,_1-_6,_6)}
if(_3){this.totalRows=_1}
if(this.localData){this.localData.length=_1}
if(_7&&this.$121q!=null){this.$121q(null,_1-_6,_6)}}
if(this.cachedRows>_1){this.cachedRows=_1}
if(this.$121v!=null){var _10=this.lengthIsKnown();if(_5!=_10){this.$121v(_5,_10)}}
if(this.localData!=null){this.$212q=true}},isc.A.invalidateCache=function isc_ResultSet_invalidateCache(){this.cancelActionOnPause("fetchRemoteData");this.fetchStartRow=this.fetchEndRow=null;this.cancelActionOnPause("invalidateAllRowsCache");this.$212j=null;this.$122t=this.$39r;if(this.neverDropCache){isc.logWarn("invalidateCache() called on ResultSet populated with local data (not from dataSource). Ignoring.");return}
delete this.$572;delete this.$175h;delete this.$576;delete this.$573;delete this.$574;delete this.$575;delete this.$175g;this.$394();if(!this.$52z())this.dataChanged(null,null,null,null,true)},isc.A.$394=function isc_ResultSet__invalidateCache(){this.invalidateRows();delete this.$212q;this.totalRows=null;this.logInfo("Invalidating cache")},isc.A.invalidateRows=function isc_ResultSet_invalidateRows(){var _1=this.localData,_2=(_1&&_1.length)||0,_3=this.lengthIsKnown(),_4=Math.max(_2,(_3?this.getLength():_2));this.localData=null;var _5=(this.lengthIsKnown()?this.getLength():0);this.localData=_1;var _6=(_4>0&&_5==0),_7=(_2>0&&_5>0),_8;if(_6&&(this.$121t!=null||this.$121u!=null)){if(_2>0){_8=_1;for(var i=_2;i<_4;++i){_1[i]=null}}else{_8=null}
if(this.$121t!=null){this.$121t(_8,_4,0)}}else if(_7&&this.$121n!=null){this.$121n(_1,_2,0,null,_2)}
this.localData=this.allRows=null;if(_6&&this.$121u!=null){this.$121u(_8,_4,0)}else if(_7&&this.$121o!=null){this.$121o(_1,_2,0,null,_2)}
if(this.$121v!=null&&_3){this.$121v(true,false)}
this.allRowsCriteria=null;delete this.$505;this.cachedRows=0;this.$50k=null;this.$1317=[]},isc.A.invalidateRowOrder=function isc_ResultSet_invalidateRowOrder(){this.$50k=true},isc.A.rowOrderInvalid=function isc_ResultSet_rowOrderInvalid(){return this.$50k},isc.A.dataChanged=function isc_ResultSet_dataChanged(){if(this.onDataChanged)this.onDataChanged()});isc.evalBoundary;isc.B.push(isc.A.dataArrived=function isc_ResultSet_dataArrived(){},isc.A.getNewSelection=function isc_ResultSet_getNewSelection(_1){var _2=this.getDataSource().selectionClass;if(!_2)return null;return isc.ClassFactory.getClass(_2,true).create(_1)});isc.B._maxIndex=isc.C+104;isc.ResultSet.registerStringMethods({transformData:"newData,dsResponse",dataArrived:"startRow,endRow,dataFromCache",dataChanged:"operationType,originalRecord,rowNum,updateData,filterChanged,dataFromCache",$121p:"records,length,rowNum",$121q:"records,length,rowNum",$121t:"records,length,rowNum",$121u:"records,length,rowNum",$121n:"originalRecords,originalLength,rowNum,updatedRecords,updatedLength",$121o:"originalRecords,originalLength,rowNum,updatedRecords,updatedLength",$121w:"records,length,originalRowNum,updatedRowNum",$121v:"originalValue,updatedValue"});isc.ResultSet.getPrototype().toString=isc.$63a;isc.ResultSet.getPrototype().logMessage=isc.$63b;isc.ClassFactory.defineClass("LocalResultSet",isc.ResultSet);isc.A=isc.LocalResultSet.getPrototype();isc.A.fetchMode="local";isc.ClassFactory.defineClass("WindowedResultSet",isc.ResultSet);isc.ResultSet.addMethods(isc.ClassFactory.makePassthroughMethods(["find","findIndex","findNextIndex","findAllIndices","findAll","getProperty"],"localData",true,"ResultSet.${methodName} called with no cached local data. Calling code can use ResultSet.lengthIsKnown() to determine whether the ResultSet has loaded any data.","dataSource"))
isc.ClassFactory.defineClass("ResultTree",isc.Tree);isc.A=isc.ResultTree;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getLoadingMarker=function isc_c_ResultTree_getLoadingMarker(){return(isc.ResultSet!=null?isc.ResultSet.getLoadingMarker():Array.LOADING)});isc.B._maxIndex=isc.C+1;isc.A=isc.ResultTree.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.nameProperty="$399";isc.A.nodeTypeProperty="nodeType";isc.A.childTypeProperty="childType";isc.A.modelType="parent";isc.A.loadDataOnDemand=true;isc.A.autoPreserveOpenState="whenUnique";isc.A.fetchDelay=0;isc.A.fetchMode="basic";isc.A.resultSize=75;isc.A.$121y={fetchMode:"paged",$121p:function(_1,_2,_3){var _4=this.$121z,_5=this.$97q;_4.$1210(this,_5,_1,_2,_3,true)},$121q:function(_1,_2,_3){var _4=this.$121z,_5=this.$97q;_4.$1210(this,_5,_1,_2,_3,false)},$121t:function(_1,_2,_3){var _4=this.$121z,_5=this.$97q;_4.$1211(this,_5,_1,_2,_3,true)},$121u:function(_1,_2,_3){var _4=this.$121z,_5=this.$97q;_4.$1211(this,_5,_1,_2,_3,false)},$121n:function(_1,_2,_3,_4,_5){var _6=this.$121z,_7=this.$97q;_6.$1212(this,_7,_1,_2,_3,_4,_5,true)},$121o:function(_1,_2,_3,_4,_5){var _6=this.$121z,_7=this.$97q;_6.$1212(this,_7,_1,_2,_3,_4,_5,false)},$121w:function(_1,_2,_3,_4){var _5=this.$121z,_6=this.$97q;_5.$1213(this,_6,_1,_2,_3,_4)},$121v:function(_1,_2){var _3=this.$121z,_4=this.$97q;_3.$1214(this,_4,_1,_2)},applyUpdatesToExistingRecord:true};isc.A.childCountProperty="childCount";isc.A.canReturnOpenSubfoldersProperty="canReturnOpenSubfolders";isc.A.canReturnOpenFolders=false;isc.A.autoOpen="none";isc.A.defaultNewNodesToRoot=false;isc.A.updateCacheFromRequest=true;isc.B.push(isc.A.getImplicitCriteria=function isc_ResultTree_getImplicitCriteria(){if(!this.implicitCriteria&&!this.dbcImplicitCriteria)return null;return isc.DS.compressNestedCriteria(isc.DS.combineCriteria(isc.DataSource.copyCriteria(this.dbcImplicitCriteria),isc.DataSource.copyCriteria(this.implicitCriteria)))});isc.B._maxIndex=isc.C+1;isc.A=isc.ResultTree.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$864=isc.Tree.getPrototype().$864.concat(["fetchMode","dataSource","loadDataOnDemand","childCountProperty","defaultIsFolder","discardParentlessNodes","defaultNewNodesToRoot","updateCacheFromRequest","disableCacheSync","keepParentsOnFilter","serverFilterFields","canReturnOpenFolders"]);isc.A.currentFetch=0;isc.A.$131y={};isc.B.push(isc.A.add=function isc_ResultTree_add(_1,_2,_3){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only.  This operation (add) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"add",_1,_2,_3)}},isc.A.addList=function isc_ResultTree_addList(_1,_2,_3){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only.  This operation (addList) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"addList",_1,_2,_3)}},isc.A.linkNodes=function isc_ResultTree_linkNodes(_1,_2,_3,_4,_5,_6,_7){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only.  This operation (linkNodes) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"linkNodes",_1,_2,_3,_4,_5,_6,_7)}},isc.A.move=function isc_ResultTree_move(_1,_2,_3){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only.  This operation (move) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"move",_1,_2,_3)}},isc.A.remove=function isc_ResultTree_remove(_1,_2){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only.  This operation (remove) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"remove",_1,_2)}},isc.A.removeList=function isc_ResultTree_removeList(_1){if(this.isPaged()){isc.logWarn("ResultTrees with fetchMode \"paged\" are read-only.  This operation (removeList) will be ignored.")}else{return this.invokeSuper(isc.ResultTree,"removeList",_1)}},isc.A.init=function isc_ResultTree_init(_1,_2,_3,_4,_5,_6){isc.ClassFactory.addGlobalID(this);if(!this.criteria)this.criteria={};if(!this.operation)this.operation={operationType:"fetch"};if(!this.dataSource)this.dataSource=this.operation.dataSource;if(!this.operation.dataSource)this.operation.dataSource=this.dataSource;if(isc.isAn.Array(this.dataSource)){this.dataSource=this.dataSource[0];this.operation.dataSource=this.dataSource}
if(!this.isMultiDSTree()){if(!this.root)this.root=this.makeRoot();var _7=this.getTreeRelationship(this.root);var _8;if(this.rootValue===_8)this.rootValue=_7.rootValue;if(!this.loadDataOnDemand&&(this.rootValue!=null||(this.root!=null&&this.root[this.idField]!=null))&&this.discardParentlessNodes==null)
{this.discardParentlessNodes=true}
if(this.idField==null)this.idField=_7.idField;if(this.parentIdField==null)this.parentIdField=_7.parentIdField;if(_7.childrenProperty)this.childrenProperty=_7.childrenProperty;this.root[this.idField]=this.rootValue}
this.setupProperties();if(this.isPaged()){var _9=this.context;this.resultSize=_9&&_9.dataPageSize>0?_9.dataPageSize:this.resultSize;this.$121y=isc.addProperties({},this.$121y,{resultSize:this.resultSize})}
if(this.keepParentsOnFilter&&!(this.isPaged()||this.isLocal())){this.fetchMode="local"}
if(!this.loadDataOnDemand&&this.isPaged()){this.logWarn("Found loadDataOnDemand: false, but that's incompatible with fetchMode: 'paged' - setting true");this.loadDataOnDemand=true}
if(this.initialData){if("parent"==this.modelType)this.data=this.initialData;else if("children"==this.modelType)this.root=this.initialData}
var _10=isc.DataSource.getDataSource(this.dataSource);this.observe(_10,"dataChanged","observer.dataSourceDataChanged(dsRequest,dsResponse);");this.dropCacheOnUpdate=this.operation.dropCacheOnUpdate;if(this.defaultIsFolder==null)this.defaultIsFolder=this.loadDataOnDemand;this.invokeSuper(isc.ResultTree,"init",_1,_2,_3,_4,_5,_6);this.setDefaultLoadState(this.loadDataOnDemand?isc.Tree.UNLOADED:isc.Tree.LOADED)},isc.A.setupProperties=function isc_ResultTree_setupProperties(){this.invokeSuper(isc.ResultTree,"setupProperties");if(this.isPaged()){this.$1215=("_visibleDescendantsCached_"+this.ID);this.$166s=("_initialLoadingState_"+this.ID);this.$166t=("_initialLoadingFetchCount_"+this.ID)}},isc.A.duplicate=function isc_ResultTree_duplicate(_1,_2,_3){var _4=this.serverFilterFields;if(isc.isAn.Array(_4)){_4=_4.duplicate()}
var _5={};this.$1201(_5);_5.autoOpenRoot=false;var _6=isc.ResultTree.create(_5),_7=this.getRoot(),_8=this.isOpen(_7),_9=this.isFolder(_7),_10=_7[this.$111w],_11=_7[this.$1200],_12=_7[this.$1215],_13=this.getCleanNodeData(_7,false,false,_2);if(_3){var _14=isc.DataSource.getDataSource(this.dataSource);if(_14)_6.ignore(_14,"dataChanged")}
_13[_6.openProperty]=_8;_13[_6.isFolderProperty]=_9;_13[_6.$111w]=_10;_13[_6.$1200]=_11;_13[_6.$1215]=_12;this.$1216(_7,_6,_13,_2);_6.setRoot(_13);return _6},isc.A.$61g=function isc_ResultTree__getCleanNodeData(_1,_2,_3){var _4=this.$111w,_5=this.$1200,_6=this.$1215,_7=_1.openProperty,_8=_1.isFolderProperty,_9=_1.$111w,_10=_1.$1200,_11=_1.$1215;if(_2==null){return null}else if(isc.isAn.Array(_2)){var _12=new Array(_2.length);for(var i=_2.length;i--;){var _14=_2[i],_15=null;if(_14!=null){var _16=this.isOpen(_14),_17=this.isFolder(_14),_18=_14[_4],_19=_14[_5],_20=_14[_6];_15=this.getCleanNodeData(_14,false,false,_3);_15[_7]=_16;_15[_8]=_17;_15[_9]=_18;_15[_10]=_19;_15[_11]=_20}
_12[i]=_15}
return _12}else{var _16=this.isOpen(_2),_17=this.isFolder(_2),_18=_2[_4],_19=_2[_5],_20=_2[_6],_15=this.getCleanNodeData(_2,false,false,_3);_15[_7]=_16;_15[_8]=_17;_15[_9]=_18;_15[_10]=_19;_15[_11]=_20;return _15}},isc.A.$1216=function isc_ResultTree__duplicate(_1,_2,_3,_4){if(this.isLeaf(_1)){return}
var _5=this.getChildren(_1),_6=0;if(isc.isA.ResultSet(_5)){_6=_5.getLength();_3[_2.childCountProperty]=_6;var _7=_3[_2.childrenProperty]=new Array(_6);for(var i=_6;i--;){_7[i]=_5.getCachedRow(i)}}else if(isc.isAn.Array(_5)){_6=_5.length;_3[_2.childrenProperty]=_5}else if(_5){_6=1;_3[_2.childrenProperty]=[_5]}
var _9=(this.modelType==isc.Tree.PARENT),_10=this.parentIdField,_7=_3[_2.childrenProperty]=this.$61g(_2,_3[_2.childrenProperty],_4);for(var i=0;i<_6;++i){var _11=_5.getCachedRow(i);if(_11==null){continue}
if(_9){_7[i][_10]=_11[_10]}
var _12=_11[this.childrenProperty];if(_12&&!_12.isEmpty()){this.$1216(_11,_2,_7[i],_4)}}},isc.A.destroy=function isc_ResultTree_destroy(){if(this.isPaged()){this.$1217(this.getRoot(),false)}
var _1=isc.DataSource.getDataSource(this.dataSource);if(_1)this.ignore(_1,"dataChanged");this.Super("destroy",arguments)},isc.A.isLocal=function isc_ResultTree_isLocal(){return this.fetchMode=="local"},isc.A.isPaged=function isc_ResultTree_isPaged(){return this.fetchMode=="paged"},isc.A.haveCriteria=function isc_ResultTree_haveCriteria(_1){return!(_1==null||isc.isAn.emptyObject(_1)||(_1._constructor==="AdvancedCriteria"&&_1.operator==="and"&&isc.isAn.Array(_1.criteria)&&_1.criteria.length==0))},isc.A.setContext=function isc_ResultTree_setContext(_1){this.context=_1;if(this.isPaged()&&this.$122c!=null){for(var i=this.$122c.length;i--;){var _3=_1&&isc.addProperties({},_1);if(_1){delete _3.clientContext;delete _3.internalClientContext}
this.$122c[i].setContext(_3)}}},isc.A.getTreeRelationship=function isc_ResultTree_getTreeRelationship(_1){var _2=this.getChildDataSource(_1);var _3=_2.getTreeRelationship();return _3},isc.A.getChildDataSource=function isc_ResultTree_getChildDataSource(_1,_2){var _3=_1[this.childTypeProperty];if(_3!=null)return isc.DS.get(_3);var _2=_2||this.getNodeDataSource(_1);if(_2==null||!this.isMultiDSTree())return this.getRootDataSource();var _4=this.treeRelations,_5=_2.getChildDataSources();if(_4){_3=_4[_2.ID];if(_3!=null)return isc.DS.get(_3)}
if(_5!=null)return _5[0]},isc.A.getNodeDataSource=function isc_ResultTree_getNodeDataSource(_1){var _2=_1[this.nodeTypeProperty];if(_2==null){var _3=this.getParent(_1);if(_3==null){return null}else if(_3==this.root){_2=this.getRootDataSource().ID}else{_2=_3.$40a;if(_2==null)_2=this.getRootDataSource().ID}}
return isc.DS.get(_2)||this.getRootDataSource()},isc.A.isMultiDSTree=function isc_ResultTree_isMultiDSTree(){return this.multiDSTree||this.treeRelations!=null},isc.A.getRootDataSource=function isc_ResultTree_getRootDataSource(){if(this.operation&&this.operation.dataSource)return isc.DS.get(this.operation.dataSource);else return isc.DS.get(this.dataSource)},isc.A.getCriteria=function isc_ResultTree_getCriteria(_1,_2,_3){if(this.getRootDataSource()==_1)return this.criteria;return null},isc.A.getOperationId=function isc_ResultTree_getOperationId(_1,_2,_3){return this.operation?this.operation.ID:null},isc.A.$1218=function isc_ResultTree__getRelationship(_1,_2){var _3=(_1==null||_1==this.root),_4;var _5,_6;if(_3&&this.isMultiDSTree()){_5=this.getRootDataSource();_6=null;_4={childDS:_5}}else{_4=this.getTreeRelationship(_1);_5=_4.childDS;_6=_4.parentDS}
if(!this.isMultiDSTree()){_4.idField=this.idField;_4.parentIdField=this.parentIdField;_4.rootValue=_4.rootValue}
if(_2&&this.logIsDebugEnabled()){this.logDebug("parent id: "+(_3?"[root]":_1[_4.idField])+" (type: "+(_3?"[root]":(_6?_6.ID:"null"))+") has childDS: "+_5.ID+", relationship: "+this.echo(_4))}
return _4},isc.A.$1219=function isc_ResultTree__getLoadChildrenCriteria(_1,_2,_3){var _4=(_1==null||_1==this.root),_5=_2.childDS,_6=_2.parentDS,_7={};if(!this.isLocal()){_7=isc.addProperties({},this.getCriteria(_5,_6,_1));_7=isc.DS.checkEmptyCriteria(_7)||{}}else if(this.$868!=null){_7=isc.addProperties({},this.$868)}
var _8=isc.isAn.emptyObject(_7);var _9=!_8&&isc.DS.isAdvancedCriteria(_7);if(_4&&this.isMultiDSTree()){}else if(this.loadDataOnDemand||this.isPaged()){var _10=_1[_2.idField];var _11;if(_4&&_10===_11){_10=_2.rootValue}
if(!_9&&!this.useSimpleCriteriaLOD){var _12=this.context,_13=_12&&_12.hasOwnProperty("textMatchStyle")?_12.textMatchStyle:_5&&_5.defaultTextMatchStyle;if(_13!="exact"){_9=true;if(!_8)_7=isc.DS.convertCriteria(_7,_13,_2.childDS);else _7={_constructor:"AdvancedCriteria",operator:"and",criteria:[]}}}
if(_9){_7=isc.DataSource.combineCriteria(_7,{_constructor:"AdvancedCriteria",fieldName:_2.parentIdField,value:_10,operator:"equals"},"and")}else{_7[_2.parentIdField]=_10}}
if(_9){_7=isc.DS.compressNestedCriteria(_7);_7=isc.DS.checkEmptyCriteria(_7)}
return _7},isc.A.$1702=function isc_ResultTree__getPagedLineRange(_1,_2,_3){if(_1>=_2)return null
if(_3){_1=Math.max(_3.firstIndexOf(false,_1,_2),_1);_2=Math.max(_3.lastIndexOf(false,_1,_2)+1,_1+1)}
var _4=this.resultSize,_5=(_2-_1)/2,_6=(_2+_1)/2;var _7=Math.ceil(_5*2/_4);var _8=Math.floor(_6-_7*_4/2),_9=Math.floor(_6+_7*_4/2);if(_8<0){_9+=-_8;_8=0}
if(_3){var _10=_3.lastIndexOf(true,_8,_1)+1,_11=_3.firstIndexOf(true,_2,_9);if(_10>0||_11>=0){var _12=_3.lastIndexOf(true,_8-(_9-_2),_8)+1,_13=_3.firstIndexOf(true,_9,_9+(_1-_8));var _14=_12>0?_8-_12:_9-_2,_15=_13>=0?_13-_9:_1-_8;_14=_11>=0?Math.min(_14,_9-_11):0;_15=_10>0?Math.min(_15,_10-_8):0;if(_15>_14){_8+=_15;_9+=_15}else if(_14>0){_8-=_14;_9-=_14}}}
return[_8,_9]},isc.A.$193b=function isc_ResultTree__getLoadChildrenRequestPropsFromContext(_1,_2,_3,_4,_5){var _6=isc.addProperties({parentNode:_3,willHandleError:true,resultTree:this},_5,this.context);if(this.context&&this.context.internalClientContext){_4=isc.addProperties({},this.context.internalClientContext,_4)}
_6.internalClientContext=_4;var _7=this.getOperationId(_1,_2,_3);if(_7)_6.operationId=_7;return _6},isc.A.$121b=function isc_ResultTree__loadChildren(_1,_2,_3,_4){var _5=this.$1218(_1,true),_6=_5.childDS,_7=_5.parentDS;_1.$40a=_6.ID;var _8=(_1==null||_1==this.root),_9=this.$1219(_1,_5,true);if(!((_8&&this.isMultiDSTree())||this.loadDataOnDemand)){this.setDefaultLoadState(isc.Tree.LOADED)}
var _10={parentNode:_1,relationship:_5,childrenReplyCallback:_4};if(!this.$84a){_10.$84b=true;this.$84a=true}
var _11=_10.fetchCount=(++this.currentFetch);var _12=this.$193b(_6,_7,_1,_10);if(this.isPaged()){if(this.keepParentsOnFilter){_12.keepParentsOnFilter=true}
if(_1!=null&&_2!=null&&_3!=null){var _13=_1[this.childrenProperty];if(!isc.isA.ResultSet(_13)&&_2<_3){var _14=_1[this.$166s],_15=_1[this.$166t],_16=(_15!=null&&this.invalidatedFetchCount!=null&&_15<=this.invalidatedFetchCount),_17;if(_14==null||_16){_14=isc.BitSet.create();_1[this.$166s]=_14;_1[this.$166t]=_11;_17=this.$1702(_2,_3)}else{if(_4==null&&_14.all(true,_2,_3)){return}
_17=this.$1702(_2,_3,_14)}
_14.setRange((_2=_17[0]),(_3=_17[1]),true)}}
_12.startRow=_2;_12.endRow=_3;_12.sortBy=isc.shallowClone(this.$39x)}
if(_1!=null)this.setLoadState(_1,isc.Tree.LOADING);var _18=this.$124u(),_19=null;if(_18!==false){var _20=true;for(var n=_1,p=null;_20&&n!=null;n=p){p=this.getParent(n);if(p==null){_20=true}else{var c=this.getChildren(p);_20=(c.getLength()==1+c.indexOf(n))}}
_18=_20&&_18;if(_18===true||_18===false){_19={progressiveLoading:_18}}}else{_19={progressiveLoading:false}}
_6.fetchData(_9,{caller:this,methodName:"loadChildrenReply"},isc.addProperties(_12,_19))},isc.A.$172v=function isc_ResultTree__addChildren(_1,_2,_3,_4,_5,_6){if(!isc.isA.Array(_2)||_2.length==0){if(_3.status==isc.RPCResponse.STATUS_OFFLINE){this.setLoadState(_1,isc.Tree.UNLOADED);this.delayCall("closeFolder",[_1],0)}else{this.setLoadState(_1,isc.Tree.LOADED)}
if(!isc.isA.Array(_2)){if(_3.status<0){isc.RPCManager.$a0(_3,_5)}else if(_2==null){this.logWarn("passed null children; return empty List instead")}else{this.logWarn("Unexpected new node format.  Array of new nodes expected, instead found: "+this.echoLeaf(_2))}
_2=[]}}
this.$192s=_3.operationType;if(this.isPaged()){var _7=_2.length;var _8=_3.startRow!=null?_3.startRow:_5.startRow;var _9=_3.endRow!=null?_3.endRow:_8+_7;var _10=_3.totalRows==null&&_9<_5.endRow?_9:_3.totalRows;var _11=_1[this.childrenProperty];if(isc.isA.ResultSet(_11)){}else if(_9<_10&&_7>0){_1[this.childCountProperty]=_10;var _12=this.getParent(_1),_13=_12!=null&&this.$111x(_1,_12);_11=this.$1202(_1,_1[this.childrenProperty],false,true);_11.fillCacheData(_2,_8)}else{if(_11!=null){var _14=_11.getRange(_8,_9);for(var i=_14.length;i--;){this.$786(_14[i])}}
this.$27k(_2,_1,_8)}}else if(this.isMultiDSTree()){for(var i=0;i<_2.length;i++){var _16=_2[i];var _17=this.getChildDataSource(_16,_4.childDS);if(_17!=null)this.convertToFolder(_16);this.$27e(_16,_1)}}else{if(_3.status==isc.RPCResponse.STATUS_OFFLINE){this.setLoadState(_1,isc.Tree.UNLOADED);this.delayCall("closeFolder",[_1],0)}else{var _18=_6;this.$1369(_2,_4.idField,_4.parentIdField,_4.rootValue,_4.isFolderProperty,_1,_18)}}
delete this.$192s},isc.A.loadChildrenReply=function isc_ResultTree_loadChildrenReply(_1,_2,_3){var _4=_1.internalClientContext,_5=_4.parentNode;if(_5!=null&&this.isPaged()){delete _5[this.$166s];delete _5[this.$166t]}
var _6=_4.fetchCount;if(this.invalidatedFetchCount!=null&&_6<=this.invalidatedFetchCount){return}
var _7=_5,_8;while((_8=this.getParent(_7))!=null){_7=_8}
if(_7!==this.getRoot()){return}
var _9=(this.isLocal()&&this.haveCriteria(this.$869||this.criteria));var _10=_4.relationship,_11=_1.data;if(_1.status<0)_11=null;if(_1.status==isc.RPCResponse.STATUS_OFFLINE){_11=[];if(_5!=null&&!this.isRoot(_5)){isc.say(window[_3.componentId].offlineNodeMessage)}}
var _12=this;if(_9){if(!this.completeTree)this.completeTree=this.duplicate(true,true,true);_12=this.completeTree;var _13=this.getPath(_5);_5=_12.find(_13)}
_12.$172v(_5,_11,_1,_10,_3,_9);if(_9){if(this.$87a==null)this.$87a=this.$87b();this.filterLocalData()}
if(this.$87a){this.$87c(this.$87a,true);delete this.$87a}
if(_4.childrenReplyCallback){this.fireCallback(_4.childrenReplyCallback,"node",[_5],this)}
if(this.dataArrived!=null){this.dataArrived(_5)}},isc.A.setChildren=function isc_ResultTree_setChildren(_1,_2,_3){this.removeChildren(_1);if(_3==null){_3=isc.isAn.Array(_2)?_2.length:0}
this.$172v(_1,_2,{startRow:0,totalRows:_3},this.$1218(_1))},isc.A.getDataSource=function isc_ResultTree_getDataSource(){return isc.DataSource.getDataSource(this.dataSource)},isc.A.invalidateCache=function isc_ResultTree_invalidateCache(){if(!this.isLoaded(this.root))return;this.invalidatedFetchCount=this.currentFetch;this.$87a=this.$87b(true);this.$27d=0;this.setRoot(this.makeRoot(),true);if(!this.loadDataOnDemand){this.reloadChildren(this.root)}},isc.A.dataSourceDataChanged=function isc_ResultTree_dataSourceDataChanged(_1,_2){if(this.disableCacheSync)return;var _3=isc.DataSource.getUpdatedData(_1,_2,this.updateCacheFromRequest,true);this.handleUpdate(_1.operationType,_3,_2.invalidateCache)},isc.A.handleUpdate=function isc_ResultTree_handleUpdate(_1,_2,_3){if(isc.$cv)arguments.$cw=this;var _4=(this.dropCacheOnUpdate||_3||(this.isPaged()&&this.keepParentsOnFilter));if(_4){this.invalidateCache();if(!this.getDataSource().canQueueRequests)this.dataChanged();return}
this.updateCache(_1,_2);this.dataChanged(_1)},isc.A.updateCache=function isc_ResultTree_updateCache(_1,_2){if(_2==null)return;_1=isc.DS.$372(_1);if(!isc.isAn.Array(_2))_2=[_2];if(this.logIsInfoEnabled()){this.logInfo("Updating cache: operationType '"+_1+"', "+_2.length+" rows update data"+(this.logIsDebugEnabled()?":\n"+this.echoAll(_2):""))}
switch(_1){case"remove":this.removeCacheData(_2);break;case"add":this.addCacheData(_2);break;case"replace":case"update":this.updateCacheData(_2);break}},isc.A.$186a=function isc_ResultTree__sortUpdateDataAncestorsLast(_1){var _2={},_3=this.idField;for(var i=0;i<_1.length;i++){var _5=_1[i];if(!_5)continue;var _6=_5[_3];if(_6!=null)_2[_6]=i}
var _7=this.parentIdField;for(var i=_1.length-1;i>=0;i--){var _5=_1[i],_8=_5[_7],_9=_2[_8];if(_9!=null&&_9<i){_1[i]=_1[_9];_1[_9]=_5;_2[_5[_3]]=_9;_2[_8]=i++}}},isc.A.$186b=function isc_ResultTree__addValidParentsAndSort(_1,_2){this.$186a(_1);var _3={},_4=this.idField;for(var i=0;i<_2.length;i++){var _6=_2[i];if(!_6)continue;var _7=_6[_4];if(_7!=null)_3[_7]=_6}
var _8={},_9=this.parentIdField;for(var i=0;i<_1.length;i++){var _10=_1[i];_7=_10[_4];if(_7!=null)_8[_7]=_10}
for(var i=0;i<_1.length;i++){var _10=_1[i],_11=_10[_9];if(_11!=null&&!_8[_11]&&_3[_11]){_1.add((_8[_11]=_3[_11]))}}},isc.A.addCacheData=function isc_ResultTree_addCacheData(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2,_3=(this.$87d||this.criteria),_4=this.haveCriteria(_3),_5=this.getDataSource().getPrimaryKeyFieldNames()[0],_6=this.idField||_5,_7=(this.idField!=_2&&this.parentIdField!=_2);if(this.completeTree)for(var i=0;i<_1.length;i++){var _9=_1[i];if(_7&&_9!=null&&_9[this.idField]==_9[this.parentIdField])
{this.logWarn("Invalid attempt to add a node that is specified to be its own parent (the '"+this.idField+"' + and '"+this.parentIdField+"' properties of the node are both set to "+(_9[this.idField]==null?"null":_9[this.idField].toString())+").  Skipping this node.");continue}
this.$651(this.completeTree,_9,_6)}
var _10=this.getDataSource().applyFilter(_1,_3,this.context);if(this.keepParentsOnFilter&&_4){this.$186b(_10,_1)}
this.logInfo("Adding rows to cache: "+_10.length+" of "+_1.length+" rows match filter criteria");for(var i=_10.length-1;i>=0;i--){var _9=_10[i];if(_7&&_9!=null&&_9[this.idField]==_9[this.parentIdField])
{if(!this.completeTree)this.logWarn("Invalid attempt to add a node that is specified to be its own parent (the '"+this.idField+"' + and '"+this.parentIdField+"' properties of the node are both set to "+(_9[this.idField]==null?"null":_9[this.idField].toString())+").  Skipping this node.");continue}
this.$651(this,_9,_6)}},isc.A.$651=function isc_ResultTree__addNodeToCache(_1,_2,_3){var _4=_2[this.parentIdField],_5;if(_4!=null)_5=_1.find(_3,_4);else{if(this.defaultNewNodesToRoot||_1.rootValue==null)_5=_1.getRoot();else _5=null}
var _6=(_5!=null&&(_1.getLoadState(_5)==isc.Tree.LOADED)&&!(this.isPaged()&&isc.isA.ResultSet(this.getChildren(_5))));if(_6){_2=isc.clone(_2);_1.$27e(_2,_5)}
return _6},isc.A.updateCacheData=function isc_ResultTree_updateCacheData(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2={addedRows:0,updatedRows:0,removedRows:0};var _3=(this.$87d||this.criteria),_4=this.haveCriteria(_3);var _5,_6,_7=(this.idField!=_5&&this.parentIdField!=_5),_8=this.getDataSource();if(this.keepParentsOnFilter&&_4){_6=[];this.$186a(_1)}
for(var i=_1.length-1;i>=0;i--){var _10=_1[i],_11=_4?_8.$1859([_10],_3,this.context):true;if(this.logIsDebugEnabled()&&!_11){this.logDebug("updated node :\n"+this.echo(_10)+"\ndidn't match filter: "+this.echo(_3))}
if(_10==null){continue}
if(_7&&_10[this.idField]==_10[this.parentIdField])
{this.logWarn("Invalid attempt to update a node where the '"+this.idField+"' and '"+this.parentIdField+"' properties of the record are both set to "+(_10[this.idField]==null?"null":_10[this.idField].toString())+" (this would reparent the node to itself).  Skipping this node.");continue}
if(this.completeTree){this.$87e(this.completeTree,_10,true)}
this.$87e(this,_10,_11,_3,_6,_2)}
if(_6){for(var i=0;i<_6.length;i++){var _12=_6[i];if(!_12)continue;var _13=_12[this.childrenProperty];if(_13==null||_13.isEmpty()){var _14=this.getParent(_12);if(_14&&!_8.$1859([_14],_3,this.context)){_6.add(_14)}
this.$786(_12);_2.removedRows++}}}
if(this.logIsDebugEnabled()){this.logDebug("updated cache: "+_2.addedRows+" row(s) added, "+_2.updatedRows+" row(s) updated, "+_2.removedRows+" row(s) removed.")}},isc.A.$87e=function isc_ResultTree__updateNodeInCache(_1,_2,_3,_4,_5,_6){var _7=this.getDataSource(),_8=_7.getPrimaryKeyFieldNames()[0],_9=this.idField||_8,_10=_1.find(_9,_2[_9]);if(_10==null){if(_3||_5){if(this.$651(_1,_2,_9)){if(!_3)_5.add(_1.find(_9,_2[_9]));this.logInfo("updated row returned by server doesn't match any cached row,  adding as new row.  idField value: "+this.echo(_2[_9])+", complete row: "+this.echo(_2));if(_6)_6.addedRows++}}
return}
var _11=this.isPaged(),_12=_11&&this.getChildren(this.getParent(_10));if(_3||_5){if(_2[this.parentIdField]!=_10[this.parentIdField]){var _13=_1.find(this.idField,_2[this.parentIdField]);if(_13==null&&(this.defaultNewNodesToRoot||this.rootValue==null))
{_13=_1.getRoot()}
if(_13==null||(_1.getLoadState(_13)!=isc.Tree.LOADED)){if(!(_11&&isc.isA.ResultSet(_12))){_1.$786(_10);if(_6)_6.removedRows++}
return}else{var _14=_11&&this.getChildren(_13),_15=!(_11&&isc.isA.ResultSet(_14)),_16=!(_11&&isc.isA.ResultSet(_12));if(_16&&_5){var _17=_1.find(this.idField,_10[this.parentIdField]);if(!_7.$1859([_17],_4,this.context)){_5.add(_17)}}
if(_15&&_16){_1.$1083(_10,_13)}else if(_15){_1.$27e(_10,_13)}else if(_16){_1.$786(_10)}}}
isc.addProperties(_10,_2);var _18=_7.getFieldNames();for(var i=0;i<_18.length;i++){var _20=_18[i];if(!_2.hasOwnProperty(_20))delete _10[_20]}
if(!_3)_5.add(_10);if(_6)_6.updatedRows++}else if(!(_11&&isc.isA.ResultSet(_12))){_1.$786(_10);if(_6)_6.removedRows++}},isc.A.removeCacheData=function isc_ResultTree_removeCacheData(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2=this.getDataSource().getPrimaryKeyFieldNames()[0],_3=this.idField||_2,_4=(this.$87d||this.criteria),_5=this.haveCriteria(_4);if(this.completeTree){this.$87f(this.completeTree,_1,_3)}
this.$87f(this,_1,_3,this.keepParentsOnFilter&&_5?_4:null)},isc.A.$87f=function isc_ResultTree__removeNodesFromCache(_1,_2,_3,_4){var _5=this.isPaged(),_6=[];for(var i=0;i<_2.length;i++){var _8=_1.find(_3,_2[i][_3]);if(_8==null){this.logWarn("Cache synch: couldn't find deleted node:"+this.echo(_2[i]))}else if(!(_5&&isc.isA.ResultSet(this.getChildren(this.getParent(_8))))){_6.add(_8)}}
if(_4){var _9=_1.getDataSource();for(var i=0;i<_6.length;i++){var _8=_6[i],_10=_1.getParent(_8);_1.$786(_8);if(_10){var _11=_10[_1.childrenProperty];if((_11==null||_11.isEmpty())&&!_9.$1859([_10],_4,_1.context))
{_6.add(_10)}}}}else{_1.$137c(_6)}},isc.A.getTitle=function isc_ResultTree_getTitle(_1){var _2=this.getNodeDataSource(_1);if(!_2)return"root";var _3=_1[_2.getTitleField()];if(_3!=null)return _3;return this.Super("getTitle",arguments)},isc.A.indexOf=function isc_ResultTree_indexOf(_1,_2,_3,_4,_5){var _6=this.getDataSource().getPrimaryKeyFieldNames();for(var i=0;i<_6.length;i++){var _8=_6[i];if(_1[_8]!=null)return this.findNextIndex(_2,_8,_1[_8],_3,true)}
return this.invokeSuper(isc.ResultTree,"indexOf",_1,_2,_3,_4,_5)},isc.A.contains=function isc_ResultTree_contains(_1,_2,_3){var _4;if(this.isPaged()&&_1!=null&&_2===_4&&_3===_4){var _5=this.idField;return(_1[this.treeProperty]==this.ID&&this.nodeIndex[_1[_5]]==_1)}else{return this.invokeSuper(isc.ResultTree,"contains",_1,_2,_3)}},isc.A.getLength=function isc_ResultTree_getLength(){var _1=this.invokeSuper(isc.ResultTree,"getLength");if(this.isPaged()&&this.$122c!=null){var _2=this.getRoot(),_3=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0);for(var i=this.$122c.length;i--;){var _5=this.$122c[i],_6=_5.$97q,_7=(_6[this.canReturnOpenSubfoldersProperty]!=null?_6[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_8=!(_7||_3==0);if(!_8){var _9=true;for(var p=_6;_9&&p!=_2;p=this.getParent(p)){_9=p!=null&&this.isOpen(p)}
if(_9){_1+=Math.max(0,_5.$121l()-_5.$137f())}}}}
return _1},isc.A.get=function isc_ResultTree_get(_1,_2){if(_1<0){var _3;return _3}else{return this.getRange(_1,_1+1,!!_2)[0]}},isc.A.getCachedRow=function isc_ResultTree_getCachedRow(_1){if(_1<0){return null}else{var _2=this.getRange(_1,_1+1,true)[0];if(_2!=null&&_2!==isc.ResultTree.getLoadingMarker()){return _2}else{return null}}},isc.A.getRange=function isc_ResultTree_getRange(_1,_2,_3){if(_1==null){this.logWarn("getRange() called with no specified range - ignoring.");return}else if(_2==null){_2=_1+1}
if(_1<0||_2<0){this.logWarn("getRange("+_1+", "+_2+"): negative indices not supported, clamping start to 0");_1=Math.max(_1,0)}
if(_2<=_1){this.logDebug("getRange("+_1+", "+_2+"): returning empty list");return[]}
var _4=this.$122a;if(_4!=null&&_4.length>0){var _5=_4[_4.length-1],_6=_5.start;if(_6<=_1&&_2<=_5.end){return _5.range.slice(_1-_6,_2-_6)}}
if(!this.isPaged()){return this.invokeSuper(isc.ResultTree,"getRange",_1,_2)}
if(!_3&&this.isLoading(this.root)&&this.parallelFetchesRequireRootLoaded!==false)
{var _7=this.currentFetch,_8=this.invalidatedFetchCount;if(_8==null?_7!=null:_7>_8){if(this.logIsInfoEnabled()){this.logInfo("getRange("+_1+", "+_2+"): parallel fetches are not allowed before the ResultTree root is loaded - not fetching")}
_3=true}}
var _9=isc.ResultTree.getLoadingMarker(),_10=this.$111w,_11=this.getRoot(),_12={range:[],rangeLoading:false,needQueue:false,wasAlreadyQueuing:false,dontFetch:_3===true};if(_2>_1){if(!(this.openDisplayNodeType!=isc.Tree.LEAVES_ONLY&&this.showRoot)){++_1;++_2}
var _13=this.$124u();this.$122b(_11,_11,[_11],0,_1,_2,true,_13,false,_12)}
return _12.range},isc.A.$121e=function isc_ResultTree__pushCachedRange(_1,_2){if(this.isPaged()){if(this.$122a==null){this.$122a=[]}
this.$122a.push({start:_1,end:_2,range:this.getRange(_1,_2)})}},isc.A.$121f=function isc_ResultTree__popCachedRange(_1,_2){if(this.isPaged()){this.$122a.pop();if(this.$122a.length==0){delete this.$122a}}},isc.A.$122b=function isc_ResultTree__getRange(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10){var _11=this.separateFolders,_12=_11&&this.sortFoldersBeforeLeaves,_13=_11&&!this.sortFoldersBeforeLeaves,_14=_10.range,_15=_10.rangeLoading,_16=_10.needQueue,_17=_10.dontFetch;var _18=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0);var _19=this.$1215,_20=this.$111w,_21=isc.ResultTree.getLoadingMarker(),_22=(_2[this.canReturnOpenSubfoldersProperty]!=null?_2[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_23=isc.isA.ResultSet(_3),j=_4;var _25=(_3==null?0:(_23?_3.$121l():_3.getLength()));for(var z=0;z<(_11?2:1);++z){var _27=(z==0),_28=(_27==_12),_29=(_27==_13),_30=false,_31=0,p=0;for(;j<_6&&p<_25;++p){var _33=_3.getCachedRow(p);var _34=_33!=null&&(!this.isOpen(_33)||_33[_19]||this.hideLoadingNodes&&this.isLoading(_33));if(_33==null){var _35=(_22||_15||_18==0);if(_27&&(_35||_11||j>=_5)){if(_35){if(!_15){for(var r=Math.max(_5,j);r<_6;++r){_14[r-_5]=_21}
_15=_10.rangeLoading=true;if(_17){return}}}else{_9=_11;if(j>=_5){_14[j-_5]=_21}}
if(!(_17||_30)){_30=true;_31=p;if(!_16){_10.wasAlreadyQueuing=isc.RPCManager.startQueue();_16=_10.needQueue=true}}}
j+=(_11&&_27?0:_18)}else{if(_30){_30=false;var _37=_3.progressiveLoading;_3.progressiveLoading=false;_3.getRange(_31,p);_3.progressiveLoading=_37}
if(this.isFolder(_33)?!_29:!_28){var _38,_39;if(_33==_1){_38=_33[_20];_39=true}else{_38=this.$111x(_33,_2);_39=this.$121c(_33,_2)}
var _40=_38-(_39?1:0);if(j>=_5&&_39&&!_15){_14[j-_5]=(_9?_21:_33)}
var k=j+(_39?1:0),l=j+_38;if(k<_6&&(!_34||(l>=_5&&_40>0))){var _43=this.getChildren(_33,null,null,null,null,null,null,null,false);this.$122b(_1,_33,_43,k,_5,_6,false,(p==_25-1&&_8),_9,_10);_15=_10.rangeLoading;_16=_10.needQueue;if(_17&&_15){return}}
j=l}}}
if(_30){_30=false;var _37=_3.progressiveLoading;_3.progressiveLoading=_8;_3.getRange(_31,p);_3.progressiveLoading=_37}}
if(_25==0||(_23&&!_3.lengthIsKnown())){if(!_15){for(var r=Math.max(_5,j);r<_6;++r){_14[r-_5]=_21}
_15=_10.rangeLoading=true;if(_17){return}}
if(!_16){_10.wasAlreadyQueuing=isc.RPCManager.startQueue();_16=_10.needQueue=true}
var _37;if(_23){_37=_3.progressiveLoading;_3.progressiveLoading=_8}
if(_11||(_18==0)){if(_23){_3.$121m()}else{this.$121b(_2,0,this.resultSize,null)}}else if(_23){_3.getRange(0,_6-j)}else{this.$121b(_2,0,_6-j,null)}
if(_23){_3.progressiveLoading=_37}}
if(_7&&_16&&!_10.wasAlreadyQueuing){isc.RPCManager.sendQueue()}});isc.evalBoundary;isc.B.push(isc.A.$124u=function isc_ResultTree__getProgressiveLoading(){return(this.isPaged()&&this.progressiveLoading)},isc.A.$1202=function isc_ResultTree__canonicalizeChildren(_1,_2,_3,_4){if(isc.isA.ResultSet(_2)){_1[this.childrenProperty]=_2;return _2}else if(this.$132d===true){return _2}
var _5=_1[this.childCountProperty],_6=(isc.isAn.Array(_2)?_2.length:0),_7=(_5!=null&&isc.isA.Number(_5)&&Math.floor(_5)==_5&&_5>=0),_8;if(_4===_8){_4=_2!=null&&!_2.isEmpty()}
if(this.isOpen(_1)&&(_4?_7&&_5==0:(_7?_5>0:_2==null||!_2.isEmpty())))
{this.logMessage(this.$1704?isc.Log.INFO:isc.Log.WARN,"Node "+_1[this.nameProperty]+" is marked as open but has "+(_4?"":"no ")+"children and "+(_5==null?"no":_5+" as the")+" child count; see the RPC Tab of the Developer Console for further details","nodeFormat");this.$1704=true;if(_2==null&&_5!=0&&!_4){this.$121b(_1,0,1)}}
if(!_7)return _2;if(_5==0){this.setLoadState(_1,isc.Tree.LOADED);return[]}
if(_5<_6){this.logMessage(this.$1705?isc.Log.INFO:isc.Log.WARN,"The child count of node "+_1[this.nameProperty]+" was set to "+_5+".  The number of children was "+_6+", but the number of children can't exceed the child count; clamping the set of children to the child count.","nodeFormat");this.$1705=true;_2=_1[this.childrenProperty]=_2.slice(0,_5)}
if(this.isLeaf(_1)&&(_5>0||_4)){this.logMessage(this.$1706?isc.Log.INFO:isc.Log.WARN,"Node "+_1[this.nameProperty]+" is marked as a leaf but has "+(_4?"children specified":"a child count of "+_5),"nodeFormat");this.$1706=true}
if(!this.isLeaf(_1)&&_4){this.$122c=this.$122c||[];var _9=this.$27i,_10=this.$73p,_11=false;if(isc.isAn.Array(_10)&&_9!=null){for(var i=_10.length;i--;){var _13=_10[i];if(_13!=null&&_13.normalizer===_9){if(!_11){_10=_10.duplicate();_11=true}
_10[i]=isc.addProperties({},_13,{normalizer:null})}}}
var _14=this.getDataSource(),_15;if(this.keepParentsOnFilter){_15=(_2?_2.duplicate():[])}else{_15=_14.applyFilter(_2,this.criteria,this.context)}
var _16=Math.max(_15.length,_1[this.childCountProperty]+(_15.length-_6));var _17=this.context&&isc.addProperties({},this.context);if(_17){delete _17.clientContext;delete _17.internalClientContext}
if(this.keepParentsOnFilter){_17=_17||{};_17.keepParentsOnFilter=true}
var _18={init:function(){var _19=this.$121z;this.$97q[_19.childrenProperty]=this;if(!_19.$122c.contains(this)){_19.$122c.add(this)}
if(_19.dataArrived!=null){_19.observe(this,"dataArrived","observer.dataArrived(observed.$97q)")}
var _1=this.$97q,_20=_19.$1218(_1,false);this.$134h=_19.$1219(_1,_20,false);var _21=this.Super("init",arguments);var _22=this.$97q,_23=_22!=_19.root&&_19.getParent(_22),_24=(_22[_19.canReturnOpenSubfoldersProperty]!=null?_22[_19.canReturnOpenSubfoldersProperty]:_19.canReturnOpenFolders),_25=(_19.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0),_26=!(_24||_25==0);if(_26){var _27=(_23&&_19.$111x(_22,_23));_22[_19.$111w]=_19.$1112(_22);if(_23){var _28=(_19.$111x(_22,_23)-_27);_19.$111z(_23,_28)}}
if(this.$122d){this.addProperties(_19.$121y)}
delete this.$122d;return _21},$121z:this,$97q:_1,$122d:_3,dataSource:_14,criteria:this.criteria,context:_17,fetchDelay:this.fetchDelay,disableCacheSync:this.disableCacheSync,updateCacheFromRequest:this.updateCacheFromRequest,sortSpecifiers:_10,initialData:_15,initialLength:_16,setCriteria:function(_29){var _19=this.$121z;_29=arguments[0]=_19.$122e(_29,this.$134h);return this.Super("setCriteria",arguments)}};if(this.keepParentsOnFilter){_18.dropCacheOnUpdate=true}
if(!_3){isc.addProperties(_18,this.$121y)}
_2=_1[this.childrenProperty]=isc.ResultSet.create(_18);this.setLoadState(_1,isc.Tree.LOADED_PARTIAL_CHILDREN);this.$1203(_1,false,null,false)}
return _2},isc.A.$1924=function isc_ResultTree__pendingResultSetActionOnPause(_1){var _2=this.getClass().$cn[_1];if(!_2)return false;for(var _1 in _2){var _3=window[_1];if(isc.isA.ResultSet(_3)&&_3.$121z==this){return true}}
return false},isc.A.$122e=function isc_ResultTree__combineCriteria(_1,_2){var _3=(_1==null||isc.isAn.emptyObject(_1)),_4=(_2==null||isc.isAn.emptyObject(_2));if(_3||_4){if(!_3){return _1}else if(!_4){return _2}else{return(_1||_2)}}
var _5=(_1._constructor=="AdvancedCriteria"||_2._constructor=="AdvancedCriteria");if(!_5){var _6=false;for(var _7 in _1){if(_2[_7]!=null){if(_2[_7]!==_1[_7]){_5=true}else{if(!_6){_2=isc.addProperties({},_2);_6=true}
delete _2[_7]}}}}
var _8=isc.DataSource.combineCriteria(_1,_2,"and");_5=(_8._constructor=="AdvancedCriteria");if(_5&&isc.isAn.Array(_8.criteria)){var _9=_8.criteria;for(var i=_9.length;i--;){var _11=_9[i];if(_11.operator=="iContains"&&_11.value==null){_11.operator="isNull";delete _11.value}}}
return _8},isc.A.setSort=function isc_ResultTree_setSort(_1){var _2=this.invokeSuper(isc.ResultTree,"setSort",_1);_1=this.$73p;this.$39x=_1?isc.DS.getSortBy(_1):null;if(this.isPaged()){var _3=this.$122c;if(_3!=null&&_3.length>0){var _4=isc.RPCManager.startQueue();for(var i=_3.length;i--;){var _6=_3[i];_6.setSort(_1)}
if(!_4){isc.RPCManager.sendQueue()}}}
return _2},isc.A.$122f=function isc_ResultTree__getStartRow(_1){if(_1==null){return null}
var _2=this.getRoot(),_3=null,_4=0;for(;_1!=_2;_1=_3){_3=this.getParent(_1);if(_3!=null){if(!this.$1111(_1,_3)){return null}
var _5=this.getChildren(_3),j=_5.indexOf(_1);if(j==-1){return null}
for(var i=0;i<j;++i){var _8=_5.getCachedRow(i);if(_8!=null){_4+=this.$111x(_8,_3)}}
if(this.$121c(_1,_3)){++_4}}else if(_1!=_2){var _9;return _9}}
return _4},isc.A.$1203=function isc_ResultTree__setVisibleDescendantsCached(_1,_2,_3,_4){var _5;var _6=this.$1215,_7=_1[_6];if(_2==null){var _8=this.getLoadState(_1);_2=(_8===isc.Tree.LOADED||_8===isc.Tree.LOADED_PARTIAL_CHILDREN);var _9=this.getChildren(_1,_5,_5,_5,_5,_5,true),_10=isc.isA.ResultSet(_9);if(_2&&(_10||isc.isAn.Array(_9))){_2=_2&&((!_10||(_9.allMatchingRowsCached()&&_9.lengthIsKnown())));for(var i=0,_12=_9.getLength();_2&&i<_12;++i){var _13=_9.getCachedRow(i);_2=(_13!=null&&(!this.isOpen(_13)||_13[_6]||false))}}}
_1[_6]=_2;_3=_3||this.getParent(_1);if((_4||!_7)&&_2){if(_3!=null&&this.isOpen(_1)){var _8=this.getLoadState(_3),_9=this.getChildren(_3),_10=isc.isA.ResultSet(_9),_14=((_8===isc.Tree.LOADED||_8===isc.Tree.LOADED_PARTIAL_CHILDREN)&&(!_10||(_9.allMatchingRowsCached()&&_9.lengthIsKnown())));if(_14&&(_10||isc.isAn.Array(_9))){var _15=_9.indexOf(_1);for(var i=_9.getLength();_14&&i-->0;){if(i!=_15){var _13=_9.getCachedRow(i);_14=(_13!=null&&(!this.isOpen(_13)||_13[_6]))}}}
if(_14){this.$1203(_3,true,null,false)}else{}}}else if((_4||_7)&&!_2){while(_3!=null&&_3[_6]&&this.isOpen(_1)){_3[_6]=false;_1=_3;_3=this.getParent(_3)}}},isc.A.$137a=function isc_ResultTree___add(_1,_2,_3){if(this.isPaged()&&!this.keepParentsOnFilter){var _4=this.getDataSource().applyFilter([_1],this.criteria,this.context);if(_4.length==0){return}}
return this.invokeSuper(isc.ResultTree,"$137a",_1,_2,_3)},isc.A.$1205=function isc_ResultTree__preAdd(_1,_2,_3,_4){var _5=this.invokeSuper(isc.ResultTree,"$1205",_1,_2,_3,_4);if(this.isPaged()){var _6=this.getLoadState(_1),_7=(_6===isc.Tree.LOADED||_6===isc.Tree.LOADED_PARTIAL_CHILDREN);this.$1203(_1,_7,_2,true)}
return _5},isc.A.setRoot=function isc_ResultTree_setRoot(_1,_2){if(this.isPaged()){var _3=(_1&&isc.endsWith(this.parentProperty,this.ID));this.$1217(_3?_1:this.getRoot(),true)}
return this.invokeSuper(isc.ResultTree,"setRoot",_1,_2)},isc.A.$1209=function isc_ResultTree__preRemove(_1,_2,_3){if(this.isPaged()){this.$1203(_1,true,_2,false);delete _1[this.$1215];this.$1217(_1,false)}
return this.invokeSuper(isc.ResultTree,"$1209",_1,_2,_3)},isc.A.unloadChildren=function isc_ResultTree_unloadChildren(_1,_2,_3){if(this.isPaged()){this.$1217(_1,false)}
return this.invokeSuper(isc.ResultTree,"unloadChildren",_1,_2,_3)},isc.A.$1217=function isc_ResultTree__cleanResultSetChildren(_1,_2){var _3=this.$122c;for(var i=(_3!=null?_3.length:0);i--;){var _5=_3[i],_6=_5.$97q;if(_2^(_6==_1||this.isDescendantOf(_6,_1))){_3.removeAt(i);if(this.isObserving(_5,"dataArrived")){this.ignore(_5,"dataArrived")}
delete _5.$97q;delete _5.$121z;delete _5.context.keepParentsOnFilter;_5.setCriteria=isc.ResultSet.getInstanceProperty("setCriteria");delete _5.$121p;delete _5.$121q;delete _5.$121t;delete _5.$121u;delete _5.$121n;delete _5.$121o;delete _5.$121w;delete _5.$121v}}},isc.A.changeDataVisibility=function(node,newState,callback){if(this.isPaged()){var parent=this.getParent(node),state=node[this.openProperty],changed=(!this.isLeaf(node)&&(state^newState)),closedToOpen=(changed&&!state&&newState),openToClosed=(changed&&!closedToOpen),visibleCached=node[this.$1215],parentVisibleCached=(parent!=null&&parent[this.$1215]);var ret=this.invokeSuper(isc.ResultTree,"changeDataVisibility",node,newState,callback);if(parent!=null&&!visibleCached&&((closedToOpen&&parentVisibleCached)||(openToClosed&&!parentVisibleCached)))
{this.$1203(parent,null,null,false)}
return ret}else{return this.invokeSuper(isc.ResultTree,"changeDataVisibility",node,newState,callback)}},isc.A.$1210=function isc_ResultTree__childrenDataAdd(_1,_2,_3,_4,_5,_6){var _7=isc.ResultSet.getLoadingMarker();var _8=(_2[this.canReturnOpenSubfoldersProperty]!=null?_2[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_9=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0),_10=(!(_8||_9==0)&&!_6&&this.$1111(null,_2));if(_3==null||_3==_7){if(_10){this.$111z(_2,_4)}
return}
if(_4==1&&!isc.isAn.Array(_3)){_3=[_3]}
var _11=this.$122f(_2),_12;if(_11===_12){return}
if(_6){_2[this.$1200]=1+(_2[this.$1200]||0)}
var _13=(this.$122g=this.$122g||[]),_14=(this.$125t=this.$125t||[]),_15,_16=[],_17=0,_18,_19;if(_6){_15=[];_14.push(_15)}else{_15=_14.pop()}
var _20=(_6?0:_4-1),_21=(_6?1:-1);for(var i=_20;(_6?i<_4:i>=0);i+=_21){var _23=_3[i];if(_23!=null&&_23!=_7){if(_6){var _24={};_13.push(_24);var _25=this.$1208(_23);if(_25){_15.add(_25)}
this.$1205(_23,_2,false,_24)}else{var _24=_13.pop();this.$1206(_23,_2,_5,_24);_16.push(_24.grandChildren);_17+=_24.deltaParentLength;_18=_24.grandParent;_19=_24.origParentLength}}else if(_10){++_2[this.$111w]}}
if(!_6){var _26=(_2[this.canReturnOpenSubfoldersProperty]!=null),_27=!_8;for(var i=0;i<_4;++i){var _23=_3[i];if(_23!=null&&_23!=_7){var _28=this.$1202(_23,_16.pop(),false);if(_27&&this.isOpen(_23)&&_28!=null&&!_28.isEmpty())
{this.logWarn("Adding the open folder node '"+this.getPath(_23)+"' as a child of the parent node '"+this.getPath(_2)+"' is contradictory to the setting of the "+(_26?"'"+this.canReturnOpenSubfoldersProperty+"' property of the parent node.":"'canReturnOpenFolders' property of the tree."))}
if(_28!=null){if(isc.isA.ResultSet(_28)){if(!(_28.lengthIsKnown()&&_28.allMatchingRowsCached())){this.$1203(_23,false,_2,false)}}else if(!isc.isAn.Array(_28)){this.$137a(_28,_23)}else{this.$137b(_28,_23)}}}}
if((--_2[this.$1200])==0){delete _2[this.$1200];if(_18){_17+=(this.$111x(_2,_18)-_19);this.$111z(_18,_17)}}
this.$1203(_2,null,null,false);if(_15.length>0){for(var i=_15.length;i--;){var _25=_15.pop();this.$1207(_25)}}
this.$736(true);this.dataChanged()}},isc.A.$1211=function isc_ResultTree__childrenDataRemove(_1,_2,_3,_4,_5,_6){var _7=isc.ResultSet.getLoadingMarker();var _8=(_2[this.canReturnOpenSubfoldersProperty]!=null?_2[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_9=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0),_10=(!(_8||_9==0)&&!_6&&this.$1111(null,_2));if(_3==null||_3==_7){if(_10){this.$111z(_2,-_4)}
return}
if(_4==1&&!isc.isAn.Array(_3)){_3=[_3]}
var _11=this.$122f(_2),_12;if(_11===_12){return}
if(_6){_2[this.$1200]=1+(_2[this.$1200]||0)}
var _13=(this.$122g=this.$122g||[]),_14,_15;var _16=(_6?0:_4-1),_17=(_6?1:-1);for(var i=_16;(_6?i<_4:i>=0);i+=_17){var _19=_3[i];if(_19!=null&&_19!=_7){if(_6){var _20={};_13.push(_20);this.$1209(_19,_2,_20)}else{var _20=_13.pop();this.$121a(_19,_2,_20);_14=_20.grandParent;_15=_20.origParentLength}}else if(_10){--_2[this.$111w]}}
if(!_6){if((--_2[this.$1200])==0){delete _2[this.$1200];if(_14){var _21=(this.$111x(_2,_14)-_15);this.$111z(_14,_21)}}
this.$1203(_2,null,null,false);this.$736(true);this.dataChanged()}},isc.A.$1212=function isc_ResultTree__childrenDataSplice(_1,_2,_3,_4,_5,_6,_7,_8){var _9=isc.ResultSet.getLoadingMarker();var _10=(_2[this.canReturnOpenSubfoldersProperty]!=null?_2[this.canReturnOpenSubfoldersProperty]:this.canReturnOpenFolders),_11=(this.openDisplayNodeType==isc.Tree.FOLDERS_AND_LEAVES?1:0),_12=(!(_10||_11==0)&&!_8&&this.$1111(null,_2));var _13=!(_3==null||_3==_9),_14=!(_6==null||_6==_9);if(!(_13||_14)){if(_12){this.$111z(_2,_7-_4)}
return}else if(!_14){if(_12){this.$111z(_2,_7)}
this.$1211(_1,_2,_3,_4,_5,_8);return}else if(!_13){if(_12){this.$111z(_2,-_4)}
this.$1210(_1,_2,_6,_7,_5,_8);return}
var _15=this.$122f(_2),_16;if(_15===_16){return}
if(_8){_2[this.$1200]=1+(_2[this.$1200]||0)}
var _17=(this.$122g=this.$122g||[]),_18=(this.$125t=this.$125t||[]),_19,_20=[],_21=0,_22,_23;if(_8){_19=[];_18.push(_19)}else{_19=_18.pop()}
if(_7==1&&!isc.isAn.Array(_6)){_6=[_6]}
if(_4==1&&!isc.isAn.Array(_3)){_3=[_3]}
var _24=(_8?0:_7+_4-1),_25=(_8?1:-1);for(var i=_24;(_8?i<_7+_4:i>=0);i+=_25){var _27=(_4<=i),_28=(_27?_6[i-_4]:_3[i]);if(_28!=null&&_28!=_9){if(_8){var _29={};_17.push(_29);if(_27){var _30=this.$1208(_28);if(_30&&!(_13&&_3.contains(_30))){_19.add(_30)}
this.$1205(_28,_2,false,_29)}else{this.$1209(_28,_2,_29)}}else{var _29=_17.pop();if(_27){this.$1206(_28,_2,_5,_29);_20.push(_29.grandChildren);_21+=_29.deltaParentLength}else{this.$121a(_28,_2,_29)}
_22=_29.grandParent;_23=_29.origParentLength}}else if(_12){if(_27){++_2[this.$111w]}else{--_2[this.$111w]}}}
if(!_8){var _31=(_2[this.canReturnOpenSubfoldersProperty]!=null),_32=!_10;for(var i=0,j=0;i<_7;++i){var _34=_6[i];if(_34!=null&&_34!=_9){var _35=this.$1202(_34,_20.pop(),false);if(_32&&this.isOpen(_34)&&_35!=null&&!_35.isEmpty())
{this.logWarn("Adding the open folder node '"+this.getPath(_34)+"' as a child of the parent node '"+this.getPath(_2)+"' is contradictory to the setting of the "+(_31?"'"+this.canReturnOpenSubfoldersProperty+"' property of the parent node.":"'canReturnOpenFolders' property of the tree."))}
if(_35!=null){if(isc.isA.ResultSet(_35)){if(!(_35.lengthIsKnown()&&_35.allMatchingRowsCached())){this.$1203(_34,false,_2,false)}}else if(!isc.isAn.Array(_35)){this.$137a(_35,_34)}else{this.$137b(_35,_34)}}}}
if((--_2[this.$1200])==0){delete _2[this.$1200];if(_22){_21+=(this.$111x(_2,_22)-_23);this.$111z(_22,_21)}}
this.$1203(_2,null,null,false);if(_19.length>0){for(var i=_19.length;i--;){var _30=_19.pop();this.$1207(_30)}}
this.$736(true);this.dataChanged()}},isc.A.$1213=function isc_ResultTree__childrenDataMoved(_1,_2,_3,_4,_5,_6){var _7=isc.ResultSet.getLoadingMarker()},isc.A.$1214=function isc_ResultTree__childrenDataLengthIsKnownChanged(_1,_2,_3,_4){var _5=isc.ResultSet.getLoadingMarker();this.$1203(_2,null,null,false)},isc.A.setDefaultLoadState=function isc_ResultTree_setDefaultLoadState(_1){var _2=this.defaultLoadState;this.defaultLoadState=_1;if(this.isPaged()&&(_2!==_1||(_2==null)^(_1==null)))
{var _3=(_2===isc.Tree.LOADED||_2===isc.Tree.LOADED_PARTIAL_CHILDREN),_4=(_1===isc.Tree.LOADED||_1===isc.Tree.LOADED_PARTIAL_CHILDREN);if(_3^_4){var _5=this.getRoot(),_6=this.findAll("$27g",null);if(_5.$27g==null){if(_6==null){_6=[_5]}else{_6.add(_5)}}
if(_6!=null){for(var i=_6.length;i--;){var _8=_6[i],_9=this.getParent(_8);this.$1203(_8,null,_9,true)}}}}},isc.A.setCriteria=function isc_ResultTree_setCriteria(_1,_2){var _3=this.criteria||{},_4=!this.haveCriteria(_3),_5=this.$868||{},_6=this.getDataSource(),_7;if(_2)_7=this.$780(_1,true);this.$51w=this.context&&this.context.textMatchStyle||null;if(!_6.isAdvancedCriteria(_1)){_1=isc.clone(_1)}
this.criteria=_1;if(_6.isAdvancedCriteria(_1)&&!_6.isAdvancedCriteria(_3)){_3=isc.DataSource.convertCriteria(_3)}
if(!_6.isAdvancedCriteria(_1)&&_6.isAdvancedCriteria(_3)){_1=isc.DataSource.convertCriteria(_1);this.criteria=_1}
if(this.isLocal()&&this.serverFilterFields!=null&&this.serverFilterFields.length>0)
{this.$87d=isc.DataSource.copyCriteria(_1);this.$868=_6.splitCriteria(this.$87d,this.serverFilterFields)}else{delete this.$87d;delete this.$868}
var _8=this.compareCriteria(_1,_3);if(_8!=0){if(!this.isLocal()){this.logInfo("setCriteria: filter criteria changed, invalidating cache");this.invalidateCache();if(this.isPaged()&&this.$122c!=null){var _9=this.$122c.duplicate();for(var i=_9.length;i--;){var _11=_9[i];if(this.$122c.contains(_11)){var _12=_11.$97q,_13=this.$1218(_12,false),_14=this.$1219(_12,_13,false);_11.setCriteria(isc.DataSource.combineCriteria(_14,this.criteria))}}}}else{if(this.haveCriteria(this.$868)?(this.compareCriteria(this.$868,_5)!=0):this.haveCriteria(_5))
{this.logInfo("setCriteria: filter criteria changed, invalidating cache");this.invalidateCache()}else{var _15=this.$87b();if(_4){this.completeTree=this.duplicate(true,true,true)}
this.filterLocalData();this.$87c(_15);if(this.dataArrived!=null){this.dataArrived(this.getRoot())}}}}
return _7},isc.A.filterLocalData=function isc_ResultTree_filterLocalData(_1){if(!_1)_1=this.getRoot();var _2=this.$87d||this.criteria,_3=this.completeTree;if(this.haveCriteria(_2)){var _4=(this.keepParentsOnFilter?isc.Tree.KEEP_PARENTS:isc.Tree.STRICT),_5=this.getDataSource();_3=this.applyFilter(this.completeTree,_2,_4,_5,this.context);this.logInfo("Local filter applied: "+_3.getNodeList().length+" of "+this.completeTree.getNodeList().length+" records matched filter:"+this.echoFull(_2))}else{if(!_3)return;this.logInfo("Local filter applied: all "+_3.getNodeList().length+" records matched filter: none");delete this.completeTree}
var _6=_3.getAllNodes();this.data=_3.getCleanNodeData(_6,false,false,true);this.setRoot(this.getCleanNodeData(this.getRoot(),false,false,true));this.setLoadState(this.getRoot(),isc.Tree.LOADED);if(this.completeTree!=null)_3.destroy();this.$736(true)},isc.A.applyFilter=function isc_ResultTree_applyFilter(_1,_2,_3,_4,_5){return _1.getFilteredTree(_2,_3,_4,_5)},isc.A.compareCriteria=function isc_ResultTree_compareCriteria(_1,_2,_3,_4){return this.getDataSource().compareCriteria(_1,_2,(_3?_3:this.context),(_4?_4:"dropOnChange"))},isc.A.willFetchData=function isc_ResultTree_willFetchData(_1){return this.$780(_1)==true},isc.A.$780=function isc_ResultTree__willFetchData(_1,_2){var _3;var _4=this.criteria||{},_5=this.$868||{},_6=this.getDataSource();if(!_6.isAdvancedCriteria(_1)){_1=isc.DataSource.copyCriteria(_1)}
if(_6.isAdvancedCriteria(_1)&&!_6.isAdvancedCriteria(_4)){_4=isc.DataSource.convertCriteria(_4)}
if(!_6.isAdvancedCriteria(_1)&&_6.isAdvancedCriteria(_4)){_1=isc.DataSource.convertCriteria(_1)}
var _7=0;if(_2&&!isc.isAn.emptyObject(_4)){var _8=_6.defaultTextMatchStyle,_9=this.$51w||_8,_10=this.context&&this.context.textMatchStyle||_8;_7=_6.compareTextMatchStyle(_10,_9)}
if(_7==0)_7=this.compareCriteria(_1,_4);if(_7==0)return null;if(!this.isLocal())return true;var _11={};if(this.isLocal()&&this.serverFilterFields!=null&&this.serverFilterFields.length>0)
{var _12=isc.DataSource.copyCriteria(_1);_11=_6.splitCriteria(_12,this.serverFilterFields)}
return(this.haveCriteria(_11)?(this.compareCriteria(_11,_5)!=0):this.haveCriteria(_5))},isc.A.getOpenState=function isc_ResultTree_getOpenState(){var _1=this.$87b();return isc.Comm.serialize(_1)},isc.A.$87b=function isc_ResultTree__getOpenState(_1){var _2=this.getRoot(),_3=[];this.$45q(this,_2,_3,_1);return _3},isc.A.setOpenState=function isc_ResultTree_setOpenState(_1){_1=isc.Canvas.evalViewState(_1,"openState",false,this)
if(!_1)return;this.$87c(_1)},isc.A.$87c=function isc_ResultTree__setOpenState(_1,_2){if(!_1)return;if(!_2){this.closeAll()}
this.openFolders(_1)},isc.A.$45q=function isc_ResultTree__addNodeToOpenState(_1,_2,_3,_4){if(!_1.isOpen(_2)||!_1.isLoaded(_2))return false;if(_4){_1.getName(_2);if(this.autoPreserveOpenState=="never"||(this.autoPreserveOpenState=="whenUnique"&&_2._autoAssignedName))
{return false}}
var _5=_1.getFolders(_2),_6=false;if(_5!=null){for(var i=0;i<_5.length;i++){_6=this.$45q(_1,_5[i],_3,_4)||_6}}
_3[_3.length]=_1.getPath(_2);return true});isc.B._maxIndex=isc.C+85;isc.ResultTree.getPrototype().toString=isc.$63a;isc.ResultTree.getPrototype().logMessage=isc.$63b;isc.ResultTree.registerStringMethods({dataArrived:"parentNode"});isc.A=isc.Canvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.buildRequest=function isc_Canvas_buildRequest(_1,_2,_3){if(!_1)_1={};if(_3)_1.afterFlowCallback=_3;if(_2=="filter"){_2="fetch";if(_1.textMatchStyle==null)_1.textMatchStyle="substring"}
if(this.textMatchStyle!=null)_1.textMatchStyle=this.textMatchStyle;_2=isc.DS.$372(_2);if(this.dataPageSize)_1.dataPageSize=this.dataPageSize;if(this.dataFetchMode)_1.dataFetchMode=this.dataFetchMode;var _4=_1.operationId||_1.operation;if(_4==null){switch(_2){case"fetch":_4=this.fetchOperation;break;case"add":_4=this.addOperation||this.saveOperation;break;case"update":_4=this.updateOperation||this.saveOperation;break;case"remove":_4=this.removeOperation||this.deleteOperation;break;case"validate":_4=this.validateOperation;break}}
_1.operation=_4||this.operation;if(this.implicitCriteria){_1.dbcImplicitCriteria=this.getImplicitCriteria()}
if(_1.operationId==null){_1.operationId=_1.operation}
_1.componentId=this.ID;return isc.rpc.addDefaultOperation(_1,this.dataSource,_2)},isc.A.createResultTree=function isc_Canvas_createResultTree(_1,_2,_3,_4,_5,_6){if(_4==null)_4="fetch";if(!_6)this.$117s(_3,_2);if(_3==null)_3={};var _7=isc.addProperties({initialData:_5||this.initialData},this.dataProperties,_3.dataProperties,this.treeProperties,_3.treeProperties);delete _7.ID;_7.criteria=_1;if(_3.operation!=null){_7.operation=_3.operation}
_7.context=_3;_7.dataSource=this.dataSource;_7.componentId=this.ID;_7.$31k=true;if(_6)_7.$1925=false;if(isc.TreeGrid&&isc.isA.TreeGrid(this)){if(_7.hideLoadingNodes==null)_7.hideLoadingNodes=true}
if(this.loadDataOnDemand!=null)_7.loadDataOnDemand=this.loadDataOnDemand;if(this.keepParentsOnFilter!=null)_7.keepParentsOnFilter=this.keepParentsOnFilter;if(this.dataFetchMode!=null)_7.fetchMode=this.dataFetchMode;if(this.dataFetchDelay!=null)_7.fetchDelay=this.dataFetchDelay;if(this.serverFilterFields!=null)_7.serverFilterFields=this.serverFilterFields;if(this.treeRootValue!=null)_7.rootValue=this.treeRootValue;if(this.treeDataRelations)_7.treeRelations=this.treeDataRelations;if(this.multiDSTree!=null)_7.multiDSTree=this.multiDSTree;if(this.progressiveLoading===true||this.progressiveLoading===false){isc.addProperties(_7,{progressiveLoading:this.progressiveLoading})}
var _8=this.getSort();if(_8)_7.$39x=isc.DS.getSortBy(_8);var _9=this.getDataSource();var _10=!_9?'ResultTree':_9.resultTreeClass||"ResultTree";return isc.ClassFactory.getClass(_10,true).create(_7)},isc.A.$117s=function isc_Canvas__setupResultTreeFetchCallback(_1,_2){if(_1==null)_1={};var _3=_1.internalClientContext={$53w:_2};if(_1.afterFlowCallback!=null){if(_3.$53w==null){_3.$53w=_1.afterFlowCallback}else if(_3.$53w!=_1.afterFlowCallback){this.logWarn("createResultTree called with request.afterFlowCallback:"+this.echo(_1.afterFlowCallback)+" as well as explicit callback parameter "+this.echo(_2)+". The request.afterFlowCallback will not be fired.")}}
_1.afterFlowCallback={target:this,methodName:"$53x"}},isc.A.$53x=function isc_Canvas__fireFetchCallback(_1,_2,_3){var _4=_3.internalClientContext;if(_4&&_4.$84b&&_4.$53w!=null){var _5=_4.$53w;this.fireCallback(_5,"dsResponse,data,dsRequest",arguments)}});isc.B._maxIndex=isc.C+4;if(isc.ValuesManager){isc.A=isc.ValuesManager.getPrototype();isc.A.buildRequest=isc.Canvas.getInstanceProperty("buildRequest")}
isc.ClassFactory.defineInterface("EditorActionMethods");isc.EditorActionMethods.addInterfaceMethods({save:function(_1){return this.saveData(_1)},editSelected:function(_1,_2){return this.editSelectedData(_1,_2)},editNew:function(_1,_2){return this.editNewRecord(_1,_2)},editNewRecord:function(_1){this.setSaveOperationType("add");this.$39m(_1)},editRecord:function(_1){var _2=(_1==null?"add":"update");this.setSaveOperationType(_2);this.$39m(_1)},$39m:function(_1){delete this.$50l;delete this.$39l;var _1=isc.addProperties({},_1);this.$180b=true;this.setData(_1);if(this.getFileItemForm!=null){var _2=this.getFileItemForm();if(_2){_2.editNewRecord();_2.clearErrors(true)}}
delete this.$180b},editSelectedData:function(_1){if(isc.isA.String(_1))_1=window[_1];if(!_1)return;var _2=_1.getSelection();if(_2.length>0){var _3=[];for(var i=0;i<_2.length;i++){_3[i]=_1.getCleanRecordData(_2[i])}
this.editList(_3)}},editList:function(_1){this.setSaveOperationType("update");this.$50b(_1)},$50b:function(_1){this.$50l=0;this.$39l=_1;var _2=isc.addProperties({},_1[this.$50l]);this.editRecord(_2)},editNextRecord:function(){this.editOtherRecord(true)},editPrevRecord:function(){this.editOtherRecord(false)},editOtherRecord:function(_1){if(!this.$39l)return;if(this.isVisible()&&this.valuesHaveChanged()){this.$39n=_1;this.saveData({target:this,methodName:"editOtherReply"});return};if(_1&&this.$50l>=this.$39l.length-1){this.logWarn("Unable to edit next record - this is the last selected record");return false}
if(!_1&&this.$50l<=0){this.logWarn("Unable to edit previous record - this is the first selected record");return false}
this.$50l+=(_1?1:-1);var _2=isc.addProperties({},this.$39l[this.$50l]);this.setData(_2)},editOtherReply:function(_1,_2,_3){var _4=this.$39n;delete this.$39n;if(_1.status<0&&_1.errors){return this.setErrors(_1.errors,true)}
if(_1.status<0)return isc.RPCManager.$a0(_1,_3);this.rememberValues();this.$39l[this.$50l]=this.getValues();this.editOtherRecord(_4)
return true},validateData:function(_1,_2){if(!this.validate())return false;var _3=this.getValues();var _4=this.buildRequest(_2,"validate");_4.editor=this;if(_4.valuesAsParams){if(!_4.params)_4.params={};isc.addProperties(_4.params,_3)}
var _5=this.getDataSource();return _5.validateData(_3,_1?_1:{target:this,methodName:"saveEditorReply"},_4)},reset:function(){this.resetValues()},cancel:function(_1){var _2={actionURL:this.action,target:window,sendNoQueue:true,ignoreTimeout:true,useXmlHttpRequest:false,params:{},useSimpleHttp:true};_2.params[this.cancelParamName]=this.cancelParamValue;if(!_2.actionURL){this.logWarn("No actionURL defined for the cancel RPC - set 'action' on your form orprovide an actionURL in the requestProperties to cancel()");return}
isc.addProperties(_2,_1);isc.rpc.sendRequest(_2)},cancelEditing:function(){if(this.valuesManager!=null){this.valuesManager.cancelEditing()}
if(this.userTask!=null){this.userTask.cancelEditing()}},completeEditing:function(){if(this.valuesManager!=null){this.valuesManager.completeEditing()}
if(this.userTask!=null){this.userTask.completeEditing()}},submit:function(_1,_2){if(this.saveToServer==false)return;if(this.valuesManager!=null){return this.valuesManager.submit(_1,_2)}
if(this.submitValues!=null){return this.submitValues(this.getValues(),this)}
if(this.canSubmit)return this.submitForm();else return this.saveData(_1,_2)},saveOperationIsAdd:function(){if(this.saveOperationType)return this.saveOperationType=="add";if(this.dataSource){var _1=isc.DataSource.getDataSource(this.dataSource);return!_1.recordHasAllKeys(this.getValues())}
return false},saveData:function(_1,_2,_3){if(this.selectionComponent!=null){var _4=this.$71d;if(_4&&this.selectionComponent.setRecordValues){if(this.selectionComponent.discardEdits){this.selectionComponent.discardEdits(_4)}
this.selectionComponent.setRecordValues(_4,this.getValues())}
return}
if(this.dataSource==null){this.logWarn("saveData() called on a non-databound "+this.Class+". This is not supported.  for information on databinding of components look at the documentation for the DataSource class.  If this was intended to be a native HTML form submission, set the canSubmit property to true on this form.");return}
if(isc.ValuesManager&&isc.isA.ValuesManager(this.valuesManager)&&this.dataPath){var _5=this.getFields();for(var i=0;i<_5.length;i++){var _7;if(_5[i].getTrimmedDataPath){_7=_5[i].getTrimmedDataPath()}
if(_7==null){_7=_5[i].dataPath||_5[i].name}
var _8=this.getValue(_7);this.valuesManager.$10y(_7,_8,this)}
return}
if(isc.Offline&&isc.Offline.isOffline()&&!this.dataSource.clientOnly){isc.warn(this.offlineSaveMessage);return}
if(_2==null)_2={};var _9=this.getSaveOperationType(_2);if(!_2.oldValues){_2.oldValues=_9!="add"?this.$10s:{}}
if(this.validationURL&&!_3){var _10={};isc.addProperties(_10,_2);isc.addProperties(_10,{actionURL:this.validationURL,valuesAsParams:true,sendNoQueue:true});_10.$40b=_2;_10.$40c=_1;this.performingServerValidation=true;this.validateData(this.getID()+".$40d(rpcRequest,rpcResponse,data)",_10);return}
var _11=this.getFileItemForm();if(_11&&_11.isDrawn()){this.updateFileItemForm();if(!this.validate())return false;if(_2.clientContext==null)_2.clientContext={};_2.clientContext.saveDataTarget=this;return _11.saveData(_1,_2,_3)}
this.$40c=_1;_1=this.getID()+".$49z(dsRequest, dsResponse, data)";_2=this.buildRequest(_2,_9,_1);var _12=false;if(this.submitParamsOnly)_2.useSimpleHttp=true;if(isc.DynamicForm&&isc.isA.DynamicForm(this)){if(this.$66g){_2.actionURL=this.action;_2.target=this.target?this.target:window;_12=true}
if(this.method!=isc.DynamicForm.getInstanceProperty("method")){_2.httpMethod=this.method}}
if(this.disableValidation)this.clearErrors(true);else{if(!this.validate(null,null,null,null,true))return false}
if(this.rulesEngine){var _13=this.rulesEngine.processSubmit(this);if(_13==false)return}
var _14=this.getDataSource().$708(this.getValues());if((isc.DynamicForm&&isc.isA.DynamicForm(this)&&this.isMultipart())||this.canSubmit||_12)
{return this.submitEditorValues(_14,_2.operation,_2.callback,_2)}else{return this.saveEditorValues(_14,_2.operation,_2.callback,_2)}},updateFileItemForm:function(){var _1=this.getFileItemForm();if(_1==null)return;var _2=_1.getValues(),_3=this.getValues(),_4=_1.getItem(0).getFieldName();for(var _5 in _2){if(_5==_4)continue;_1.setValue(_5,null)}
for(var _5 in _3){if(_5==_4)continue;_1.setValue(_5,_3[_5])}
if(this.$66g)_1.setAction(this.action);_1.dataSource=this.dataSource;_1.fileItemFormParentForm=this},isNewRecord:function(){return this.getSaveOperationType()=="add"},setSaveOperationType:function(_1){this.saveOperationType=_1},getSaveOperationType:function(_1){var _2;if(!_1||!_1.operation){if(!_1)_1={};_2=_1.operationType?_1.operationType:this.saveOperationType;if(!_2&&this.dataSource!=null){if(this.valuesManager&&this.dataPath==null){_2=this.valuesManager.getSaveOperationType()}else{var _3=isc.DataSource.getDataSource(this.dataSource).getPrimaryKeyFieldNames(),_4=this.getValues(),_5;for(var i=0;i<_3.length;i++){var _7=_3[i],_8=_4[_3];if(_8==null){_2="add";break}
if(this.$10s[_7]!==_5&&this.$10s[_7]!=_8){_2="add"}
var _9=this.getItem(_7);if(_9&&_9.isVisible()&&(_9.shouldSaveValue&&_9.isEditable())){_2="add";break}}
if(_2==null){_2="update"}}}}
return _2},$49z:function(_1,_2,_3){var _4=this.suppressServerDataSync;var _5=_1.clientContext;if(_5&&_5.saveDataTarget!=null&&_5.saveDataTarget!=this)
{_5.saveDataTarget.$49z(_1,_2,_3);if(_5.saveDataTarget.suppressServerDataSync){_4=true}}
this.$490=0;if(!_4&&_2&&_2.status>=0&&_3!=null){if(isc.isAn.Array(_3))_3=_3[0];if(_1.originalData)_1.originalData=isc.shallowClone(_1.originalData);if(_1.data)_1.data=isc.shallowClone(_1.data);var _6=(_1.originalData||_1.data),_7=this.getValues();var _8=false,_9=true,_10;for(var _11 in _3){var _12=_6[_11]===_10?this.$10s[_11]:_6[_11];var _13=this.getField(_11);if(this.fieldValuesAreEqual(_13,_7[_11],_12)){if(!this.fieldValuesAreEqual(_13,_12,_3[_11])){_7[_11]=_3[_11];_8=true}}else{_9=false}}
if(_8){this.$10r(_7)}
for(var i=0;i<this.items.length;i++){var _15=this.items[i];if(isc.isAn.UploadItem(_15))continue;var _16=_15.dataPath||_15.name;if(_16==null)continue;var _17=isc.DynamicForm.$70o(_16,_15,_6,this,true,"edit");if(_17===_10||this.fieldValuesAreEqual(_15,_17,_15.getValue()))
{if(_8){var _18=isc.DynamicForm.$70o(_16,_15,_3,this,true,"edit");if(!this.fieldValuesAreEqual(_15,_17,_18)){_15.setValue(_18)}}}else{_9=false}}
if(_9){this.rememberValues()}
if(this.saveOperationType=="add")delete this.saveOperationType}
this.$491={request:_1,response:_2,serverData:_3};this.formSavedComplete();var _19=this.getItem("_transaction");if(_19&&isc.isA.HiddenItem(_19)){_19.clearValue()}},formSavedComplete:function(){var _1=this.getFields();for(var i=this.$490;i<_1.length;i++){this.$490++;var _3=_1[i];if(isc.isA.Function(_3.formSaved)&&_3.formSaved(this.$491.request,this.$491.response,this.$491.serverData)===false)return}
if(this.$40c){this.fireCallback(this.$40c,"dsResponse,data,dsRequest",[this.$491.response,this.$491.serverData,this.$491.request])}
delete this.$492;delete this.$40c},saveEditorValues:function(_1,_2,_3,_4){if(!_4)_4={};isc.addProperties(_4,{prompt:(_4.prompt||isc.RPCManager.saveDataPrompt),editor:this});_4.internalClientContext={$69t:_4.willHandleError};_4.willHandleError=true;if(_4.valuesAsParams){if(!_4.params)_4.params={};isc.addProperties(_4.params,_1)}
var _5=this.getDataSource();return _5.performDSOperation(_2.type,_1,_3?_3:{target:this,methodName:"saveEditorReply"},_4)},submitEditorValues:function(_1,_2,_3,_4){if(!_4)_4={};isc.addProperties(_4,{directSubmit:true,submitForm:this});return this.saveEditorValues(_1,_2,_3,_4)},saveEditorReply:function(_1,_2,_3){if(_3.internalClientContext){_3.willHandleError=_3.internalClientContext.$69t}
if(_1.status==isc.RPCResponse.STATUS_VALIDATION_ERROR&&_1.errors){var _4=this;var _5=_3.clientContext;if(_5&&_5.saveDataTarget!=null){_4=_5.saveDataTarget}
_4.setErrors(_1.errors,true);return this.suppressValidationErrorCallback?false:_3.willHandleError==true}
if(_1.status<0&&!_3.willHandleError)
return isc.RPCManager.$a0(_1,_3);return true},$40d:function(_1,_2,_3){if(_2.status==isc.RPCResponse.STATUS_SUCCESS){this.performingServerValidation=false;this.markForRedraw("serverValidationSuccess");this.saveData(_1.$40c,_1.$40b,true);_1.$40c=null;_1.$40b=null}else{this.setErrors(_2.errors,true)}}});if(isc.DynamicForm){isc.ClassFactory.mixInInterface("DynamicForm","EditorActionMethods");isc.A=isc.DynamicForm.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.selectionComponentSelectionChanged=function isc_DynamicForm_selectionComponentSelectionChanged(_1,_2,_3){if(!_3){_2=_1.getSelectedRecord();if(_2==null)_2={}}
this.$71d=_1.getPrimaryKeys(_2);this.clearErrors(true);if(this.valuesManager&&this.valuesManager.synchronizeMember){this.valuesManager.synchronizeMember(this)}else{this.editRecord(isc.addProperties({},_2))}},isc.A.selectionComponentCellSelectionChanged=function isc_DynamicForm_selectionComponentCellSelectionChanged(_1,_2){for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.selectionComponent.getCellRecord(_4[0],_4[1]);if(_1.cellIsSelected(_5))break;_5=null}
if(_5){this.$71d=_1.getPrimaryKeys(_5);if(this.valuesManager&&this.valuesManager.synchronizeMember){this.valuesManager.synchronizeMember(this)}else{this.editRecord(isc.addProperties({},_5))}}});isc.B._maxIndex=isc.C+2}
isc.$457={fetchData:function(_1,_2,_3){var _4=this.getDataSource();if(!_4){this.logWarn("Ignoring call to fetchData() on a DynamicForm with no valid dataSource");return}
if(this.$458==null)this.$458=[];this.$458.add(_2);_3=this.buildRequest(_3,"fetch");_4.fetchData(_1,{target:this,methodName:"fetchDataReply"},_3)},fetchDataReply:function(_1,_2,_3){if(_2==null||isc.isAn.emptyObject(_2)||(isc.isAn.Array(_2)&&_2.getLength()==0))
{if(_1.status==isc.RPCResponse.STATUS_OFFLINE){isc.say(this.offlineMessage)}}
var _4;if(isc.isAn.Array(_2)){_4=_2.get(0)}else{_4=_2}
if(_1.status==isc.RPCResponse.STATUS_SUCCESS||_1.status==isc.RPCResponse.STATUS_VALIDATION_ERROR)
{this.editRecord(_4)}
var _5=this.$458.pop();if(_5)this.fireCallback(_5,"dsResponse,data,dsRequest",[_1,_2,_3])},filterData:function(_1,_2,_3){var _4=this.getDataSource();if(!_4){this.logWarn("Ignoring call to filterData() on a DynamicForm with no valid dataSource");return}
if(this.$458==null)this.$458=[];this.$458.add(_2);_4.filterData(_1,{target:this,methodName:"fetchDataReply"},_3)}}
if(isc.DynamicForm)isc.DynamicForm.addMethods(isc.$457)
if(isc.ValuesManager)isc.ClassFactory.mixInInterface("ValuesManager","EditorActionMethods");if(isc.ValuesManager)isc.ValuesManager.addMethods(isc.$457)
if(isc.ValuesManager){isc.A=isc.ValuesManager.getPrototype();isc.A.fieldValuesAreEqual=isc.Canvas.getPrototype().fieldValuesAreEqual}
if(isc.ListGrid){isc.A=isc.ListGrid.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.filterWithCriteria=function isc_ListGrid_filterWithCriteria(_1,_2,_3){var _4=this.Super("filterWithCriteria",arguments);if(this.data&&isc.isA.ResultSet(this.data)){this.$178p();if(!this.data.lengthIsKnown()){this.data.$178q=true;this.$178r()}}
return _4});isc.B._maxIndex=isc.C+1}
if(isc.TreeGrid){isc.A=isc.TreeGrid.getPrototype();isc.A.ignoreEmptyCriteria=true;isc.A=isc.TreeGrid.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.alwaysCreateNewResultTree=false;isc.B.push(isc.A.useExistingDataModel=function isc_TreeGrid_useExistingDataModel(_1,_2,_3){if(this.alwaysCreateNewResultTree)return false;return this.Super("useExistingDataModel",arguments)},isc.A.createDataModel=function isc_TreeGrid_createDataModel(_1,_2,_3){return this.createResultTree(_1,_3.afterFlowCallback,_3,null)},isc.A.filterWithCriteria=function isc_TreeGrid_filterWithCriteria(_1,_2,_3){var _4=false;if(this.useExistingDataModel(_1,_2,_3)&&isc.ResultTree&&isc.isA.ResultTree(this.data))
{this.$117s(_3);delete this.data.$84a}
var _5=this.Super("filterWithCriteria",arguments);if(this.data&&isc.isA.ResultTree(this.data)){if(this.data.isLoading(this.data.getRoot())){this.$178r()}}
return _5});isc.B._maxIndex=isc.C+3}
if(isc.DetailViewer){isc.A=isc.DetailViewer.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.viewSelectedData=function isc_DetailViewer_viewSelectedData(_1,_2,_3){if(isc.isA.String(_1))_1=window[_1];_3=_3||{};var _4=_1.getSelection();if(_4.length>0){if(!_3.operation){this.setData(_4)}else{var _5=_3.operation,_6=this.getDataSource(),_7=_6.filterPrimaryKeyFields(_4);if(_3.prompt==null)
_3.prompt=isc.RPCManager.getViewRecordsPrompt;_3.viewer=this;return _6.performDSOperation(_5.type,_7,(_2?_2:{target:this,methodName:"viewSelectedDataReply"}),_3)}}
return false},isc.A.viewSelected=function isc_DetailViewer_viewSelected(_1,_2){return this.viewSelectedData(_1,_2)},isc.A.viewSelectedDataReply=function isc_DetailViewer_viewSelectedDataReply(_1,_2,_3){this.setData(_2)});isc.B._maxIndex=isc.C+3}
isc.defineClass("MockDataSource","DataSource");isc.A=isc.MockDataSource;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.parseTextWikiSymbols=function isc_c_MockDataSource_parseTextWikiSymbols(_1){var _2=false;var _3=false;var _4=false;var _5=[];for(var i=0;i<_1.length;i++){var c=_1.charAt(i);if(c=='\\'){if((i+1)<_1.length&&_1.charAt(i+1)=='r'){c="<br/>";i++}}else if(c=='['&&_1.indexOf("]",i+1)>0){c="<a href='#'>";_4=true}else if(c==']'){if(_4){c="</a>";_4=false}}else if(c=='*'){if(_3){_3=false;c="</b>"}else{_3=true;c="<b>"}}else if(c=='_'){if(_2){_2=false;c="</i>"}else{_2=true;c="<i>"}}
_5.push(c)}
return _5.join("")},isc.A.convertTitleToName=function isc_c_MockDataSource_convertTitleToName(_1,_2,_3){var _4=true,_5=_1.trim().replace(/(\\r|\r)/g,"_").replace(/[^a-zA-Z0-9_# ]/g,"_");_5=_5.replace(/#+/g," Number ");_5=_5.trim();if(_5==""||(_5.charAt(0)>='0'&&_5.charAt(0)<='9')){_5='_'+_5}
var _6=_5.split(" ");_5="";if("underscores"==_2){for(var i=0;i<_6.length;i++){_5+=_6[i].toLowerCase();if(i!=(_6.length-1)){_5+="_"}}}else if("underscoresAllCaps"==_2){for(var i=0;i<_6.length;i++){_5+=_6[i].toUpperCase();if(i!=(_6.length-1)){_5+="_"}}}else if("underscoresKeepCase"==_2){for(var i=0;i<_6.length;i++){_5+=_6[i];if(i!=(_6.length-1)){_5+="_"}}}else{_5=_6[0].toLowerCase();for(var i=1;i<_6.length;i++){_5+=_6[i].substring(0,1).toUpperCase();_5+=_6[i].substring(1).toLowerCase()}}
while(_4){if(_5.endsWith("_")){_5=_5.substring(0,_5.length-1)}else{_4=false}}
if(_5==""){_5="isc_gen"}
if(_5!=_1&&_3.contains(_5)){while(_3.contains(_5)){_5+="_"}}
return _5},isc.A.$871=function isc_c_MockDataSource__isDigit(_1){var _2=_1.charCodeAt(0);if((_2>47)&&(_2<58)){return true}
return false},isc.A.splitComma=function isc_c_MockDataSource_splitComma(_1){var _2=_1.split(","),_3=[];for(var i=0,_5=_2.length,_6;i<_5;++i){_6="";while(_2[i].slice(-1)=="\\"){_6+=_2[i++].slice(0,-1)+","}
_3.push(_6+_2[i])}
return _3},isc.A.isFieldParametersLine=function isc_c_MockDataSource_isFieldParametersLine(_1){return(_1.startsWith("[")&&_1.endsWith("]")&&_1!="[]"&&_1!="[ ]"&&_1!="[x]")},isc.A.parseTree=function isc_c_MockDataSource_parseTree(_1){var _2=_1.split("\n");var _3=[];var _4;var _5=0;for(var i=0;i<_2.length;i++){var _7={};var _8=_2[i].split("");var _9=0;for(var j=0;j<_8.length;j++){if(_8[j]==" "||_8[j]=="."){_9+=1}else{break}}
var _11=_2[i].substr(_9);if(_11.startsWith("f")||_11.startsWith(">")||_11.startsWith("[x")||_11.startsWith("[+")){_7.isFolder=true}else if(_11.startsWith("F")||_11.startsWith("v")||_11.startsWith("[ ")||_11.startsWith("[-")){_7.isFolder=true;_7.isOpen=true}
var _12=isc.CheckboxItem.getInstanceProperty("checkedImage");var _13=isc.CheckboxItem.getInstanceProperty("uncheckedImage");if(_11.startsWith("f")){}else if(_11.startsWith(">")){}else if(_11.startsWith("[x")){_7.icon=_12}else if(_11.startsWith("[+")){}else if(_11.startsWith("F")){}else if(_11.startsWith("v")){}else if(_11.startsWith("[ ")){_7.icon=_13}else if(_11.startsWith("[-")){}else if(_11.startsWith("-")){_7.isFolder=false}else if(_11.startsWith("_")){_7.icon=isc.Canvas.$wz;_7.isOpen=true}
if(_11.startsWith("["))_11=_11.substr(3);else if(_7.isFolder)_11=_11.substr(1);else if(_11.startsWith("-")||_11.startsWith("_"))_11=_11.substr(1);_7.name=isc.MockDataSource.parseTextWikiSymbols(_11).trim();_7.children=[];if(_9==0){_3.add(_7)}else if(_9>_5){_4.children.add(_7);_7.parent=_4}else if(_9==_5){_4.parent.children.add(_7);_7.parent=_4.parent}else{var _14=_5;var _15=_4.parent;while(_14>_9){_15=_15.parent;_14-=1}
_15.children.add(_7);_7.parent=_15}
_4=_7;_5=_9}
return _3});isc.B._maxIndex=isc.C+6;isc.A=isc.MockDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.mockData="md";isc.A.mockDataType="grid";isc.A.fieldNamingConvention="camelCaps";isc.A.detectFieldTypes=true;isc.A.guesserProperties={minExampleCount:4};isc.A.clientOnly=true;isc.B.push(isc.A.init=function isc_MockDataSource_init(){if(!this.cacheData)this.cacheData=[];if(!this.fields)this.fields=[];if(this.mockData&&isc.isAn.Array(this.mockData)&&this.mockData.length>0){this.$188z=this.mockData;var _1=this.mockData,_2=[];var _3=[];_1.forEach(function(_13){var _4=isc.getKeys(_13);for(var i=0;i<_4.length;i++){var _6=_4[i];if(!_3.contains(_6))_3.add(_6)}});_2.push(_3.join());_1.forEach(function(_13){var _7=[];for(var i=0;i<_3.length;i++){var _6=_3[i],_8=_13[_6];if(_8==null)_8="";else if(isc.isA.String(_8)&&_8.contains(","))_8="\""+_8+"\"";_7.push(_8)}
_2.push(_7.join())});this.mockData=_2.join('\n')}
if(this.mockDataType=="grid"){var _9=this.mockData.split("\n");var _10=this.getFieldParameters(_9);this.rawHeaderLine=_9[0];var _11=this.parseTableFields(this.rawHeaderLine,_10);this.sortProperties=this.extractSortProperties(_11);var _2=this.getDataRecords(_9,_11,_10);if(isc.SchemaGuesser&&this.detectFieldTypes){var _12=isc.SchemaGuesser.create(this.guesserProperties);_12.fields=_11;_11=_12.extractFieldsFrom(_2);_2=_12.convertData(_2)}
if(!this.fields||this.fields.length==0)this.fields=_11;if(!this.cacheData||this.cacheData.length==0)this.cacheData=_2}else if(this.mockDataType=="tree"){if(!this.fields||this.fields.length==0){this.fields=[{name:"name",type:"text"}]}
if(!this.cacheData||this.cacheData.length==0){this.cacheData=isc.MockDataSource.parseTree(this.mockData)}}
return this.Super("init",arguments)},isc.A.applyGridSettings=function isc_MockDataSource_applyGridSettings(_1){if(!_1)_1={};_1.autoFetchData=true;if(this.mockDataType=="tree"){_1.dataProperties={openProperty:"isOpen"};return _1}
var _2=this.getHeaderDisplayRowCount();_1.headerHeight=Math.max(25,15*_2);_1.autoFitFieldWidths=true;_1.autoFitWidthApproach="title";if(_1.leaveScrollbarGap==null){_1.leaveScrollbarGap=false}
if(this.sortProperties)isc.addProperties(_1,this.sortProperties);var _3=isc.getValues(this.fields);_1.fields=[];for(var i=0;i<_3.length;i++){_1.fields.add({name:_3[i].name,type:_3[i].type,title:_3[i].title})}
if(_1.dataSource&&_1.dataSource.MockDataSource){_1.dataSource.MockDataSource.fieldNamingConvention=this.fieldNamingConvention;_1.dataSource.MockDataSource.fields=_3;_1.dataSource.MockDataSource.cacheData=this.cacheData}
return _1},isc.A.getFieldParameters=function isc_MockDataSource_getFieldParameters(_1){var _2=null,_3=_1[_1.length-1];if(isc.MockDataSource.isFieldParametersLine(_3)){_2=_3.substring(1,_3.length-1).split(",")}
return _2},isc.A.extractSortProperties=function isc_MockDataSource_extractSortProperties(_1){var _2;for(var i=0;i<_1.length;i++){if(_1[i].sortDirection){_2={sortField:_1[i].name};if(_1[i].sortDirection=="descending"){_2.sortDirection=_1[i].sortDirection}
delete _1[i].sortDirection;break}}
return _2},isc.A.getHeaderDisplayRowCount=function isc_MockDataSource_getHeaderDisplayRowCount(){var _1=this.rawHeaderLine.split(","),_2=1;for(var i=0;i<_1.length;i++){_2=Math.max(_2,_1[i].split("\\r").length)}
return _2},isc.A.parseTableFields=function isc_MockDataSource_parseTableFields(_1,_2){var _3=isc.MockDataSource.splitComma(_1),_4=[];for(var j=0;j<_3.length;j++){var _6=_3[j].trim().replace(/(\\r|\r)/g,"<br/>");var _7=null;if(_6.endsWith(" ^")){_7="ascending";_6=_6.substring(0,_6.length-2).trim()}else if(_6.endsWith(" v")){_7="descending";_6=_6.substring(0,_6.length-2).trim()}
var _8=isc.MockDataSource.convertTitleToName(_3[j],this.fieldNamingConvention,_3);var _9=_8;var _10=0;do{var _11=false;for(var i=0;i<_4.length;i++){if(_4[i].name==_9){_10++;_9=_8+_10;_11=true;break}}}while(_11);if(_6==""){_6="&nbsp;"}
var _13={name:_9,title:_6};if(_13.title.length<=3){_13.align="center"}
if(_7)_13.sortDirection=_7;if(_2&&_2[j]){_13.width=_2[j];var _14=_13.width[_13.width.length-1];if(!isc.MockDataSource.$871(_14)){_13.width=_13.width.substring(0,_2[j].length-1);if(_14=='R'||_14=='r'){_13.align="right"}else if(_14=='L'||_14=='l'){_13.align="left"}else if(_14=='C'||_14=='c'){_13.align="center"}}
_13.width+="%"}
_4.add(_13)}
return _4},isc.A.getDataRecords=function isc_MockDataSource_getDataRecords(_1,_2,_3){var _4=[];var _5=_1.length-(_3?1:0);for(var i=1;i<_5;i++){if(isc.MockDataSource.isFieldParametersLine(_1[i])){continue}
var _7={};var _8=isc.MockDataSource.splitComma(_1[i]);for(var j=0;j<_2.length;j++){var _10=_8[j];if(_10!=null){_10=_10.replace(/\r/g,"<br/>");if(!this.detectFieldTypes||_10!="[]"&&_10!="[ ]"&&_10!="[x]"){_10=_10.replace("[]","<input type='checkbox' />");_10=_10.replace("[ ]","<input type='checkbox' />");_10=_10.replace("[x]","<input type='checkbox' checked='true' />");_10=isc.MockDataSource.parseTextWikiSymbols(_10)}
_7[_2[j].name]=_10}}
_4.add(_7)}
return _4});isc.B._maxIndex=isc.C+7;isc.defineClass("OfflineDataSource","DataSource");isc.A=isc.OfflineDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.cacheAllData=true;isc.A.clientOnly=true;isc.B.push(isc.A.getOfflineStorageKey=function isc_OfflineDataSource_getOfflineStorageKey(){return this.storageKey||this.getID()},isc.A.updateOfflineCache=function isc_OfflineDataSource_updateOfflineCache(){var _1=this;var _2=function(){isc.Offline.put(_1.getOfflineStorageKey(),isc.JSON.encode(_1.cacheData))}
isc.Timer.setTimeout(_2,1)},isc.A.init=function isc_OfflineDataSource_init(){this.Super("init",arguments);var _1=this.cacheData;if(!_1){var _2=isc.Offline.get(this.getOfflineStorageKey());if(_2){_1=isc.JSON.decode(_2,{dateFormat:"logicalDateConstructor"})}else{_1=[]}
this.setCacheData(_1)}
this.observe(this,"updateCaches","observer.updateOfflineCache()")});isc.B._maxIndex=isc.C+3;isc.defineClass("DataView",isc.VLayout);isc.A=isc.DataView.getPrototype();isc.A.autoLoadServices=true;isc.A.autoBindDBCs=true;isc.A=isc.Canvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.dataViewInit=function isc_Canvas_dataViewInit(){var _1=this.operations;if(_1==null){this.bindToServices();return}
this.operations.setProperty("dataView",this);if(!this.autoLoadServices)return;var _2=_1.getProperty("location").getUniqueItems();this.logInfo("loading services: "+_2);this.$72q=_2.length;var _3=this;for(var i=0;i<_2.length;i++){isc.xml.loadWSDL(_2[i],function(_5){_3.$72q--;_3.logInfo("service loaded: "+_5+", remaining: "+_3.$72q);if(_3.$72q==0){_3.dataViewLoaded();_3.bindToServices()}},null,true)}},isc.A.addVM=function isc_Canvas_addVM(_1){this.addedVMs=this.addedVMs||[];this.addedVMs.add(_1)},isc.A.bindToServices=function isc_Canvas_bindToServices(){if(!this.autoBindDBCs)return;var _1=this.getAllDBCs(this);if(!_1)return;var _2=this.getAllVMs();if(this.logIsDebugEnabled("DataView")){this.logDebug("vms: "+this.echoAll(_2.getProperties(["dataSource","serviceNamespace","serviceName"]))+", all dbcs: "+this.echoAll(_1.getProperties(["dataSource","serviceNamespace","serviceName"])),"DataView")}
for(var i=0;i<_1.length;i++){var _4=_1[i];if(_4.dataSource){if(this.canEdit!=null&&_4.canEdit==null)_4.setCanEdit(this.canEdit);var _5=this.findVM(_4,_2);if(_5){if(this.logIsInfoEnabled("dataRegistration")){this.logWarn("dbc: "+_4+" binding to dataSource: "+_4.dataSource+" and vm: "+_5+", with fields: "+this.echoAll(_4.originalFields),"dataRegistration")}
if(_4.originalFields)_4.setDataSource(_4.dataSource,_4.originalFields);_5.addMember(_4)}else{this.logInfo("no VM for DBC: "+this.echoLeaf(_4),"DataView")}}
if(isc.isA.DynamicForm(_4)&&_4.items){_4.items.callMethod("registerWithDataView",this)}}},isc.A.getAllVMs=function isc_Canvas_getAllVMs(){var _1=[];var _2=this.operations;if(_2){_1.addAll(_2.getProperty("inputVM"));_1.addAll(_2.getProperty("outputVM"))}
_1.addAll(this.addedVMs);_1.removeList([null]);return _1},isc.A.findVM=function isc_Canvas_findVM(_1,_2){if(!_2)_2=this.getAllVMs();var _3=(isc.isA.DataSource(_1)?_1:_1.getDataSource());for(var i=0;i<_2.length;i++){var _5=_2[i];if(_3==_5.getDataSource())return _5}},isc.A.getAllDBCs=function isc_Canvas_getAllDBCs(_1){var _2=_1.children;if(!_2)return null;var _3=[];for(var i=0;i<_2.length;i++){var _1=_2[i];if(isc.isA.DataBoundComponent(_1))_3.add(_1);_3.addAll(this.getAllDBCs(_1))}
return _3},isc.A.registerItem=function isc_Canvas_registerItem(_1){if(!_1.inputDataPath)return;var _2=isc.WebService.getByName(_1.inputServiceName,_1.inputServiceNamespace);if(!_2){this.logWarn("Member: "+_1+" could not find webService with name '"+_1.inputServiceName+"', namespace '"+_1.inputServiceNamespace+"'. Has it been loaded?");return}
var _3=_1.inputSchemaDataSource;var _4=this.itemRegistry=this.itemRegistry||{};var _5=_4[_3]=_4[_3]||[];_5.add(_1)},isc.A.populateListeners=function isc_Canvas_populateListeners(_1){var _2=_1.getDataSource().getID();var _3=this.itemRegistry;if(this.logIsInfoEnabled("DataView")){this.logInfo("message: "+_2+", registry: "+this.echo(_3)+", data: "+this.echo(_1.getValues()),"DataView")}
if(!_3)return;var _4=_3[_2];if(!_4)return;for(var i=0;i<_4.length;i++){var _6=_4[i];var _7=_1.getValue(_6.inputDataPath);this.logWarn("component: "+_6+" with inputDataPath: "+_6.inputDataPath+" got data: "+this.echo(_7));if(isc.isA.FormItem(_6)){_6.setValue(_7)}else{_6.setData(_7)}}},isc.A.dataViewLoaded=function isc_Canvas_dataViewLoaded(){});isc.B._maxIndex=isc.C+9;isc.DataView.registerStringMethods({dataViewLoaded:""});isc.defineClass("ServiceOperation").addClassMethods({getServiceOperation:function(_1,_2,_3){if(this.$725)return this.$725.find({operationName:_1,serviceName:_2,serviceNamespace:_3})}});isc.A=isc.ServiceOperation.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.init=function isc_ServiceOperation_init(){isc.ClassFactory.addGlobalID(this);this.Super("init",arguments);if(!isc.ServiceOperation.$725)isc.ServiceOperation.$725=[];isc.ServiceOperation.$725.add(this)},isc.A.invoke=function isc_ServiceOperation_invoke(){var _1=this.service=isc.WebService.getByName(this.serviceName,this.serviceNamespace);if(!_1){this.logWarn("Unable to find web service with serviceName '"+this.serviceName+"' and serviceNamespace '"+this.serviceNamespace+"'. Has it been loaded?");return}
var _2=this.inputVM.getValues();if(_1.useSimplifiedInputs(this.operationName)){_2=_2[isc.firstKey(_2)]}
var _3=this;_1.callOperation(this.operationName,_2,null,function(_2,_4,_5,_6){_3.invocationCallback(_2,_4,_5,_6)})},isc.A.invocationCallback=function isc_ServiceOperation_invocationCallback(_1,_2,_3,_4){if(!this.outputVM)return;if(this.service.getSoapStyle(this.operationName)=="document"){var _5=this.outputVM.getDataSource().getFieldNames();if(_5.length==1){var _6=_5.first(),_7={};_7[_6]=_1;_1=_7}}
this.outputVM.setValues(_1);if(this.logIsInfoEnabled()){this.logInfo("populating listeners on dataView: "+this.dataView+", vm has values: "+this.echo(this.outputVM.getValues()))}
if(this.dataView)this.dataView.populateListeners(this.outputVM)});isc.B._maxIndex=isc.C+3;(function(){var Offline={explicitOffline:null,isOffline:function(){if(this.explicitOffline!==null)return this.explicitOffline;var offline=window.navigator.onLine?false:true;return offline},goOffline:function(){this.explicitOffline=true},goOnline:function(){this.explicitOffline=false},useNativeOfflineDetection:function(){this.explicitOffline=null},KEY_PREFIX:"isc-",LOCAL_STORAGE:"localStorage",GLOBAL_STORAGE:"globalStorage",DATABASE_STORAGE:"databaseStorage",GEARS_DATABASE_API:"gears database api",USERDATA_PERSISTENCE:"userData persistence",GOOGLE_GEARS:"google gears",NO_MECHANISM:"no discovered mechanism",maxResponsesToPersist:100,userDataPersistenceInIE8:false,localStorageType:function(){if(window.localStorage){if(!this.userDataPersistenceInIE8||!isc.Browser.isIE){return this.LOCAL_STORAGE}}
if(window.globalStorage)return this.GLOBAL_STORAGE;if(window.openDatabase)return this.DATABASE_STORAGE;if(isc.Browser.isIE&&isc.Browser.version>=5){if(!UserDataPersistence.isInitialized)UserDataPersistence.init();return this.USERDATA_PERSISTENCE}
return this.NO_MECHANISM},getNativeStoredValuesCount:function(){switch(this.localStorageType()){case this.LOCAL_STORAGE:return localStorage.length;break;case this.USERDATA_PERSISTENCE:return UserDataPersistence.getNativeStoredValuesCount();break;case this.GLOBAL_STORAGE:case this.DATABASE_STORAGE:case this.GEARS_DATABASE_API:case this.GOOGLE_GEARS:break}},getSCStoredValuesCount:function(){var entries=this.get(this.countKey);entries=entries?entries*1:0;return entries},getKeyForNativeIndex:function(index){switch(this.localStorageType()){case this.LOCAL_STORAGE:return localStorage.key(index);case this.USERDATA_PERSISTENCE:return UserDataPersistence.getKeyForNativeIndex(index);break;case this.GLOBAL_STORAGE:case this.DATABASE_STORAGE:case this.GEARS_DATABASE_API:case this.GOOGLE_GEARS:break}},clearCache:function(){var count=this.getSCStoredValuesCount();while(this.getSCStoredValuesCount()>0){this.removeOldestEntry();if(this.getSCStoredValuesCount()==count)break;count=this.getSCStoredValuesCount()}},clearCacheNatively:function(){if(this.localStorageType()==this.USERDATA_PERSISTENCE){UserDataPersistence.clearCacheNatively();return}
var count=this.getNativeStoredValuesCount();this.logDebug("Removing all "+count+" entries from local storage");for(var i=0;i<count;i++){this.$786(this.getKeyForNativeIndex(0),false)}},logCacheContents:function(maxEntryLength){var contents=this.getCacheContents();this.logDebug("Dumping the contents of the browser's local storage:");for(var key in contents){var value=contents[key];if(value&&value.length>maxEntryLength){value=value.substring(0,maxEntryLength)}
this.logDebug(key+" ===> "+value)}},getCacheContents:function(){var index=0,contents={},count=this.getSCStoredValuesCount();while(index<count){var key=this.getPriorityQueueKey(index);if(key.indexOf(this.KEY_PREFIX)==0)key=key.substring(this.KEY_PREFIX.length);contents[key]=this.get(key);index++}
return contents},getCacheKeys:function(){var index=0,keys=[],count=this.getSCStoredValuesCount();while(index<count){var key=this.getPriorityQueueKey(index);keys[keys.length]=key;index++}
return keys},removeOldestEntry:function(){var key=this.getAndRemoveOldestFromPriorityQueue();if(key==null)return;this.remove(key,true)},$787:function(maxEntryLength){var doc=this.userDataSpan.xmlDocument;var maxEntryLength=100;this.logDebug("Dumping the contents of raw userData storage:");for(var i=0;i<this.userDataSpan.xmlDocument.firstChild.attributes.length;i++){var key=this.userDataSpan.xmlDocument.firstChild.attributes[i].name;var value=this.userDataSpan.getAttribute(key);if(value&&value.length>maxEntryLength){value=value.substring(0,maxEntryLength)+"..."}
this.logDebug(key+" ===> "+value)}},put:function(key,value,recycleEntries){if(value==null){this.remove(key);return}
var ts=new Date().getTime();var oldValue=this.get(key);while(true){try{this.$788(key,value);break}catch(e){if(recycleEntries!==false&&this.isStorageException(e)){var entries=this.getStorageMetrics().storedEntries;if(entries>0){this.logDebug("Cache full; removing oldest entry and trying again");this.removeOldestEntry()}else{this.logDebug("Can't add this entry to browser-local storage, even though the cache is empty - the item must be larger than the browser's permitted cache space.");break}}else{throw e}}}
var end=new Date().getTime();var pqOK=false,metricsOK=false;while(!pqOK||!metricsOK){try{if(!pqOK)this.addToPriorityQueue(key);pqOK=true;if(!metricsOK)this.updateMetrics("put",key,value,oldValue);metricsOK=true}catch(e){if(this.isStorageException(e)){if(recycleEntries!==false){var entries=this.getStorageMetrics().storedEntries;if(entries>0){this.logDebug("Cache full when updating priority queue or metrics; removing oldest entry and trying again");this.removeOldestEntry();continue}}
this.logDebug("Cache full when updating priority queue or metrics; rolling back the entire update");this.$786(key);if(pqOK)this.removeFromPriorityQueue(key);this.rebuildMetrics();throw e}else{throw e}}}
this.logDebug("put() with key: "+key+"\nitem: "+this.echoLeaf(value)+": "+(end-ts)+"ms. Maintaining the priority queue and metrics took a further "+new Date().getTime()-end+"ms")},$788:function(key,value,applyPrefix){key=(applyPrefix===false?"":this.KEY_PREFIX)+key;switch(this.localStorageType()){case this.LOCAL_STORAGE:localStorage.setItem(key,value);break;case this.USERDATA_PERSISTENCE:UserDataPersistence.putValue(key,value);break;case this.GLOBAL_STORAGE:case this.DATABASE_STORAGE:case this.GEARS_DATABASE_API:case this.GOOGLE_GEARS:this.logError("Persistence method '"+this.localStorageType()+"' not yet supported");break}},isStorageException:function(e){switch(this.localStorageType()){case this.LOCAL_STORAGE:if(isc.Browser.isIE){return(e.number==-2147024882)}else if(isc.Browser.isMoz){return(e.name=="NS_ERROR_DOM_QUOTA_REACHED")}else{return(e.name=="QUOTA_EXCEEDED_ERR")||e.name=="QuotaExceededError"}
break;case this.USERDATA_PERSISTENCE:return(e.number==-2147024857)}},get:function(key){var ts=new Date().getTime(),item;switch(this.localStorageType()){case this.LOCAL_STORAGE:item=localStorage.getItem(this.KEY_PREFIX+key);break;case this.USERDATA_PERSISTENCE:item=UserDataPersistence.getValue(this.KEY_PREFIX+key);break;case this.GLOBAL_STORAGE:case this.DATABASE_STORAGE:case this.GEARS_DATABASE_API:case this.GOOGLE_GEARS:break}
if(item)item=isc.clone(item);var end=new Date().getTime();this.logDebug("get() with key: "+key+"\nitem is: "+this.echoLeaf(item)+": "+(end-ts)+"ms");return item},remove:function(key,skipPriorityQueueUpdate){this.logDebug("Removing item for key: "+key);this.updateMetrics("remove",key);if(!skipPriorityQueueUpdate)this.removeFromPriorityQueue(key);this.$786(key)},$786:function(key,applyPrefix){key=(applyPrefix===false?"":this.KEY_PREFIX)+key;switch(this.localStorageType()){case this.LOCAL_STORAGE:localStorage.removeItem(key);break;case this.USERDATA_PERSISTENCE:UserDataPersistence.removeValue(key);break;case this.GLOBAL_STORAGE:case this.DATABASE_STORAGE:case this.GEARS_DATABASE_API:case this.GOOGLE_GEARS:break}},getUndecoratedKey:function(key){if(key&&key.startsWith(this.KEY_PREFIX)){key=key.substring(this.KEY_PREFIX.length)}
return key},priorityQueueKey:"pq",addToPriorityQueue:function(userKey){this.removeFromPriorityQueue(userKey);var key=this.toInternalKey(userKey);var pqText=this.get(this.priorityQueueKey);if(pqText){try{eval("var pq = "+pqText)}catch(e){isc.logWarn("Caught exception trying to parse priority queue: "+isc.echo(e))}}else{var pq=[]}
if(!isc.isAn.Array(pq)){isc.logWarn("Priority queue is not an array after parsing - rebuilding");pq=this.rebuildPriorityQueue()}
pq.push(key);this.$788(this.priorityQueueKey,this.serialize(pq))},removeFromPriorityQueue:function(userKey){var key=this.toInternalKey(userKey);var pqText=this.get(this.priorityQueueKey);if(pqText){try{eval("var pq = "+pqText)}catch(e){isc.logWarn("Caught exception trying to parse priority queue: "+isc.echo(e))}}else{var pq=[]}
if(!isc.isAn.Array(pq)){isc.logWarn("Priority queue is not an array after parsing - rebuilding");pq=this.rebuildPriorityQueue()}
for(var i=0;i<pq.length;i++){if(pq[i]==key){var leading=pq.slice(0,i);var trailing=pq.slice(i+1);pq=leading.concat(trailing);break}}
this.$788(this.priorityQueueKey,this.serialize(pq))},getAndRemoveOldestFromPriorityQueue:function(){var pqText=this.get(this.priorityQueueKey);if(pqText){try{eval("var pq = "+pqText)}catch(e){isc.logWarn("Caught exception trying to parse priority queue: "+isc.echo(e))}}else{var pq=[]}
if(!isc.isAn.Array(pq)){isc.logWarn("Priority queue is not an array after parsing - rebuilding");pq=this.rebuildPriorityQueue()}
var oldest=pq.shift();this.$788(this.priorityQueueKey,this.serialize(pq));return this.toUserKey(oldest)},getPriorityQueueEntry:function(index){var key=this.getPriorityQueueKey(index);var value=this.get(key);var entry={};entry[key]=value;return entry},getPriorityQueueValue:function(index){var key=this.getPriorityQueueKey(index);return this.get(key)},getPriorityQueueKey:function(index){var pqText=this.get(this.priorityQueueKey);if(pqText){try{eval("var pq = "+pqText)}catch(e){isc.logWarn("Caught exception trying to parse priority queue: "+isc.echo(e))}}else{var pq=[]}
if(!isc.isAn.Array(pq)){isc.logWarn("Priority queue is not an array after parsing - rebuilding");pq=this.rebuildPriorityQueue()}
return this.toUserKey(pq[index])},getPriorityQueue:function(){var pqText=this.get(this.priorityQueueKey);if(pqText){eval("var pq = "+pqText)}else{var pq=[]}
return pq},rebuildPriorityQueue:function(){isc.logWarn("WARNING: rebuildPriorityQueue() called!  This will reconstruct a corrupt priority queue, but can only do so with a random ordering; henceforth, until priority queue is modified organically to be a real priority queue again, we will not make Offline space available by deleting the oldest entries, but by deleting random entries");var entries=this.getNativeStoredValuesCount();var pq=[];for(var i=0;i<entries;i++){var key=this.toInternalKey(this.getKeyForNativeIndex(i))
key=key.substring(this.KEY_PREFIX.length);if(key==this.priorityQueueKey||key==this.countKey||key==this.keyKey||key==this.valueKey)
{continue}
pq.push(key)}
this.$788(this.priorityQueueKey,this.serialize(pq));return pq},toInternalKey:function(userKey){if(this.localStorageType()==this.USERDATA_PERSISTENCE){return UserDataPersistence.getDataStoreKey(this.KEY_PREFIX+userKey)}
return userKey},toUserKey:function(internalKey){if(this.localStorageType()==this.USERDATA_PERSISTENCE){return this.getUndecoratedKey(UserDataPersistence.getUserKey(internalKey))}
return internalKey},countKey:"storedEntryCount__",keyKey:"storedKeyBytes__",valueKey:"storedValueBytes__",updateMetrics:function(mode,key,value,oldValue){var realKey=this.KEY_PREFIX+key,storedEntries=this.get(this.countKey)||0,storedKeyBytes=this.get(this.keyKey)||0,storedValueBytes=this.get(this.valueKey)||0;storedKeyBytes=1*storedKeyBytes;storedValueBytes=1*storedValueBytes;if(mode=="remove"){var item=this.get(key);if(item!=null){storedEntries--;storedKeyBytes-=realKey.length;storedValueBytes-=item.length}}else{if(oldValue==null){storedEntries++;storedKeyBytes+=realKey.length;storedValueBytes+=value.length}else{storedValueBytes+=value.length-oldValue.length}}
this.$788(this.countKey,storedEntries);this.$788(this.keyKey,storedKeyBytes);this.$788(this.valueKey,storedValueBytes)},rebuildMetrics:function(){var pq=this.getPriorityQueue(),entries=0,keyBytes=0,valueBytes=0;for(var i=0;i<pq.length;i++){var value=this.get(pq[i]);entries++;keyBytes+=pq[i].length;valueBytes+=value.length}
this.$788(this.countKey,entries);this.$788(this.keyKey,keyBytes);this.$788(this.valueKey,valueBytes)},getStorageMetrics:function(){var storedEntries=this.get(this.countKey)||0,storedKeyBytes=this.get(this.keyKey)||0,storedValueBytes=this.get(this.valueKey)||0,countLen=0,keyLen=0,valueLen=0;if(storedEntries)countLen=storedEntries.length;if(storedKeyBytes)keyLen=storedKeyBytes.length;if(storedValueBytes)valueLen=storedValueBytes.length;storedEntries=1*storedEntries;storedKeyBytes=1*storedKeyBytes;storedValueBytes=1*storedValueBytes;var pqText=this.get(this.priorityQueueKey);var overhead=this.countKey.length+this.keyKey.length+this.valueKey.length+countLen+keyLen+valueLen;var pqLength=pqText==null?0:pqText.length+(this.KEY_PREFIX+this.priorityQueueKey).length;return{storedEntries:storedEntries,storedKeyBytes:storedKeyBytes,storedValueBytes:storedValueBytes,metricsOverhead:overhead,priorityQueue:pqLength,total:storedKeyBytes+storedValueBytes+overhead+pqLength}},getTotalStorageUsed:function(){var metrics=this.getStorageMetrics();return metrics.storedKeyBytes+metrics.storedValueBytes+metrics.metricsOverhead+metrics.priorityQueue},storeResponse:function(dsRequest,dsResponse){var ts=new Date().getTime();dsResponse.offlineTimestamp=ts;var trimmedRequest=this.trimRequest(dsRequest),key=this.serialize(trimmedRequest),value=this.serialize(this.trimResponse(dsResponse));this.logDebug("storeResponse serializing: "+(new Date().getTime()-ts)+"ms");if(this.get(key)==null){if(this.getSCStoredValuesCount()>=this.maxResponsesToPersist){this.removeOldestEntry()}}
this.put(key,value)},trimRequest:function(dsRequest){var keyProps=["dataSource","operationType","operationId","textMatchStyle","values","sortBy","startRow","endRow","data"],trimmed={},undef;for(var i=0;i<keyProps.length;i++){if(dsRequest[keyProps[i]]!==undef){trimmed[keyProps[i]]=dsRequest[keyProps[i]]}}
return trimmed},trimResponse:function(dsResponse){var keyProps=["dataSource","startRow","endRow","totalRows","data","offlineTimestamp","status","errors","invalidateCache","cacheTimestamp"],trimmed={},undef;for(var i=0;i<keyProps.length;i++){if(dsResponse[keyProps[i]]!==undef){trimmed[keyProps[i]]=dsResponse[keyProps[i]]}}
return trimmed},getResponse:function(dsRequest){var trimmedRequest=this.trimRequest(dsRequest),key=this.serialize(trimmedRequest),value=this.get(key),returnValue;eval('returnValue = '+value);if(returnValue)returnValue.fromOfflineCache=true;return returnValue},serialize:function(obj){return isc.Comm.serialize(obj,false)},showStorageInfo:function(){if(!this.storageBrowser){if(isc.Offline.localStorageType()==isc.Offline.USERDATA_PERSISTENCE){isc.Timer.setTimeout(function(){isc.say("WARNING:  This browser uses an old storage mechanism that does not permit arbitrary key/value pair storage.  This means we have to store extra management data, with the upshot that the metrics reported for 'priority queue' and 'overhead' are indicative, but not accurate")},0)}
this.metricsDF=isc.DynamicForm.create({width:"100%",numCols:6,fields:[{name:"storedEntries",title:"No. entries",disabled:true},{name:"storedKeyBytes",title:"Used by keys",disabled:true},{name:"storedValueBytes",title:"Used by values",disabled:true},{name:"priorityQueue",title:"Used by Priority Queue",disabled:true},{name:"metricsOverhead",title:"Metrics overhead",disabled:true},{name:"total",title:"Total Bytes",disabled:true}]});this.storageLG=isc.ListGrid.create({width:"100%",height:"*",canRemoveRecords:true,removeData:function(record){isc.ask("Remove this entry?",function(value){if(value){isc.Offline.remove(record.key);isc.Offline.refreshStorageInfo()}})},rowDoubleClick:function(record){isc.Offline.createStorageEditorWindow();isc.Offline.storageEditorWindow.show();isc.Offline.storageEditor.editRecord(record)},fields:[{name:"key",width:"25%",title:"Key"},{name:"value",title:"Value"}]});this.storageBrowser=isc.Window.create({autoCenter:true,canDragResize:true,width:Math.floor(isc.Page.getWidth()*0.5),height:Math.floor(isc.Page.getHeight()*0.5),title:"Offline Storage",items:[this.metricsDF,this.storageLG,isc.HLayout.create({width:"100%",height:1,members:[isc.LayoutSpacer.create({width:"*"}),isc.Button.create({title:"Add Entry",click:function(){isc.Offline.createStorageEditorWindow();isc.Offline.storageEditorWindow.show();isc.Offline.storageEditor.editNewRecord()}})]})]})}
this.storageBrowser.show();this.refreshStorageInfo()},createStorageEditorWindow:function(){if(!isc.Offline.storageEditorWindow){isc.Offline.storageEditor=isc.DynamicForm.create({fields:[{name:"key",title:"Key",editorType:"TextAreaItem",width:400},{name:"value",title:"Value",editorType:"TextAreaItem",width:400},{name:"saveButton",type:"button",title:"Save",click:function(){var form=isc.Offline.storageEditor;if(form.saveOperationType=="update"&&form.getValue("key")!=form.getOldValue("key"))
{isc.ask("Key has changed - this will create a new entry. Do you want to retain the old entry as well? (if you answer 'No', it will be removed",function(value){if(value===false){isc.Offline.remove(form.getOldValue("key"))}
if(value!=null){isc.Offline.put(form.getValue("key"),form.getValue("value"));isc.Offline.storageEditorWindow.hide();isc.Offline.refreshStorageInfo()}})}else{isc.Offline.put(form.getValue("key"),form.getValue("value"));isc.Offline.storageEditorWindow.hide();isc.Offline.refreshStorageInfo()}}}]});isc.Offline.storageEditorWindow=isc.Window.create({bodyProperties:{margin:5},title:"Edit Offline Storage Entry",isModal:true,autoCenter:true,height:280,width:480,items:[isc.Offline.storageEditor]})}},refreshStorageInfo:function(){this.metricsDF.editRecord(isc.Offline.getStorageMetrics());var dataObj=isc.Offline.getCacheContents();var data=[];for(var key in dataObj){data.add({key:key,value:dataObj[key]})}
this.storageLG.setData(data)}};var UserDataPersistence={isInitialized:false,poolSize:10,keyIndexKey:"keyIndex",reverseKeyIndexKey:"reverseKeyIndex",init:function(){this.userDataSpan=[];for(var i=0;i<this.poolSize;i++){this.userDataSpan[i]=document.createElement('span');this.userDataSpan[i].ID='isc_userData_'+i;this.userDataSpan[i].style.behavior='url(#default#userdata)';document.body.appendChild(this.userDataSpan[i]);this.userDataSpan[i].load("isc_userData_"+i)}
this.keyIndexStore=document.createElement('span');this.keyIndexStore.ID='isc_userData_keyIndex';this.keyIndexStore.style.behavior='url(#default#userdata)';document.body.appendChild(this.keyIndexStore);this.keyIndexStore.load("isc_userData_keyIndex");this.keyIndex=this.getKeyIndexFromStore();this.reverseKeyIndex=this.getReverseKeyIndexFromStore();if(!this.keyIndex){this.keyIndex={};this.reverseKeyIndex={}}else if(!this.reverseKeyIndex)this.buildReverseKeyIndex();this.buildNextAttributeInfo();this.isInitialized=true},clearCacheNatively:function(){for(var i=0;i<this.poolSize;i++){var attrs=this.userDataSpan[i].xmlDocument.firstChild.attributes;while(attrs.length>0){this.userDataSpan[i].removeAttribute(attrs[0].name)}}
this.keyIndex={};this.reverseKeyIndex={};this.saveKeyIndex()},getNativeStoredValuesCount:function(){var count=0;for(var i=0;i<this.poolSize;i++){count+=this.userDataSpan[i].xmlDocument.firstChild.attributes.length}
return count},getKeyForNativeIndex:function(index){var iCounter=0;for(var i=0;i<this.poolSize;i++){if(iCounter+this.userDataSpan[i].xmlDocument.firstChild.attributes.length>index){var offsetIndex=index-iCounter;var attrName=this.userDataSpan[i].xmlDocument.firstChild.attributes[offsetIndex].name,attrNum=attrName.substring(1),dsKey=this.getKeyIndexValue(i,attrNum);return this.getUserKey(dsKey)}}},getKeyIndexValue:function(index,attrName){var attrNum=attrName.substring(1);if(index==0){return"00000".substring(attrNum.length)+attrNum}
return index*10000+(1*attrNum)},getUserKey:function(userKey){return this.reverseKeyIndex[userKey]},getDataStoreKey:function(key){return this.keyIndex[key]},$70p:function(dataStore,attr){return this.userDataSpan[dataStore].getAttribute(attr)},getValue:function(userKey){var key=this.getDataStoreKey(userKey),undef;if(key===undef)return null;var dataStore=(""+key).substring(0,1),attr="v"+((""+key).substring(1)*1);return this.$70p(dataStore,attr)},putValue:function(userKey,value){var key=this.getDataStoreKey(userKey);if(key){var dataStore=(""+key).substring(0,1),attr="v"+((""+key).substring(1)*1),savedValue=this.$70p(dataStore,attr)}else{var dataStore=this.getDataStoreForNewItem(),attr=this.getNextAttributeName(dataStore)}
this.userDataSpan[dataStore].setAttribute(attr,value);try{this.userDataSpan[dataStore].save("isc_userData_"+dataStore);this.addToKeyIndex(userKey,dataStore,attr)}catch(e){if(isc.Offline.isStorageException(e)){if(savedValue){this.userDataSpan[dataStore].setAttribute(attr,savedValue)}else{this.userDataSpan[dataStore].removeAttribute(attr);this.removeFromKeyIndex(userKey)}}
throw e}},removeValue:function(userKey){var key=this.getDataStoreKey(userKey),undef;if(key===undef){Offline.logDebug("userData: in removeValue, no value for key '"+userKey+"' was found");return}
var dataStore=(""+key).substring(0,1),attr="v"+((""+key).substring(1)*1);this.userDataSpan[dataStore].removeAttribute(attr);this.userDataSpan[dataStore].save("isc_userData_"+dataStore);this.removeFromKeyIndex(userKey);this.unusedAttributeNumbers[dataStore].push(attr.substring(1)*1)},getDataStoreForNewItem:function(){var undef;if(this.nextDataStoreToUse===undef){this.nextDataStoreToUse=Math.floor(Math.random()*this.poolSize)}
var rtnValue=this.nextDataStoreToUse++;if(this.nextDataStoreToUse>=this.poolSize)this.nextDataStoreToUse=0;return rtnValue},buildNextAttributeInfo:function(){this.nextAttributeNumber=[];this.unusedAttributeNumbers=[];for(var i=0;i<this.poolSize;i++){this.unusedAttributeNumbers[i]=[];var attrs=this.userDataSpan[i].xmlDocument.firstChild.attributes;var work=[];for(var j=0;j<attrs.length;j++){var num=attrs[j].name.substring(1)*1;if(!isNaN(num))work.add(attrs[j].name.substring(1)*1)}
if(work.sort)work.sort();else this.sort(work);var counter=0;for(j=0;j<work.length;j++){if(work[j]==counter){counter++;continue}
while(work[j]!=counter&&counter<=9999){this.unusedAttributeNumbers[i].push(counter++)}
counter++}
this.nextAttributeNumber[i]=counter}},sort:function(array){for(var i=0;i<array.length;i++){var swapped=false;for(var j=1;j<array.length-i;j++){if(array[j]<array[j-1]){var temp=array[j];array[j]=array[j-1];array[j-1]=temp;swapped=true}}
if(!swapped)break}},getNextAttributeName:function(dataStore){if(this.unusedAttributeNumbers[dataStore]&&this.unusedAttributeNumbers[dataStore].length>0)
{return"v"+this.unusedAttributeNumbers[dataStore].shift()}
if(this.nextAttributeNumber[dataStore]==null){this.nextAttributeNumber[dataStore]=1}
return"v"+this.nextAttributeNumber[dataStore]++},addToKeyIndex:function(userKey,dataStore,attr){var keyIndexValue=this.getKeyIndexValue(dataStore,attr);this.keyIndex[userKey]=keyIndexValue;this.reverseKeyIndex[keyIndexValue]=userKey;this.saveKeyIndex()},removeFromKeyIndex:function(userKey){var keyIndexValue=this.keyIndex[userKey];delete this.keyIndex[userKey];delete this.reverseKeyIndex[keyIndexValue];this.saveKeyIndex()},saveKeyIndex:function(){this.keyIndexStore.setAttribute(this.keyIndexKey,Offline.serialize(this.keyIndex));this.keyIndexStore.setAttribute(this.reverseKeyIndexKey,Offline.serialize(this.reverseKeyIndex));this.keyIndexStore.save("isc_userData_keyIndex")},buildReverseKeyIndex:function(){this.reverseKeyIndex={};for(var key in this.keyIndex){this.reverseKeyIndex[keyIndex[key]]=key}},getKeyIndexFromStore:function(){var kiText=this.keyIndexStore.getAttribute(this.keyIndexKey);if(kiText){eval("var ki = "+kiText)}else{var ki=null}
return ki},getReverseKeyIndexFromStore:function(){var kiText=this.keyIndexStore.getAttribute(this.reverseKeyIndexKey);if(kiText){eval("var ki = "+kiText)}else{var ki=null}
return ki}};if(window.isc){isc.defineClass("Offline").addClassProperties(Offline);isc.defineClass("UserDataPersistence").addClassProperties(UserDataPersistence)}else{isc.addProperties=function(objOne,objTwo){for(var propName in objTwo)objOne[propName]=objTwo[propName]}
isc.addProperties(isc.Offline,{serialize:function(object){return isc.OfflineJSONEncoder.encode(object)},logDebug:function(message){if(console)console.log(message)},logError:function(message){if(console){console.log(message)}else{alert(message)}},echoLeaf:function(obj){var output="",undef;if(obj===undef)return"undef";try{if(typeof obj=="Array"){output+="Array["+obj.length+"]"}else if(typeof obj=="Date"){output+="Date("+obj.toShortDate()+")"}else if(typeof obj=="Function"){output+=isc.Func.getName(obj,true)+"()"}else{switch(typeof obj){case"string":if(obj.length<=40){output+='"'+obj+'"';break}
output+='"'+obj.substring(0,40)+'..."['+obj.length+']';output=output.replaceAll("\n","\\n").replaceAll("\r","\\r");break;case"object":if(obj==null){output+="null";break}
if(obj.tagName!=null){output+="["+obj.tagName+"Element]";break}
var toString=""+obj;if(toString!=""&&toString!="[object Object]"&&toString!="[object]")
{output+=toString;break}
output+="Obj";break;default:output+=""+obj}}
return output}catch(e){var message="[Error in echoLeaf: "+e+"]";output+=message;return output}},echo:function(object){return this.serialize(object)}});isc.OfflineJSONEncoder={$zm:function(objRefs,object,path){objRefs.obj.add(object);objRefs.path.add(path)},$42b:function(object){var treeId=object["$42c"];if(treeId!=null){var theTree=window[treeId];if(theTree&&theTree.parentProperty&&object[theTree.parentProperty]){object=theTree.getCleanNodeData(object)}}
return object},$zl:function(objRefs,object){var rowNum=objRefs.obj.indexOf(object);if(rowNum==-1)return null;return objRefs.path[rowNum]},$zp:function(objPath,newIdentifier){if(isc.isA.Number(newIdentifier)){return objPath+"["+newIdentifier+"]"}else if(!isc.Comm.$zk.test(newIdentifier))
{return objPath+'["'+newIdentifier+'"]'}else{return objPath+"."+newIdentifier}},encode:function(object){this.objRefs={obj:[],path:[]};var retVal=this.$eu(object,this.prettyPrint?"":null,null);this.objRefs=null;return retVal},dateFormat:"xmlSchema",encodeDate:function(date){if(this.dateFormat=="dateConstructor"){return"new Date("+date.getTime()+")"}else{return'"'+this.toSchemaDate(date)+'"'}},toSchemaDate:function(date){var dd=""+date.getDate(),mm=""+(date.getMonth()+1),yyyy=""+(date.getyear()+1900),hh=""+date.getHours(),mi=""+date.getMinutes(),ss=""+date.getSeconds();dd=dd.length==1?"0"+dd:dd;mm=mm.length==1?"0"+mm:mm;hh=hh.length==1?"0"+hh:ff;mi=mi.length==1?"0"+mi:mi;ss=ss.length==1?"0"+ss:ss;return yyyy+"-"+mm+"-"+dd+"T"+hh+":"+mi+":"+ss},strictQuoting:true,circularReferenceMode:"path",circularReferenceMarker:"$$BACKREF$$",prettyPrint:false,$eu:function(object,prefix,objPath){if(!objPath){if(object&&object.getID)objPath=object.getID();else objPath=""}
if(object==null)return null;if(this.isAString(object))return this.asSource(object);if(this.isAFunction(object))return null;if(this.isANumber(object)||this.isASpecialNumber(object))return object;if(this.isABoolean(object))return object;if(this.isADate(object))return this.encodeDate(object);if(this.isAnInstance(object))return null;var prevPath=this.$zl(this.objRefs,object);if(prevPath!=null&&objPath.contains(prevPath)){var nextChar=objPath.substring(prevPath.length,prevPath.length+1);if(nextChar=="."||nextChar=="["||nextChar=="]"){var mode=this.circularReferenceMode;if(mode=="marker"){return"'"+this.circularReferenceMarker+"'"}else if(mode=="path"){return"'"+this.circularReferenceMarker+":"+prevPath+"'"}else{return null}}}
if(this.isAClassObject(object))return null;if(object==window)return null;this.$zm(this.objRefs,object,objPath);if(this.isAFunction(object.$eu)){return object.$eu(prefix,this.objRefs,objPath)}
if(this.isAnArray(object)){return this.$zn(object,objPath,this.objRefs,prefix)}
var data;if(object.getSerializeableFields){data=object.getSerializeableFields([],[])}else{data=object}
return this.$zo(data,objPath,this.objRefs,prefix)},$zn:function(object,objPath,objRefs,prefix){var output="[";for(var i=0,len=object.length;i<len;i++){var value=object[i];if(prefix!=null)output+="\r"+prefix;var objPath=this.$zp(objPath,i);var serializedValue=this.$eu(value,(prefix!=null?prefix:null),objPath);output+=serializedValue+",";if(prefix!=null)output+=" "}
var commaChar=output.lastIndexOf(",");if(commaChar>-1)output=output.substring(0,commaChar);if(prefix!=null)output+="\r"+prefix;output+="]";return output},$zo:function(object,objPath,objRefs,prefix){var output="{",undef;object=this.$42b(object);try{for(var key in object)break}catch(e){return null}
for(var key in object){if(key==null)continue;if(key=="xmlHttpRequest")continue;if(key.substring(0,1)=="_"||key.substring(0,1)=="$")continue;var value=object[key];if(this.isAFunction(value))continue;if(this.isAnInstance(value))continue;var keyStr=key.toString();keyStr='"'+keyStr+'"';var objPath=this.$zp(objPath,key);var serializedValue;if(key!="__ref"&&key!="__module"){serializedValue=this.$eu(value,(prefix!=null?prefix:null),objPath)}
if(prefix!=null)output+="\r"+prefix;output+=keyStr+":"+serializedValue+",";if(prefix!=null)output.append(" ")}
var commaChar=output.lastIndexOf(",");if(commaChar>-1)output=output.substring(0,commaChar);if(prefix!=null)output+="\r"+prefix;output+="}";return output},isAString:function(object){if(object==null)return false;if(typeof object==this.$a7)return false;if(object.constructor&&object.constructor.$k!=null){return object.constructor.$k==4}
if(object.Class!=null&&object.Class==this.$73x)return true;return typeof object=="string"},isAnArray:function(object){if(object==null)return false;if(typeof object==this.$a7)return false;if(object.constructor&&object.constructor.$k!=null){return object.constructor.$k==2}
if(isc.Browser.isSafari)return""+object.splice=="(Internal function)";return""+object.constructor==""+Array},isAFunction:function(object){if(object==null)return false;if(isc.Browser.isIE&&typeof object==this.$a7)return true;var cons=object.constructor;if(cons&&cons.$k!=null){if(cons.$k!=1)return false;if(cons===Function)return true}
return isc.Browser.isIE?(isc.emptyString+object.constructor==Function.toString()):(typeof object==this.$a7)},isANumber:function(object){if(object==null)return false;if(object.constructor&&object.constructor.$k!=null){if(object.constructor.$k!=5)return false}else{if(typeof object!="number")return false}
return!isNaN(object)&&object!=Number.POSITIVE_INFINITY&&object!=Number.NEGATIVE_INFINITY},isASpecialNumber:function(object){if(object==null)return false;if(object.constructor&&object.constructor.$k!=null){if(object.constructor.$k!=5)return false}else{if(typeof object!="number")return false}
return(isNaN(object)||object==Number.POSITIVE_INFINITY||object==Number.NEGATIVE_INFINITY)},isABoolean:function(object){if(object==null)return false;if(object.constructor&&object.constructor.$k!=null){return object.constructor.$k==6}
return typeof object=="boolean"},isADate:function(object){if(object==null)return false;if(object.constructor&&object.constructor.$k!=null){return object.constructor.$k==3}
return(""+object.constructor)==(""+Date)&&object.getDate&&isc.isA.Number(object.getDate())},isAnXMLNode:function(object){if(object==null)return false;if(isc.Browser.isIE){return object.specified!=null&&object.parsed!=null&&object.nodeType!=null&&object.hasChildNodes!=null}
var doc=object.ownerDocument;if(doc==null)return false;return doc.contentType==this.$bm},isAnInstance:function(object){return(object!=null&&object.$76y!=null)},isAClassObject:function(object){return(object!=null&&object.$bp==true)},asSource:function(string,singleQuote){if(!this.isAString(string))string=""+string;var quoteRegex=singleQuote?String.$ez:String.$e0,outerQuote=singleQuote?"'":'"';return outerQuote+string.replace(/\\/g,"\\\\").replace(quoteRegex,'\\'+outerQuote).replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+outerQuote}}}})();isc.defineClass("OfflineFileSource","DataSource");isc.A=isc.OfflineFileSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.dataProtocol="clientCustom";isc.A.fields=[{name:"fileName",type:"text"},{name:"fileType",type:"text"},{name:"fileFormat",type:"text"},{name:"fileContents",type:"text"}];isc.A.fileNamePrefix="ofs-";isc.B.push(isc.A.$1733=function isc_OfflineFileSource__getAllFiles(){var _1=this;var _2=isc.Offline.getCacheKeys().findAll(function(_3){return _3.startsWith(_1.fileNamePrefix)})||[];return _2.map(function(_3){return _1.keyToFileSpec(_3)})},isc.A.$1734=function isc_OfflineFileSource__getFileContents(_1){return isc.Offline.get(this.fileSpecToKey(_1))},isc.A.keyToFileSpec=function isc_OfflineFileSource_keyToFileSpec(_1){if(_1.startsWith(this.fileNamePrefix)){_1=_1.substring(this.fileNamePrefix.length)}
return isc.DataSource.makeFileSpec(_1)},isc.A.fileSpecToKey=function isc_OfflineFileSource_fileSpecToKey(_1){return[this.fileNamePrefix,_1.fileName?_1.fileName:"",_1.fileType?"."+_1.fileType:"",_1.fileFormat?"."+_1.fileFormat:""].join("")},isc.A.transformRequest=function isc_OfflineFileSource_transformRequest(_1){var _2=this;var _3;switch(_1.operationType){case"getFile":case"hasFile":case"listFiles":var _4=this.$1733();var _5=this.getClientOnlyFetchResponse(_1,_4);_3=_5[0]||{};_3.data=_5[1]||[];if(_1.operationType=="getFile"){_3.data.map(function(_10){_10.fileContents=_2.$1734(_10)})}
break;case"removeFile":var _6=this.$1734(_1.data);isc.Offline.remove(this.fileSpecToKey(_1.data));_3={status:0,data:_6==null?[]:[_1.data]};break;case"renameFile":var _7=_1.oldValues;if(!_7){_3={status:-1,data:"File to rename must be provided in oldValues"}}else{var _8=this.$1734(_7);if(_8==null){_3={status:-1,data:"File not found"}}else{var _9=this.$1734(_1.data);if(_9!=null){_3={status:-1,data:"destination file already exists"}}else{try{isc.Offline.put(this.fileSpecToKey(_1.data),_8);isc.Offline.remove(this.fileSpecToKey(_7));_3={status:0,data:_1.data}}
catch(ex){_3={status:-1,data:ex.message}}}}}
break;case"saveFile":if(!_1.data){_3={status:-1,data:"No data provided with dsRequest"}}else if(!_1.data.fileName){_3={status:-1,data:"fileName field must be provided"}}else{isc.Offline.put(this.fileSpecToKey(_1.data),_1.data.fileContents);_3={status:0,data:_1.data}}
break;default:_3={status:-1,data:"Not implemented"};break}
this.delayCall("processResponse",[_1.requestId,_3]);return _1.data});isc.B._maxIndex=isc.C+5;isc.ClassFactory.defineClass("Rule","Validator");isc.defineClass("RulesEngine");isc.A=isc.RulesEngine.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.init=function isc_RulesEngine_init(){this.Super("init",arguments);isc.ClassFactory.addGlobalID(this);if(this.members==null)this.members=[];else{for(var i=0;i<this.members.length;i++){var _2=this.members[i];if(isc.isA.String(_2)){this.members[i]=_2=window[_2]}
this.$889(_2,true)}}},isc.A.destroy=function isc_RulesEngine_destroy(){this.Super("destroy",arguments);isc.ClassFactory.dereferenceGlobalID(this)},isc.A.addMember=function isc_RulesEngine_addMember(_1){if(!this.members.contains(_1)){this.members.add(_1);this.$889(_1)}},isc.A.$889=function isc_RulesEngine__addMember(_1){if(_1.rulesEngine!=this){if(_1.rulesEngine!=null){_1.rulesEngine.removeMember(_1)}
_1.rulesEngine=this}},isc.A.processEditStart=function isc_RulesEngine_processEditStart(_1){this.$89b("editStart",_1);this.$89b("editStartAndChanged",_1)},isc.A.processEditorEnter=function isc_RulesEngine_processEditorEnter(_1,_2){this.$89c("editorEnter",_1,_2)},isc.A.processChanged=function isc_RulesEngine_processChanged(_1,_2){this.$89c("changed",_1,_2);this.$89c("editStartAndChanged",_1,_2)},isc.A.processEditorExit=function isc_RulesEngine_processEditorExit(_1,_2){this.$89c("editorExit",_1,_2)},isc.A.processSubmit=function isc_RulesEngine_processSubmit(_1){return this.$89b("submit",_1)},isc.A.processContextChanged=function isc_RulesEngine_processContextChanged(_1){this.$89b("contextChanged",_1)},isc.A.$89b=function isc_RulesEngine__processComponentTriggerEvent(_1,_2){var _3=this.rulesData;if(!_3||_3.length==0)return;var _4=[];for(var i=0;i<_3.length;i++){if(_3[i].triggerEvent==_1){_4[_4.length]=_3[i]}}
if(_4.length>0)return this.processRules(_4,_2);return null},isc.A.$89c=function isc_RulesEngine__processFieldTriggerEvent(_1,_2,_3){var _4=this.rulesData;if(!_4||_4.length==0)return;var _5=[];for(var i=0;i<_4.length;i++){if(_4[i].triggerEvent==_1){var _7=_4[i],_8=isc.Validator.getValidatorDefinition(_4[i].type),_9=null;if(!_8){this.logWarn("RulesEngine unable to process rule with invalid type: "+_4[i].type);continue}
if(_7.dependentFields!=null){_9=_7.dependentFields}else if(_8.getDependentFields!=null){_9=_8.getDependentFields(_7,_1)}
if(_9==null||isc.isAn.emptyArray(_9)){_9=(isc.isAn.Array(_7.fieldName)?_7.fieldName.duplicate():_7.fieldName)}
if(_9!=null&&!isc.isAn.Array(_9)){_9=_9.split(",")}
if(_7.applyWhen!=null){var _10=true;if(_7.dependsOnApplyWhenFields!=null){_10=_7.dependsOnApplyWhenFields}else if(_8.dependsOnApplyWhenFields!=null){_10=_7.dependsOnApplyWhenFields}
if(_10){var _11=isc.DataSource.getCriteriaFields(_7.applyWhen);if(_9==null){_9=_11}else{_9.addList(_11)}}}
if(_9){for(var j=0;j<_9.length;j++){var _13=_9[j].indexOf("."),_14=_9[j].substring(0,_13),_15=_9[j].substring(_13+1);if(_2.getDataSource()==isc.DataSource.get(_14)&&_15==_3.name)
{_5.add(_4[i]);break}}}}}
if(_5.length>0)return this.processRules(_5,_2);return null},isc.A.getValues=function isc_RulesEngine_getValues(){if(this.ruleContext)return this.ruleContext;var _1={};for(var i=0;i<this.members.length;i++){var _3=this.members[i];if(_3.destroyed||!_3.getValues)continue;var _4=_3.getValues(),_5=_3.getDataSource(),_6=_5?_5.getID():null;if(_6!=null){_1[_6]=isc.addProperties(_1[_6]||{},_4)}else{isc.addProperties(_1,_4)}}
return _1},isc.A.processRules=function isc_RulesEngine_processRules(_1,_2){if(_1==null)return;var _3=this.getValues(),_4=null;if(!isc.isAn.Array(_1)){_1=[_1]}
for(var i=0;i<_1.length;i++){var _6=_1[i],_7=_3,_8=_6.fieldName,_9=_6.propertyName,_10=_6.locator,_11=true;if((_6.logCategory&&this.logIsInfoEnabled(_6.logCategory))||(!_6.logCategory&&this.logIsInfoEnabled("rulesEngine")))
{this.logInfo("Processing rule: name: "+_6.name+", rule type: "+_6.type+". event type: "+_6.triggerEvent+", component: "+isc.echoLeaf(_2),_6.logCategory||"rulesEngine")}
var _12=[];if(_10!=null){if(isc.isA.String(_10))_10=_10.split(/,(?![^\[]*\])/);for(var j=0;j<_10.length;j++){var _14=_10[j],_15=isc.AutoTest.isRelativeLocator(_14),_16=null;if(_15){if(this.baseComponent==null){this.logWarn("RulesEngine has no specified baseComponent. Unable to process rule with specified relative locator:"+_14);continue}
_16=isc.AutoTest.getRelativeObjectContext(this.baseComponent,_14,_6.internalRule)}else{_16=isc.AutoTest.getObjectContext(_14,_6.internalRule)}
if(_16==null||_16.object==null){_14=_14.replace(/,locatorMatching=restrictSuffix/,"");_16=isc.AutoTest.getObjectContext(_14,_6.internalRule);if(!_16||!_16.object||!_16.object.destroying){this.logWarn("RulesEngine unable to resolve locator specified on rule. "+(this.baseComponent?"\nBase Component: "+this.baseComponent:"")+"\nLocator in question:\n"+_14+" - "+isc.AutoTest.getLogFailureText()+this.getStackTrace())}
continue}
_12.add(_16)}}
if(_6.applyWhen){var _17=_6.applyWhen;if(isc.DS.isAdvancedCriteria(_17)){_17=isc.DataSource.resolveDynamicCriteria(_17,_7)}
var _18=_2?_2.getRuleScopeComponent():null;_17=isc.DataSource.validateCriteria(_17,this,_18,this.resolveFieldOrPropertyType);var _19=[];for(var j=0;j<_12.length;j++){var _16=_12[j];var _20=_16.container;if(isc.isA.GridBody(_20)&&_20.grid.$286){_20=_20.grid.$286}
var _21=_20&&((_20.hasStableLocalID&&_20.hasStableLocalID())||_20.grid||(_20.editNode!=null));if(_20&&!_21&&_20.getValues){var _22=_20.getLocalId();_7[_22]={values:_20.getValues()};_19.add(_22)}}
var _23=isc.DataSource.applyFilter([_7],_17);if(_23.length==0){_11=false}
if((_6.logCategory&&this.logIsDebugEnabled(_6.logCategory))||(!_6.logCategory&&this.logIsDebugEnabled("rulesEngine")))
{this.logDebug("Specified rule.applyWhen ["+_11+"]: "+isc.echoFull(_17)+". Values: "+isc.echoFull(_7),_6.logCategory||"rulesEngine")}
if(_19.length>0){for(var j=0;j<_19.length;j++){delete _7[_19[j]]}}}
for(var j=0;j<_12.length;j++){var _16=_12[j];var _20=_16.container;if(isc.isA.GridBody(_20)&&_20.grid.$286){_20=_20.grid.$286}
isc.Validator.performAction(_11?true:null,_16.object,_6,_7,_20,_16.objectType)}
if(isc.isA.String(_8)){_8=_8.split(",")}else if(_8==null){_8=[]}
for(var j=0;j<_8.length;j++){var _24=_8[j],_25=_24.substring(0,_24.indexOf(".")),_26=_25?isc.DataSource.get(_25):null,_27=(_25?_24.substring(_25.length+1):_24),_28=isc.DataSource.getPathValue(_7,_24),_29=this.getComponentInfo(_24),_2=_29?_29.component:null,_30=_29?_29.item:(_26?_26.getField(_27):null);;if(_2==null||_30==null){this.logWarn("RulesEngine contains rule definition with specified fieldName:"+_24+" - unable to find associated "+(_2==null?"member component":"field")+" for this rule.");continue}
var _31=null;if(_11){_31=(isc.Validator.processValidator(_30,_6,_28,null,_7)==true)}
isc.Validator.performAction(_31,_30,_6,_7,_2);if(_31==false){_4=false;var _32=isc.Validator.getErrorMessage(_6);_2.addFieldErrors(_30.name,_32,true);this.rememberRuleFieldError(_6,_2,_30,_32)}else{var _33=this.getRuleFieldError(_6,_2,_30);if(_33&&_2.clearFieldError){_2.clearFieldError(_30.name,_33,true);this.clearRememberedRuleFieldError(_6,_2,_30)}
if(_4==null)_4=true}}
if(isc.isA.String(_9)){_9=_9.split(",")}else if(_9==null){_9=[]}
for(var j=0;j<_9.length;j++){var _34=_9[j],_35=_34.substring(0,_34.indexOf(".")),_34=(_35.length>0?_34.substring(_35.length+1):_34),_2=(_35.length>0?window[_35]:null);if(_2==null||_34==null){this.logWarn("RulesEngine contains rule definition with specified propertyName:"+_34+" - unable to find associated "+(_2==null?"member component":"property")+" for this rule.");continue}
var _31=null;if(_11){_31=(isc.Validator.processValidator(_34,_6,_28,null,_7)==true)}
isc.Validator.performAction(_31,_34,_6,_7,_2,"Canvas")}
this.logInfo("Specified rule has been processed. Result: "+(_11?"Passed.":"Failed."),_6.logCategory||"rulesEngine")}
return _4},isc.A.resolveFieldOrPropertyType=function isc_RulesEngine_resolveFieldOrPropertyType(_1,_2){var _3=this.getValues(),_4=_2?_2.getRuleScopeDataBoundComponents():[],_5=_1.split("."),_6=_5[_5.length-1];var _7=_5[0],_8=_5.length>2?_5[1]:null,_9;if(!_8){_9=isc.DataSource.get(_7)}
if(!_9){for(var i=0;i<_4.length;i++){if(_4[i].getLocalId()==_7){_9=_4[i];break}}}
if(!_9)return null;var _11=_9.getField(_6),_12;if(_11){_12=isc.SimpleType.getType(_11.type?_11.type:"text")}else{var _13=_9.getClass().Class,_14=isc.Canvas.$171k[_13]
if(_14&&_14.metaFields.contains(_6)){_12=isc.SimpleType.getType(isc.Canvas.$177q[_6])}}
return _12},isc.A.rememberRuleFieldError=function isc_RulesEngine_rememberRuleFieldError(_1,_2,_3,_4){if(_1.$927==null){_1.$927={}}
var _5=_2.getID();if(_1.$927[_5]==null){_1.$927[_5]={}}
_1.$927[_5][_3.name]=_4},isc.A.getRuleFieldError=function isc_RulesEngine_getRuleFieldError(_1,_2,_3){var _4=_2.getID();if(_1.$927&&_1.$927[_4]&&_1.$927[_4][_3.name]!=null)
{return _1.$927[_4][_3.name]}},isc.A.clearRememberedRuleFieldError=function isc_RulesEngine_clearRememberedRuleFieldError(_1,_2,_3){var _4=_2.getID();if(_1.$927&&_1.$927[_4]&&_1.$927[_4][_3.name]!=null)
{delete _1.$927[_4][_3.name]}},isc.A.applyFieldValidators=function isc_RulesEngine_applyFieldValidators(_1,_2){var _3=this.rulesData||[],_4=this.getValues(),_5=false;for(var i=0;i<_3.length;i++){var _7=_3[i],_8=_4,_9=_7.fieldName;if(_9==null)continue;var _10=this.getComponentInfo(_9);if(_10==null||_10.component!=_2)continue;var _11=_10.item,_12=isc.DataSource.getPathValue(_8,_9);if(!_11)return;this.clearRememberedRuleFieldError(_7,_2,_11);var _13=true;if(_7.applyWhen){var _14=_7.applyWhen;var _15=isc.DataSource.applyFilter([_8],_14);if(_15.length==0){_13=false}}
if(!_13)continue;var _16=isc.Validator.processValidator(_11,_7,_12,null,_8)==true;if(!_16){var _17=isc.Validator.getErrorMessage(_7);if(_1[_11.name]==null)_1[_11.name]=_17;else{if(!isc.isAn.Array(_1[_11.name])){_1[_11.name]=[_1[_11.name]]}
_1[_11.name].add(_17)}
this.rememberRuleFieldError(_7,_2,_11,_17);_5=true}}
return _5},isc.A.getComponentInfo=function isc_RulesEngine_getComponentInfo(_1){var _2,_3=_1.indexOf("."),_4;if(_3!=-1){_4=isc.DataSource.get(_1.substring(0,_3));_1=_1.substring(_3+1)}
for(var i=0;i<this.members.length;i++){if(this.members[i].getDataSource()==_4&&this.members[i].getItem){_2=this.members[i].getItem(_1);if(_2!=null){return{component:this.members[i],item:_2}}}}},isc.A.removeMember=function isc_RulesEngine_removeMember(_1){if(this.members.contains(_1)){this.$89a(_1)}},isc.A.$89a=function isc_RulesEngine__removeMember(_1){this.members.remove(_1);_1.rulesEngine=null},isc.A.setRulesData=function isc_RulesEngine_setRulesData(_1){this.rulesData=_1},isc.A.addRule=function isc_RulesEngine_addRule(_1){if(!_1)return;if(!this.rulesData)this.rulesData=[];this.rulesData.add(_1)},isc.A.removeRule=function isc_RulesEngine_removeRule(_1){if(!_1||!this.rulesData||this.rulesData.length==0)return;var _2=this.rulesData;for(var i=0;i<_2.length;i++){if(_1==_2[i].name){_2.removeAt(i);break}}},isc.A.getRule=function isc_RulesEngine_getRule(_1){if(_1&&this.rulesData&&this.rulesData.length>0){var _2=this.rulesData;for(var i=0;i<_2.length;i++){if(_1==_2[i].name){return _2[i]}}}
return null});isc.B._maxIndex=isc.C+26;isc.A=isc.Canvas;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$145x=["editMaskProperties","hoopSelectionMode","hoopSelectorProperties","selectedAppearance","selectedBorder","selectedLabelBackgroundColor","selectedTintColor","selectedTintOpacity"];isc.B.push(isc.A.$145y=function isc_c_Canvas__getEditProxyPassThruProperties(_1){var _2={};for(var i=0;i<isc.Canvas.$145x.length;i++){var _4=isc.Canvas.$145x[i];if(_1[_4]!=null)_2[_4]=_1[_4]}
return _2});isc.B._maxIndex=isc.C+1;isc.A=isc.Canvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="CanvasEditProxy";isc.B.push(isc.A.wrapChildNode=function isc_Canvas_wrapChildNode(_1,_2,_3,_4){if(_2.useEditMask==null&&(this.autoMaskComponents||(_3&&_3.liveObject&&_3.liveObject.editProxy&&_3.liveObject.editProxy.autoMaskChildren)))
{_2.useEditMask=true}
return _3},isc.A.setEditMode=function isc_Canvas_setEditMode(_1,_2,_3){if(_1==null)_1=true;if(this.editingOn==_1)return;this.editingOn=_1;if(this.editingOn){if(_2&&!isc.isAn.EditContext(_2)&&_2.getEditContext){_2=_2.getEditContext()}
this.editContext=_2}
this.editNode=_3;if(this.editingOn&&!this.editProxy){var _4=isc.Canvas.$145y(this.editContext);if(this.editNode&&this.editNode.editProxyProperties)isc.addProperties(_4,this.editNode.editProxyProperties);this.editProxy=this.createAutoChild("editProxy",_4)}
if(this.editProxy){this.editProxy.setEditMode(_1)}
if(this.editingOn&&_2.canSelectEditNodes&&this.editProxy&&this.editProxy.canSelectChildren==null&&(!this.editNode||this.editNode.type!="Tab"))
{this.editProxy.setCanSelectChildren(true)}
if(this.editingOn&&this.editProxy&&this.editProxy.canSelectChildren&&!_2.$159m){_2.$159m=this}
this.markForRedraw()});isc.B._maxIndex=isc.C+2;isc.A=isc.Class.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getSchema=function isc_Class_getSchema(){if(this.schemaName)return isc.DS.get(this.schemaName);var _1=this.getSGWTClassName();if(_1){var _2=isc.DS.get(_1);if(_2)return _2}
return isc.DS.get(this.Class)},isc.A.getSchemaField=function isc_Class_getSchemaField(_1){return this.getSchema().getField(_1)},isc.A.getObjectField=function isc_Class_getObjectField(_1,_2){if(!isc.SGWTFactory.getFactory(_1)&&_1.contains("."))_1=_1.split(/\./).pop();var _3=isc.isA.Canvas(this)&&_2==null;var _4;if(_3){_4=this.$40j;var _5;if(_4!=null&&_4[_1]!==_5){return _4[_1]}}
var _6=this.getSchema();if(!_6){this.logWarn("getObjectField: no schema exists for: "+this);return}
var _7=_6.getObjectField(_1,false,_2);if(_3){if(_4==null)this.$40j=_4={};_4[_1]=_7}
return _7},isc.A.addChildObject=function isc_Class_addChildObject(_1,_2,_3,_4){return this.$40k("add",_1,_2,_3,_4)},isc.A.removeChildObject=function isc_Class_removeChildObject(_1,_2,_3){return this.$40k("remove",_1,_2,_3)},isc.A.$40k=function isc_Class__doVerbToChild(_1,_2,_3,_4,_5){var _6=_5||this.getObjectField(_2);var _7=this.getSchemaField(_6);if(!_7.multiple){var _8=(_1=="remove"?null:_3);if(this.editingOn&&this.editProxy){var _9=this.$ds(_6);if(_9&&this.editProxy[_9]){this.editProxy[_9](_8);if(isc.isA.DataSource(_8)&&this.autoFetchData)this.fetchData(this.initialCriteria);this.logInfo(_1+"ChildObject calling set property for fieldName '"+_6+"'","editing");return true}}
var _10={};_10[_6]=_8;this.logInfo(_1+"ChildObject calling setProperties for fieldName '"+_6+"'","editing");this.setProperties(_10);return true}
var _11=[this.editProxy,this];for(var i=0;i<_11.length;i++){var _13=_11[i];if(_13==null)continue;var _14=this.getFieldMethod(_13,_2,_6,_1);if(_14!=null&&_13[_14]){this.logInfo("calling "+_14+"("+this.echoLeaf(_3)+(_4!=null?","+_4+")":")"),"editing");_13[_14](_3,_4);return true}}
return false},isc.A.getChildObject=function isc_Class_getChildObject(_1,_2,_3,_4){var _5=_3||this.getObjectField(_1),_6=this.getSchemaField(_5);if(_6==null){if(_3){this.logWarn("getChildObject: no such field '"+_3+"' in schema: "+this.getSchema())}else{this.logWarn("getChildObject: schema for Class '"+this.Class+"' does not have a field accepting type: "+_1)}
return null}
if(!_6.multiple)return this.getPropertyValue(_5);var _7;if(isc.isA.ListGrid(this)&&_5=="fields"){_7="getSpecifiedField"}else{_7=this.getFieldMethod(this,_1,_5,"get")}
if(_7==null)var _7=this.getFieldMethod(this,_1,_5,"get");if(_7&&this[_7]){this.logInfo("getChildObject calling: "+_7+"('"+_2+"')","editing");return this[_7](_2)}else{this.logInfo("getChildObject calling getArrayItem('"+_2+"',this."+_5+")","editing");return isc.Class.getArrayItem(_2,this[_5],_4)}},isc.A.getFieldMethod=function isc_Class_getFieldMethod(_1,_2,_3,_4){var _5=_4+_2;if(isc.isA.Function(_1[_5])&&isc.Func.getArgs(_1[_5]).length>0)
{return _5}
if(_3.endsWith("s")){_5=_4+this.$123a(_3.slice(0,-1));if(isc.isA.Function(_1[_5])&&isc.Func.getArgs(_1[_5]).length>0)
{return _5}}},isc.A.$123a=function isc_Class__withInitialCaps(_1){return _1.substring(0,1).toLocaleUpperCase()+_1.substring(1)},isc.A.getEditableProperties=function isc_Class_getEditableProperties(_1){var _2={},_3;if(!this.editModeOriginalValues)this.editModeOriginalValues={};if(!isc.isAn.Array(_1))_1=[_1];for(var i=0;i<_1.length;i++){var _5=isc.isAn.Object(_1[i])?_1[i].name:_1[i];var _6=null;if(this.editModeOriginalValues[_5]===_3){this.logInfo("Field "+_5+" - value ["+this[_5]+"] is coming from live values","editModeOriginalValues");_6=this[_5];if(isc.isA.Function(_6)&&_6.$dw){_6=this[_6.$c1]}}else{this.logInfo("Field "+_5+" - value ["+this.editModeOriginalValues[_5]+"] is coming from original values","editModeOriginalValues");_6=this.editModeOriginalValues[_5]}
_2[_5]=_6}
return _2},isc.A.setEditableProperties=function isc_Class_setEditableProperties(_1){var _2;if(!this.editModeOriginalValues)this.editModeOriginalValues={};for(var _3 in _1){if(this.editModeOriginalValues[_3]===_2){this.logInfo("Field "+_3+" - value is going to live values","editModeOriginalValues");this.setProperty(_3,_1[_3])}else{this.logInfo("Field "+_3+" - value is going to original values","editModeOriginalValues");this.editModeOriginalValues[_3]=_1[_3]}}
this.editablePropertiesUpdated(_1)},isc.A.setChildEditableProperties=function isc_Class_setChildEditableProperties(_1,_2,_3,_4){this.setDescendantEditableProperties(_1,_2,_3,_4,0)},isc.A.setDescendantEditableProperties=function isc_Class_setDescendantEditableProperties(_1,_2,_3,_4,_5){isc.addProperties(_1,_2)},isc.A.saveToOriginalValues=function isc_Class_saveToOriginalValues(_1){var _2;if(!this.editModeOriginalValues)this.editModeOriginalValues={};for(var i=0;i<_1.length;i++){var _4=isc.isAn.Object(_1[i])?_1[i].name:_1[i];if(this[_4]===_2){this.editModeOriginalValues[_4]=null}else{if(this[_4]&&this[_4].$dw){var _5=isc.$ah+_4;this.editModeOriginalValues[_4]=this[_5]}else{this.editModeOriginalValues[_4]=this[_4]}}}},isc.A.restoreFromOriginalValues=function isc_Class_restoreFromOriginalValues(_1){var _2;if(!this.editModeOriginalValues)this.editModeOriginalValues={};var _3="Retrieving fields from original values:"
var _4={};for(var i=0;i<_1.length;i++){var _6=isc.isAn.Object(_1[i])?_1[i].name:_1[i];if(this.editModeOriginalValues[_6]!==_2){_4[_6]=this.editModeOriginalValues[_6];delete this.editModeOriginalValues[_6]}else{}}
isc.$179n=true;this.setProperties(_4);delete isc.$179n},isc.A.propertyHasBeenEdited=function isc_Class_propertyHasBeenEdited(_1){var _2;if(!this.editModeOriginalValues)return false;if(isc.isAn.Object(_1))_1=_1.name;if(this.editModeOriginalValues[_1]!==_2){if(isc.isA.Function(this.editModeOriginalValues[_1]))return false;if(this.editModeOriginalValues[_1]!=this[_1])return true}
return false},isc.A.editablePropertiesUpdated=function isc_Class_editablePropertiesUpdated(_1,_2){if(!_2&&this.editContext&&this.editContext.editNodeUpdated){this.editContext.editNodeUpdated(this.editNode,this.editContext,isc.getKeys(_1))}});isc.B._maxIndex=isc.C+17;isc.A=isc.DataSource;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getSchema=function isc_c_DataSource_getSchema(_1){if(isc.isA.Class(_1))return _1.getSchema();return isc.DS.get(_1.schemaName||_1._constructor||_1.Class)},isc.A.getObjectField=function isc_c_DataSource_getObjectField(_1,_2){if(_1==null)return null;if(isc.isA.Class(_1))return _1.getObjectField(_2);var _3=isc.DS.getSchema(_1);if(_3)return _3.getObjectField(_2)},isc.A.getSchemaField=function isc_c_DataSource_getSchemaField(_1,_2){var _3=isc.DS.getSchema(_1);if(_3)return _3.getField(_2)},isc.A.addChildObject=function isc_c_DataSource_addChildObject(_1,_2,_3,_4,_5){return this.$40k(_1,"add",_2,_3,_4,_5)},isc.A.removeChildObject=function isc_c_DataSource_removeChildObject(_1,_2,_3,_4){return this.$40k(_1,"remove",_2,_3,null,_4)},isc.A.$40k=function isc_c_DataSource__doVerbToChild(_1,_2,_3,_4,_5,_6){var _7=_6||isc.DS.getObjectField(_1,_3);if(_7==null){this.logWarn("No field for child of type "+_3);return false}
this.logInfo(_2+" object "+this.echoLeaf(_4)+" in field: "+_7+" of parentObject: "+this.echoLeaf(_1),"editing");var _8=isc.DS.getSchemaField(_1,_7);if(isc.isA.Class(_1)){if(_1.$40k(_2,_3,_4,_5,_6))return true}
if(!_8.multiple){if(_2=="add")_1[_7]=_4;else if(_2=="remove"){if(_1[_7]!=null)delete _1[_7]}else{this.logWarn("unrecognized verb: "+_2);return false}
return true}
this.logInfo("using direct Array manipulation for field '"+_7+"'","editing");var _9=_1[_7];if(_2=="add"){if(_9!=null&&!isc.isAn.Array(_9)){this.logWarn("unexpected field value: "+this.echoLeaf(_9)+" in field '"+_7+"' when trying to add child: "+this.echoLeaf(_4));return false}
if(_9==null)_1[_7]=_9=[];if(_5!=null)_9.addAt(_4,_5);else _9.add(_4)}else if(_2=="remove"){if(!isc.isAn.Array(_9))return false;if(_5!=null)_9.removeAt(_4,_5);else _9.remove(_4)}else{this.logWarn("unrecognized verb: "+_2);return false}
return true},isc.A.getChildObject=function isc_c_DataSource_getChildObject(_1,_2,_3,_4,_5){if(isc.isA.Class(_1))return _1.getChildObject(_2,_3,_4,_5);var _6=isc.DS.getObjectField(_1,_2),_7=isc.DS.getSchemaField(_1,_6);var _8=_1[_6];if(!_7.multiple)return _8;if(!isc.isAn.Array(_8))return null;return isc.Class.getArrayItem(_3,_8,_5)},isc.A.getAutoIdField=function isc_c_DataSource_getAutoIdField(_1){var _2=this.getNearestSchema(_1);return _2?_2.getAutoIdField():"ID"},isc.A.getAutoId=function isc_c_DataSource_getAutoId(_1){var _2=this.getAutoIdField(_1);return _2?_1[_2]:null});isc.B._maxIndex=isc.C+9;isc.A=isc.DataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getAutoIdField=function isc_DataSource_getAutoIdField(){return this.getInheritedProperty("autoIdField")||"ID"},isc.A.shouldCreateStandalone=function isc_DataSource_shouldCreateStandalone(){if(this.createStandalone!=null)return this.createStandalone;if(!this.superDS())return true;return this.superDS().shouldCreateStandalone()});isc.B._maxIndex=isc.C+2;isc.A=isc.StatefulCanvas.getPrototype();isc.A.editProxyConstructor="StatefulCanvasEditProxy";isc.A=isc.Img.getPrototype();isc.A.editProxyConstructor="ImgEditProxy";isc.A=isc.ToolStripSeparator.getPrototype();isc.A.editProxyConstructor="ToolStripSeparatorEditProxy";isc.A=isc.Label.getPrototype();isc.A.editProxyConstructor="LabelEditProxy";isc.A=isc.Progressbar.getPrototype();isc.A.editProxyConstructor="ProgressbarEditProxy";if(isc.MenuButton){isc.A=isc.MenuButton.getPrototype();isc.A.editProxyConstructor="MenuEditProxy"}
if(isc.MenuBar){isc.A=isc.MenuBar.getPrototype();isc.A.editProxyConstructor="MenuEditProxy"}
if(isc.TabSet){isc.A=isc.TabSet.getPrototype();isc.A.editProxyConstructor="TabSetEditProxy";isc.A.defaultPaneConstructor="VLayout";isc.A=isc.TabBar.getPrototype();isc.A.editProxyConstructor="TabBarEditProxy"}
if(isc.Layout){isc.A=isc.Layout.getPrototype();isc.A.editProxyConstructor="LayoutEditProxy"}
if(isc.SplitPane){isc.A=isc.SplitPane.getPrototype();isc.A.editProxyConstructor="SplitPaneEditProxy"}
if(isc.Deck){isc.A=isc.Deck.getPrototype();isc.A.editProxyConstructor="DeckEditProxy"}
if(isc.NavPanel){isc.A=isc.NavPanel.getPrototype();isc.A.editProxyConstructor="NavPanelEditProxy"}
if(isc.Window){isc.A=isc.Window.getPrototype();isc.A.editProxyConstructor="WindowEditProxy"}
if(isc.DetailViewer){isc.A=isc.DetailViewer.getPrototype();isc.A.editProxyConstructor="DetailViewerEditProxy"}
if(isc.Portlet){isc.A=isc.Portlet;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.shouldPersistCoordinates=function isc_c_Portlet_shouldPersistCoordinates(_1,_2){if(_1.persistCoordinates==false)return false;var _3=_1.getEditNodeTree().getParent(_2);if(!_3)return false;var _4=_3.liveObject;return(_4&&!_4.editProxy||_4.editProxy.persistCoordinates!=false)});isc.B._maxIndex=isc.C+1;isc.A=isc.Portlet.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="PortletEditProxy";isc.B.push(isc.A.updateEditNode=function isc_Portlet_updateEditNode(_1,_2){if(isc.Portlet.shouldPersistCoordinates(_1,_2)){var _3=this._percent_width||this.$pn;if(_3){_1.setNodeProperties(_2,{width:_3},true)}else{_1.removeNodeProperties(_2,"width")}}});isc.B._maxIndex=isc.C+1;isc.A=isc.PortalRow.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="PortalRowEditProxy";isc.B.push(isc.A.updateEditNode=function isc_PortalRow_updateEditNode(_1,_2){if(isc.Portlet.shouldPersistCoordinates(_1,_2)){var _3=this._percent_height||this.$po;if(_3){_1.setNodeProperties(_2,{height:_3},true)}else{_1.removeNodeProperties(_2,"height")}}},isc.A.wrapChildNode=function isc_PortalRow_wrapChildNode(_1,_2,_3,_4){var _5=_2.liveObject;if(isc.isA.Portlet(_5)){return _3}else{var _6=_1.makeEditNode({type:"Portlet",defaults:{title:_2.title,destroyOnClose:true}});_1.addNode(_6,_3,_4);return _6}},isc.A.handleDroppedEditNode=function isc_PortalRow_handleDroppedEditNode(_1,_2){var _3=this.editContext;var _4=this.editNode;if(isc.isA.Palette(_1)){var _5=_1.transferDragData();_5=isc.isAn.Array(_5)?_5[0]:_5;var _6=(_3?_3.makeEditNode(_5):_1.makeEditNode(_5));if(_3&&_4){_3.addNode(_6,_4,_2);return false}else{if(isc.isA.Portlet(_6.liveObject)){_1=_6.liveObject}else{_1=isc.Portlet.create({autoDraw:false,title:_6.title,items:[_6.liveObject],destroyOnClose:true})}}}
return _1});isc.B._maxIndex=isc.C+3;isc.A=isc.PortalColumnBody.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.handleDroppedEditNode=function isc_PortalColumnBody_handleDroppedEditNode(_1,_2){var _3=this.creator.editContext;var _4=this.creator.editNode;if(isc.isA.Palette(_1)){var _5=_1.transferDragData();_5=isc.isAn.Array(_5)?_5[0]:_5;var _6=(_3?_3.makeEditNode(_5):_1.makeEditNode(_5));if(_3&&_4){_3.addNode(_6,_4,_2);return false}else{if(isc.isA.Portlet(_6.liveObject)){_1=_6.liveObject}else{_1=isc.Portlet.create({autoDraw:false,title:_6.title,items:[_6.liveObject],destroyOnClose:true})}}}
if(_1){var _7=_1.portalRow;if(_7&&_7.parentElement==this&&_7.getMembers().length==1){if(_3&&_4&&_7.editNode){var _8=this.getMemberNumber(_7);if(_2==_8||_2==_8+1)return;_3.removeNode(_7.editNode);if(_8<_2)_2-=1;_3.addNode(_7.editNode,_4,_2);return false}}else{if(_3&&_4&&_1.editNode){_3.addNode(_1.editNode,_4,_2);return false}}}
return _1});isc.B._maxIndex=isc.C+1;isc.A=isc.PortalColumn.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="PortalColumnEditProxy";isc.B.push(isc.A.wrapChildNode=function isc_PortalColumn_wrapChildNode(_1,_2,_3,_4){var _5=_2.liveObject;if(isc.isA.PortalRow(_5)||_2.type=="PortalRow"){return _3}else if(isc.isA.Portlet(_5)){var _6=_1.makeEditNode({type:this.rowConstructor,defaults:{}});_1.addNode(_6,_3,_4);return _6}else{var _7=_1.makeEditNode({type:"Portlet",defaults:{title:_2.title,destroyOnClose:true}});_1.addNode(_7,_3,_4);return _7}},isc.A.updateEditNode=function isc_PortalColumn_updateEditNode(_1,_2){if(isc.Portlet.shouldPersistCoordinates(_1,_2)){var _3=this._percent_width||this.$pn;if(_3){_1.setNodeProperties(_2,{width:_3},true)}else{_1.removeNodeProperties(_2,"width")}}});isc.B._maxIndex=isc.C+2;isc.A=isc.PortalLayout.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="PortalLayoutEditProxy";isc.B.push(isc.A.addedToEditContext=function isc_PortalLayout_addedToEditContext(_1,_2){for(var i=0;i<this.getNumColumns();i++){var _4=this.getPortalColumn(i);if(!_4.editContext){var _5=_1.makeEditNode({type:this.columnConstructor,liveObject:_4,defaults:{ID:_4.ID,_constructor:this.columnConstructor}});_1.addNode(_5,_2,i,null,true)}}
_2.defaults.numColumns=0},isc.A.wrapChildNode=function isc_PortalLayout_wrapChildNode(_1,_2,_3,_4){var _5=_2.liveObject;if(isc.isA.PortalColumn(_5)){return _3}
var _6=this.getPortalColumn(0);if(!_6)return null;_3=_6.editNode;if(isc.isA.Portlet(_5)){return _3}else{var _7=_1.makeEditNode({type:"Portlet",defaults:{title:_2.title,destroyOnClose:true}});_1.addNode(_7,_3,_4);return _7}});isc.B._maxIndex=isc.C+2}
if(isc.DynamicForm){isc.A=isc.DynamicForm.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="FormEditProxy";isc.B.push(isc.A.setEditorType=function isc_DynamicForm_setEditorType(_1,_2){if(!_1.editContext)return;var _3=_1.editContext.getEditNodeTree(),_4=_3.getParent(_1.editNode),_5=_3.getChildren(_4).indexOf(_1.editNode),_6=_1.editContext,_7={type:_2,defaults:_1.editNode.defaults},_8=_6.makeEditNode(_7);_6.removeNode(_1.editNode);_6.addNode(_8,_4,_5)});isc.B._maxIndex=isc.C+1;isc.A=isc.FormItem.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="FormItemEditProxy";isc.B.push(isc.A.setEditMode=function isc_FormItem_setEditMode(_1,_2,_3){if(_1==null)_1=true;if(this.editingOn==_1)return;this.editingOn=_1;if(this.editingOn){if(_2&&!isc.isAn.EditContext(_2)&&_2.getEditContext){_2=_2.getEditContext()}
this.editContext=_2}
this.editNode=_3;if(this.editingOn&&!this.editProxy){var _4=isc.Canvas.$145y(this.editContext);if(this.editNode&&this.editNode.editProxyProperties)isc.addProperties(_4,this.editNode.editProxyProperties);this.editProxy=this.createAutoChild("editProxy",_4)}
if(this.editProxy)this.editProxy.setEditMode(_1)},isc.A.setEditorType=function isc_FormItem_setEditorType(_1){if(this.form)this.form.setEditorType(this,_1)});isc.B._maxIndex=isc.C+2;isc.A=isc.TextItem.getPrototype();isc.A.editProxyConstructor="TextItemEditProxy";isc.A=isc.TextAreaItem.getPrototype();isc.A.editProxyConstructor="TextAreaItemEditProxy";isc.A=isc.StaticTextItem.getPrototype();isc.A.editProxyConstructor="TextItemEditProxy";isc.A=isc.BlurbItem.getPrototype();isc.A.editProxyConstructor="TextItemEditProxy";isc.A=isc.ButtonItem.getPrototype();isc.A.editProxyConstructor="ButtonItemEditProxy";isc.A=isc.SelectItem.getPrototype();isc.A.editProxyConstructor="SelectItemEditProxy";isc.A=isc.ComboBoxItem.getPrototype();isc.A.editProxyConstructor="SelectItemEditProxy";isc.A=isc.RadioGroupItem.getPrototype();isc.A.editProxyConstructor="SelectItemEditProxy";isc.A=isc.CheckboxItem.getPrototype();isc.A.editProxyConstructor="CheckboxItemEditProxy";if(isc.DateItem){isc.A=isc.DateItem.getPrototype();isc.A.editProxyConstructor="DateItemEditProxy"}}
isc.A=isc.SectionStack.getPrototype();isc.A.editProxyConstructor="SectionStackEditProxy";if(isc.ListGrid!=null){isc.A=isc.ListGrid.getPrototype();isc.A.editProxyConstructor="GridEditProxy"}
isc.$135q=function(){isc.DrawPane.addMethods({editProxyConstructor:"DrawPaneEditProxy"});var _1=function(_6,_7,_8){if(_6==null)_6=true;if(this.editingOn==_6)return;this.editingOn=_6;if(this.editingOn){if(_7&&!isc.isAn.EditContext(_7)&&_7.getEditContext){_7=_7.getEditContext()}
this.editContext=_7}
this.editNode=_8;if(this.editingOn&&!this.editProxy){var _2=isc.Canvas.$145y(this.editContext);if(this.editNode&&this.editNode.editProxyProperties)isc.addProperties(_2,this.editNode.editProxyProperties);this.editProxy=this.createAutoChild("editProxy",_2)}
if(this.editProxy)this.editProxy.setEditMode(_6)};var _3=function(_6){var _4;if(!this.editModeOriginalValues)this.editModeOriginalValues={};for(var _5 in _6){if(this.editModeOriginalValues[_5]===_4){this.logInfo("Field "+_5+" - value is going to live values","editModeOriginalValues");this.setPropertyValue(_5,_6[_5])}else{this.logInfo("Field "+_5+" - value is going to original values","editModeOriginalValues");this.editModeOriginalValues[_5]=_6[_5]}}
this.editablePropertiesUpdated(_6)};isc.DrawItem.addMethods({editProxyConstructor:"DrawItemEditProxy",setEditMode:_1,setEditableProperties:_3,updateEditNode:function(_6,_7){_6.setNodeProperties(_7,{shapeData:this.getShapeData()});_6.removeNodeProperties(_7,["rotation","translate","scale","xShearFactor","yShearFactor"])}});isc.DrawLabel.addMethods({editProxyConstructor:"DrawLabelEditProxy",setEditMode:_1,setEditableProperties:_3});isc.DrawLine.addProperties({updateEditNode:function(_6,_7){this.Super("updateEditNode",arguments);_6.setNodeProperties(_7,{startPoint:this.startPoint,endPoint:this.endPoint},true);_6.removeNodeProperties(_7,["left","top","width","height"])}});isc.DrawLinePath.addProperties({updateEditNode:function(_6,_7){this.Super("updateEditNode",arguments);_6.setNodeProperties(_7,{startPoint:this.startPoint,endPoint:this.endPoint},true);_6.removeNodeProperties(_7,["left","top","width","height"])}});isc.DrawCurve.addProperties({updateEditNode:function(_6,_7){this.Super("updateEditNode",arguments);_6.setNodeProperties(_7,{startPoint:this.startPoint,endPoint:this.endPoint,controlPoint1:this.controlPoint1,controlPoint2:this.controlPoint2},true);_6.removeNodeProperties(_7,["left","top","width","height"])}});isc.DrawPath.addProperties({updateEditNode:function(_6,_7){this.Super("updateEditNode",arguments);_6.setNodeProperties(_7,{points:this.points},true);if(!isc.isA.DrawDiamond(this)){_6.removeNodeProperties(_7,["left","top","width","height"])}}});isc.DrawDiamond.addProperties({updateEditNode:function(_6,_7){this.Super("updateEditNode",arguments);_6.removeNodeProperties(_7,"points")}})};if(isc.DrawPane!=null){isc.$135q()}else{isc.Page.setEvent("moduleLoaded",function(_1,_2){if(_2.moduleName=="Drawing"){isc.$135q()}})}
isc.$1478=function(){isc.FacetChart.addMethods({editProxyConstructor:"FacetChartEditProxy"})};if(isc.FacetChart!=null){isc.$1478()}else{isc.Page.setEvent("moduleLoaded",function(_1,_2){if(_2.moduleName=="Charts"){isc.$1478()}})}
isc.A=isc.ServiceOperation.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="EditProxy";isc.B.push(isc.A.getActionTargetTitle=function isc_ServiceOperation_getActionTargetTitle(){return"Operation: ["+this.operationName+"]"});isc.B._maxIndex=isc.C+1;if(isc.ValuesManager!=null){isc.A=isc.ValuesManager.getPrototype();isc.A.editProxyConstructor="EditProxy"}
isc.ClassFactory.defineClass("EditContext","Class");isc.A=isc.EditContext;isc.A.editNodePasteOffset=5;isc.A.$178k=["canDuplicate","icon","idPrefix","title","type"];isc.A=isc.EditContext;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.manageTitleEditor=function isc_c_EditContext_manageTitleEditor(_1,_2,_3,_4,_5,_6,_7,_8){if(!isc.isA.DynamicForm(this.titleEditor)){var _9=isc.addProperties({name:"title",type:"text",showTitle:false},_1.editProxy.titleEditorDefaults,_1.editProxy.titleEditorProperties,{keyPress:function(_16,_17,_18){if(_18=="Escape"){_17.discardUpdate=true;_17.hide();if(_8)_8();return}
if(_18=="Enter")_16.blurItem()},blur:function(_17,_16){_17.saveOrDiscardValue();_17.hide();if(!_17.discardUpdate&&_8)_8(_16.getValue())}});this.titleEditor=isc.DynamicForm.create({autoDraw:false,margin:0,padding:0,cellPadding:0,fields:[_9],saveOrDiscardValue:function(){if(!this.discardUpdate){var _10=this.targetComponent,_11=_10.editContext;if(_11){var _12=this.getValue("title"),_13=isc.EditContext.getTitleField(_1,this.titleField),_14={};if(_13=="title"&&_14[_13]==null&&_12==_10.name)
{return}
_14[_13]=_12;_11.setNodeProperties(_10.editNode,_14);if(_11.nodeClick)_11.nodeClick(_11,_10.editNode);_11.refreshSelectedAppearance(_10)}}},dismissEditor:function(){this.saveOrDiscardValue();this.hide();if(!this.discardUpdate&&_8)_8(this.getValue("title"))}})}
var _15=this.titleEditor;_15.setProperties({targetComponent:_1,titleField:_7});_15.discardUpdate=false;var _16=_15.getItem("title"),_12;if(_6){_12=_6}else{var _13=this.getTitleField(_1,_7);_12=_1[_13];if(_12==null&&_13=="title")_12=_1.name}
_16.setValue(_12);this.positionTitleEditor(_1,_2,_3,_4,_5);_15.show();_15.showClickMask({target:_15,methodName:"dismissEditor"},"soft",[_15]);_16.focusInItem();if(!_6)_16.delayCall("selectValue",[],100);else _16.delayCall("setSelectionRange",[_6.length,_6.length])},isc.A.getTitleField=function isc_c_EditContext_getTitleField(_1,_2){if(_2!=null)return _2;var _3="title";if((isc.isA.Label(_1)&&!isc.isA.SectionHeader(_1))||isc.isA.DrawLabel(_1))
{_3="contents"}else if(!isc.isA.DrawItem(_1)&&!isc.isA.Button(_1)&&!isc.isA.ButtonItem(_1)&&!_1.showTitle)
{_3="defaultValue"}
return _3},isc.A.positionTitleEditor=function isc_c_EditContext_positionTitleEditor(_1,_2,_3,_4,_5){if(_4==null)_4=_1.getPageTop();if(_5==null)_5=_1.getVisibleHeight();if(_2==null)_2=_1.getPageLeft();if(_3==null)_3=_1.getVisibleWidth();var _6=this.titleEditor;var _7=_6.getItem("title");_7.setHeight(_5);_7.setWidth(_3);_6.setTop(_4);_6.setLeft(_2)},isc.A.selectCanvasOrFormItem=function isc_c_EditContext_selectCanvasOrFormItem(_1,_2){if(!isc.isA.Canvas(_1)&&!isc.isA.FormItem(_1)&&!_1.$73a){return}
if(isc.isA.Menu(_1)){return}
var _3;if(_1.$73a){_3=_1;_1=_1.$73a}
if(isc.isA.Canvas(_1)&&_1.canvasItem){_1=_1.canvasItem}
var _4=_3?_3.editContext:_1.editContext;if(!_4)return;if(_1.editProxy&&_1.editProxy.canSelect==false){if(_1.editingOn)_1.editContext.deselectAllComponents();return}
var _5=_4.getRootEditNode();if(_5.liveObject==_1)return;if(!_1.editNode)return;if(_4.allowNestedDrops==false){var _6=_4.getEditNodeTree();var _7=_6.getParent(_1.editNode);if(_7!=_5)return}
if(_3)_1=_3;if(_1.editingOn){var _8=_1.editContext;var _9=_1.editNode;if(_9){_8.selectSingleComponent(_1)}else{_8.deselectAllComponents()}}
if(_1._eventMask){_1._eventMask.focus()}else if(isc.isA.Canvas(_1)){_1.focus()}else if(isc.isA.FormItem(_1)){_1.form.focus()}},isc.A.hideAncestorDragDropLines=function isc_c_EditContext_hideAncestorDragDropLines(_1){while(_1&&_1.parentElement){if(_1.parentElement.hideDragLine)_1.parentElement.hideDragLine();if(_1.parentElement.hideDropLine)_1.parentElement.hideDropLine();_1=_1.parentElement;if(isc.isA.FormItem(_1))_1=_1.form}},isc.A.getSchemaInfo=function isc_c_EditContext_getSchemaInfo(_1){var _2={},_3=_1.liveObject;if(!_3)return _2;if(isc.isA.FormItem(_3)){if(_3.form&&_3.form.dataSource){var _4=_3.form;_2.dataSource=isc.DataSource.getDataSource(_4.dataSource).ID;_2.serviceName=_4.serviceName;_2.serviceNamespace=_4.serviceNamespace}else{_2.dataSource=_3.schemaDataSource;_2.serviceName=_3.serviceName;_2.serviceNamespace=_3.serviceNamespace}}else if(isc.isA.Canvas(_3)&&_3.dataSource){_2.dataSource=isc.DataSource.getDataSource(_3.dataSource).ID;_2.serviceName=_3.serviceName;_2.serviceNamespace=_3.serviceNamespace}else{_2.dataSource=_3.schemaDataSource;_2.serviceName=_3.serviceName;_2.serviceNamespace=_3.serviceNamespace}
return _2},isc.A.clearSchemaProperties=function isc_c_EditContext_clearSchemaProperties(_1){if(_1&&_1.defaults&&isc.isA.FormItem(_1.liveObject)){delete _1.defaults.schemaDataSource;delete _1.defaults.serviceName;delete _1.defaults.serviceNamespace;var _2=_1.liveObject.form;if(_2&&_2.inputSchemaDataSource&&isc.DataSource.get(_2.inputSchemaDataSource).ID==_1.defaults.inputSchemaDataSource&&_2.inputServiceName==_1.defaults.inputServiceName&&_2.inputServiceNamespace==_1.defaults.inputServiceNamespace)
{delete _1.defaults.inputSchemaDataSource;delete _1.defaults.inputServiceName;delete _1.defaults.inputServiceNamespace}}},isc.A.serializeDefaults=function isc_c_EditContext_serializeDefaults(_1,_2,_3){if(_1==null)return null;if(!isc.isAn.Array(_1))_1=[_1];var _4=isc.SB.create();isc.Comm.omitXSI=true;for(var i=0;i<_1.length;i++){var _6=_1[i],_7=_6.$97p,_8=isc.DS.getNearestSchema(_6),_9={indent:_2,schema:_8};if(_3&&_3.ignoreConstructor)_9.ignoreConstructor=true;_4.append(_8.xmlSerialize(_6,_9,null,_7),"\n\n")}
isc.Comm.omitXSI=null;return _4.release(false)},isc.A.serializeDefaultsAsJSON=function isc_c_EditContext_serializeDefaultsAsJSON(_1,_2){if(_1==null)return null;if(!isc.isAn.Array(_1))_1=[_1];for(var i=0;i<_1.length;i++){var _4=_1[i],_5=_4.$97p,_6=isc.DS.getNearestSchema(_4),_7=_5||(_6&&_6.ID);if(_4._constructor&&_4._constructor==_7){delete _4._constructor}
for(var _8=isc.getKeys(_4),j=_8.length;j>=0;j--){var _10=_8[j],_11=_6&&_6.getField(_10);if(!_11)delete _4[_10]}
_1[i]={type:_7,defaults:_4}}
return isc.JSON.encode(_1,_2)},isc.A.convertActions=function isc_c_EditContext_convertActions(_1,_2,_3){for(var _4 in _2){var _5=_2[_4];if((!isc.isAn.Object(_5)&&!isc.isA.String(_5))||isc.isA.StringMethod(_5))
{continue}
var _6;if(_3&&_3.getField)_6=_3.getField(_4).type;if(_6&&(_6!="StringMethod"))continue;var _7=_1.liveObject,_8=_7?_7[_4]:null,_9=_8?_8.iscAction:null;if(_9){_2[_4]=isc.StringMethod.create({value:_5})}else{if(!_7){var _10=isc.ClassFactory.getClass(_1.type),_11;if(_10&&_10._stringMethodRegistry&&_10._stringMethodRegistry[_4]!==_11)
{_2[_4]=isc.StringMethod.create({value:_10._stringMethodRegistry[_4]})}else{var _12=isc.DataSource.get(_1.type);if(_12){var _13=_12.getStringMethod(_4,_5);if(_13)_2[_4]=_13}}}}}},isc.A.getNonNullProperties=function isc_c_EditContext_getNonNullProperties(_1){var _2={};for(var _3 in _1){if(_1[_3]!=null)_2[_3]=_1[_3]}
return _2},isc.A.$1941=function isc_c_EditContext__getTextAsIdentifier(_1,_2){_1=_1.replace(/\s/g,"_");if(!String.isValidID(_1))return;while(_2.hasOwnProperty(_1)){if(_1.match(/_([0-9])+$/)){_1=_1.replace(/_(([0-9])+)$/,function(_3,_4){return"_"+(parseInt(_4)+1)})}else{_1+="_1"}}
return _1},isc.A.testNodeSchemaFieldProperty=function isc_c_EditContext_testNodeSchemaFieldProperty(_1,_2,_3,_4){if(_1==null)return false;var _5=isc.DS.get(_1.type);if(_5==null)return false;if(_2==null||_3==null){return false}
var _6=!_4;for(var _7 in _3){var _8=_5.fields[_7];if(!_8)continue;var _9=_8[_2];if(isc.isA.String(_9)&&_9.toLowerCase()==_6.toString()||isc.isA.Boolean(_9)&&_9==_6)
{return true}}
return false});isc.B._maxIndex=isc.C+13;isc.A=isc.EditContext.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.persistCoordinates=true;isc.A.wrapperFormDefaults={_constructor:"DynamicForm"};isc.A.wrapperDrawPaneDefaults={_constructor:"DrawPane"};isc.A.selectionType="multiple";isc.A.selectedBorder="1px dashed #44ff44";isc.A.selectedTintColor="#cccccc";isc.A.selectedTintOpacity=25;isc.A.hoopSelectionMode="encloses";isc.A.groupMaskDefaults={autoDraw:false,canFocus:true,$146g:true,border:"2px solid black",visibility:"hidden",overflow:"hidden",setSelection:function(_1){this.selection=_1;var _2=this.getComponentsBoundingBox(_1);this.setRect(_2)},getComponentsBoundingBox:function(_1){var _2=0,_3=0,_4=0,_5=0;if(_1.length>0){_2=_1[0].left;_3=_2+_1[0].width;_4=_1[0].top;_5=_4+_1[0].height}
for(var i=1;i<_1.length;i++){var _7=_1[i],_8=(_7.getVisibleHeight?_7.getVisibleHeight():_7.height);if(_7.left<_2)_2=_7.left;if((_7.left+_7.width)>_3)_3=_7.left+_7.width;if(_7.top<_4)_4=_7.top;if((_7.top+_8)>_5)_5=_7.top+_8}
return[_2,_4,_3-_2,_5-_4]},show:function(){this.showOverSelection();return this.Super("show",arguments)},setRect:function(_1,_2,_3,_4,_5){this.$146h=true;this.Super("setRect",arguments);this.$146h=false},showOverSelection:function(){var _1=this.selection;if(_1!=null){for(var i=0,_3=_1.length;i<_3;++i){var _4=_1[i];if(isc.isA.Canvas(_4)){this.moveAbove(_4)}else if(isc.isA.DrawItem&&isc.isA.DrawItem(_4)&&_4.drawPane!=null){this.moveAbove(_4.drawPane)}}}},visibilityChanged:function(_1){this.enableKeyMovement(_1)},enableKeyMovement:function(_1){if(_1){if(!this.$1367){this.$1367=isc.Page.setEvent("keyPress",this)}}else{if(this.$1367){isc.Page.clearEvent("keyPress",this.$1367);delete this.$1367}}},bringToFront:function(){},dragRepositionStart:function(){if(this.hideBorderOnDrag){this.$146i=this.border;this.setBorder(null)}},dragRepositionStop:function(){if(this.hideBorderOnDrag){this.setBorder(this.$146i)}},doubleClick:function(){return isc.EH.STOP_BUBBLING},pageKeyPress:function(_1,_2){var _3=this.creator.getRootEditNode().liveObject;if(!_3.containsFocus())return;var _4=isc.EH.getKeyEventCharacter();if(!isc.isA.AlphaNumericChar(_4)){var _5=this.parentElement,_6=isc.EH.shiftKeyDown(),_7=(_6?1:_5.snapVGap),_8=(_6?1:_5.snapHGap),_9=[0,0],_10=false;_5.$128p=true;for(var i=0;i<this.selection.length;i++){var _1=this.selection[i];if(this.isPercent(_1.left)||this.isPercent(_1.top))continue;if(_1.snapTo&&(this.isPercent(_1.snapOffsetLeft)||this.isPercent(_1.snapOffsetTop)))
{continue}
switch(isc.EH.getKey()){case"Arrow_Up":_9=[0,_7*-1];break;case"Arrow_Down":_9=[0,_7];break;case"Arrow_Left":_9=[_8*-1,0];break;case"Arrow_Right":_9=[_8,0];break;default:_10=null;break}
if(_9[0]!=0||_9[1]!=0){if(_1.snapTo){_1.setSnapOffsetLeft((_1.snapOffsetLeft||0)+_9[0]);_1.setSnapOffsetTop((_1.snapOffsetTop||0)+_9[1])}else{_1.moveBy(_9[0],_9[1])}}}
this.parentElement.$128p=false;return _10}},$o9:"%",isPercent:function(_1){return(isc.isA.String(_1)&&isc.endsWith(_1,this.$o9))},canDrag:true,canDragReposition:true,dragRepositionAppearance:"target",setDragTracker:function(){return isc.EH.STOP_BUBBLING},moved:function(_1,_2){if(this.$146h)return;this.Super("moved",arguments);this.creator.$146j=true;this.parentElement.$128p=true;for(var i=0;i<this.selection.length;i++){this.selection[i].moveBy(_1,_2)}
this.parentElement.$128p=false;this.creator.$146j=false;this.showOverSelection()}};isc.B.push(isc.A.getDefaultPalette=function isc_EditContext_getDefaultPalette(){if(this.defaultPalette)return this.defaultPalette;return(this.defaultPalette=isc.HiddenPalette.create())},isc.A.setDefaultPalette=function isc_EditContext_setDefaultPalette(_1){this.defaultPalette=_1;if(_1&&!_1.defaultEditContext){_1.defaultEditContext=this}},isc.A.init=function isc_EditContext_init(){this.Super("init",arguments);this.selectedComponents=[];this.editNodeTree=this.createEditNodeTree()},isc.A.createEditNodeTree=function isc_EditContext_createEditNodeTree(){var _1=isc.addProperties({},this.rootComponent||{type:"Object"}),_2=this.rootLiveObject||_1;if(!_1)_1={type:"Object"};if(this.useCopyPasteShortcuts){if(!_1.editProxyProperties)_1.editProxyProperties={};_1.editProxyProperties.useCopyPasteShortcuts=true}
if(!_1.type){_1.type=(isc.isA.Class(_1)?_1.Class:_1._constructor)}
if(_2&&!_1.liveObject){if(isc.isA.Canvas(_2)){_1.liveObject=_2}}
var _3=this.makeEditNode(_1);return isc.Tree.create({idField:"ID",root:_3,isFolder:function(){return true}})},isc.A.switchEditMode=function isc_EditContext_switchEditMode(_1){var _2=this.getSelectedComponents();if(!_2||_2.length==0)return;for(var i=0;i<_2.length;i++){var _4=_2[i];if(_1){this.refreshSelectedAppearance(_4)}else if(_4.editProxy!=null){_4.editProxy.showSelectedAppearance(false)}}},isc.A.findPaletteNode=function isc_EditContext_findPaletteNode(_1,_2){var _3=this.getDefaultPalette().findPaletteNode(_1,_2);if(_3)return _3;if(this.extraPalettes){if(!isc.isAn.Array(this.extraPalettes))this.extraPalettes=[this.extraPalettes];for(var i=0;i<this.extraPalettes.length;i++){_3=this.extraPalettes[i].findPaletteNode(_1,_2);if(_3)return _3}}
return null},isc.A.addNode=function isc_EditContext_addNode(_1,_2,_3,_4,_5,_6){var _7=isc.DataSource.getNearestSchemaClass(_1.type);if(_7&&(_7.isA(isc.DataSource)||_1.deferCreation)){if(_1.loadData&&!_1.isLoaded){var _8=this;var _9=isc.$75u;_1.loadData(_1,function(){var _10=isc.$75u;if(!_10&&_9)isc.$75u=true;if(_1.deferCreation){_1=_8.makeEditNode(_1)}
_8.addNode(_1,_2,_3,_4,_5);if(!_10&&_9)delete isc.$75u});return}}
var _11=this.getEditNodeTree();var _12=this.getDefaultParent(_1);if(_2==null)_2=_12;var _13=this.getLiveObject(_2);this.logInfo("addNode will add newNode of type: "+_1.type+" to: "+this.echoLeaf(_13),"editing");if(_13.wrapChildNode){_2=_13.wrapChildNode(this,_1,_2,_3);if(!_2)return;_13=this.getLiveObject(_2)}
var _14=_4||isc.DS.getObjectField(_13,_1.type);var _15=isc.DS.getSchemaField(_13,_14);if(!_15){if(!_7||!_7.isA(isc.DataSource)||_2!=_12){this.logWarn("can't addNode: can't find a field in parent: "+_13+" for a new child of type: "+_1.type+", parent property:"+_14+", newNode is: "+this.echo(_1))}
return}
if(!_15.multiple){var _16=isc.DS.getChildObject(_13,_1.type,null,_4);if(_16&&!_1.generatedType&&(_16!=_1.liveObject||_6)){var _17=_11.getChildren(_2).find("ID",isc.DS.getAutoId(_16));if(_17){this.logWarn("destroying existing child: "+this.echoLeaf(_16)+" in singular field: "+_14);_11.remove(_17);if(isc.isA.Class(_16)&&!isc.isA.DataSource(_16))_16.destroy()}}}
var _18;if(_1.generatedType){_18=isc.addProperties({},_1.defaults);this.serializeChildData(_18,_11.getChildren(_1));_1.liveObject=_18}else{_18=_1.liveObject}
_18.editContext=this;_18.editNode=_1;if(!_5){var _19=_11.getChildren(_2),_20=_3;if(_20!=null&&_4){_20=0;for(var i=0;i<Math.min(_3,_19.length);i++){var _22=_19[i];if(_22.defaults&&_22.defaults.parentProperty==_4){_20++}}}else if(_20!=null){for(var i=0;i<Math.min(_3,_19.length);i++){if(isc.isA.DataSource(_19[i].liveObject)){_20--;break}}}
var _23=isc.DS.addChildObject(_13,_1.type,_18,_20,_4);if(!_23){this.logWarn("addChildObject failed, returning");return}}
if(!_1.liveObject||_1.generatedType){var _24=isc.DS.getChildObject(_13,_1.type,isc.DS.getAutoId(_1.defaults),_4,isc.DS.getAutoIdField(_1.defaults));if(_24!=null){if(_24._constructor==null)_24._constructor=_1._constructor;_1.liveObject=_24}}
this.logDebug("for new node: "+this.echoLeaf(_1)+" liveObject is now: "+this.echoLeaf(_1.liveObject),"editing");if(_1.liveObject==null){this.logWarn("wasn't able to retrieve live object after adding node of type: "+_1.type+" to liveParent: "+_13+", does liveParent have an appropriate getter() method?")}
if(_4)_1.defaults.parentProperty=_4;_11.add(_1,_2,_3);_11.openFolder(_1);this.logInfo("added node "+this.echoLeaf(_1)+" to EditTree at path: "+_11.getPath(_1)+" with live object: "+this.echoLeaf(_1.liveObject),"editing");this.$159o(_1,_2,_11.getRoot());if(_1.liveObject.addedToEditContext)_1.liveObject.addedToEditContext(this,_1,_2,_3);if(this.isNodeEditingOn(_1)&&_1.liveObject.editProxy&&_1.liveObject.editProxy.canSelectChildren&&!this.$159m)
{this.$159m=_1.liveObject}
return _1},isc.A.addComponent=function isc_EditContext_addComponent(_1,_2,_3,_4,_5){return this.addNode(_1,_2,_3,_4,_5)},isc.A.getRootEditNode=function isc_EditContext_getRootEditNode(){return(this.getEditNodeTree()?this.getEditNodeTree().getRoot():null)},isc.A.reorderNode=function isc_EditContext_reorderNode(_1,_2,_3){var _4=this.getEditNodeTree();var _5=_4.getChildren(_1).get(_2);_4.remove(_5);_4.add(_5,_1,_3)},isc.A.nodeAdded=function isc_EditContext_nodeAdded(_1,_2,_3){},isc.A.$159o=function isc_EditContext__nodeAdded(_1,_2,_3){if(_1.useEditMask!=null){this.setEditProxyProperties(_1,{useEditMask:_1.useEditMask})}
if(this.nodeAdded)this.nodeAdded(_1,_2,_3);if(this.autoEditNewNodes!=false&&((this.creator&&this.creator.editingOn)||_2&&this.isNodeEditingOn(_2)))
{this.enableEditing(_1)}},isc.A.getDefaultParent=function isc_EditContext_getDefaultParent(_1,_2){return(this.defaultParent?this.defaultParent:this.getRootEditNode())},isc.A.addFromPaletteNode=function isc_EditContext_addFromPaletteNode(_1,_2,_3){var _4=this.makeEditNode(_1,_2),_5=_4.type||_4.className,_6=isc.DataSource.getNearestSchemaClass(_5);if(_6&&_6.isA("FormItem")){var _7=(_2?_2.type||_2.className:null),_8=(_2?isc.DataSource.getNearestSchemaClass(_7):null);if(!_2||(_8&&!_8.isA("DynamicForm"))){var _9=this.addWithWrapper(_4,_2);return this.getEditNodeTree().getParent(_9)}}
return this.addNode(_4,_2,_3)},isc.A.makeEditNode=function isc_EditContext_makeEditNode(_1){var _2=this.getDefaultPalette();return _2.makeEditNode(_1)},isc.A.getLiveObject=function isc_EditContext_getLiveObject(_1){var _2=this.getEditNodeTree();var _3=_2.getParent(_1);if(_3==null){return _1.liveObject}
var _4=_3.liveObject,_5=(_1.defaults?_1.defaults.parentProperty:null),_6=isc.DS.getChildObject(_4,_1.type,isc.DS.getAutoId(_1),_5);if(_6)_1.liveObject=_6;return _1.liveObject},isc.A.requestLiveObject=function isc_EditContext_requestLiveObject(_1,_2,_3){var _4=this;if(_1.loadData&&!_1.isLoaded){_1.loadData(_1,function(_6){_6=_6||_1
_6.isLoaded=true;_6.dropped=_1.dropped;_4.fireCallback(_2,"node",[_6])},_3);return}
if(_1.wizardConstructor){this.logInfo("creating wizard with constructor: "+_1.wizardConstructor);var _5=isc.ClassFactory.newInstance(_1.wizardConstructor,_1.wizardDefaults);_5.getResults(_1,function(_6){if(!_6.liveObject){_6=_3.makeEditNode(_6)}
_4.fireCallback(_2,"node",[_6])},_3);return}
this.fireCallback(_2,"node",[_1])},isc.A.getParentNode=function isc_EditContext_getParentNode(_1){var _2=this.getEditNodeTree();return _2.getParent(_1)},isc.A.getEditNodeTree=function isc_EditContext_getEditNodeTree(){return this.editNodeTree},isc.A.getEditNodeArray=function isc_EditContext_getEditNodeArray(){return this.getEditNodeTree().getAllNodes()},isc.A.getEditComponents=function isc_EditContext_getEditComponents(){return this.getEditNodeArray()},isc.A.canAddToParent=function isc_EditContext_canAddToParent(_1,_2){var _3=_1.liveObject;if(_3.editProxy&&_3.editProxy.canAddToParent&&!_3.editProxy.canAddToParent(_2))
{return false}
if(isc.isA.Class(_3)){return(_3.getObjectField(_2)!=null)}
return(isc.DS.getObjectField(_1,_2)!=null)},isc.A.removeAll=function isc_EditContext_removeAll(){var _1=this.getEditNodeTree();var _2=_1.getChildren(_1.getRoot()).duplicate();for(var i=0;i<_2.length;i++){this.removeNode(_2[i])}},isc.A.destroyAll=function isc_EditContext_destroyAll(){this.deselectAllComponents();var _1=this.getEditNodeTree();var _2=_1.getChildren(_1.getRoot()).duplicate();for(var i=0;i<_2.length;i++){this.destroyNode(_2[i])}
this.defaultParent=null},isc.A.removeNode=function isc_EditContext_removeNode(_1,_2){var _3=this.getEditNodeTree();var _4=_3.getParent(_1);var _5=this.getLiveObject(_1);var _6=_4==null?null:this.getLiveObject(_4);if(this.isComponentSelected(_5))this.deselectComponents(_5);_3.remove(_1);if(_1==this.defaultParent)this.defaultParent=null;if(_2)return;if(_6&&_5){isc.DS.removeChildObject(_6,_1.type,_5,(_1.defaults?_1.defaults.parentProperty:null))}},isc.A.removeComponent=function isc_EditContext_removeComponent(_1,_2){return this.removeNode(_1,_2)},isc.A.destroyNode=function isc_EditContext_destroyNode(_1){var _2=this.getLiveObject(_1);this.removeNode(_1);if(_2.destroy)_2.destroy()},isc.A.destroyComponent=function isc_EditContext_destroyComponent(_1){return this.destroyNode(_1)},isc.A.getEditDataSource=function isc_EditContext_getEditDataSource(_1){return isc.DataSource.getDataSource(_1.editDataSource||_1.Class||this.editDataSource)},isc.A.$40l=function isc_EditContext__getEditFields(_1){var _2=[];_2.addList(_1.baseEditFields);_2.addList(_1.editFields);for(var i=0;i<_2.length;i++){var _4=_2[i];if(_4.visible==null)_4.visible=true}
if(_2.length==0){_2=this.getEditDataSource(_1).getFields();_2=isc.getValues(_2)}
return _2},isc.A.getEditFieldsList=function isc_EditContext_getEditFieldsList(_1){var _2=[],_3=this.$40l(_1);for(var i=0;i<_3.length;i++){var _5=_3[i];if(isc.isAn.Object(_5)){_2.add(_5.name)}else{_2.add(_5)}}
return _2},isc.A.getEditFields=function isc_EditContext_getEditFields(_1){var _2=this.$40l(_1);for(var i=0;i<_2.length;i++){var _4=_2[i];if(isc.isA.String(_4))_4={name:_4};if(_4.visible==null)_4.visible=true;_2[i]=_4}
return _2},isc.A.serializeComponents=function isc_EditContext_serializeComponents(_1,_2){return this.serializeAllEditNodes({serverless:_1},_2)},isc.A.serializeAllEditNodes=function isc_EditContext_serializeAllEditNodes(_1,_2){var _3=this.getEditNodeTree();var _4=_2?[_3.root]:_3.getChildren(_3.root).duplicate();var _5=this.serializeEditNodes(_4,_1);return _5},isc.A.serializeAllEditNodesAsJSON=function isc_EditContext_serializeAllEditNodesAsJSON(_1,_2){var _3=this.getEditNodeTree();var _4=_2?[_3.root]:_3.getChildren(_3.root).duplicate();return this.serializeEditNodesAsJSON(_4,_1)},isc.A.serializeEditNodes=function isc_EditContext_serializeEditNodes(_1,_2){if(!_1)return null;return this.$1285(_1,_2)},isc.A.serializeEditNodesAsJSON=function isc_EditContext_serializeEditNodesAsJSON(_1,_2){if(!_1)return null;return this.$1285(_1,_2,"json")},isc.A.$1285=function isc_EditContext__serializeEditNodes(_1,_2,_3){if(!isc.isAn.Array(_1))_1=[_1];this.serverless=(_2?_2.serverless:null);this.outputComponentsIndividually=_2&&_2.outputComponentsIndividually!=null?_2.outputComponentsIndividually:true;var _4=this.defaultsBlocks=[];this.map("getSerializeableTree",_1,null,true);this.outputComponentsIndividually=null;this.serverless=null;if(_2&&_2.separateComponents){_4=this.$174x()}
return this.$174y(_4,_2,_3)},isc.A.$174y=function isc_EditContext___serializeEditNodes(_1,_2,_3){if(!isc.isAn.Array(_1)&&isc.isAn.Object(_1)){var _4={};for(var _5 in _1){if(!_1.hasOwnProperty(_5))continue;_4[_5]=this.$174y(_1[_5],_2,_3)}
return _4}
var _6=_2?_2.indent:(_3=="json"?false:true),_7={prettyPrint:_6};return _3=="json"?isc.EditContext.serializeDefaultsAsJSON(_1,_7):isc.EditContext.serializeDefaults(_1,_6,_2)},isc.A.$174x=function isc_EditContext__getSeparatedDefaultsBlocks(){var _1=this,_2=0,_3=this.defaultsBlocks;_3.setSort([{direction:"ascending",normalizer:function(_6){var _4=isc.ClassFactory.getClass(_6._constructor);if(!_4)return false;return _4.isA("Canvas")}}]);for(var i=0;i<_3.length;i++){var _4=isc.ClassFactory.getClass(_3[i]._constructor);if(!_4||!_4.isA("Canvas"))_2++};return{dataSources:_3.slice(0,_2),components:_3.slice(_2)}},isc.A.getSerializeableTree=function isc_EditContext_getSerializeableTree(_1,_2,_3){var _4=_1.liveObject;if(_4&&_4.updateEditNode&&_4.editContext&&_4.editNode){_4.updateEditNode(_4.editContext,_4.editNode)}
var _5=_1.type,_6=isc.addProperties({},_1.defaults);var _7=isc.ClassFactory.getClass(_5);if(_3){_1=isc.addProperties({},_1,{defaults:_6});if(_7&&_7.isA("Canvas")&&_6&&_6.visibility!=isc.Canvas.HIDDEN&&_6.autoDraw!==false)
{_6.autoDraw=true}}
if(_1.builderAutoID)_6.builderAutoID=true;if(_6.hasStableID)delete _6.hasStableID;if(_6.parentProperty)delete _6.parentProperty;this.logInfo("node: "+this.echoLeaf(_1)+" with type: "+_5,"editing");if(_7&&_7.isA("DataSource")){var _8=(_1.liveObject.getClassName()=="MockDataSource");if(this.defaultsBlocks){var _9=this.defaultsBlocks.find("ID",_6.ID)||this.defaultsBlocks.find("loadID",_6.ID);if(_9&&_9.$schemaId=="DataSource")return}
if(!this.serverless&&(!_8||_1.referenceInProject)){_6={_constructor:"DataSource",$schemaId:"DataSource",loadID:_6.ID,loadParents:true}}else{var _10=_1.liveObject;_6=_10.getSerializeableFields();_6._constructor=_10.Class;_6.$schemaId="DataSource";if(_10.hasSuperDS()){var _11=_10.superDS();while(_11){var _12=_11.getSerializeableFields();_12._constructor=_11.Class;_12.$schemaId="DataSource";if(this.defaultsBlocks)this.defaultsBlocks.add(_12);_11=_11.superDS()}}}}
if(isc.isA.DrawItem(_4)&&_6.fillGradient!=null&&isc.isA.String(_6.fillGradient)){_6.fillGradient="ref:"+_6.fillGradient}
isc.EditContext.convertActions(_1,_6,_7);var _13=this.getEditNodeTree().getChildren(_1);if(!_13){if(this.defaultsBlocks)this.defaultsBlocks.add(_6);return}
this.serializeChildData(_6,_13);if(_2)return _6;if(this.defaultsBlocks)this.defaultsBlocks.add(_6)},isc.A.addChildData=function isc_EditContext_addChildData(_1,_2){return this.serializeChildData(_1,_2)},isc.A.serializeChildData=function isc_EditContext_serializeChildData(_1,_2){var _3=isc.DS.getNearestSchema(_1._constructor);for(var i=0;i<_2.length;i++){var _5=_2[i],_6=_5.defaults._constructor,_7=isc.addProperties({},_5.defaults),_8=_7.parentProperty||_3.getObjectField(_6),_9=_3.getField(_8);if(_7.parentProperty)delete _7.parentProperty;if(!_8&&_1._constructor=="DynamicForm"&&isc.isA.Canvas(_5.liveObject)){_8="children";_9=_3.getField(_8)}
this.logInfo("serializing: child of type: "+_6+" goes in parent field: "+_8,"editing");var _10=((isc.isA.Canvas(_5.liveObject)||isc.isA.DrawItem(_5.liveObject))&&!_5.liveObject._generated);if((this.outputComponentsIndividually&&_10)||isc.isA.DataSource(_5.liveObject)){if(isc.isA.DataSource(_5.liveObject)&&_8=="dataSource"){_7=_7.ID}else{_7="ref:"+_7.ID}
this.getSerializeableTree(_5)}else{_7=this.getSerializeableTree(_5,true)}
var _11=_1[_8];if(_9&&_9.multiple){if(!_11)_11=_1[_8]=[];_11.add(_7)}else{_1[_8]=_7}}},isc.A.serializeEditComponents=function isc_EditContext_serializeEditComponents(){return this.serializeLiveObjects()},isc.A.serializeLiveObjects=function isc_EditContext_serializeLiveObjects(){var _1=this.getEditNodeArray(),_2=[];if(!_1)return[];for(var i=0;i<_1.length;i++){var _4=_1[i].liveObject,_5=_4.getUniqueProperties(),_6=this.getEditFieldsList(_4);_5._constructor=_4.Class;_5=isc.applyMask(_5,_6);_2.add(_5)}
return _2},isc.A.loadNodeTreeFromXML=function isc_EditContext_loadNodeTreeFromXML(_1){this.addPaletteNodesFromXML(_1)},isc.A.addPaletteNodesFromXML=function isc_EditContext_addPaletteNodesFromXML(_1,_2,_3,_4){var _5=this;isc.DMI.callBuiltin({methodName:"xmlToJS",arguments:[_1],callback:function(_6){_5.addPaletteNodesFromJS(_6.data,_2,_3,_4)}})},isc.A.addPaletteNodesFromJSON=function isc_EditContext_addPaletteNodesFromJSON(_1,_2,_3,_4){if(_1==null)return;if(!isc.isA.String(_1)){if(isc.isAn.Object(_1)||isc.isAn.Array(_1)){this.logWarn("Passed a non-string JSON value - if passing JavaScript objects use addPaletteNodesFromJS() instead")}else{this.logWarn("Passed a non-string JSON value - ignored")}
return}
var _5;try{_5=isc.JSON.decode(_1)}catch(e){this.logWarn("JSON string could not be decoded")}
if(!_5)return;if(!isc.isAn.Array(_5)&&isc.isAn.Object(_5)){_5=[_5]}
for(var i=_5.length-1;i>=0;i--){var _7=_5[i],_8=_7.type||_7.className,_9=isc.ClassFactory.getClass(_8);if(isc.isA.DataSource(_9)){var _10=_7.defaults;if(_10.loadID){var _11=_10.loadID.split(","),_12=[];for(var j=0;j<_11.length;j++){_12.add(this.makeDSPaletteNode(_11[j]))}
if(_12.length>0){_5.removeAt(i);_5.addListAt(_12,i)}}}}
var _3={};for(var i=0;i<_5.length;i++){this.$2258(_5[i],_3)}
for(var i=0;i<_5.length;i++){this.$1287(_5[i],_3)}
if(_3==null)_3=[];else if(!isc.isAn.Array(_3))_3=[_3];this.$1288(_5,_3);this.addFromPaletteNodes(_5,_2);this.fireCallback(_4,["paletteNodes"],[_5])},isc.A.$2258=function isc_EditContext__extractGlobals(_1,_2){for(var _3 in _1){var _4=_1[_3];if(isc.isAn.Array(_4)){for(var i=0;i<_4.length;i++){if(isc.isAn.Object(_4[i])){this.$2258(_4[i],_2)}}}else if(isc.isAn.Object(_4)){this.$2258(_4,_2)}}
var _6=_1.type||_1.className,_7=_6&&isc.DS.getNearestSchema(_6),_8=_7&&isc.DS.getAutoId(_1.defaults||{});if(_8){_2[_8]=_1}},isc.A.$1287=function isc_EditContext__replaceRefs(_1,_2){for(var _3 in _1){var _4=_1[_3];if(isc.isAn.Array(_4)){for(var i=0;i<_4.length;i++){if(isc.isA.String(_4[i])&&_4[i].startsWith("ref:")){var _6=_4[i].replace("ref:","");_4[i]=_2[_6]}else if(isc.isAn.Object(_4[i])){this.$1287(_4[i],_2)}}}else if(isc.isAn.Object(_4)){this.$1287(_4,_2)}}},isc.A.$1288=function isc_EditContext__removeIDs(_1,_2){var _3=(_2.length==1&&_2[0]==isc.RPC.ALL_GLOBALS);if(_1.ID&&!_3&&!_2.contains(_1.ID))delete _1.ID;for(var _4 in _1){if(_4=="defaults")continue;var _5=_1[_4];if(isc.isAn.Array(_5)){for(var i=0;i<_5.length;i++){if(isc.isAn.Object(_5[i])){this.$1288(_5[i],_2)}}}else if(isc.isAn.Object(_5)){this.$1288(_5,_2)}}},isc.A.getPaletteNodesFromXML=function isc_EditContext_getPaletteNodesFromXML(_1,_2){var _3=this;isc.DMI.callBuiltin({methodName:"xmlToJS",arguments:[_1],callback:function(_4){_3.getPaletteNodesFromJS(_4.data,_2)}})},isc.A.loadNodeTreeFromJS=function isc_EditContext_loadNodeTreeFromJS(_1){return this.addPaletteNodesFromJS(_1)},isc.A.addPaletteNodesFromJS=function isc_EditContext_addPaletteNodesFromJS(_1,_2,_3,_4){if(_3==null)_3=[];else if(!isc.isAn.Array(_3))_3=[_3];var _5=this;this.getPaletteNodesFromJS(_1,function(_6){if(_6)_5.addFromPaletteNodes(_6,_2);_5.fireCallback(_4,["paletteNodes"],[_6])},_3)},isc.A.getPaletteNodesFromJS=function isc_EditContext_getPaletteNodesFromJS(_1,_2,_3){if(_3==null)_3=[];else if(!isc.isAn.Array(_3))_3=[_3];var _4=this;isc.captureDefaults=true;if(_3.length==1&&_3[0]==isc.RPC.ALL_GLOBALS){isc.Class.globalEvalWithCapture(_1,function(_6,_7){isc.captureDefaults=null;var _5=_4.getCapturedComponents(_7);if(_5)_4.$1288(_5,_3);_4.fireCallback(_2,["paletteNodes"],[_5])},null,false)}else{isc.Class.globalEvalAndRestore(_1,_3,function(_6,_7){isc.captureDefaults=null;var _5=_4.getCapturedComponents(_7);if(_5)_4.$1288(_5,_3);if(_5)_4.$167x(_5);_4.fireCallback(_2,["paletteNodes"],[_5])},null,false)}
isc.captureDefaults=null},isc.A.getCapturedComponents=function isc_EditContext_getCapturedComponents(_1){if(_1){isc.warn("The following error occurred during loading of your view<br><br>: "+_1+".<br><br>  The portion of the view that loaded succesfully will be shown.")}
var _2=isc.capturedComponents;isc.capturedComponents=null;var _3=(_2?_2.getProperty("defaults").getProperty("ID"):null);this.logInfo("capturedComponents are: "+_3,"loadProject");return _2},isc.A.$167x=function isc_EditContext__translateTypeToSchemaType(_1){for(var i=0;i<_1.length;i++){var _3=_1[i].type,_4=isc.DS.getNearestSchema(_3);if(_4&&_4.Constructor==_3)_1[i].type=_4.name}},isc.A.addNodeTree=function isc_EditContext_addNodeTree(_1){this.addFromPaletteNodes(_1)},isc.A.addFromPaletteNodes=function isc_EditContext_addFromPaletteNodes(_1,_2){var _3=this.getEditNodeTree();if(!_2)_2=_3.getRoot();this.componentsToCreate=[];this.addComponentCalls=[];this.requiredDataSources=[];for(var i=0;i<_1.length;i++){this.findChildPaletteNodes(null,_1[i],null,_1)}
for(var i=0;i<_1.length;i++){if(!_1[i].hasParent){this.findChildPaletteNodes(_2,_1[i],null,_1)}}
var _5,_6;for(var i=0;i<_1.length;i++){_5=_1[i];var _7=_5.type||_5.className;if(_7){var _8=this.findPaletteNode("type",_7)||this.findPaletteNode("className",_7);if(_8&&(_5.editProxyProperties||_8.editProxyProperties)){_5.editProxyProperties=isc.addProperties({},_8.editProxyProperties,_5.editProxyProperties)}}
_5.component=this.makeEditNode(_5)}
for(var i=0;i<this.componentsToCreate.length;i++){_5=this.componentsToCreate[i];if(!_5.component){_5.component=this.makeEditNode(_5)}}
var _9=-1,_10=this.addComponentCalls,_11=[];isc.$75u=true;var _12=[];while(_10.length>0&&_9!=_10.length){_9=_10.length;var _13=_10.duplicate();for(var i=0;i<_13.length;i++){var _14=_13[i],_6=_14[1],_5=_14[0],_15=_14[2],_16=_6.liveObject;if(_6.name=="/"){var _17=this.addNode(_5.component,_2);_12.add(_17);_10.remove(_14);_11.add(_14)}else if(_3.contains(_6.component)){var _18=_5.component;if(_3.contains(_18)){_18=isc.addProperties({},_18)}
var _17=this.addNode(_18,_6.component,null,_15);if(_6.component==_2){_12.add(_17)}
_10.remove(_14);_11.add(_14)}else if(_16&&_3.contains(_16.editNode)){var _18=_5.component;if(_3.contains(_18)){_18=isc.addProperties({},_18)}
var _17=this.addNode(_18,_16.editNode,null,_15);if(_16.editNode==_2){_12.add(_17)}
_10.remove(_14);_11.add(_14)}}}
delete isc.$75u;if(this.logIsDebugEnabled("loadProject")){this.logDebug("addComponent() calls during project loading:","loadProject");for(var i=0;i<_11.length;i++){var _14=_11[i],_6=_14[1],_5=_14[0];this.logDebug("addComponent("+this.echoLeaf(_5)+","+this.echoLeaf(_6),"loadProject")}}
if(_10.length>0){this.logWarn("the following components could not be added to the project tree: "+isc.echoAll(_10.getProperty("0")))}
return _12},isc.A.makeDSPaletteNode=function isc_EditContext_makeDSPaletteNode(_1,_2){var _3={ID:_1,type:"DataSource",dsType:_2||"DataSource",title:_1,icon:"DataSource.png",iconSize:16,loadData:function(_3,_6){var _4=this;isc.ClassFactory.$180h(true);isc.DS.get(_3.ID,function(_7){isc.ClassFactory.$180h(null);var _5=isc.DS.get(_7);_3.liveObject=_5;_3.defaults={_constructor:"DataSource",ID:_5.ID};_3.isLoaded=true;if(_6)isc.Class.fireCallback(_6,"",[_3])},{loadParents:true})}};return _3});isc.evalBoundary;isc.B.push(isc.A.findChildPaletteNodes=function isc_EditContext_findChildPaletteNodes(_1,_2,_3,_4){var _5=_2.type||_2.className;var _6=this.logIsInfoEnabled("loadProject"),_7=this.logIsDebugEnabled("loadProject");if(_6){this.logInfo("inspecting defaults of component: "+this.echoLeaf(_2)+" of type: "+_5,"loadProject")}
var _8=_2.defaults,_9=this;var _10=[],_11=[],_12=isc.DS.get(_5),_13=isc.ClassFactory.getClass(_5);for(var _14 in _8){var _15=_8[_14];if(!isc.isAn.Array(_15)){_11[0]=_15;_15=_11}else if(_7){this.logDebug("checking Array property: "+_14+", value: "+this.echoLeaf(_15)+(_18?" with schema: "+_18:""),"loadProject")}
var _16=_12?_12.getField(_14):null,_17=_16?_16.type:null,_18=isc.DS.get(_17),_19=false;for(var i=0;i<_15.length;i++){var _21=_15[i];if(_7){this.logDebug("checking property: "+_14+", value: "+this.echoLeaf(_21),"loadProject")}
if(_4.contains(_21)){if(_6){this.logInfo("found capturedComponent: "+this.echoLeaf(_21)+" under property: "+_14+" of component: "+this.echoLeaf(_2),"loadProject")}
_10.add([_14,_21]);_19=true;continue}
if(_21==null){this.logInfo("null property: "+_14+" on component: "+this.echoLeaf(_2))}
var _22=(_21?_21._constructor:null)||_17,_23=isc.ClassFactory.getClass(_22);if(_18&&((_23&&_23.isA(isc.Canvas))||(_23&&_23.isA(isc.DataSource))||(_23&&_23.isA(isc.FormItem))||(this.findPaletteNode("type",_22))||(this.findPaletteNode("className",_22)))){if(_6){this.logInfo("found palettized component: "+this.echoLeaf(_21)+" of type: "+_22+" under property: "+_14+" of component: "+this.echoLeaf(_2),"loadProject")}
if(isc.isA.String(_21)){var _24=_4.find("ID",_21);if(_24==null){if(isc.DataSource.isA(_17)){var _25=this.findPaletteNode("ID",_21);if(true){_24=this.makeDSPaletteNode(_21)}}
if(_24==null)continue}
_10.add([_14,_24])}else{var _26=_21;_10.add([_14,{ID:_26.ID,name:_26.name,type:_22,defaults:_26}])}
_19=true}}
if(_19)delete _8[_14]}
var _27=this.findPaletteNode("type",_5)||this.findPaletteNode("className",_5);if(_27){_2.icon=_2.icon||_27.icon;_2.iconSize=_2.iconSize||_27.iconSize;_2.showDropIcon=_2.showDropIcon||_27.showDropIcon}
this.componentsToCreate.add(_2);if(_1!=null){_2.hasParent=true;this.addComponentCalls.add([_2,_1,_3])}
if(_10.length>0){for(var i=0;i<_10.length;i++){this.findChildPaletteNodes(_2,_10[i][1],_10[i][0],_4)}}},isc.A.isNodeEditingOn=function isc_EditContext_isNodeEditingOn(_1){if(!_1)return null;var _2=this.getLiveObject(_1);return(_2?_2.editingOn:false)},isc.A.enableEditing=function isc_EditContext_enableEditing(_1){if(this.isNodeEditingOn(_1))return;var _2=_1.liveObject;if(_2.setEditMode){_2.setEditMode(true,this,_1)}else{_2.editContext=this;_2.editNode=_1;_2.editingOn=true}},isc.A.setNodeProperties=function isc_EditContext_setNodeProperties(_1,_2,_3){if(this.logIsDebugEnabled("editing")){this.logDebug("with editNode: "+this.echoLeaf(_1)+" applying properties: "+this.echo(_2),"editing")}
if(!_1.defaults)_1.defaults={};var _4=isc.DS.getSchema(_1);if(_4&&_2[_4.getAutoIdField()]){_1.builderAutoID=false}
isc.addProperties(_1.defaults,_2);var _5=(_4?_1.defaults[_4.getAutoIdField()]:null);if(_5!=null)_1.ID=_5;var _6=_1.liveObject;if(_6&&!_3){var _7=this.getEditNodeTree(),_8=_7.getParent(_1),_9=_8?isc.DS.get(_8.type):null,_10=_8?_8.liveObject:null,_11=isc.DS.getObjectField(_10,_1.type),_12=_11?_9.getFields()[_11]:null,_13=isc.DS.getNearestSchemaClass(_9);if(isc.isA.DynamicForm(_13)&&_1.builderAutoID&&_2.title&&!_2.name)
{var _14={},_15=_7.getChildren(_8);for(var i=0;i<_15.length;i++){if(_15[i]!=_1)_14[_15[i].ID]=true}
var _17=isc.EditContext.$1941(_2.title,_14);if(_17)_1.defaults.name=_2.name=_17}
if((_2.name!=null||(isc.isA.DynamicForm(_10)&&_2.type!=null))&&_12&&_12.rebuildOnChange&&_12.rebuildOnChange.toLowerCase()=="true")
{var _18=_7.getChildren(_8).findIndex(_1);this.logInfo("using remove/re-add cycle to modify liveObject: "+isc.echoLeaf(_6)+" within parent node "+isc.echoLeaf(_8));var _15=_7.getChildren(_1);if(_15){_15=_15.duplicate();for(var i=0;i<_15.length;i++){this.removeNode(_15[i],true)}}
this.removeNode(_1);if(_2.name!=null&&_1.type!="DynamicProperty"){_1.ID=_2.name;delete _2.name}
if(isc.isA.DynamicForm(_10)&&_2.type!=null){_1.type=_1._constructor=isc.FormItemFactory.getItemClass(isc.FormItemFactory.getItemClassName({type:_2.type},_2.type,_10)).getClassName();if(_1.defaults&&_1.defaults._constructor){_1.defaults._constructor=_1._constructor}
delete _2.type}
var _19=this.addNode(_1,_8,_18);if(_15){for(var i=0;i<_15.length;i++){this.addNode(_15[i],_19)}
this.selectSingleEditNode(_1)}
_6=this.getLiveObject(_1)}
if(_6.setEditableProperties){_6.setEditableProperties(_2);if(_6.markForRedraw)_6.markForRedraw();else if(_6.redraw)_6.redraw()}else{var _20=_7.getParent(_1),_21=_20;if(_20!=null){var _10=_20.liveObject;if(_10!=null&&_10.setChildEditableProperties)
{_10.setChildEditableProperties(_6,_2,_1,this)}else{var _22=1;while((_21=_7.getParent(_21))!=null){var _23=_21.liveObject;if(_23!=null&&_23.setDescendantEditableProperties)
{_23.setDescendantEditableProperties(_6,_2,_1,this,_22);break}
++_22}}}
if(_21==null){isc.addProperties(_6,_2)}}
if(this.markForRedraw)this.markForRedraw();_7.dataChanged()}},isc.A.removeNodeProperties=function isc_EditContext_removeNodeProperties(_1,_2){if(!_1.defaults)return;if(!isc.isAn.Array(_2))_2=[_2];_2.map(function(_3){delete _1.defaults[_3]})},isc.A.setEditProxyProperties=function isc_EditContext_setEditProxyProperties(_1,_2){var _3=_1.liveObject||_1;if(_3.editProxy){isc.addProperties(_3.editProxy,_2)}else{isc.addProperties(_1,{editProxyProperties:isc.addProperties({},_1.editProxyProperties,_2)})}},isc.A.makePaletteNode=function isc_EditContext_makePaletteNode(_1){if(!_1||_1.canDuplicate==false)return null;var _2=isc.addProperties({},_1.defaults);delete _2._constructor;delete _2.ID;delete _2.autoDraw;delete _2.hasStableID;var _3=isc.addProperties({},{defaults:_2});if(_1.editNodeProperties){_3.editNodeProperties=isc.addProperties({},_1.editNodeProperties)}
if(_1.editProxyProperties){_3.editProxyProperties=isc.addProperties({},_1.editProxyProperties)}
for(var i=0;i<isc.EditContext.$178k.length;i++){var _5=isc.EditContext.$178k[i];if(_1[_5])_3[_5]=_1[_5]}
return _3},isc.A.makePaletteNodeTree=function isc_EditContext_makePaletteNodeTree(_1,_2,_3){if(!_1||_1.canDuplicate==false)return null;var _4=this.makePaletteNode(_1);if(!_2){_2=isc.Tree.create({root:_4})}else{_2.add(_4,_3)}
var _5=this.getEditNodeTree(),_6=_5.getChildren(_1);if(_6&&_6.length>0){for(var i=0;i<_6.length;i++){this.makePaletteNodeTree(_6[i],_2,_4)}}
return _2},isc.A.copyEditNodes=function isc_EditContext_copyEditNodes(_1){if(!_1)return;if(!isc.isAn.Array(_1))_1=[_1];var _2=[];for(var i=0;i<_1.length;i++){var _4=this.makePaletteNodeTree(_1[i]);if(_4)_2.push(_4)}
if(_2.length>0){this.setEditClipboard(_2.length==1?_2[0]:_2)}},isc.A.setEditClipboard=function isc_EditContext_setEditClipboard(_1){this.clearEditClipboard();this.$178l=_1},isc.A.getEditClipboard=function isc_EditContext_getEditClipboard(){return this.$178l},isc.A.clearEditClipboard=function isc_EditContext_clearEditClipboard(){if(this.$178l){delete this.$178l}},isc.A.pasteEditNodes=function isc_EditContext_pasteEditNodes(_1){var _2=this.getEditClipboard();if(!_2)return;var _3=this.selectedComponents;this.selectedComponents=[];var _4=this.$1366();if(!isc.isAn.Array(_2))_2=[_2];for(var i=0;i<_2.length;i++){var _6=_2[i],_7=_6.getRoot();if(_7.defaults){_7.defaults.left=(_7.defaults.left?_7.defaults.left:0)+isc.EditContext.editNodePasteOffset;_7.defaults.top=(_7.defaults.top?_7.defaults.top:0)+isc.EditContext.editNodePasteOffset}
var _8=isc.Tree.getCleanNodeData(_7,false,false,false,_6),_9=this.addFromPaletteNode(_8,_1);if(_4)this.selectedComponents.add(_9.liveObject);this.$178m(_9,_6,_7)}
this.updateSelectionDisplay(this.selectedComponents,_3);this.fireSelectedEditNodesUpdated()},isc.A.$178m=function isc_EditContext__pasteChildNodes(_1,_2,_3){var _4=_2.getChildren(_3);if(!_4||_4.length==0){return}
var _5=this.$1366();for(var i=0;i<_4.length;i++){var _7=isc.Tree.getCleanNodeData(_4[i],false,false,false,_2),_8=this.addFromPaletteNode(_7,_1);this.$178m(_8,_2,_7)}},isc.A.addWithWrapper=function isc_EditContext_addWithWrapper(_1,_2,_3,_4){var _5=!_3,_6=(_3?this.wrapperDrawPaneDefaults:this.wrapperFormDefaults),_7=isc.Canvas.$145y(this),_8=isc.addProperties({},_6);if(_1.editProxyProperties)isc.addProperties(_7,_1.editProxyProperties);var _9={type:_6._constructor,defaults:_8,editProxyProperties:_7,parentProperty:_4};if(_5&&_1.liveObject.schemaDataSource){var _10=_1.liveObject;_8.doNotUseDefaultBinding=true;_8.dataSource=_10.schemaDataSource;_8.serviceNamespace=_10.serviceNamespace;_8.serviceName=_10.serviceName}
var _11=this.makeEditNode(_9);this.addNode(_11,_2,null,_4);return this.addNode(_1,_11)},isc.A.$145z=function isc_EditContext__getCanGroupSelect(){return(this.canGroupSelect==true||this.selectionType=="multiple")},isc.A.$1450=function isc_EditContext__getCanDragGroup(){return(this.canDragGroup!=false)&&this.$145z()},isc.A.getSelectedEditNodes=function isc_EditContext_getSelectedEditNodes(){var _1=[];this.selectedComponents.map(function(_2){_1.push(_2.editNode)});return _1},isc.A.getSelectedEditNode=function isc_EditContext_getSelectedEditNode(){var _1=this.getSelectedEditNodes();return(_1&&_1.length>0?_1[0]:null)},isc.A.isEditNodeSelected=function isc_EditContext_isEditNodeSelected(_1){if(!this.selectedComponents||!_1.liveObject)return false;return this.selectedComponents.contains(_1.liveObject)},isc.A.selectEditNode=function isc_EditContext_selectEditNode(_1){var _2=(_1&&_1.liveObject?_1.liveObject:null);if(_2&&!this.selectedComponents.contains(_2)){this.selectedComponents.add(_2);this.updateSelectionDisplay([_2],null);this.fireSelectedEditNodesUpdated()}},isc.A.selectSingleEditNode=function isc_EditContext_selectSingleEditNode(_1){var _2=(_1&&_1.liveObject?_1.liveObject:null);if(!_2)return;if(this.selectedComponents.length==1&&this.selectedComponents.contains(_2)){return}
var _3=false,_4=this.selectedComponents;if(_4.contains(_2))_4.remove(_2);if(this.selectedComponents.length>0)_3=true;this.selectedComponents=[];if(_2){this.selectedComponents=[_2];_3=true}
if(_3){this.updateSelectionDisplay([_2],_4);this.fireSelectedEditNodesUpdated()}},isc.A.selectAllEditNodes=function isc_EditContext_selectAllEditNodes(){this.selectedComponents=[];var _1=this.$1366();if(_1){this.selectedComponents=_1.getAllSelectableComponents();this.updateSelectionDisplay(this.selectedComponents,null)}
this.fireSelectedEditNodesUpdated()},isc.A.deselectEditNodes=function isc_EditContext_deselectEditNodes(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2=[];this.editNodes.map(function(_4){if(_4.liveObject)_2.push(_4.liveObject)});var _3=this.selectedComponents.removeList(_2);this.updateSelectionDisplay(null,_2);if(_3){this.fireSelectedEditNodesUpdated()}},isc.A.deselectAllEditNodes=function isc_EditContext_deselectAllEditNodes(){if(!this.selectedComponents||this.selectedComponents.length==0)return;var _1=this.selectedComponents;this.selectedComponents=[];this.updateSelectionDisplay(null,_1);this.fireSelectedEditNodesUpdated()},isc.A.getSelectedComponents=function isc_EditContext_getSelectedComponents(){return this.selectedComponents.duplicate()},isc.A.isComponentSelected=function isc_EditContext_isComponentSelected(_1){if(!this.selectedComponents)return false;return this.selectedComponents.contains(_1)},isc.A.selectComponent=function isc_EditContext_selectComponent(_1){if(!this.selectedComponents.contains(_1)){this.selectedComponents.add(_1);this.updateSelectionDisplay([_1],null);this.fireSelectedEditNodesUpdated()}},isc.A.selectSingleComponent=function isc_EditContext_selectSingleComponent(_1){if(this.selectedComponents.length==1&&this.selectedComponents.contains(_1)){this.updateSelectionDisplay([_1]);return}
var _2=false,_3=this.selectedComponents;if(_3.contains(_1))_3.remove(_1);if(this.selectedComponents.length>0)_2=true;this.selectedComponents=[];if(_1){this.selectedComponents=[_1];_2=true}
if(_2){this.updateSelectionDisplay([_1],_3);this.fireSelectedEditNodesUpdated()}},isc.A.selectAllComponents=function isc_EditContext_selectAllComponents(){this.selectedComponents=[];var _1=this.$1366();if(_1){this.selectedComponents=_1.getAllSelectableComponents();this.updateSelectionDisplay(this.selectedComponents,null)}
this.fireSelectedEditNodesUpdated()},isc.A.deselectComponents=function isc_EditContext_deselectComponents(_1){if(!isc.isAn.Array(_1))_1=[_1];var _2=this.selectedComponents.removeList(_1);this.updateSelectionDisplay(null,_1);if(_2){this.fireSelectedEditNodesUpdated()}},isc.A.deselectAllComponents=function isc_EditContext_deselectAllComponents(){if(!this.selectedComponents||this.selectedComponents.length==0)return;var _1=this.selectedComponents;this.selectedComponents=[];this.updateSelectionDisplay(null,_1);this.fireSelectedEditNodesUpdated()},isc.A.$1451=function isc_EditContext__shouldShowThumbsOrDragHandle(){return(this.selectedComponents&&this.selectedComponents.length==1)},isc.A.refreshSelectedAppearance=function isc_EditContext_refreshSelectedAppearance(_1){if(!_1||!_1.editProxy)return;if(this.isComponentSelected(_1)){_1.editProxy.showSelectedAppearance(true,(this.showSelectedLabelOnSelect==false),this.$1451())}else{_1.editProxy.showSelectedAppearance(false)}},isc.A.updateSelectionDisplay=function isc_EditContext_updateSelectionDisplay(_1,_2){var _3=this.$1451();if(_2&&_2.length>0){for(var i=0;i<_2.length;i++){var _5=_2[i].editProxy;if(_5&&_5.showSelectedAppearance){_5.showSelectedAppearance(false)}}}
if(_1&&_1.length>0){for(var i=0;i<_1.length;i++){var _5=_1[i].editProxy;if(_5&&_5.showSelectedAppearance){_5.showSelectedAppearance(true,(this.showSelectedLabelOnSelect==false),_3)}}}
if(_3&&(!_1||_1.length==0)){var _6=this.getSelectedComponents()[0];_6.editProxy.showSelectedAppearance(true,(this.showSelectedLabelOnSelect==false),_3)}
this.showGroupSelectionBox()},isc.A.$1366=function isc_EditContext__getSelectionEditProxy(){var _1=this.$159m;if(!_1)return null;return(_1.editingOn?_1.editProxy:null)},isc.A.fireSelectedEditNodesUpdated=function isc_EditContext_fireSelectedEditNodesUpdated(){var _1=this.$1366();if((_1&&_1.selectedEditNodesUpdated)||this.selectedEditNodesUpdated){var _2=this.getSelectedEditNodes(),_3=(_2&&_2.length>0?_2[0]:null);if(_1&&_1.selectedEditNodesUpdated){_1.selectedEditNodesUpdated(_3,_2)}
if(this.selectedEditNodesUpdated){this.selectedEditNodesUpdated(_3,_2)}}},isc.A.selectedEditNodesUpdated=function isc_EditContext_selectedEditNodesUpdated(_1,_2){},isc.A.saveCoordinates=function isc_EditContext_saveCoordinates(_1){if(isc.isA.SimpleTabButton(_1)||isc.isA.DrawItem(_1)||isc.isA.DrawKnob(_1)||isc.isA.Portlet(_1)||isc.isA.PortalColumn(_1)||isc.isA.PortalRow(_1)||_1.$1452||_1.$146g)
{return}
this.showGroupSelectionBox();var _2=this.getEditNodeArray().find("liveObject",_1);if(!_2)return;if(this.persistCoordinates==false)return;var _3=this.getEditNodeTree().getParent(_2);if(!_3)return;var _4=_3.liveObject;if(_4&&_4.editProxy){if((this.persistCoordinates==null&&_4.editProxy.persistCoordinates)||(this.persistCoordinates&&_4.editProxy.persistCoordinates!=false))
{var _5=(_1.$pn=="*"?"*":null),_6=(_1.$po=="*"?"*":null);this.setNodeProperties(_2,{left:_1.getLeft(),top:_1.getTop(),width:_1._percent_width||_5||_1.getWidth(),height:_1._percent_height||_6||_1.getHeight()},true)}}},isc.A.showGroupSelectionBox=function isc_EditContext_showGroupSelectionBox(){if(this.$145z()&&!this.$146j&&!(isc.isA.DrawPane&&isc.isA.DrawPane(this.$159m))){var _1=this.getGroupMask(this.$159m);if(this.selectedComponents.length>1){_1.setSelection(this.getSelectedComponents());_1.show()}else{if(_1)_1.hide()}}},isc.A.getGroupMask=function isc_EditContext_getGroupMask(_1){if(!this.groupMask&&_1){var _2={ID:_1.ID+"$146k",keepInParentRect:true,hideBorderOnDrag:(this.hideGroupBorderOnDrag!=false),canDragReposition:this.$1450()};this.groupMask=this.createAutoChild("groupMask",_2);_1.addChild(this.groupMask)}
return this.groupMask});isc.B._maxIndex=isc.C+101;isc.ClassFactory.defineInterface("Palette");isc.Palette.addInterfaceProperties({setDefaultEditContext:function(_1){if(_1&&!isc.isAn.EditContext(_1)&&_1.getEditContext){_1=_1.getEditContext()}
this.defaultEditContext=_1;if(_1&&!_1.defaultPalette){_1.defaultPalette=this}},makeEditNode:function(_1){if(!_1)_1=this.getDragData();if(isc.isAn.Array(_1))_1=_1[0];var _2=_1.type||_1.className;if(!isc.SGWTFactory.getFactory(_2)&&_2.contains("."))_2=_2.split(/\./).pop();var _3={type:_2,_constructor:_2,idPrefix:_1.idPrefix,canDuplicate:_1.canDuplicate,title:_1.title,icon:_1.icon,iconSize:_1.iconSize,showDropIcon:_1.showDropIcon,useEditMask:_1.useEditMask,autoGen:_1.autoGen,editProxyProperties:_1.editProxyProperties};if(isc.isAn.Object(_1.editNodeProperties)){for(var _4 in _1.editNodeProperties){_3[_4]=_1.editNodeProperties[_4]}}
if(_1.makeComponent){_3.liveObject=_1.makeComponent(_3);return _3}
var _5=_1.defaults;if(_5&&_5.builderAutoID)_3.builderAutoID=true;_3.ID=_1.ID||(_5?isc.DS.getAutoId(_5):null);var _6=true;if(_1.loadData&&!_1.isLoaded){_3.deferCreation=_1.deferCreation;_3.loadData=_1.loadData}else if(_1.wizardConstructor){_3.wizardConstructor=_1.wizardConstructor;_3.wizardDefaults=_1.wizardDefaults}else if(_1.liveObject){var _7=_1.liveObject;if(isc.isA.String(_7))_7=window[_7];_3.liveObject=_7}else{_3=this.createLiveObject(_1,_3);_6=false}
if(_6){_3.defaults=isc.addProperties({},_1.defaults);delete _3.defaults[isc.gwtRef];delete _3.defaults[isc.gwtModule];delete _3.defaults["xsi:type"]}
if(_3.defaults&&!_3.defaults._constructor){_3.defaults._constructor=_2}
return _3},makeNewComponent:function(_1){return this.makeEditNode(_1)},generateNames:true,typeCount:{},getNextAutoId:function(_1){if(_1==null){_1="Object"}else{if(_1.contains("."))_1=_1.split(/\./).pop()}
var _2;this.typeCount[_1]=this.typeCount[_1]||0;while(window[(_2=_1+this.typeCount[_1]++)]!=null){}
return _2},findPaletteNode:function(_1,_2){return null},createLiveObject:function(_1,_2){var _3=_1.type||_1.className;if(_3.contains(".")&&!isc.SGWTFactory.getFactory(_3))_3=_3.split(/\./).pop();var _4=isc.ClassFactory.getClass(_3),_5=isc.DS.getNearestSchema(_3),_6={},_7=(_5?_5.shouldCreateStandalone():true),_8=_1.defaults||{};var _9;if(_5&&!_4){_4=isc.DS.getNearestSchemaClass(_5);if(_4){_3=_4.getClassName();_9=true}}
var _10={};if(_4&&_4.isA("Canvas")){_6.autoDraw=false;_10.autoDraw=false}
if(_8.title){_6.title=_8.title}
if(this.generateNames&&(_5.addGlobalId==null||_5.addGlobalId!=false)){var _11=_2.ID||_8[_5.getAutoIdField()];if(_11==null){_11=this.getNextAutoId(_1.idPrefix||_1.type);if(isc.isA.Class(_4))_2.builderAutoID=true}
if(!_6.hasStableID&&_2.builderAutoID){_6.hasStableID=function(){var _12=this.editNode&&this.editNode.builderAutoID;return _12?false:this.Super("hasStableID",arguments)}}
_2.ID=_11;_6[_5.getAutoIdField()]=_11;if(_5&&_5.getField("title")&&!isc.isA.FormItem(_4)&&!(isc.isA.DrawItem&&isc.isA.DrawItem(_4))&&_3!="ListGridField"&&!_6.title){_6.title=_11}}
_6=_2.defaults=isc.addProperties(_6,this.componentDefaults,_8);delete _6[isc.gwtRef];delete _6[isc.gwtModule];delete _6.builderAutoID;delete _6["xsi:type"];_6._constructor=_3;for(var _13 in _6){var _14=_6[_13];if(isc.isAn.Array(_14)&&(!_4||_4.getInstanceProperty(_13)!==_14)){_14=_6[_13]=_14.duplicate();for(var i=_14.length;i--;){if(isc.isAn.Array(_14[i])){_14[i]=_14[i].duplicate()}}}}
var _16;if(_4&&_7){if(_3=="DataSource"&&isc.DataSource.get(_11)){_16=isc.DataSource.get(_11)}else{_16=isc.ClassFactory.newInstance(_6,_10)}}else{_2.generatedType=true;_16=isc.shallowClone(_6)}
_2.liveObject=_16;this.logInfo("palette created component, type: "+_3+", ID: "+_11+(this.logIsDebugEnabled("editing")?", defaults: "+this.echo(_6):"")+", liveObject: "+this.echoLeaf(_16),"editing");return _2}});isc.defineClass("HiddenPalette","Class","Palette");isc.A=isc.HiddenPalette.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.findPaletteNode=function isc_HiddenPalette_findPaletteNode(_1,_2){return this.data?this.data.find(_1,_2):null});isc.B._maxIndex=isc.C+1;if(isc.TreeGrid){isc.defineClass("TreePalette","TreeGrid","Palette");isc.A=isc.TreePalette.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canDragRecordsOut=true;isc.B.push(isc.A.recordDoubleClick=function isc_TreePalette_recordDoubleClick(){var _1=this.defaultEditContext;if(_1){if(isc.isA.String(_1)&&this.creator)_1=this.creator[_1];if(isc.isAn.EditContext(_1)){var _2=this.getDragData()[0];_5=this.makeEditNode(_2);if(_5){var _3=_1.getDefaultParent(_5,true);if(_3==null){isc.warn("No default parent can accept a component of this type")}else{_2=this.data.getCleanNodeData([_2],false,false,false)[0];_2=isc.clone(_2);var _4=isc.isA.FormItem(isc[_2.type]),_5=_4?_1.addFromPaletteNode(_2):_1.addFromPaletteNodes([_2],_3);if(isc.isAn.Array(_5))_5=_5[0];if(_5)isc.EditContext.selectCanvasOrFormItem(_5.liveObject,true)}}}}},isc.A.findPaletteNode=function isc_TreePalette_findPaletteNode(_1,_2){return this.data?this.data.find(_1,_2):null},isc.A.transferDragData=function isc_TreePalette_transferDragData(_1){return this.getDragData()});isc.B._maxIndex=isc.C+3}
if(isc.ListGrid){isc.defineClass("ListPalette","ListGrid","Palette");isc.A=isc.ListPalette.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canDragRecordsOut=true;isc.A.defaultFields=[{name:"title",title:"Title"}];isc.B.push(isc.A.recordDoubleClick=function isc_ListPalette_recordDoubleClick(){var _1=this.defaultEditContext;if(_1){if(isc.isA.String(_1))_1=isc.Canvas.getById(_1);if(isc.isAn.EditContext(_1)){_1.addNode(this.makeEditNode(this.getDragData()))}}},isc.A.findPaletteNode=function isc_ListPalette_findPaletteNode(_1,_2){return this.data?this.data.find(_1,_2):null},isc.A.transferDragData=function isc_ListPalette_transferDragData(){return this.getDragData()});isc.B._maxIndex=isc.C+3}
if(isc.TileGrid){isc.defineClass("TilePalette","TileGrid","Palette");isc.A=isc.TilePalette.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canDragTilesOut=true;isc.A.defaultFields=[{name:"title",title:"Title"}];isc.B.push(isc.A.recordDoubleClick=function isc_TilePalette_recordDoubleClick(){var _1=this.defaultEditContext;if(_1){if(isc.isA.String(_1))_1=isc.Canvas.getById(_1);if(isc.isAn.EditContext(_1)){_1.addNode(this.makeEditNode(this.getDragData()))}}},isc.A.findPaletteNode=function isc_TilePalette_findPaletteNode(_1,_2){return this.data?this.data.find(_1,_2):null},isc.A.transferDragData=function isc_TilePalette_transferDragData(){return this.getDragData()});isc.B._maxIndex=isc.C+3}
if(isc.Menu){isc.defineClass("MenuPalette","Menu","Palette");isc.A=isc.MenuPalette.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canDragRecordsOut=true;isc.A.selectionType="single";isc.B.push(isc.A.itemClick=function isc_MenuPalette_itemClick(_1){var _2=this.defaultEditContext;if(_2){if(isc.isA.String(_2))_2=isc.Canvas.getById(_2);if(isc.isAn.EditContext(_2)){_2.addNode(this.makeEditNode(this.getDragData()))}}},isc.A.findPaletteNode=function isc_MenuPalette_findPaletteNode(_1,_2){return this.data?this.data.find(_1,_2):null},isc.A.transferDragData=function isc_MenuPalette_transferDragData(){return this.getDragData()});isc.B._maxIndex=isc.C+3}
if(!isc.DataSource.get("EditPane")){isc.DataSource.create({ID:"EditPane",Contructor:"EditPane",addGlobalId:false,fields:[{name:"children",type:"Canvas",multiple:true}]})}
isc.ClassFactory.defineClass("EditPane","Canvas");isc.A=isc.EditPane.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.border="1px solid black";isc.A.canAcceptDrop=true;isc.A.editContextConstructor="EditContext";isc.A.editContextDefaults={canSelectEditNodes:true,nodeAdded:function(_1,_2,_3){var _4=this.creator;if(_4.creator&&_4.creator.editingOn)this.enableEditing(_1);if(_4.nodeAdded)_4.nodeAdded(_1,_2,_3)},getSelectedLabelText:function(_1){var _2=this.creator;return(_2.getSelectedLabelText?_2.getSelectedLabelText(_1):this.Super("getSelectedLabelText",arguments))}};isc.A.editMode=true;isc.B.push(isc.A.initWidget=function isc_EditPane_initWidget(){this.Super("initWidget",arguments);var _1={type:"EditPane",liveObject:this};if(this.useCopyPasteShortcuts){if(!_1.editProxyProperties)_1.editProxyProperties={};_1.editProxyProperties.useCopyPasteShortcuts=true}
var _2=isc.EditContext.getNonNullProperties({rootComponent:_1,defaultPalette:this.defaultPalette,extraPalettes:this.extraPalettes,autoEditNewNodes:this.autoEditNewNodes,persistCoordinates:this.persistCoordinates,allowNestedDrops:this.allowNestedDrops,showSelectedLabel:this.showSelectedLabel,selectedAppearance:this.selectedAppearance,selectedBorder:this.selectedBorder,selectedLabelBackgroundColor:this.selectedLabelBackgroundColor,selectedTintColor:this.selectTintColor,selectedTintOpacity:this.selectedTintOpacity,useCopyPasteShortcuts:this.useCopyPasteShortcuts});this.editContext=this.createAutoChild("editContext",_2);this.data=[];this.createSelectionModel();if(this.editMode)this.setEditMode(true,this.editContext,this.editContext.getRootEditNode())},isc.A.getEditContext=function isc_EditPane_getEditContext(){return this.editContext},isc.A.setEditMode=function isc_EditPane_setEditMode(_1,_2,_3){if(_1==null)_1=true;if(this.editingOn==_1)return;if(!_2)_2=this.getEditContext();this.Super("setEditMode",[_1,_2,_3],arguments);if(this.editingOn&&this.editProxy&&this.editProxy.canSelectChildren){_2.$159m=this}
var _4=_2.getEditNodeArray().getProperty("liveObject");_4.map(function(_5){_5.setEditMode(_1,_2,_5.editNode)});if(_1){if(this.contextMenu==null){this.contextMenu={$1894:true,autoDraw:false,data:[{title:"Clear",click:"target.destroyAll()"}]}}}else if(this.contextMenu&&this.contextMenu.$1894){this.contextMenu=null}},isc.A.switchEditMode=function isc_EditPane_switchEditMode(_1){this.editContext.switchEditMode(_1)},isc.A.getObjectField=function isc_EditPane_getObjectField(_1){var _2=isc.DS.getNearestSchemaClass(_1);if(_2==null){_2=isc.ClassFactory.getClass(_1)}
if(isc.isA.Canvas(_2)){return"children"}else{return null}},isc.A.removeChild=function isc_EditPane_removeChild(_1,_2){if(isc.EditProxy.getThumbTarget()===_1)isc.EditProxy.hideResizeThumbs();this.Super("removeChild",arguments);var _3=this.getEditContext(),_4=_3&&_3.getEditNodeArray().find("liveObject",_1);if(_4){_3.removeNode(_4,true)}},isc.A.getSaveData=function isc_EditPane_getSaveData(){var _1=this.getEditContext().getEditNodeTree(),_2=_1.getChildren(_1.getRoot()),_3=[];for(var i=0;i<_2.length;i++){var _5=_2[i],_6=_5.liveObject;var _7={type:_5.type,defaults:_5.defaults};if(_6.getSaveData)_7=_6.getSaveData(_7);_3.add(_7)}
return _3},isc.A.getRootEditNode=function isc_EditPane_getRootEditNode(){return this.editContext.getRootEditNode()},isc.A.makeEditNode=function isc_EditPane_makeEditNode(_1){return this.editContext.makeEditNode(_1)},isc.A.getEditNodeTree=function isc_EditPane_getEditNodeTree(){return this.editContext.getEditNodeTree()},isc.A.addNode=function isc_EditPane_addNode(_1,_2,_3,_4,_5){return this.editContext.addNode(_1,_2,_3,_4,_5)},isc.A.addFromPaletteNode=function isc_EditPane_addFromPaletteNode(_1,_2){return this.editContext.addFromPaletteNode(_1,_2)},isc.A.addFromPaletteNodes=function isc_EditPane_addFromPaletteNodes(_1,_2){return this.editContext.addFromPaletteNodes(_1,_2)},isc.A.removeNode=function isc_EditPane_removeNode(_1,_2){return this.editContext.removeNode(_1,_2)},isc.A.destroyNode=function isc_EditPane_destroyNode(_1){return this.editContext.destroyNode(_1)},isc.A.reorderNode=function isc_EditPane_reorderNode(_1,_2,_3){return this.editContext.reorderNode(_1,_2,_3)},isc.A.removeAll=function isc_EditPane_removeAll(){return this.editContext.removeAll()},isc.A.destroyAll=function isc_EditPane_destroyAll(){return this.editContext.destroyAll()},isc.A.isNodeEditingOn=function isc_EditPane_isNodeEditingOn(_1){return this.editContext.isNodeEditingOn(_1)},isc.A.enableEditing=function isc_EditPane_enableEditing(_1){return this.editContext.enableEditing(_1)},isc.A.setNodeProperties=function isc_EditPane_setNodeProperties(_1,_2,_3){return this.editContext.setNodeProperties(_1,_2,_3)},isc.A.removeNodeProperties=function isc_EditPane_removeNodeProperties(_1,_2){return this.editContext.removeNodeProperties(_1,_2)},isc.A.getDefaultPalette=function isc_EditPane_getDefaultPalette(){return this.editContext.getDefaultPalette()},isc.A.setDefaultPalette=function isc_EditPane_setDefaultPalette(_1){return this.editContext.setDefaultPalette(_1)},isc.A.makePaletteNode=function isc_EditPane_makePaletteNode(_1){return this.editContext.makePaletteNode(_1)},isc.A.makePaletteNodeTree=function isc_EditPane_makePaletteNodeTree(_1){return this.editContext.makePaletteNodeTree(_1)},isc.A.copyEditNodes=function isc_EditPane_copyEditNodes(_1){this.editContext.copyEditNodes(_1)},isc.A.pasteEditNodes=function isc_EditPane_pasteEditNodes(_1){this.editContext.pasteEditNodes(_1)},isc.A.addPaletteNodesFromXML=function isc_EditPane_addPaletteNodesFromXML(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromXML(_1,_2,_3,_4)},isc.A.addPaletteNodesFromJSON=function isc_EditPane_addPaletteNodesFromJSON(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromJSON(_1,_2,_3,_4)},isc.A.getPaletteNodesFromXML=function isc_EditPane_getPaletteNodesFromXML(_1,_2){return this.editContext.getPaletteNodesFromXML(_1,_2)},isc.A.addPaletteNodesFromJS=function isc_EditPane_addPaletteNodesFromJS(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromJS(_1,_2,_3,_4)},isc.A.serializeAllEditNodes=function isc_EditPane_serializeAllEditNodes(_1){return this.editContext.serializeAllEditNodes(_1)},isc.A.serializeAllEditNodesAsJSON=function isc_EditPane_serializeAllEditNodesAsJSON(_1,_2){return this.editContext.serializeAllEditNodesAsJSON(_1,_2)},isc.A.serializeEditNodes=function isc_EditPane_serializeEditNodes(_1,_2){return this.editContext.serializeEditNodes(_1,_2)},isc.A.serializeEditNodesAsJSON=function isc_EditPane_serializeEditNodesAsJSON(_1,_2){return this.editContext.serializeEditNodesAsJSON(_1,_2)});isc.B._maxIndex=isc.C+36;if(isc.TreeGrid){isc.ClassFactory.defineClass("EditTree","TreeGrid");isc.A=isc.EditTree.getPrototype();isc.A.canDragRecordsOut=false;isc.A.canAcceptDroppedRecords=true;isc.A.canReorderRecords=true;isc.A.selectionType="single";isc.A.autoShowParents=true;isc.A=isc.EditTree.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editContextConstructor="EditContext";isc.B.push(isc.A.initWidget=function isc_EditTree_initWidget(){this.fields=[{name:"ID",title:"ID",type:"identifier",width:"*",formatCellValue:function(_2,_3,_4,_5,_6){var _1=isc.DS.getAutoId(_3.liveObject);return String(_1).asHTML()}},{name:"type",title:"Type",width:"*",canEdit:false}];this.Super("initWidget",arguments);this.configureEditContext();this.observe(this,"nodeClick","observer.selectedNodeUpdated()");this.setData(this.editContext.getEditNodeTree())},isc.A.getEditContext=function isc_EditTree_getEditContext(){return this.editContext},isc.A.configureEditContext=function isc_EditTree_configureEditContext(){var _1=this;if(!this.editContext){if(!this.rootComponent&&!this.rootLiveObject){this.rootComponent={type:"Canvas"}}
var _2=isc.EditContext.getNonNullProperties({rootComponent:this.rootComponent,rootLiveObject:this.rootLiveObject,defaultPalette:this.defaultPalette,extraPalettes:this.extraPalettes,autoEditNewNodes:this.autoEditNewNodes,persistCoordinates:this.persistCoordinates,allowNestedDrops:this.allowNestedDrops,showSelectedLabel:this.showSelectedLabel,selectedAppearance:this.selectedAppearance,selectedBorder:this.selectedBorder,selectedLabelBackgroundColor:this.selectedLabelBackgroundColor,selectedTintColor:this.selectTintColor,selectedTintOpacity:this.selectedTintOpacity,useCopyPasteShortcuts:this.useCopyPasteShortcuts});this.editContext=this.createAutoChild("editContext",isc.addProperties({},this.editContextProperties,_2))}
this.editContext.addProperties({getDefaultParent:function(_3,_4){return _1.getDefaultParent(_3,_4)},$143b:this.editContext.nodeAdded,nodeAdded:function(_3,_4,_5){if(this.$143b)this.$143b();_1.selectSingleRecord(_3);_1.scrollRecordIntoView(_1.getRecordIndex(_3));if(_1.autoShowParents)_1.showParents(_3);if(_1.creator&&_1.creator.editingOn)this.enableEditing(_3);if(_1.nodeAdded)_1.nodeAdded(_3,_4,_5)},$1453:this.editContext.getSelectedLabelText,getSelectedLabelText:function(_3){return(_1.getSelectedLabelText?_1.getSelectedLabelText(_3):(this.$1453?this.$1453(_3):_3.toString()))}});this.observe(this.editContext,"selectedEditNodesUpdated","observer.selectedEditNodesUpdated()")},isc.A.selectedEditNodesUpdated=function isc_EditTree_selectedEditNodesUpdated(){var _1=this.editContext.getSelectedEditNodes();if(_1.length>0)this.selectSingleRecord(_1[0]);else this.deselectAllRecords()},isc.A.selectedNodeUpdated=function isc_EditTree_selectedNodeUpdated(){var _1=this.getSelectedRecord(),_2=this.data.getParent(_1);var _3=_1&&_1.liveObject;if(isc.isA.Canvas(_3)&&_3.$73a==null&&isc.isA.Deck&&isc.isA.Deck(_3.parentElement))
{var _4=_3.parentElement;if(_4.isVisible()&&_4.$73a==null&&isc.isAn.Array(_4.panes)&&_4.panes.contains(_3))
{_3.setVisibility(isc.Canvas.INHERIT);_4.reflowNow();isc.EditContext.selectCanvasOrFormItem(_3,false);return}}
for(var _5=_1;_5!=null;_5=this.data.getParent(_5)){var _6=_5.liveObject;if(((isc.isA.Canvas(_6)||isc.isA.FormItem(_6))&&_6.isDrawn()&&_6.isVisible())||(_6!=null&&_6.$73a!=null))
{if(_5===_1){isc.EditContext.selectCanvasOrFormItem(_6,false)}else{var _7=this.editContext.getSelectedEditNodes();if(!_7.contains(_5)){isc.EditContext.selectCanvasOrFormItem(_6,false);if(!isc.isA.DataSource(_3)){this.selectSingleRecord(_1)}}else if(isc.isA.DataSource(_3)){this.selectSingleRecord(_5)}}
break}}},isc.A.switchEditMode=function isc_EditTree_switchEditMode(_1){this.editContext.switchEditMode(_1)},isc.A.willAcceptDrop=function isc_EditTree_willAcceptDrop(){if(!this.Super("willAcceptDrop",arguments))return false;var _1=this.getEventRow(),_2=this.getDropFolder(),_3=this.ns.EH.dragTarget.getDragData();if(_3==null)return false;if(isc.isAn.Array(_3)){if(_3.length==0)return false;_3=_3[0]}
if(_2==null)_2=this.data.getRoot();var _4=_3.type||_3.className;this.logInfo("checking dragType: "+_4+" against dropLiveObject: "+_2.liveObject,"editing");return this.editContext.canAddToParent(_2,_4)},isc.A.folderDrop=function isc_EditTree_folderDrop(_1,_2,_3,_4){if(_4!=this&&!_4.isA("Palette")){return this.Super("folderDrop",arguments)}
if(_4!=this){_1=_4.transferDragData();if(!_1)return;_1=this.makeEditNode(isc.isAn.Array(_1)?_1[0]:_1)}
var _5=(isc.isAn.Array(_1)?_1[0]:_1);_5.dropped=true;this.logInfo("sourceWidget is a Palette, dropped node of type: "+_5.type,"editing");var _6=this;this.editContext.requestLiveObject(_5,function(_12){if(_12==null)return;var _7=_4==_6,_8=_5.defaults.parentProperty;if(_7){var _9=_6.data.getParent(_5);if(_2==_9){var _10=_6.data.getChildren(_9).indexOf(_5);if(_10!=null&&_10<=_3){_3--}}
_6.editContext.removeNode(_5)}
_6.editContext.addNode(_12,_2,_3,_8);if(!_7&&_12&&_2&&(_12.type||_12.className)=="Tab"&&(_2.type||_2.className)=="TabSet"){var _11=_2.liveObject;if(_11&&_11.editProxy)_11.editProxy.addDefaultPane(_12)}},_4)},isc.A.getDefaultParent=function isc_EditTree_getDefaultParent(_1,_2){if(this.editContext.defaultParent)return this.editContext.defaultParent;if(this.editContext.allowNestedDrops==false){return this.data.getRoot()}
var _3=_1.type||_1.className,_4=this.getSelectedRecord();while(_4&&(!this.editContext.canAddToParent(_4,_3)||(_4.liveObject.editProxy&&_4.liveObject.editProxy.allowNestedDrops==false)))
{_4=this.data.getParent(_4)}
var _5=this.data.getRoot()
if(_2){if(!_4&&this.editContext.canAddToParent(_5,_3))return _5;return _4}
return _4||_5},isc.A.showParents=function isc_EditTree_showParents(_1){var _2=this.data.getParents(_1),_3=_2.findAll("type","Tab");if(_3){for(var i=0;i<_3.length;i++){var _5=_3[i],_6=this.data.getParent(_5),_7=this.editContext.getLiveObject(_5),_8=this.editContext.getLiveObject(_6);_8.selectTab(_7)}}},isc.A.getRootEditNode=function isc_EditTree_getRootEditNode(){return this.editContext.getRootEditNode()},isc.A.makeEditNode=function isc_EditTree_makeEditNode(_1){return this.editContext.makeEditNode(_1)},isc.A.getEditNodeTree=function isc_EditTree_getEditNodeTree(){return this.editContext.getEditNodeTree()},isc.A.addNode=function isc_EditTree_addNode(_1,_2,_3,_4,_5){return this.editContext.addNode(_1,_2,_3,_4,_5)},isc.A.addFromPaletteNode=function isc_EditTree_addFromPaletteNode(_1,_2){return this.editContext.addFromPaletteNode(_1,_2)},isc.A.addFromPaletteNodes=function isc_EditTree_addFromPaletteNodes(_1,_2){return this.editContext.addFromPaletteNodes(_1,_2)},isc.A.removeNode=function isc_EditTree_removeNode(_1,_2){return this.editContext.removeNode(_1,_2)},isc.A.destroyNode=function isc_EditTree_destroyNode(_1){return this.editContext.destroyNode(_1)},isc.A.reorderNode=function isc_EditTree_reorderNode(_1,_2,_3){return this.editContext.reorderNode(_1,_2,_3)},isc.A.removeAll=function isc_EditTree_removeAll(){return this.editContext.removeAll()},isc.A.destroyAll=function isc_EditTree_destroyAll(){return this.editContext.destroyAll()},isc.A.isNodeEditingOn=function isc_EditTree_isNodeEditingOn(_1){return this.editContext.isNodeEditingOn(_1)},isc.A.enableEditing=function isc_EditTree_enableEditing(_1){return this.editContext.enableEditing(_1)},isc.A.setNodeProperties=function isc_EditTree_setNodeProperties(_1,_2,_3){return this.editContext.setNodeProperties(_1,_2,_3)},isc.A.removeNodeProperties=function isc_EditTree_removeNodeProperties(_1,_2){return this.editContext.removeNodeProperties(_1,_2)},isc.A.getDefaultPalette=function isc_EditTree_getDefaultPalette(){return this.editContext.getDefaultPalette()},isc.A.setDefaultPalette=function isc_EditTree_setDefaultPalette(_1){return this.editContext.setDefaultPalette(_1)},isc.A.makePaletteNode=function isc_EditTree_makePaletteNode(_1){return this.editContext.makePaletteNode(_1)},isc.A.makePaletteNodeTree=function isc_EditTree_makePaletteNodeTree(_1){return this.editContext.makePaletteNodeTree(_1)},isc.A.copyEditNodes=function isc_EditTree_copyEditNodes(_1){this.editContext.copyEditNodes(_1)},isc.A.pasteEditNodes=function isc_EditTree_pasteEditNodes(_1){this.editContext.pasteEditNodes(_1)},isc.A.addPaletteNodesFromXML=function isc_EditTree_addPaletteNodesFromXML(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromXML(_1,_2,_3,_4)},isc.A.addPaletteNodesFromJSON=function isc_EditTree_addPaletteNodesFromJSON(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromJSON(_1,_2,_3,_4)},isc.A.getPaletteNodesFromXML=function isc_EditTree_getPaletteNodesFromXML(_1,_2){return this.editContext.getPaletteNodesFromXML(_1,_2)},isc.A.addPaletteNodesFromJS=function isc_EditTree_addPaletteNodesFromJS(_1,_2,_3,_4){return this.editContext.addPaletteNodesFromJS(_1,_2,_3,_4)},isc.A.serializeAllEditNodes=function isc_EditTree_serializeAllEditNodes(_1){return this.editContext.serializeAllEditNodes(_1)},isc.A.serializeAllEditNodesAsJSON=function isc_EditTree_serializeAllEditNodesAsJSON(_1,_2){return this.editContext.serializeAllEditNodesAsJSON(_1,_2)},isc.A.serializeEditNodes=function isc_EditTree_serializeEditNodes(_1,_2){return this.editContext.serializeEditNodes(_1,_2)},isc.A.serializeEditNodesAsJSON=function isc_EditTree_serializeEditNodesAsJSON(_1,_2){return this.editContext.serializeEditNodesAsJSON(_1,_2)});isc.B._maxIndex=isc.C+39}
isc.ClassFactory.defineClass("FormItemProxyCanvas","Canvas");isc.A=isc.FormItemProxyCanvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editProxyConstructor="FormItemEditProxy";isc.A.autoDraw=false;isc.A.canDrop=true;isc.B.push(isc.A.setFormItem=function isc_FormItemProxyCanvas_setFormItem(_1){var _2=this.formItem;this.formItem=_1;this.syncWithFormItemPosition();this.sendToBack();this.show();this.$175w=_1.form;if(_1!=_2){if(_2&&this.isObserving(_2,"visibilityChanged")){this.ignore(_2,"visibilityChanged")}
if(!this.isObserving(this.formItem,"visibilityChanged")){this.observe(this.formItem,"visibilityChanged","observer.formItemVisibilityChanged()")}
if(!this.editProxy){this.editProxy=this.createAutoChild("editProxy");this.editProxy.setEditMode(true)}}},isc.A.syncWithFormItemPosition=function isc_FormItemProxyCanvas_syncWithFormItemPosition(){if(!this.formItem||!this.formItem.form)return;this.$49p=true;this.setPageLeft(this.formItem.getPageLeft());this.setPageTop(this.formItem.getPageTop());this.setWidth(this.formItem.getVisibleWidth());this.setHeight(this.formItem.getVisibleHeight());this.$49p=false},isc.A.resizeTo=function isc_FormItemProxyCanvas_resizeTo(_1,_2){var _3=this.formItem;if(!this.$49p&&_3&&_3.editContext){_3.editContext.setNodeProperties(_3.editNode,{width:_1,height:_2});_3.redraw()}
this.Super("resizeTo",arguments)},isc.A.formItemVisibilityChanged=function isc_FormItemProxyCanvas_formItemVisibilityChanged(){if(this.formItem.isVisible())this.show();else this.hide()});isc.B._maxIndex=isc.C+4;if(!(isc.licenseType=="Enterprise"||isc.licenseType=="Eval"||isc.licenseType=="Dev"||isc.licenseType=="AllModules"||isc.licenseType.contains("licenseType")))
{["EditContext","Palette","HiddenPalette","TreePalette","ListPalette","TilePalette","MenuPalette","EditPane","EditTree","FormItemProxyCanvas"].map(function(_1){isc[_1].$1226=true});isc.EditContext.vbOnly=true}
isc.defineClass("EditProxy","Class");isc.A=isc.EditProxy;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.resizeThumbConstructor=isc.Canvas;isc.A.resizeThumbDefaults={autoDraw:false,destroyWithMaster:false,$jq:true,$nt:false,overflow:"hidden",canDrag:true,canDragResize:true,getEventEdge:function(){return this.edge},depeered:function(_1,_2){this.hide()}};isc.A.minimumDropMargin=2;isc.A.minimumDropTargetSize=10;isc.B.push(isc.A.$40f=function isc_c_EditProxy__makeResizeThumbs(){var _1=isc.Canvas.getInstanceProperty("edgeCursorMap"),_2={},_3=isc.ClassFactory.getClass(this.resizeThumbConstructor,true);for(var _4 in _1){var _5=_4.length==1;_2[_4]=_3.create({ID:"isc_resizeThumb_"+_4,edge:_4,snapTo:_4,snapOffsetTop:(_4[0]==="T"?-7:(_4[0]==="B"?7:0)),snapOffsetLeft:(_4[_4.length-1]==="R"?7:(_4[_4.length-1]==="L"?-7:0)),styleName:_5?"resizeThumb":"resizeThumb cornerResizeThumb",width:_5?7:9,height:_5?7:9},this.resizeThumbDefaults,this.resizeThumbProperties)}
this.$40g=_2;this.$f0=isc.Class.create()},isc.A.showResizeThumbs=function isc_c_EditProxy_showResizeThumbs(_1){if(!_1)return;if(_1.editProxy){if(!_1.editProxy.hasEditMask()){return}
_1=_1.editProxy.getEditMask()}
if(!isc.EditProxy.$40g)isc.EditProxy.$40f();var _2=isc.EditProxy.resizeThumbDefaults.width,_3=isc.EditProxy.$40g;for(var _4 in _3){var _5=_3[_4];_5.dragTarget=_1;_5.bringToFront();_5.show();_1.addPeer(_5)}
this.$rl=_1;_1.enableKeyMovement(true)},isc.A.hideResizeThumbs=function isc_c_EditProxy_hideResizeThumbs(){var _1=this.$40g;for(var _2 in _1){var _3=_1[_2];_3.depeer()}
if(this.$rl)this.$rl.enableKeyMovement(false);this.$rl=null},isc.A.getThumbTarget=function isc_c_EditProxy_getThumbTarget(){return this.$rl},isc.A.splitString=function isc_c_EditProxy_splitString(_1,_2,_3){if(!_1)return[];var _4=_1.split(""),_5=false,_6=[],_7=[];for(var i=0;i<_4.length;i++){var _9=_4[i];if(_9==_3&&!_5){_5=true}else if(_5){if(_9!=_2)_7.push(_3);_7.push(_9);_5=false}else if(_9==_2){_6.push(isc.EditProxy.trimTrailingSpaces(_7.join("").replace(/^\s+/g,"")));_7=[]}else{_7.push(_9)}}
if(_7.length>0){_6.push(isc.EditProxy.trimTrailingSpaces(_7.join("").replace(/^\s+/g,"")))}
return _6},isc.A.parseStringValueMap=function isc_c_EditProxy_parseStringValueMap(_1,_2,_3,_4,_5,_6,_7){var _8=isc.EditProxy.splitString(_1,_2,_3);if(_8.length==0)return{};var _9={},_10=[],_11=[],_12=_7,_13=0,_14=(_8.length/2)<<0;for(var i=0;i<_8.length;i++){var _16=_8[i];if(!_4){var _17=isc.EditProxy.$1470(_16,_3,_5);if(_17.selected)_11.push(_17.value);_10.push(_17.value)}else{var _18=isc.EditProxy.splitString(_16,_4,_3);var _17=isc.EditProxy.$1470(_18[0],_3,_5);if(_17.selected)_11.push(_17.value);_10.push(_16);if(_18.length==1){_9[_17.value]=(_6?_17.value:null)}else{_16=_17.value;var _17=isc.EditProxy.$1470(_18[1],_3,_5);_9[_16]=_17.value;if(_17.selected&&!_11.contains(_16))_11.push(_16);if(++_13>_14)_12=true}}}
return{valueMap:(_12?_9:_10),value:(_11.length==0?null:(_11.length==1?_11[0]:_11))}},isc.A.trimTrailingSpaces=function isc_c_EditProxy_trimTrailingSpaces(_1,_2){_2=_2||"\\";var _3=_1.length;if(_3==1){if(_1==" ")return"";return _1}
for(var i=_3-1;i>0;i--){var c=_1.substring(i,i+1),_6=_1.substring(i-1,i);if(c!=" "||_6=="\\"){_1=_1.substring(0,i+1);break}}
return _1},isc.A.$1470=function isc_c_EditProxy__getSelectedValue(_1,_2,_3){var _4={};if(_3&&_1.startsWith(_3)){_4.value=_1.substring(1).replace(/^\s+/,"");_4.selected=true}else if(_3&&_1.endsWith(_3)){if(_1.substring(_1.length-2,_1.length-1)!=_2){_4.value=isc.EditProxy.trimTrailingSpaces(_1.substring(0,_1.length-1));_4.selected=true}else{_4.value=_1}}else{_4.value=_1}
return _4},isc.A.filterLiveObjectBySchema=function isc_c_EditProxy_filterLiveObjectBySchema(_1,_2){var _3={};var _4=isc.DS.get(_1);if(!_4)return _3;var _5=_4.fields;for(var _6 in _5){var _7=_2[_6];if(_5.hasOwnProperty(_6)&&_2.hasOwnProperty(_6)){if(!isc.isAn.Object(_7))_3[_6]=_7}}
return _3});isc.B._maxIndex=isc.C+9;isc.A=isc.EditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.editMaskDefaults={canFocus:true,draw:function(){this.Super("draw",arguments);this.observe(this.masterElement,"setZIndex","observer.moveAbove(observed)");this.observe(this.masterElement,"setPrompt","observer.setPrompt(observed.prompt)");this.observe(this.masterElement.editProxy,"startInlineEditing","observer.editingStarted()");this.observe(this.masterElement.editProxy,"inlineEditingComplete","observer.editingComplete()");return this},parentVisibilityChanged:function(){this.Super("parentVisibilityChanged",arguments);if(isc.EditProxy.getThumbTarget()==this)isc.EditProxy.hideResizeThumbs()},masterResized:function(_1,_2,_3){this.$40h=true;this.resizeTo(this.masterElement.getVisibleWidth(),this.masterElement.getVisibleHeight());this.$40h=false},handleClick:function(){this.Super("handleClick",arguments);this.select();var _1=this.masterElement;if(_1.editProxy.supportsInlineEdit&&this.editContext.enableInlineEdit&&_1.editProxy.inlineEditEvent=="click")
{_1.editProxy.startInlineEditing()}
if(this.editContext.editMaskClicked){this.editContext.editMaskClicked(_1.editNode,_1)}
return isc.EH.STOP_BUBBLING},handleDoubleClick:function(){this.Super("handleDoubleClick",arguments);this.select();var _1=this.masterElement;if(_1.editProxy.supportsInlineEdit&&this.editContext.enableInlineEdit&&(_1.editProxy.inlineEditEvent=="doubleClick"||_1.editProxy.inlineEditEvent=="dblOrKeypress"))
{_1.editProxy.startInlineEditing()}
return isc.EH.STOP_BUBBLING},enableKeyMovement:function(_1){if(_1){if(!this.$1367){this.$1367=isc.Page.setEvent("keyPress",this)}}else{if(this.$1367){isc.Page.clearEvent("keyPress",this.$1367);delete this.$1367}}},editingStarted:function(){this.$1471=(this.$1367!=null);if(this.$1471)this.enableKeyMovement(false)},editingComplete:function(){if(this.$1471)this.enableKeyMovement(true)},select:function(){if(this.editPaneProxy&&this.editPaneProxy.canSelectChildren){var _1=this.getTarget(),_2=(this.editContext.selectionType==isc.Selection.MULTIPLE);if(_1.editProxy&&_1.editProxy.canSelect==false)return;if(this.editPaneProxy.bringToFrontOnSelect)_1.bringToFront();else this.bringToFront();var _3=(isc.EH.shiftKeyDown()||(isc.Browser.isWin&&isc.EH.ctrlKeyDown()));if(!this.editContext.isComponentSelected(_1)){if(!_2||!_3){this.editContext.selectSingleComponent(_1)}else{this.editContext.selectComponent(_1)}}else{if(!_2||!_3){this.editContext.selectSingleComponent(_1)}else{this.editContext.deselectComponents(_1)}}}},moveAbove:function(_1){if(!this.editContext.isComponentSelected(this.masterElement)||this.getZIndex(true)<=_1.getZIndex(true))
{this.Super("moveAbove",arguments)}},handleMouseDown:function(){this.Super("handleMouseDown",arguments);return isc.EH.STOP_BUBBLING},handleMouseUp:function(){this.Super("handleMouseUp",arguments);return isc.EH.STOP_BUBBLING},dragRepositionStart:function(){if(this.editPaneProxy&&(!this.editPaneProxy.canSelectChildren||this.editPaneProxy.canSelect==false)){return false}
var _1=this.getTarget();if(this.editPaneProxy.bringToFrontOnSelect)_1.bringToFront();else this.bringToFront();if(this.editPaneProxy&&this.editPaneProxy.canSelectChildren&&(this.editContext.selectionType!=isc.Selection.MULTIPLE||!this.editContext.isComponentSelected(_1)))
{this.editContext.selectSingleComponent(_1)}},pageKeyPress:function(_1,_2){var _3=this.editContext.getRootEditNode().liveObject;if(!_3.containsFocus())return;var _4=isc.EH.getKeyEventCharacter();if(!isc.isA.AlphaNumericChar(_4)){var _5=this.masterElement,_6=_5.editContext.getSelectedComponents();if(!_6.contains(_5))return;if(this.isPercent(_5.left)||this.isPercent(_5.top))return;if(_5.snapTo&&(this.isPercent(_5.snapOffsetLeft)||this.isPercent(_5.snapOffsetTop)))
{return}
var _7=_5.parentElement,_8=isc.EH.shiftKeyDown(),_9=(_8?1:_7.snapVGap),_10=(_8?1:_7.snapHGap),_11=[0,0],_12=false;switch(isc.EH.getKey()){case"Arrow_Up":_11=[0,_9*-1];break;case"Arrow_Down":_11=[0,_9];break;case"Arrow_Left":_11=[_10*-1,0];break;case"Arrow_Right":_11=[_10,0];break;default:_12=null;break}
if(_11[0]!=0||_11[1]!=0){_7.$128p=true;if(_5.snapTo){_5.setSnapOffsetLeft((_5.snapOffsetLeft||0)+_11[0]);_5.setSnapOffsetTop((_5.snapOffsetTop||0)+_11[1])}else{_5.moveBy(_11[0],_11[1])}
_7.$128p=false}
return _12}},$o9:"%",isPercent:function(_1){return(isc.isA.String(_1)&&isc.endsWith(_1,this.$o9))},canDrag:true,canDragReposition:true,dragRepositionAppearance:"target",setDragTracker:function(){return isc.EH.STOP_BUBBLING},moved:function(){this.Super("moved",arguments);var _1=this.masterElement;if(_1){var _2=this.getOffsetLeft()-_1.getLeft();var _3=this.getOffsetTop()-_1.getTop();this.$ns=false;_1.moveTo(this.getOffsetLeft(),this.getOffsetTop());this.$ns=true}
if(isc.EditProxy.getThumbTarget()==this)isc.EditProxy.showResizeThumbs(this)},resized:function(){this.Super("resized",arguments);if(this.editPaneProxy)this.editPaneProxy.updateDropMargin();if(this.$40h)return;this.$40h=true;var _1=this.masterElement;if(_1){this.$jo=false;_1.resizeTo(this.getWidth(),this.getHeight());this.$jo=true;_1.redrawIfDirty();this.resizeTo(_1.getVisibleWidth(),_1.getVisibleHeight())}
if(isc.EditProxy.getThumbTarget()==this)isc.EditProxy.showResizeThumbs(this);this.$40h=false},showContextMenu:function(){var _1=this.masterElement,_2=this.editContext.isComponentSelected(_1);if(this.editPaneProxy.canSelectChildren&&this.editPaneProxy.canSelect!=false){if(!_2){this.editContext.selectSingleComponent(_1)}}
var _3=this.editContext.getSelectedComponents(),_4;if(_3.length>1&&_2){_4=this.multiSelectionMenuItems}else{_4=this.standardMenuItems}
if(!this.contextMenu)this.contextMenu=this.getMenuConstructor().create({});this.contextMenu.setData(_4);this.contextMenu.showContextMenu(this);return false},componentsRemove:function(){this.editContext.getSelectedComponents().callMethod("destroy")},componentsBringToFront:function(){this.editContext.getSelectedComponents().callMethod("bringToFront")},componentsSendToBack:function(){this.editContext.getSelectedComponents().callMethod("sendToBack")},standardMenuItems:[{title:"Bring to front",click:"target.componentsBringToFront()"},{title:"Send to back",click:"target.componentsSendToBack()"},{title:"Remove",click:"target.componentsRemove()"}],multiSelectionMenuItems:[{title:"Bring to front",click:"target.componentsBringToFront()"},{title:"Send to back",click:"target.componentsSendToBack()"},{title:"Remove selected items",click:"target.componentsRemove()"}]};isc.B.push(isc.A.setCanSelectChildren=function isc_EditProxy_setCanSelectChildren(_1){if(_1==this.canSelectChildren)return;this.restoreOverrideProperties();this.canSelectChildren=_1;this.saveOverrideProperties();if(this.useCopyPasteShortcuts!=false&&_1&&this.creator.editContext.getRootEditNode().liveObject==this.creator){this.useCopyPasteShortcuts=true;this.enableCopyPasteKeyPressHandler(true)}});isc.B._maxIndex=isc.C+1;isc.A=isc.EditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$1454="tintMask";isc.A.$1455="outlineMask";isc.A.$1456="outlineEdges";isc.A.$1698={"children":true,"peers":true};isc.A.defaultDropMargin=10;isc.A.dropMargin=10;isc.A.supportsInlineEdit=true;isc.A.inlineEditEvent="doubleClick";isc.A.$1472="edit";isc.A.inlineEditFormConstructor="DynamicForm";isc.A.inlineEditFormDefaults={minWidth:80,minHeight:20,numCols:1};isc.A.inlineEditInstructionLabelConstructor="Label";isc.A.inlineEditInstructionLabelDefaults={height:10};isc.A.inlineEditMultiline=false;isc.B.push(isc.A.setEditMode=function isc_EditProxy_setEditMode(_1){if(_1){this.saveOverrideProperties();if(!isc.isA.FormItem(this.creator))this.updateDropMargin();if(this.useEditMask){var _2=this.creator.editContext,_3=_2.getParentNode(this.creator.editNode);if(_3&&_3.liveObject)this.showEditMask(_3.liveObject)}
if(this.hasEditMask())this.showEditMask();if(this.useCopyPasteShortcuts!=false&&this.canSelectChildren&&this.creator.editContext.getRootEditNode().liveObject==this.creator){this.useCopyPasteShortcuts=true}
if(this.useCopyPasteShortcuts){this.enableCopyPasteKeyPressHandler(true)}}else{this.restoreOverrideProperties();this.hideEditMask();this.enableCopyPasteKeyPressHandler(false)}
if(this.persistCoordinates!=null){if(isc.isA.String(this.persistCoordinates))this.persistCoordinates=(this.persistCoordinates=="true")}},isc.A.getOverrideProperties=function isc_EditProxy_getOverrideProperties(){var _1={canAcceptDrop:true,canDropComponents:true};if(this.canSelectChildren){isc.addProperties(_1,{canDrag:true,dragAppearance:"none",overflow:"hidden"})}
if(this.childrenSnapToGrid!=null){if(isc.isA.String(this.childrenSnapToGrid))this.childrenSnapToGrid=(this.childrenSnapToGrid=="true");_1.childrenSnapToGrid=this.childrenSnapToGrid}
if(this.showSnapGrid!=null){if(isc.isA.String(this.showSnapGrid))this.showSnapGrid=(this.showSnapGrid=="true");_1.showSnapGrid=this.showSnapGrid}
if(this.childrenSnapAlign!=null){if(isc.isA.String(this.childrenSnapAlign))this.childrenSnapAlign=(this.childrenSnapAlign=="true");_1.childrenSnapAlign=this.childrenSnapAlign;_1.childrenSnapEdgeAlign=false}
if(this.childrenSnapResizeToGrid!=null){if(isc.isA.String(this.childrenSnapResizeToGrid))this.childrenSnapResizeToGrid=(this.childrenSnapResizeToGrid=="true");_1.childrenSnapResizeToGrid=this.childrenSnapResizeToGrid}
return _1},isc.A.destroy=function isc_EditProxy_destroy(){this.enableCopyPasteKeyPressHandler(false);this.Super("destroy",arguments)},isc.A.enableCopyPasteKeyPressHandler=function isc_EditProxy_enableCopyPasteKeyPressHandler(_1){if(_1){if(!this.$1367){this.$1367=isc.Page.setEvent("keyPress",this)}}else{if(this.$1367){isc.Page.clearEvent("keyPress",this.$1367);delete this.$1367}}},isc.A.nodeDropped=function isc_EditProxy_nodeDropped(){if(this.inlineEditOnDrop){this.delayCall("startInlineEditing")}},isc.A.editTitle=function isc_EditProxy_editTitle(_1,_2,_3){var _1=_1||this.creator,_4,_5,_6;if(isc.isA.Button(_1)){_4=_1.getPageLeft()+_1.getLeftBorderSize()+_1.getLeftMargin()+1
-_1.getScrollLeft();_5=_1.getVisibleWidth()-_1.getLeftBorderSize()-_1.getLeftMargin()
-_1.getRightBorderSize()-_1.getRightMargin()-1}else if(isc.isA.StretchImgButton(_1)){_4=_1.getPageLeft()+_1.capSize;_5=_1.getVisibleWidth()-_1.capSize*2}else{isc.logWarn("Ended up in editTitle with a StatefulCanvas of type '"+_1.getClass()+"'.  This is neither a Button nor a StretchImgButton - editor will work, but will hide the entire component it is editing");_4=_1.getPageLeft();_5=_1.getVisibleWidth()}
isc.Timer.setTimeout({target:isc.EditContext,methodName:"manageTitleEditor",args:[_1,_4,_5,_6,null,_2,null,_3]},0)},isc.A.repositionTitleEditor=function isc_EditProxy_repositionTitleEditor(){var _1=this.creator;var _2=_1.getPageLeft()+_1.capSize,_3=_1.getVisibleWidth()-_1.capSize*2;isc.EditContext.positionTitleEditor(_1,_2,_3)},isc.A.saveOverrideProperties=function isc_EditProxy_saveOverrideProperties(){var _1=this.getOverrideProperties();this.overrideProperties(_1)},isc.A.restoreOverrideProperties=function isc_EditProxy_restoreOverrideProperties(){var _1=this.getOverrideProperties();this.restoreProperties(isc.getKeys(_1))},isc.A.overrideProperties=function isc_EditProxy_overrideProperties(_1){this.creator.saveToOriginalValues(isc.getKeys(_1));this.creator.setProperties(_1)},isc.A.restoreProperties=function isc_EditProxy_restoreProperties(_1){if(_1==null)return;this.creator.restoreFromOriginalValues(_1)},isc.A.showEditMask=function isc_EditProxy_showEditMask(_1){var _2=this.creator,_3=_2.getID()+":<br>"+_2.src;if(!this.$40i||this.$40i.destroyed){var _4={};if(isc.SVG&&isc.isA.SVG(_2)&&isc.Browser.isIE){isc.addProperties(_4,{backgroundColor:"gray",mouseOut:function(){this.$jr.Super("$mc")},contents:isc.Canvas.spacerHTML(10000,10000,_3)})}
var _5=isc.addProperties({},this.editMaskDefaults,this.editMaskProperties,{editPane:_1,editPaneProxy:_1.editProxy,editContext:_2.editContext||_2.parentElement,keepInParentRect:_2.keepInParentRect},_4);this.$40i=isc.EH.makeEventMask(_2,_5)}
this.$40i.show();if(isc.SVG&&isc.isA.SVG(_2)){if(isc.Browser.isIE)_2.showNativeMask();else{_2.setBackgroundColor("gray");_2.setContents(_3)}}},isc.A.hideEditMask=function isc_EditProxy_hideEditMask(){if(this.$40i)this.$40i.hide()},isc.A.setEditMaskBorder=function isc_EditProxy_setEditMaskBorder(_1){if(this.$40i)this.$40i.setBorder(_1)},isc.A.hasEditMask=function isc_EditProxy_hasEditMask(){return(this.$40i!=null)},isc.A.getEditMask=function isc_EditProxy_getEditMask(){return this.$40i},isc.A.mouseDown=function isc_EditProxy_mouseDown(_1){var _2=this.creator,_3=_1.target;if(_3==_2&&_2.useEventParts){if(_2.firePartEvent(_1,isc.EH.MOUSE_DOWN)==false)return false}},isc.A.dragMove=function isc_EditProxy_dragMove(){if(this.creator==this.creator.ns.EH.dragTarget){return false}
if(this.creator.dragMove)return this.creator.dragMove()},isc.A.dragRepositionStart=function isc_EditProxy_dragRepositionStart(){var _1;if(this.creator.dragRepositionStart)_1=this.creator.dragRepositionStart();if(this.creator.parentElement&&this.creator.parentElement.editProxy)this.creator.parentElement.editProxy.$1313(true);return _1},isc.A.dragRepositionStop=function isc_EditProxy_dragRepositionStop(){var _1;if(this.creator.dragRepositionStop)_1=this.creator.dragRepositionStop();if(this.creator.parentElement&&this.creator.parentElement.editProxy)this.creator.parentElement.editProxy.$1313(false);return _1},isc.A.dragResizeStart=function isc_EditProxy_dragResizeStart(){var _1;if(this.creator.dragResizeStart)_1=this.creator.dragResizeStart();if(this.creator.parentElement&&this.creator.parentElement.editProxy)this.creator.parentElement.editProxy.$1313(true);return _1},isc.A.dragResizeStop=function isc_EditProxy_dragResizeStop(){var _1;if(this.creator.dragResizeStop)_1=this.creator.dragResizeStop();if(this.creator.parentElement&&this.creator.parentElement.editProxy)this.creator.parentElement.editProxy.$1313(false);return _1},isc.A.click=function isc_EditProxy_click(){var _1=this.creator;if(_1.editNode){isc.EditContext.selectCanvasOrFormItem(_1,true);var _2=_1.editContext.getRootEditNode().liveObject;if(!_2.containsFocus()){_2.setFocus(true)}
return isc.EH.STOP_BUBBLING}},isc.A.getAllSelectableComponents=function isc_EditProxy_getAllSelectableComponents(){var _1=this.creator;if(!_1.children)return null;var _2=[];for(var i=0;i<_1.children.length;i++){var _4=this.deriveSelectedComponent(_1.children[i]);if(_4)_2.add(_4)}
return _2},isc.A.$1457=function isc_EditProxy__getSelectedAppearance(){if(this.selectedAppearance)return this.selectedAppearance;return(this.creator.editContext.selectionType==isc.Selection.MULTIPLE?this.$1454:this.$1455)},isc.A.showSelectedAppearance=function isc_EditProxy_showSelectedAppearance(_1,_2,_3){var _4,_5=this.$1457();if(_5==this.$1454){var _6=this.getEditMask();if(!_6||_6.destroyed)return;if(_6.$1458===_4){_6.$1458=(_6.backgroundColor===_4?null:_6.backgroundColor)}
if(_6.$1459===_4){_6.$1459=(_6.opacity===_4?null:_6.opacity)}
if(_1&&this.selectedTintColor!=_6.backgroundColor){_6.setBackgroundColor(this.selectedTintColor)}else if(!_1&&_6.$1458!=_6.backgroundColor){_6.setBackgroundColor(_6.$1458)}
if(_1&&this.selectedTintOpacity!=_6.opacity){_6.setOpacity(this.selectedTintOpacity)}else if(!_1&&_6.$1459!=_6.opacity){_6.setOpacity(_6.$1459)}
if(_1&&_3)isc.EditProxy.showResizeThumbs(_6);else isc.EditProxy.hideResizeThumbs();if(!_1)_6.moveAbove(this.creator)}else if(_5==this.$1455){var _6=this.getEditMask();if(!_6||_6.destroyed)return;if(_6.$146a===_4){_6.$146a=(_6.border===_4?null:_6.border)}
if(_1&&this.selectedBorder!=_6.border){_6.setBorder(this.selectedBorder)}else if(!_1&&_6.$146a!=_6.border){_6.setBorder(_6.$146a)}
if(_1&&_3)isc.EditProxy.showResizeThumbs(_6);else isc.EditProxy.hideResizeThumbs();if(!_1)_6.moveAbove(this.creator)}else if(_5==this.$1456){var _7=this.creator;if(_1){var _8,_9;if(_7.$73a){var _10=_7.type||_7._constructor;_9="["+_10+" "+(_7.name?"name:":"ID");_9+=_7.name||_7.ID;_9+="]";_8=_7;_7=_7.$73a}
var _11=this.creator.editContext,_12=!_2;if(this.selectedBorder)isc.SelectionOutline.border=this.selectedBorder;if(_11.selectedLabelBackgroundColor)isc.SelectionOutline.labelBackgroundColor=_11.selectedLabelBackgroundColor;if(_11.showSelectedLabel==false)_12=false;if(_12!=false&&!_9&&_11.getSelectedLabelText){_9=_11.getSelectedLabelText(_7)}
isc.SelectionOutline.select(_7,false,_12,_9,this.getResizeEdges());if(_3&&!isc.isA.TabBar(_7.parentElement)){isc.SelectionOutline.showDragHandle()}
if(this.overrideDragProperties)this.overrideDragProperties()}else if(isc.SelectionOutline.getSelectedObject()==_7){isc.SelectionOutline.deselect();if(this.restoreDragProperties)this.restoreDragProperties()}}},isc.A.resizeStart=function isc_EditProxy_resizeStart(){if(isc.isA.FormItem(this.creator)&&this.creator.form&&this.creator.form.editProxy){this.creator.form.editProxy.$1313(true)}else if(this.creator.parentElement&&this.creator.parentElement.editProxy){this.creator.parentElement.editProxy.$1313(true)}},isc.A.resizeStop=function isc_EditProxy_resizeStop(){if(isc.isA.FormItem(this.creator)&&this.creator.form&&this.creator.form.editProxy){this.creator.form.editProxy.$1313(false)}else if(this.creator.parentElement&&this.creator.parentElement.editProxy){this.creator.parentElement.editProxy.$1313(false)}},isc.A.getResizeEdges=function isc_EditProxy_getResizeEdges(){var _1=this.creator,_2=_1.editContext,_3=_1.editNode,_4=_1.editContext.getEditNodeTree().getParent(_3),_5;if(_4){var _6=_4.liveObject;if(_6){if(isc.isA.Layout(_6)){var _7=_6.vertical,_8=((_7?_6.vPolicy:_6.hPolicy)==isc.Layout.FILL),_9=_6.getMembers().length,_10=_6.getMemberNumber(_1),_11=(_10==(_9-1)),_12=(!_8||!_11);if(_11&&!_12){var _13=(_7?_3.defaults.height!=null:_3.defaults.width!=null);var _14=_1.getClass().getInstanceProperty(_7?"height":"width")!=null;_12=_13||_14}
if(_12){_5=(_7?"B":"R")}}
if(_6.editProxy){if((_2.persistCoordinates==null&&_6.editProxy.persistCoordinates)||(_2.persistCoordinates&&_6.editProxy.persistCoordinates!=false))
{_5=["B","R"]}}}}
return _5},isc.A.pageKeyPress=function isc_EditProxy_pageKeyPress(_1,_2){var _3=this.creator;if(!_3.containsFocus())return;if(this.useCopyPasteShortcuts){var _4=_3.editContext,_5=_4.getSelectedComponents(),_6=null;var _7=(isc.Browser.isMac?isc.EH.metaKeyDown():isc.EH.ctrlKeyDown());if(_7){switch(isc.EH.getKey()){case"C":var _8=_4.getSelectedEditNodes();_4.copyEditNodes(_8);_6=false;break;case"V":if(_5.length==1&&_4.allowNestedDrops){_4.pasteEditNodes(_5[0].editNode)}else{_4.pasteEditNodes()}
_6=false;break}}
return _6}},isc.A.doubleClick=function isc_EditProxy_doubleClick(){var _1=this.creator;if(_1.editNode)isc.EditContext.selectCanvasOrFormItem(_1,true);if(this.supportsInlineEdit&&_1.editContext.enableInlineEdit&&(this.inlineEditEvent=="doubleClick"||this.inlineEditEvent=="dblOrKeypress"))
{this.startInlineEditing()}
return isc.EH.STOP_BUBBLING},isc.A.willAcceptDrop=function isc_EditProxy_willAcceptDrop(_1){var _2=this.creator;this.logInfo("editProxy.willAcceptDrop for "+_2.ID,"editModeDragTarget");var _3=_2.ns.EH.dragTarget;if(_2==_3){return false}
var _4=_2.ns.EH.dragTarget.getDragData(),_5,_6=true;if(_4==null||(isc.isAn.Array(_4)&&_4.length==0)){_6=false;this.logInfo("dragData is null - using the dragTarget itself","editModeDragTarget");_4=_2.ns.EH.dragTarget;if(isc.isA.FormItemProxyCanvas(_4)){this.logInfo("The dragTarget is a FormItemProxyCanvas for "+_4.formItem,"editModeDragTarget");_4=_4.formItem}
_5=_4._constructor||_4.Class}else{if(isc.isAn.Array(_4))_4=_4[0];_5=_4.type||_4.className}
this.logInfo("Using dragType "+_5,"editModeDragTarget");var _7=this.findEditNode(_5);var _8=this.canAdd(_5);if(_8===false)return false;if(_5==null||!_8){this.logInfo(_2.ID+" does not accept drop of type "+_5,"editModeDragTarget");var _9=_2.parentElement;while(_9&&!_9.editorRoot){if(_9.editingOn){var _10=_9.editProxy.willAcceptDrop();if(!_10){this.logInfo("No ancestor accepts drop","editModeDragTarget");if(_1!=false){if(_7&&_7.editProxy){_7.editProxy.showSelectedAppearance(false)}
this.setNoDropIndicator()}
return _10}
this.logInfo("An ancestor accepts drop","editModeDragTarget");return true}
_9=_9.parentElement}
this.logInfo(_2.ID+" has no parentElement in editMode","editModeDragTarget");if(_1!=false){if(_7&&_7.editProxy){_7.editProxy.showSelectedAppearance(false)}
this.setNoDropIndicator()}
return false}
this.logInfo(_2.ID+" is accepting the "+_5+" drop","editModeDragTarget");if(_7){if(_1!=false){this.logInfo(_2.ID+": selecting editNode object "+_7.ID);if(_7.editProxy&&_7.editContext.allowNestedDrops){_7.editProxy.showSelectedAppearance(true,false);_7.editProxy.clearNoDropIndicator()}}
return true}else{this.logInfo("findEditNode() returned null for "+_2.ID,"editModeDragTarget")}
if(_1!=false){this.logInfo("In editProxy.willAcceptDrop, '"+_2.ID+"' was willing to accept a '"+_5+"' drop but we could not find an ancestor with an editNode")}
return true},isc.A.canDropAtLevel=function isc_EditProxy_canDropAtLevel(){var _1=this.creator,_2=_1.editContext,_3=_2.getRootEditNode(),_4=_2.getLiveObject(_3);return this.allowNestedDrops!=false&&(_2.allowNestedDrops!=false||_1==_4)},isc.A.findEditNode=function isc_EditProxy_findEditNode(_1){var _2=this.creator;if(!_2.editNode){this.logInfo("Skipping '"+_2+"' - has no editNode","editModeDragTarget");if(_2.parentElement&&_2.parentElement.editProxy&&_2.parentElement.editProxy.findEditNode)
{return _2.parentElement.editProxy.findEditNode(_1)}else{return null}}
return _2},isc.A.canAdd=function isc_EditProxy_canAdd(_1){if(!this.canDropAtLevel())return false;var _2=this.creator;if(_2.getObjectField(_1)==null){var _3=isc.ClassFactory.getClass(_1);if(_3){if(_3.isA("FormItem")){return(_2.getObjectField("DynamicForm",this.$1698)!=null)}else if(_3.isA("DrawItem")){return(_2.getObjectField("DrawPane",this.$1698)!=null)}}
return null}else{return true}},isc.A.clearNoDropIndicator=function isc_EditProxy_clearNoDropIndicator(_1){var _2=this.creator;if(_2.$uh)delete _2.$uh;_2.$k2()},isc.A.setNoDropIndicator=function isc_EditProxy_setNoDropIndicator(){var _1=this.creator;_1.$uh=true;_1.$v8(_1.noDropCursor)},isc.A.updateDropMargin=function isc_EditProxy_updateDropMargin(){var _1=this.creator,_2=this.defaultDropMargin;if(_2*2>_1.getVisibleHeight()-isc.EditProxy.minimumDropTargetSize){_2=Math.round((_1.getVisibleHeight()-isc.EditProxy.minimumDropTargetSize)/2);if(_2<isc.EditProxy.minimumDropMargin)_2=isc.EditProxy.minimumDropMargin}
this.dropMargin=_2},isc.A.shouldPassDropThrough=function isc_EditProxy_shouldPassDropThrough(){var _1=this.creator,_2=isc.EH.dragTarget,_3,_4;if(!_2.isA("Palette")){_4=_2.isA("FormItemProxyCanvas")?_2.formItem.Class:_2.Class}else{_3=_2.getDragData();if(isc.isAn.Array(_3))_3=_3[0];_4=_3.type||_3.className}
this.logInfo("Dropping a "+_4,"formItemDragDrop");if(!this.canAdd(_4)){this.logInfo("This canvas cannot accept a drop of a "+_4,"formItemDragDrop");return true}
if(_1.parentElement==null||_1.parentElement.editProxy==null||!_1.parentElement.editProxy.willAcceptDrop(false))
{this.logInfo(_1.ID+" is not passing drop through - no ancestor is willing to accept the drop","editModeDragTarget");return false}
if(_1.parentElement==_2){this.logInfo(_1.ID+" is not passing drop through - attempt to drop on self","editModeDragTarget");return false}
var x=isc.EH.getX(),y=isc.EH.getY(),_7=_1.getPageRect(),_8={left:_7[0],top:_7[1],right:_7[0]+_7[2],bottom:_7[1]+_7[3]}
if(!_1.orientation||_1.orientation=="vertical"){if(x<_8.left+this.dropMargin||x>_8.right-this.dropMargin){this.logInfo("Close to right or left edge - passing drop through to parent for "+_1.ID,"editModeDragTarget");return true}}
if(!_1.orientation||_1.orientation=="horizontal"){if(y<_8.top+this.dropMargin||y>_8.bottom-this.dropMargin){this.logInfo("Close to top or bottom edge - passing drop through to parent for "+_1.ID,"editModeDragTarget");return true}}
this.logInfo(_1.ID+" is not passing drop through","editModeDragTarget");return false},isc.A.drop=function isc_EditProxy_drop(){if(this.shouldPassDropThrough()){return}
var _1=this.creator,_2=isc.EH.dragTarget,_3,_4;if(!_2.isA("Palette")){if(_2.isA("FormItemProxyCanvas")){_2=_2.formItem}
_4=_2._constructor||_2.Class}else{_3=_2.transferDragData();if(isc.isAn.Array(_3))_3=_3[0];_3.dropped=true;_4=_3.type||_3.className}
if(_2.isA("TreeGrid")){_3=_2.data.getCleanNodeData([_3],false,false,false)[0]}
_3=isc.clone(_3);if(!_2.isA("Palette")){if(_2==_1)return;var _5=_1.editContext,_6=_1.editNode,_7=_5.getEditNodeTree(),_8=_7.getParent(_2.editNode);_5.removeNode(_2.editNode);var _9;if(_2.isA("FormItem")){if(_2.isA("CanvasItem")){_9=_5.addNode(_2.canvas.editNode,_6)}else{_9=_5.addWithWrapper(_2.editNode,_6)}}else if(_2.isA("DrawItem")){_9=_5.addWithWrapper(_2.editNode,_6,true)}else{_9=_5.addNode(_2.editNode,_6);var _10=isc.EH.getDragRect(),x=(_10?_10[0]-_1.getPageLeft():_1.getOffsetX()),y=(_10?_10[1]-_1.getPageTop():_1.getOffsetY());_9.liveObject.moveTo(x,y)}
if(_9&&_9.liveObject){isc.EditContext.selectCanvasOrFormItem(_9.liveObject,true)}}else{var _13=isc.EH.shiftKeyDown();if(_3.loadData&&!_3.isLoaded){var _14=this;_3.loadData(_3,function(_15){_15=_15||_3;_15.isLoaded=true;_14.completeItemDrop(_15,_13)
_15.dropped=_3.dropped});return isc.EH.STOP_BUBBLING}
this.completeItemDrop(_3,_13)}
return isc.EH.STOP_BUBBLING},isc.A.completeItemDrop=function isc_EditProxy_completeItemDrop(_1,_2){var _3=this.creator;if(!_3.editContext)return;var _4=_3.editContext,_5=_1.type||_1.className,_6,_7=false;var _8=isc.ClassFactory.getClass(_5);if(_8&&(_8.isA("FormItem")||_8.isA("DrawItem"))){_6=_4.makeEditNode(_1);if(_8&&_8.isA("FormItem")){_6=_3.editContext.addWithWrapper(_6,_3.editNode)}else{_6=_3.editContext.addWithWrapper(_6,_3.editNode,true)}
_7=true}else{var _9=_4.addFromPaletteNodes([_1],_3.editNode);if(_9&&_9.length>0)_6=_9[0]}
var _10=_6;if(_7){var _11=_4.getEditNodeTree(),_12=_11.getParent(_10);if(_12)_10=_12}
var x=_3.getOffsetX(),y=_3.getOffsetY();if(_3.childrenSnapToGrid&&!_2){x=_3.getHSnapPosition(x);y=_3.getVSnapPosition(y)}
if(_10.liveObject&&_10.liveObject.moveTo)_10.liveObject.moveTo(x,y);if(this.canSelectChildren&&_6.liveObject.editProxy!=null&&_6.liveObject.editProxy.canSelect!=false)
{_4.selectSingleComponent(_10.liveObject)}
if(_10.liveObject&&_10.liveObject.editProxy&&_10.liveObject.editProxy.nodeDropped){_10.liveObject.editProxy.nodeDropped()}
if(_10.liveObject&&isc.isA.Function(_10.liveObject.focus)){_10.liveObject._eventMask?_10.liveObject._eventMask.focus():_10.liveObject.focus()}},isc.A.dropMove=function isc_EditProxy_dropMove(){if(!this.canDropAtLevel())return;if(!this.willAcceptDrop())return false;if(!this.shouldPassDropThrough()){if(this.creator.dropMove&&this.creator.getClass()!=isc.Canvas&&this.creator.getClass()!=isc.EditPane&&this.creator.getClass()!=isc.TabSet&&this.creator.getClass()!=isc.DetailViewer)
{this.creator.Super("dropMove",arguments)}
var _1=this.creator,_2=_1.parentElement;if(_2&&_2.hideDropLine){_2.hideDropLine();if(_2.isA("FormItem")){_2.form.hideDragLine()}else if(_2.isA("DrawItem")){_2.drawPane.hideDragLine()}}
return isc.EH.STOP_BUBBLING}},isc.A.dragOver=function isc_EditProxy_dragOver(){if(!this.willAcceptDrop()){return false}
return this.Super("dragOver",arguments)},isc.A.dropOver=function isc_EditProxy_dropOver(){if(!this.canDropAtLevel())return;if(!this.willAcceptDrop()){if(this.creator==this.creator.ns.EH.dragTarget){return}
return false}
if(!this.shouldPassDropThrough()){if(this.creator.dropMove&&this.creator.getClass()!=isc.Canvas&&this.creator.getClass()!=isc.EditPane&&this.creator.getClass()!=isc.DrawPane&&this.creator.getClass()!=isc.TabSet&&this.creator.getClass()!=isc.DetailViewer)
{this.creator.Super("dropOver",arguments)}
var _1=this.creator,_2=_1.parentElement;if(_2&&_2.hideDropLine){_2.hideDropLine();if(_2.isA("FormItem")){_2.form.hideDragLine()}else if(_2.isA("DrawItem")){_2.drawPane.hideDragLine()}}
this.$1313(true);return isc.EH.STOP_BUBBLING}
this.$1313(true)},isc.A.dropOut=function isc_EditProxy_dropOut(){var _1=this.creator;this.showSelectedAppearance(false);if(_1.dropOut)this.creator.dropOut();this.$1313(false);if(!this.willAcceptDrop()&&_1==_1.ns.EH.dragTarget){return}
return isc.EH.STOP_BUBBLING},isc.A.overrideDragProperties=function isc_EditProxy_overrideDragProperties(){if(this.$146t)return;var _1=this.creator.editContext;var _2={canDrop:true,dragAppearance:"outline",dragStart:function(){return true},dragMove:function(){return true},setDragTracker:function(){isc.EH.setDragTracker("");return false},dragStop:function(){isc.SelectionOutline.positionDragHandle()}};this.overrideProperties(_2);this.$146t=true},isc.A.restoreDragProperties=function isc_EditProxy_restoreDragProperties(){this.creator.restoreFromOriginalValues(["canDrag","canDrop","dragAppearance","dragStart","dragMove","dragStop","setDragTracker"]);this.$146t=false},isc.A.$1313=function isc_EditProxy__showSnapGrid(_1){var _2=this.creator;if(_2.childrenSnapToGrid||_2.childrenSnapResizeToGrid){_2.setShowSnapGrid(_1)}},isc.A.setDataSource=function isc_EditProxy_setDataSource(_1,_2,_3){var _4=this.creator,_5=_4.editContext;if(isc.$75u){_4.setDataSource(_1,_2);return}
if(_1==_4.dataSource&&!_3)return;var _6;if(_1!=null){var _7=_1.fields;if(_7&&isc.getKeys(_7).length==1&&_1.fieldIsComplexType(_7[isc.firstKey(_2)].name))
{_6=_1.getSchema(_7[isc.firstKey(_2)].type)}else{_6=_1}}
var _8=(_4.getAllFields?_4.getAllFields():_4.getFields()),_9=(_6!=null?_6.getFields():{}),_10=[];if(_8){var _11=_5.getEditNodeTree(),_12=_11.findById(_4.ID),_13=_11.getChildren(_12),_14=[],_15=[];for(var i=0;i<_8.length;i++){var _17=_8[i],_18=null;for(var j=0;j<_13.length;j++){var _20=_13[j];if(_17.name==_20.name){_18=_20;break}}
if(_18){var _21=_5.fieldRenames,_22=(_21&&_21[_17.name]?_21[_17.name]:_17.name),_23=(_9[_22]!=null),_24=this.fieldEdited(_4,_18);if(!_23&&!_24){_15.add(_18)}else{var _25=isc.addProperties({},_17.editingOn?_17.editNode.defaults:_17);if(!_24){_25=isc.addProperties({},_18.defaults)}
if(_17.name!=_22){_25=isc.addProperties({},_25,_9[_22]);_5.setNodeProperties(_18,_25,true)}
_10.add(_25);_14.add(isc.addProperties({},_25))}}}
_4.setFields(_14);if(!this.$1479){for(var i=0;i<_15.length;i++){_5.removeNode(_15[i],true)}}}
if(_1==null){if(isc.isA.ListGrid(_4)){_4.setData([]);_4.dataSource=null;_4.setFields([])}
if(isc.isA.DynamicForm(_4)&&_10.length==0){_4.setData({});_4.dataSource=null;_4.setFields([])}
return}
var _2=[],_26=[];for(var i=0;i<_10.length;i++){_2.add(_10[i])}
for(var _27 in _9){var _17=_9[_27];if(!_4.shouldUseField(_17,_1))continue;if(_10.find("name",_27))continue;var _28=isc.addProperties({},_9[_27]);_2.add(_28);_26.add(_28)}
_4.setDataSource(_1,_2);if(!this.$1479){for(var i=0;i<_26.length;i++){var _17=_26[i];var _29=this.makeFieldPaletteNode(_5,_17,_6);var _18=_5.makeEditNode(_29);_5.addNode(_18,_4.editNode,null,null,true)}}},isc.A.fieldEdited=function isc_EditProxy_fieldEdited(_1,_2){var _3=false;if(_2.defaults){var _4=_2.defaults,_5=false;var _6=_4.name,_7,_8;if(_6&&_1&&_1.dataSource){var _9=_1.dataSource;if(isc.isA.String(_9))_9=isc.DS.getDataSource(_9);if(_9){var _10=_9.getField(_6)
if(_10){_7=_10.type;_8=_10.title}}}
for(var _11 in _4){if(_11=="name"||_11=="title"||_11=="parentProperty"||_11.startsWith("_"))continue;if(_11=="type"&&_7&&_7==_4.type)continue;_5=true;break}
if(!_5){var _12=_4.title;if(_12){if((!_8&&_12!=isc.DataSource.getAutoTitle(_6))||(_8&&_12!=_8))
{_3=true}}}else{_3=true}}
return _3},isc.A.makeFieldPaletteNode=function isc_EditProxy_makeFieldPaletteNode(_1,_2,_3,_4){var _5=this.creator.Class+"Field",_4=isc.addProperties({},_4,{name:_2.name});var _6;if(_1){_6=_1.findPaletteNode("type",_5)||_1.findPaletteNode("className",_5)||{type:_5};_6=isc.addProperties({},_6,{defaults:_4})}else{_6={type:_5,defaults:_4}}
if(_5!="ListGridField"||!_3){if(_2.type)_4.type=_2.type;else delete _4.type;if(_2.title||!_4.title){_4.title=_2.title||_3.getAutoTitle(_2.name)}}
return _6},isc.A.startInlineEditing=function isc_EditProxy_startInlineEditing(_1,_2){if(!this.supportsInlineEdit||!this.creator.editContext.enableInlineEdit)return;var _3=this.createInlineEditForm(),_4=this.getInlineEditText(),_5=_2==="Backspace";if(_1!=null)_4=(_4?_4+_1:_1);else if(_5){if(!_4)_4="";else{_4=String(_4);_4=_4.substring(0,_4.length-1)}}
_3.setValues({edit:_4});this.inlineEditForm=_3;if(!this.inlineEditLayout){this.inlineEditLayout=this.createInlineEditLayout()}else if(this.inlineEditLayout.getMembers().length>0){this.inlineEditLayout.removeMembers(this.inlineEditLayout.getMembers())}
var _6=this.inlineEditLayout;_6.addMember(_3);if(this.inlineEditInstructions){if(!this.inlineEditInstructionLabelDefaults.baseStyle){isc.EditProxy.changeDefaults("inlineEditInstructionLabelDefaults",{baseStyle:isc.Hover.hoverCanvasDefaults.baseStyle})}
if(!this.inlineEditInstructionLabel){this.inlineEditInstructionLabel=this.createInlineEditInstructionLabel()}
this.inlineEditInstructionLabel.setContents(this.inlineEditInstructions);_6.addMember(this.inlineEditInstructionLabel)}
this.positionAndSizeInlineEditor();_6.show();_6.showClickMask({target:_6,methodName:"dismissEditor"},"soft",[_6]);var _7=_3.getItem(this.$1472);if(_7){_7.focusInItem();if(_1||_5){var _8=(_4!=null?_4.length:0);_7.delayCall("setSelectionRange",[_8,_8])}else{_7.delayCall("selectValue")}}});isc.evalBoundary;isc.B.push(isc.A.createInlineEditLayout=function isc_EditProxy_createInlineEditLayout(){return isc.VStack.create({dismissEditor:function(){this.hide()}})},isc.A.createInlineEditForm=function isc_EditProxy_createInlineEditForm(){var _1=isc.addProperties({name:this.$1472,type:(this.inlineEditMultiline?"TextArea":"text"),allowNativeResize:this.inlineEditMultiline,width:"*",height:"*",showTitle:false},{keyPress:function(_4,_2,_5){if(_5=="Escape"){_2.discardUpdate=true;_2.parentElement.hide()}else if(_5=="Enter"){if(!isc.isA.TextAreaItem(_4))_4.blurItem()}},blur:function(_2,_4){_2.saveOrDiscardValue();_2.parentElement.hide();if(_2.creator.inlineEditingComplete)_2.creator.inlineEditingComplete()}});var _2=this.createAutoChild("inlineEditForm",{margin:0,padding:0,cellPadding:0,minWidth:(this.inlineEditMultiline?250:80),fields:[_1],saveOrDiscardValue:function(){if(!this.discardUpdate){var _3=this.getValue(this.creator.$1472);this.creator.setInlineEditText(_3)}}});return _2},isc.A.createInlineEditInstructionLabel=function isc_EditProxy_createInlineEditInstructionLabel(){return this.createAutoChild("inlineEditInstructionLabel")},isc.A.positionAndSizeInlineEditor=function isc_EditProxy_positionAndSizeInlineEditor(){this.positionInlineEditor();this.sizeInlineEditor()},isc.A.positionInlineEditor=function isc_EditProxy_positionInlineEditor(){var _1=this.creator,_2=_1.getPageLeft(),_3=_1.getPageTop();this.inlineEditLayout.moveTo(_2,_3)},isc.A.sizeInlineEditor=function isc_EditProxy_sizeInlineEditor(){var _1=this.creator,_2=this.inlineEditLayout,_3=_1.getVisibleWidth(),_4=this.inlineEditForm.minWidth||1,_5=_1.getVisibleHeight(),_6=this.inlineEditForm.minHeight||1;_3=Math.max(_3,_4);if(this.inlineEditMultiline)_5=Math.max(_5,50);else _5=_6;_2.setWidth(_3);this.inlineEditForm.setHeight(_5)},isc.A.inlineEditingComplete=function isc_EditProxy_inlineEditingComplete(){var _1=this.creator.editContext;if(_1)_1.fireSelectedEditNodesUpdated()},isc.A.getInlineEditText=function isc_EditProxy_getInlineEditText(){if(this.creator.isGroup)return this.creator.groupTitle;return this.creator.getContents()},isc.A.setInlineEditText=function isc_EditProxy_setInlineEditText(_1){var _2=this.creator,_3;if(_2.isGroup)_3={groupTitle:_1};else _3={contents:_1};_2.editContext.setNodeProperties(_2.editNode,_3)});isc.B._maxIndex=isc.C+61;isc.defineClass("CanvasEditProxy","EditProxy");isc.A=isc.CanvasEditProxy.getPrototype();isc.A.persistCoordinates=null;isc.A=isc.CanvasEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.hoopSelectorDefaults={_constructor:"Canvas",$1452:true,autoDraw:false,keepInParentRect:true,redrawOnResize:false,overflow:"hidden"};isc.B.push(isc.A.mouseDown=function isc_CanvasEditProxy_mouseDown(_1){var _2=this.Super("mouseDown",arguments);if(_2==false)return _2;var _3=this.creator,_4=_1.target;if(!this.canSelectChildren||this.canSelect==false)return;var _5=_3.editContext;if(_4!=_3){while(_4.parentElement&&!_4.canvasItem)_4=_4.parentElement;if(!_4.canvasItem||_4.canvasItem.containerWidget!=_3)return}
if(!(isc.EH.shiftKeyDown()||(isc.Browser.isWin&&isc.EH.ctrlKeyDown()))){_5.deselectAllComponents()}
if(_5.selectionType!=isc.Selection.MULTIPLE)return;if(this.hoopSelector==null){var _6=isc.addProperties({},this.hoopSelectorDefaults,this.hoopSelectorProperties,{border:this.selectedBorder},{left:isc.EH.getX(),top:isc.EH.getY()});this.hoopSelector=_3.createAutoChild("hoopSelector",_6);_3.addChild(this.hoopSelector)}
this.$79h=_3.getOffsetX();this.$79i=_3.getOffsetY();this.$136k=_5.getSelectedComponents();this.resizeHoopSelector();this.hoopSelector.show()},isc.A.dragMove=function isc_CanvasEditProxy_dragMove(){this.Super("dragMove",arguments);if(this.hoopSelector&&this.hoopSelector.isVisible())this.resizeHoopSelector()},isc.A.dragStop=function isc_CanvasEditProxy_dragStop(){if(this.hoopSelector&&this.hoopSelector.isVisible()){this.hoopSelector.hide();var _1=this.creator.editContext.getSelectedComponents();if(!this.$136k.equals(_1)){this.creator.editContext.showGroupSelectionBox();this.creator.editContext.fireSelectedEditNodesUpdated()}}},isc.A.mouseUp=function isc_CanvasEditProxy_mouseUp(){if(!this.canSelectChildren)return;if(this.hoopSelector&&this.hoopSelector.isVisible()){this.hoopSelector.hide();var _1=this.creator.editContext.getSelectedComponents();if(!this.$136k.equals(_1)){this.creator.editContext.showGroupSelectionBox();this.creator.editContext.fireSelectedEditNodesUpdated()}}},isc.A.updateCurrentSelection=function isc_CanvasEditProxy_updateCurrentSelection(){var _1=this.creator,_2=_1.editContext,_3=isc.isA.DrawPane(_1);var _4=(_3?_1.drawItems:_1.children);if(!_4)return;var _5=_2.getSelectedComponents(),_6=(_2.hoopSelectionMode=="intersects"?"intersects":"encloses"),_7=(isc.EH.shiftKeyDown()||(isc.Browser.isWin&&isc.EH.ctrlKeyDown()));if(!_7)_2.selectedComponents=[];for(var i=0;i<_4.length;i++){var _9=_4[i],_10=(_9.creator&&(isc.isA.DrawKnob(_9.creator)||_9.$145w));if(!_10&&this.hoopSelector[_6](_9)){if(!_3)_9=this.deriveSelectedComponent(_9);if(_9&&!_2.selectedComponents.contains(_9)){if(_9.editProxy&&_9.editProxy.canSelect!=false){_2.selectedComponents.add(_9)}}}}
for(var i=0;i<_2.selectedComponents.length;i++){_2.selectedComponents[i].editProxy.showSelectedAppearance(true,true)}
if(!_7){_5.removeList(_2.selectedComponents);for(var i=0;i<_5.length;i++){_5[i].editProxy.showSelectedAppearance(false)}}},isc.A.deriveSelectedComponent=function isc_CanvasEditProxy_deriveSelectedComponent(_1){var _2=this.creator;if(_1.masterElement)return this.deriveSelectedComponent(_1.masterElement);if(!_1.parentElement||_1.parentElement==_2){if(_1.editProxy&&_1.editProxy.hasEditMask())return _1;return null}
return this.deriveSelectedComponent(_1.parentElement)},isc.A.resizeHoopSelector=function isc_CanvasEditProxy_resizeHoopSelector(){var _1=this.creator,x=_1.getOffsetX(),y=_1.getOffsetY();if(this.hoopSelector.keepInParentRect){if(x<0)x=0;var _4=this.hoopSelector.parentElement.getVisibleHeight();if(y>_4)y=_4}
this.hoopSelector.resizeTo(Math.abs(x-this.$79h),Math.abs(y-this.$79i));if(x<this.$79h)this.hoopSelector.setLeft(x);else this.hoopSelector.setLeft(this.$79h);if(y<this.$79i)this.hoopSelector.setTop(y);else this.hoopSelector.setTop(this.$79i);this.updateCurrentSelection()});isc.B._maxIndex=isc.C+7;isc.defineClass("LayoutEditProxy","CanvasEditProxy");isc.A=isc.LayoutEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=false;isc.B.push(isc.A.drop=function isc_LayoutEditProxy_drop(){var _1=this.creator;if(this.shouldPassDropThrough()){_1.hideDropLine();return}
isc.EditContext.hideAncestorDragDropLines(_1);var _2=isc.EH.dragTarget,_3,_4;if(!_2.isA("Palette")){if(_2.isA("FormItemProxyCanvas")){_2=_2.formItem}
_4=_2._constructor||_2.Class}else{var _5=_2.transferDragData();_3=_1.editContext.makeEditNode(_5);_3.dropped=true;_4=_3.type||_3.className}
var _6=this.findEditNode(_4);if(_6){_6=_6.editNode}
if(this.modifyEditNode){_6=this.modifyEditNode(_3,_6,_4);if(!_6){_1.hideDropLine();return isc.EH.STOP_BUBBLING}}
if(!_2.isA("Palette")){if(_2==_1)return;var _7=_1.editContext.getEditNodeTree(),_8=_7.getParent(_2.editNode),_9=_7.getChildren(_8).indexOf(_2.editNode),_10=_1.getDropPosition(_4);_1.editContext.removeNode(_2.editNode);if(_8==this.editNode&&_10>_9)_10--;var _11;if(_2.isA("FormItem")){if(_2.isA("CanvasItem")){_11=_1.editContext.addNode(_2.canvas.editNode,_6,_10)}else{_11=_1.editContext.addWithWrapper(_2.editNode,_6)}}else if(_2.isA("DrawItem")){_11=_1.editContext.addWithWrapper(_2.editNode,_6,true)}else{_11=_1.editContext.addNode(_2.editNode,_6,_10)}
if(isc.isA.TabSet(_6.liveObject)){_6.liveObject.selectTab(_2)}else if(_11&&_11.liveObject){isc.EditContext.delayCall("selectCanvasOrFormItem",[_11.liveObject,true],200)}}else{var _12;var _13=isc.ClassFactory.getClass(_4);if(_13&&_13.isA("FormItem")){_12=_1.editContext.addWithWrapper(_3,_6)}else if(_13&&_13.isA("DrawItem")){_12=_1.editContext.addWithWrapper(_3,_6,true)}else{var _14=_1.getDropPosition(_4),_15=isc.DataSource.getNearestSchemaClass(_4);if(_15&&_15.isA(isc.DataSource))_14=0;_12=_1.editContext.addNode(_3,_6,_14)}
if(_12!=null){if(_3.liveObject.editProxy&&_3.liveObject.editProxy.nodeDropped){_3.liveObject.editProxy.nodeDropped()}}}
_1.hideDropLine();return isc.EH.STOP_BUBBLING},isc.A.dropMove=function isc_LayoutEditProxy_dropMove(){if(!this.willAcceptDrop())return false;if(!this.shouldPassDropThrough()){var _1=this.creator;if(_1.dropMove)_1.dropMove();if(_1.parentElement&&_1.parentElement.hideDropLine){_1.parentElement.hideDropLine();if(_1.parentElement.isA("FormItem")){_1.parentElement.form.hideDragLine()}else if(_1.parentElement.isA("DrawItem")){_1.parentElement.drawPane.hideDragLine()}}
return isc.EH.STOP_BUBBLING}else{this.creator.hideDropLine()}},isc.A.dropOver=function isc_LayoutEditProxy_dropOver(){var _1=this.creator;if(!this.willAcceptDrop()){if(_1==_1.ns.EH.dragTarget){return}
return false}
if(!this.shouldPassDropThrough()){if(_1.dropOver)_1.dropOver();if(_1.parentElement&&_1.parentElement.hideDropLine){_1.parentElement.hideDropLine();if(_1.parentElement.isA("FormItem")){_1.parentElement.form.hideDragLine()}else if(_1.parentElement.isA("DrawItem")){_1.parentElement.drawPane.hideDragLine()}}
return isc.EH.STOP_BUBBLING}else{this.creator.hideDropLine()}},isc.A.dropOut=function isc_LayoutEditProxy_dropOut(){var _1=this.creator;if(!this.shouldPassDropThrough()){if(_1.dropOut)_1.dropOut();return isc.EH.STOP_BUBBLING}else{this.creator.hideDropLine()}});isc.B._maxIndex=isc.C+4;isc.defineClass("DeckEditProxy","LayoutEditProxy");isc.A=isc.DeckEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.addPane=function isc_DeckEditProxy_addPane(_1,_2){var _3=this.creator;_3.addPane(_1,_2);_3.setCurrentPane(_1)});isc.B._maxIndex=isc.C+1;isc.defineClass("NavPanelEditProxy","LayoutEditProxy");isc.A=isc.NavPanelEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.A.inlineEditEvent="none";isc.B.push(isc.A.startItemInlineEditing=function isc_NavPanelEditProxy_startItemInlineEditing(_1,_2){this.$167s=_1;this.$167t=_2;this.startInlineEditing()},isc.A.positionAndSizeInlineEditor=function isc_NavPanelEditProxy_positionAndSizeInlineEditor(){var _1=this.creator,_2=_1.navGrid,_3=_2.getPageOffsets(),_4=_2.getRowTop(this.$167t),_5=_2.getVisibleWidth(),_6=this.inlineEditForm.minWidth||1,_7=_2.getRowHeight(this.$167s,this.$167t),_8=this.inlineEditForm.minHeight||1;this.inlineEditLayout.setRect(_3.left,_3.top+_4,Math.max(_6,_5),Math.max(_8,_7))},isc.A.getInlineEditText=function isc_NavPanelEditProxy_getInlineEditText(){var _1=this.$167s;if(_1==null||_1.title==null)return"";return _1.title},isc.A.setInlineEditText=function isc_NavPanelEditProxy_setInlineEditText(_1){var _2=this.creator;var _3=_2.editContext;_3.setNodeProperties(this.$167s.editNode,{title:_1});var _4=_2.navGrid;if(_4!=null){var _5=_4.body;if(_5!=null)_5.redrawIfDirty("setInlineEditText")}},isc.A.onFolderDrop=function isc_NavPanelEditProxy_onFolderDrop(_1,_2,_3,_4,_5){var _6=this.creator;var _7=_2.editContext||_6.editContext;var _8=_2.editNode||_6.editNode;var _9=_1[0].type;if(_9==null)return;var _10;if(_4=="over"){if(_9=="NavItem"){_10=_7.addFromPaletteNode(_1[0],_8)}else if(_8.liveObject.isHeader){var _11=_7.findPaletteNode("type","NavItem")
var _12=_7.addFromPaletteNode(_11,_8,_3);_10=_12;var _13=_12.liveObject.editContext.addFromPaletteNode(_1[0],_12);_6.setItemPane(_12.liveObject,_13.liveObject)}else{var _13=_7.addFromPaletteNode(_1[0],_8);_6.setItemPane(_2,_13.liveObject)}}else{if(_9=="NavItem"){_10=_7.addFromPaletteNode(_1[0],_8,_3)}else{var _11=_7.findPaletteNode("type","NavItem")
var _12=_7.addFromPaletteNode(_11,_8,_3);_10=_12;var _13=_12.liveObject.editContext.addFromPaletteNode(_1[0],_12);_6.setItemPane(_12.liveObject,_13.liveObject)}}
if(_10!=null){var _14=_10.liveObject;if(!_14.isSeparator){_6.editProxy.delayCall("startItemInlineEditing",[_14,_6.navGrid.getRecordIndex(_14)])}}
return false},isc.A.setEditMode=function isc_NavPanelEditProxy_setEditMode(_1){var _2=this.Super("setEditMode",arguments);if(_1){this.creator.navGrid.canAcceptDroppedRecords=true;this.creator.navGrid.canDragRecordsOut=true;this.creator.navGrid.canReorderRecords=false;this.creator.navGrid.canReparentNodes=false;this.creator.navGrid.canDropOnLeaves=true;this.creator.navGrid.onFolderDrop=this.onFolderDrop;this.creator.navGrid.dragDataAction="copy";this.creator.navGrid.showOpenIcons=true;this.creator.navGrid.showDropIcons=true;this.creator.navGrid.$31i();this.creator.editContext.setNodeProperties(this.creator.editNode,{currentItemId:this.creator.currentItemId})}else{this.creator.navGrid.canAcceptDroppedRecords=false;this.creator.navGrid.canDropOnLeaves=false;this.creator.navGrid.canDragRecordsOut=false;this.creator.navGrid.canReorderRecords=false;this.creator.navGrid.canReparentNodes=false;delete this.creator.navGrid.onFolderDrop;this.creator.navGrid.$31i()}},isc.A.canAdd=function isc_NavPanelEditProxy_canAdd(_1){var _2=this.creator;if(_1=="NavItem"&&!_2.navGrid.containsEvent()){return false}
return true},isc.A.drop=function isc_NavPanelEditProxy_drop(){this.creator.navDeck.setBorder("");if(!this.creator.navGrid.containsEvent()){if(this.shouldPassDropThrough()){return}
var _1=this.creator,_2=isc.EH.dragTarget,_3,_4;if(!_2.isA("Palette")){if(_2.isA("FormItemProxyCanvas")){_2=_2.formItem}
_4=_2._constructor||_2.Class}else{_3=_2.transferDragData();if(isc.isAn.Array(_3))_3=_3[0];_3.dropped=true;_4=_3.type||_3.className}
if(_2.isA("TreeGrid")){_3=_2.data.getCleanNodeData([_3],false,false,false)[0]}
_3=isc.clone(_3);if(!_2.isA("Palette")){if(_2==_1)return;var _5=_1.editContext,_6=_1.editNode,_7=_5.getEditNodeTree(),_8=_7.getParent(_2.editNode);_5.removeNode(_2.editNode)}
var _9=this.creator.navGrid.getSelectedRecord();if(_9==null){_9=this.creator.navGrid.data.getRoot()}
this.onFolderDrop([_3],_9,0,"over")}
return isc.EH.STOP_BUBBLING},isc.A.dropOut=function isc_NavPanelEditProxy_dropOut(){this.creator.navDeck.setBorder("")},isc.A.dropMove=function isc_NavPanelEditProxy_dropMove(){if(!this.willAcceptDrop())return false;if(this.creator.hideDropLine)this.creator.hideDropLine();if(!this.shouldPassDropThrough()){if(this.creator.navGrid.containsEvent()){this.creator.navDeck.setBorder("")}else{this.creator.navDeck.setBorder("2px dashed blue")}
return isc.EH.STOP_BUBBLING}});isc.B._maxIndex=isc.C+10;isc.defineClass("SplitPaneEditProxy","LayoutEditProxy");isc.A=isc.SplitPaneEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.dropOverlayDefaults={backgroundColor:"white",visibility:"hidden",width:"100%",height:"100%",paneDefaults:{_constructor:"VLayout",border:"1px solid blue",align:"center",showDropLines:false},initWidget:function(){this.Super("initWidget",arguments);this.navPane=this.createPane("30%","Navigation Pane","navigationPane");this.listPane=this.createPane("100%","List Pane","listPane");this.detailPane=this.createPane("100%","Detail Pane","detailPane");var _1=isc.VLayout.create({widht:"70%",members:[this.listPane,this.detailPane]});this.addChild(isc.HLayout.create({width:"100%",height:"100%",members:[this.navPane,_1]}));this.$1497=[this.navPane,this.listPane,this.detailPane]},createPane:function(_1,_2,_3){var _4=this.getPaneText(_2,false,_3),_5=isc.Label.create({align:"center",overflow:"hidden",contents:_4});return this.createAutoChild("pane",{width:_1,members:[_5],name:_2,canAcceptDrop:true,parentProperty:_3,drop:function(){return this.creator.creator.addPane(this.parentProperty)}})},setPaneLabel:function(_1,_2){var _3=_1.getMember(0);_3.setContents(_2)},getPaneText:function(_1,_2,_3){var _4=(_2?"style='color:#0000ff'":""),_5="<span "+_4+">"+_1+"</span>",_6=this.creator,_7=_6.creator,_8=_7[_3];if(_8){var _9=(this.editContext.getSelectedLabelText?this.editContext.getSelectedLabelText(_8):_8.toString());_5+="<br>Currently: <span style='color:#666666'>"+_9+"</span>"}
return _5},canAcceptDrop:true,drop:function(){if(this.$1498){this.creator.addPane(this.$1498.parentProperty)}
return isc.EH.STOP_BUBBLING},dropMove:function(){var _1,x=isc.EH.getX(),y=isc.EH.getY();for(var i=0;i<this.$1497.length;i++){if(this.$1497[i].containsPoint(x,y)){_1=this.$1497[i];break}}
if(!this.$1499||this.$1499!=_1){if(this.$1499&&this.$1499!=_1){var _5=this.getPaneText(this.$1499.name,false,this.$1499.parentProperty);this.setPaneLabel(this.$1499,_5)}
if(_1){var _5=this.getPaneText(_1.name,true,_1.parentProperty);this.setPaneLabel(_1,_5)}
this.$1499=_1}
return isc.EH.STOP_BUBBLING},dropOver:function(){this.$1498=null},dropOut:function(){var _1,x=isc.EH.getX(),y=isc.EH.getY();for(var i=0;i<this.$1497.length;i++){if(this.$1497[i].containsPoint(x,y)){_1=this.$1497[i];break}}
this.$1498=_1;this.hide();return isc.EH.STOP_BUBBLING},show:function(){this.Super("show",arguments);delete this.$1499;for(var i=0;i<this.$1497.length;i++){var _2=this.$1497[i],_3=this.getPaneText(_2.name,false,_2.parentProperty);this.setPaneLabel(_2,_3)}},draw:function(){this.Super("draw",arguments);if(!this.isObserving(this.creator.creator,"setZIndex")){this.observe(this.creator.creator,"setZIndex","observer.moveAbove(observed)")}
return this},bringToFront:function(){},resized:function(){this.Super("resized",arguments);var _1=this.creator.creator;if(_1){_1.redrawIfDirty();this.resizeTo(_1.getVisibleWidth(),_1.getVisibleHeight())}}};isc.A.supportsInlineEdit=false;isc.B.push(isc.A.canAddToParent=function isc_SplitPaneEditProxy_canAddToParent(_1){return false},isc.A.drop=function isc_SplitPaneEditProxy_drop(){return isc.EH.STOP_BUBBLING},isc.A.dropOver=function isc_SplitPaneEditProxy_dropOver(){if(!this.canDropAtLevel())return;if(!this.willAcceptDrop()){if(this.creator==this.creator.ns.EH.dragTarget){return}
return false}
if(!this.shouldPassDropThrough()){this.showDropOverlay(true)}
return isc.EH.STOP_BUBBLING},isc.A.dropOut=function isc_SplitPaneEditProxy_dropOut(){this.showDropOverlay(false)},isc.A.showDropOverlay=function isc_SplitPaneEditProxy_showDropOverlay(_1){if(_1){var _2=this.creator;if(!this.$150a){var _3=isc.addProperties({},this.dropOverlayDefaults,this.dropOverlayProperties,{editContext:_2.editContext,creator:this});this.$150a=isc.Canvas.create(_3);_2.addChild(this.$150a)}
this.$150a.show()}else if(this.$150a){this.$150a.hide()}},isc.A.addPane=function isc_SplitPaneEditProxy_addPane(_1){var _2=this.creator,_3=isc.EH.dragTarget,_4,_5;if(!_3.isA("Palette")){if(_3.isA("FormItemProxyCanvas")){_3=_3.formItem}
_5=_3._constructor||_3.Class}else{var _6=_3.transferDragData();_4=_2.editContext.makeEditNode(_6);_4.dropped=true;_4.defaults.parentProperty=_1;_5=_4.type||_4.className}
var _7=this.findEditNode(_5);if(_7){_7=_7.editNode}
if(this.modifyEditNode){_7=this.modifyEditNode(_4,_7,_5);if(!_7){_2.hideDropLine();return isc.EH.STOP_BUBBLING}}
if(!_3.isA("Palette")){if(_3==_2)return;var _8=_2.editContext.getEditNodeTree(),_9=_8.getParent(_3.editNode),_10=_8.getChildren(_9).indexOf(_3.editNode),_11=_2.getDropPosition(_5);_2.editContext.removeNode(_3.editNode);if(_9==this.editNode&&_11>_10)_11--;var _12;if(_3.isA("FormItem")){if(_3.isA("CanvasItem")){_3.canvas.editNode.defaults.parentProperty=_1;_12=_2.editContext.addNode(_3.canvas.editNode,_7,_11,_1)}else{_3.editNode.defaults.parentProperty=_1;_12=_2.editContext.addWithWrapper(_3.editNode,_7,null,_1)}}else if(_3.isA("DrawItem")){_3.editNode.defaults.parentProperty=_1;_12=_2.editContext.addWithWrapper(_3.editNode,_7,true,_1)}else{_3.editNode.defaults.parentProperty=_1;_12=_2.editContext.addNode(_3.editNode,_7,_11,_1)}
if(isc.isA.TabSet(_7.liveObject)){_7.liveObject.selectTab(_3)}else if(_12&&_12.liveObject){isc.EditContext.delayCall("selectCanvasOrFormItem",[_12.liveObject,true],200)}}else{var _13;var _14=isc.ClassFactory.getClass(_5);if(_14&&_14.isA("FormItem")){_13=_2.editContext.addWithWrapper(_4,_7,null,_1)}else if(_14&&_14.isA("DrawItem")){_13=_2.editContext.addWithWrapper(_4,_7,true,_1)}else{_13=_2.editContext.addNode(_4,_7,_2.getDropPosition(_5),_1)}
if(_13!=null){if(_4.liveObject.editProxy&&_4.liveObject.editProxy.nodeDropped){_4.liveObject.editProxy.nodeDropped()}}}
_2.hideDropLine();return isc.EH.STOP_BUBBLING});isc.B._maxIndex=isc.C+6;isc.defineClass("SectionStackEditProxy","LayoutEditProxy");isc.A=isc.SectionStackEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=false;isc.B.push(isc.A.canAdd=function isc_SectionStackEditProxy_canAdd(_1){if(!this.canDropAtLevel())return false;if(_1=="SectionStackSection")return true;var _2=isc.ClassFactory.getClass(_1);if(_2&&(_2.isA("Canvas")||_2.isA("FormItem")||_2.isA("DrawItem")))
{return true}
return null},isc.A.modifyEditNode=function isc_SectionStackEditProxy_modifyEditNode(_1,_2,_3){if(_3=="SectionStackSection")return _2;var _4=this.creator.getDropPosition();if(_4==0){isc.warn("Cannot drop before the first section header");return false}
var _5=this.$700();for(var i=_5.length-1;i>=0;i--){if(_4>_5[i]){return this.creator.getSectionHeader(i).editNode}}
return _2},isc.A.getDropPosition=function isc_SectionStackEditProxy_getDropPosition(_1){var _2=this.creator.invokeSuper(isc.SectionStack,"getDropPosition");if(!_1||_1=="SectionStackSection"){return _2}
var _3=this.$700();for(var i=_3.length-1;i>=0;i--){if(_2>_3[i]){return _2-_3[i]-1}}
return 0},isc.A.$700=function isc_SectionStackEditProxy__getHeaderPositions(){var _1=this.creator,_2=[],j=0;for(var i=0;i<_1.getMembers().length;i++){if(_1.getMember(i).isA(_1.sectionHeaderClass)){_2[j++]=i}}
return _2});isc.B._maxIndex=isc.C+4;isc.defineClass("TabSetEditProxy","CanvasEditProxy");isc.A=isc.TabSetEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.persistCoordinates=false;isc.A.inlineEditOnDrop=true;isc.A.inlineEditInstructions="Enter tab titles (comma separated)";isc.B.push(isc.A.setEditMode=function isc_TabSetEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);var _2=this.creator;if(_1){for(var i=0;i<_2.tabs.length;i++){var _4=_2.tabs[i];this.saveTabProperties(_4)}
_2.closeClick=function(_4){}}else{for(var i=0;i<_2.tabs.length;i++){var _4=_2.tabs[i];this.restoreTabProperties(_4)}}
_2.tabBar.setEditMode(_1,_2.editContext,null);_2.paneContainer.setEditMode(_1,_2.editContext,null)},isc.A.saveTabProperties=function isc_TabSetEditProxy_saveTabProperties(_1){var _2=this.creator.getTab(_1);if(_2){_2.saveToOriginalValues(["closeClick","icon","iconSize","iconOrientation","iconAlign","setDisabled","getStateSuffix"]);if(_2.disabled){_2.disabled=false;_2.$180e=true;_2.$180f=_2.getStateSuffix;_2.getStateSuffix=function(){return"Disabled"}}
_2.setDisabled=function(_3){this.disabled=false;if(_3){this.$180e=true;if(!this.$180f){this.$180f=this.getStateSuffix}
this.getStateSuffix=function(){return"Disabled"}
this.setState(isc.StatefulCanvas.STATE_DISABLED)}else{delete this.$180e;this.getStateSuffix=this.$180f;this.setState(isc.StatefulCanvas.STATE_UP)}}}},isc.A.restoreTabProperties=function isc_TabSetEditProxy_restoreTabProperties(_1){var _2=this.creator.getTab(_1);if(_2){_2.restoreFromOriginalValues(["closeClick","icon","iconSize","iconOrientation","iconAlign","setDisabled","getStateSuffix"]);_2.setDisabled(_2.$180e);delete _2.$180e}},isc.A.getInlineEditText=function isc_TabSetEditProxy_getInlineEditText(){var _1=this.creator,_2=_1.tabs,_3=null;for(var i=0;i<_2.length;i++){var _5=_2[i].title.replace(/,/,"\\,");_3=(_3?_3+", ":"")+_5+(_2[i].canClose?" [x]":"")}
return _3},isc.A.setInlineEditText=function isc_TabSetEditProxy_setInlineEditText(_1){var _2=isc.EditProxy.splitString(_1,",","\\");var _3=[];for(var i=0;i<_2.length;i++){if(_2[i].endsWith("[x]")||_2[i].endsWith("[X]")){_2[i]=_2[i].replace(/\[[xX]\]/,"").replace(/\s+$/,"");_3.add(_2[i])}}
var _5=this.creator,_6=_5.tabs,_7=[],_8=[];if(_6.length>0){for(var i=0;i<_6.length;i++){if(!_2.contains(_6[i].title)){_7.add(_6[i].editNode)}else if(_2.contains(_6[i].title)){_8.add(_6[i].title);this.creator.editContext.setNodeProperties(_6[i].editNode,{canClose:_3.contains(_6[i].title)})}}}
_7.map(function(_10){_5.editContext.removeNode(_10)});for(var i=0;i<_2.length;i++){if(_8.contains(_2[i]))continue;var _9={type:"Tab",defaults:{title:_2[i]}};var _10=this.creator.editContext.addNode(this.creator.editContext.makeEditNode(_9),this.creator.editNode,i);this.addDefaultPane(_10)}},isc.A.addDefaultPane=function isc_TabSetEditProxy_addDefaultPane(_1){if(!_1)return;var _2=isc.addProperties({},this.creator.defaultPaneDefaults);if(!_2.type&&!_2.className){_2.type=_2._constructor||this.creator.defaultPaneConstructor}
this.creator.editContext.addNode(this.creator.editContext.makeEditNode(_2),_1)},isc.A.addTabsEditModeExtras=function isc_TabSetEditProxy_addTabsEditModeExtras(_1){if(this.creator.editingOn){for(var i=0;i<_1.length;i++){this.saveTabProperties(_1[i])}}},isc.A.removeTabsEditModeExtras=function isc_TabSetEditProxy_removeTabsEditModeExtras(){},isc.A.reorderTabsEditModeExtras=function isc_TabSetEditProxy_reorderTabsEditModeExtras(_1,_2){if(this.creator.editContext&&this.creator.editContext.reorderNode){this.creator.editContext.reorderNode(this.creator.editNode,_1,_2)}},isc.A.findEditNode=function isc_TabSetEditProxy_findEditNode(_1){this.logInfo("In TabSet.findEditNode, dragType is "+_1,"editModeDragTarget");if(_1!="Tab"){var _2=this.creator.getTab(this.creator.getSelectedTabNumber());if(_2&&_2.editNode)return _2;for(var i=0;i<this.creator.tabs.length;i++){_2=this.creator.getTab(i);if(_2.editNode)return _2}
if(this.creator.parentElement)return this.creator.parentElement.editProxy.findEditNode(_1)}
return this.Super("findEditNode",arguments)},isc.A.completeItemDrop=function isc_TabSetEditProxy_completeItemDrop(_1,_2,_3,_4,_5,_6){this.Super("completeItemDrop",arguments);if(_1&&(_1.type||_1.className)=="Tab"){var _7=_1.liveObject;this.addDefaultPane(_1);this.creator.selectTab(_7);_7.editProxy.delayCall("editTitle")}});isc.B._maxIndex=isc.C+11;isc.defineClass("TabBarEditProxy","CanvasEditProxy");isc.A=isc.TabBarEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.findEditNode=function isc_TabBarEditProxy_findEditNode(_1){if(_1=="Tab"){return this.creator.parentElement.editProxy.findEditNode(_1)}else if(this.creator.parentElement&&isc.isA.Layout(this.creator.parentElement.parentElement)&&this.creator.parentElement.parentElement.editProxy)
{return this.creator.parentElement.parentElement.editProxy.findEditNode(_1)}
return this.Super("findEditNode",arguments)},isc.A.startInlineEditing=function isc_TabBarEditProxy_startInlineEditing(){var _1=this.creator.parentElement;_1.editProxy.startInlineEditing()});isc.B._maxIndex=isc.C+2;isc.defineClass("StatefulCanvasEditProxy","CanvasEditProxy");isc.A=isc.StatefulCanvasEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.inlineEditOnDrop=true;isc.B.push(isc.A.getOverrideProperties=function isc_StatefulCanvasEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);delete _1.canAcceptDrop;delete _1.canDropComponents;return _1},isc.A.click=function isc_StatefulCanvasEditProxy_click(_1,_2){var _3=this.Super("click",arguments);if(this.creator.handleActivate)this.creator.handleActivate(_1,_2);return _3},isc.A.getInlineEditText=function isc_StatefulCanvasEditProxy_getInlineEditText(){return this.creator.getTitle()},isc.A.setInlineEditText=function isc_StatefulCanvasEditProxy_setInlineEditText(_1){var _2=this.creator;_2.editContext.setNodeProperties(_2.editNode,{title:_1})});isc.B._maxIndex=isc.C+4;isc.defineClass("ImgEditProxy","CanvasEditProxy");isc.defineClass("ToolStripSeparatorEditProxy","ImgEditProxy");isc.A=isc.ToolStripSeparatorEditProxy.getPrototype();isc.A.inlineEditOnDrop=false;isc.A.canSelectChildren=false;isc.defineClass("LabelEditProxy","StatefulCanvasEditProxy");isc.A=isc.LabelEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getInlineEditText=function isc_LabelEditProxy_getInlineEditText(){if(isc.isA.SectionHeader(this.creator)){return this.creator.getTitle()}
return this.creator.getContents()},isc.A.setInlineEditText=function isc_LabelEditProxy_setInlineEditText(_1){var _2=this.creator;if(isc.isA.SectionHeader(_2)){_2.editContext.setNodeProperties(_2.editNode,{title:_1})}else{_2.editContext.setNodeProperties(_2.editNode,{contents:_1})}});isc.B._maxIndex=isc.C+2;isc.defineClass("ProgressbarEditProxy","StatefulCanvasEditProxy");isc.A=isc.ProgressbarEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.inlineEditOnDrop=false;isc.B.push(isc.A.getInlineEditText=function isc_ProgressbarEditProxy_getInlineEditText(){return(this.creator.percentDone!=null?this.creator.percentDone.toString():"")},isc.A.setInlineEditText=function isc_ProgressbarEditProxy_setInlineEditText(_1){var _2=this.creator;var _3=parseInt(_1);if(isNaN(_3))_3=null;_2.editContext.setNodeProperties(_2.editNode,{percentDone:_3})});isc.B._maxIndex=isc.C+2;isc.defineClass("WindowEditProxy","LayoutEditProxy");isc.A=isc.WindowEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.canAdd=function isc_WindowEditProxy_canAdd(_1){var _2=this.creator;var _3=_2.ns.EH.dragTarget.getDragData(),_4=(isc.isAn.Array(_3)?_3[0]:_3);var _5=isc.ClassFactory.getClass(_4.type);if(_5){if(_5.$177b=="header"&&_2.header&&!_2.header.containsEvent()){return false}
if(_5.$177b=="footer"&&_2.footer&&!_2.footer.containsEvent()){return false}}
return true},isc.A.dropMove=function isc_WindowEditProxy_dropMove(){if(!this.willAcceptDrop())return false;if(this.creator.hideDropLine)this.creator.hideDropLine();if(!this.shouldPassDropThrough()){if(this.creator.header){if(this.creator.header.containsEvent()){this.creator.header.setBorder("2px dashed blue")}else{this.creator.header.setBorder("")}}
if(this.creator.footer){if(this.creator.footer.containsEvent()){this.creator.footer.setBorder("2px dashed blue")}else{this.creator.footer.setBorder("")}}
return isc.EH.STOP_BUBBLING}},isc.A.dropOut=function isc_WindowEditProxy_dropOut(){if(this.creator.header)this.creator.header.setBorder("");if(this.creator.footer)this.creator.footer.setBorder("")},isc.A.drop=function isc_WindowEditProxy_drop(){if(this.creator.header)this.creator.header.setBorder("");if(this.creator.footer)this.creator.footer.setBorder("");var _1=this.creator,_2;if(this.creator.header&&this.creator.header.containsEvent()){_1=this.creator.header;_2="headerControls"}else if(this.creator.footer&&this.creator.footer.containsEvent()){_1=this.creator.footer;_2="footerControls"}
if(_1){if(this.shouldPassDropThrough())return;var _3=this.creator,_4=isc.EH.dragTarget,_5,_6;if(!_4.isA("Palette")){_6=_4._constructor||_4.Class}else{_5=_4.transferDragData();if(isc.isAn.Array(_5))_5=_5[0];_5.dropped=true;_6=_5.type||_5.className}
if(_4.isA("TreeGrid")){_5=_4.data.getCleanNodeData([_5],false,false,false)[0]}
_5=isc.clone(_5);if(!_4.isA("Palette")){if(_4==_3)return;var _7=_3.editContext,_8=_3.editNode,_9=_7.getEditNodeTree(),_10=_9.getParent(_4.editNode);_7.removeNode(_4.editNode)}
var _11=_3.editContext.makeEditNode(_5,_3.editNode);_3.editContext.addNode(_11,_3.editNode,null,_2)}
return isc.EH.STOP_BUBBLING},isc.A.getInlineEditText=function isc_WindowEditProxy_getInlineEditText(){return this.creator.title},isc.A.setInlineEditText=function isc_WindowEditProxy_setInlineEditText(_1){var _2=this.creator;_2.editContext.setNodeProperties(_2.editNode,{title:_1})});isc.B._maxIndex=isc.C+6;isc.defineClass("DetailViewerEditProxy","CanvasEditProxy");isc.A=isc.DetailViewerEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.A.inlineEditMultiline=true;isc.A.inlineEditInstructions="Enter options, one per line. Use \"*\" to mark the selected option. Use \"Field:Value\" to create a mapping between fields and values.";isc.A.dataSeparatorChar=",";isc.A.dataDisplaySeparatorChar=":";isc.A.dataEscapeChar="\\";isc.B.push(isc.A.getInlineEditText=function isc_DetailViewerEditProxy_getInlineEditText(){var _1=this.creator;if(!_1.data)return null;var _2=(this.inlineEditMultiline?"\n":this.dataSeparatorChar),_3=_1.data,_4=_1.fields,_5="";for(var i=0;i<_4.length;i++){var _7=_4[i],_8=_3[_7.name];if(_8!=null)_8=_8.replace(this.dataDisplaySeparatorChar,this.dataEscapeChar+this.dataDisplaySeparatorChar);_5=_5+(_5.length>0?_2:"")+_7.name+(_8!=null?this.dataDisplaySeparatorChar+_8:"")}
return _5},isc.A.setInlineEditText=function isc_DetailViewerEditProxy_setInlineEditText(_1){var _2=(this.inlineEditMultiline?"\n":this.dataSeparatorChar);var _3=isc.EditProxy.parseStringValueMap(_1,_2,this.dataEscapeChar,this.dataDisplaySeparatorChar,null,false,true);var _4=_3.valueMap,_5=[];for(var _6 in _4)_5.add({name:_6});this.creator.editContext.setNodeProperties(this.creator.editNode,{data:_4,fields:_5})});isc.B._maxIndex=isc.C+2;isc.defineClass("MenuEditProxy","CanvasEditProxy");isc.A=isc.MenuEditProxy;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.parseMenuButtonString=function isc_c_MenuEditProxy_parseMenuButtonString(_1){var _2=isc.MenuEditProxy.parseMenuBarString(_1,true);return(_2.length>0?_2[0]:null)},isc.A.parseMenuBarString=function isc_c_MenuEditProxy_parseMenuBarString(_1,_2){var _3=_1.trim().split("\n"),_4=[],_5=[],_6;for(var i=0;i<_3.length;i++){var _8=_3[i].trim();if(/^-+$/.test(_8)||/^=+$/.test(_8)){_4.add(_8);continue}
if(_8.startsWith("--")||_8.startsWith("==")||_8.startsWith("title:")){if(_4.length>0){var _9=isc.MenuEditProxy.parseMenuString(_4.join("\n")),_10={title:_6||"Menu",data:_9};_5.add(_10);_4=[];if(_2)return _5}else if(_6){_5.add({title:_6});if(_2)return _5}
if(_8.startsWith("title:")){_6=_8.replace(/^title:/,"").trim()}else{_6=_8.substring(2).trim()}}else{_4.add(_8)}}
if(_4.length>0||_6){var _9=this.parseMenuString(_4.join("\n")),_10={title:_6||"Menu",data:_9};_5.add(_10)}
return _5},isc.A.parseMenuString=function isc_c_MenuEditProxy_parseMenuString(_1){var _2=_1.trim().split("\n");var _3=[];for(var i=0;i<_2.length;i++){var _5=_2[i];if(/^-+$/.test(_5)||/^=+$/.test(_5)){_3.add({isSeparator:true})}else{var _6=_5.split(",");var _7=_6[0];var _8={title:isc.MenuEditProxy.parseTextWikiSymbols(_6[0])}
if(_6.length>1){_8.keyTitle=_6[1]}
if(_8.title.endsWith(">")){_8.title=_8.title.substring(0,_8.title.length-1);_8.submenu=[{}]}
if(_8.title.startsWith("x")||_8.title.startsWith("o")){_8.title=_8.title.substring(1);_8.checked=true}
if(_8.title.startsWith("-")&&_8.title.endsWith("-")){_8.title=_8.title.substring(1,_8.title.length-1);_8.enabled=false}
_3.add(_8)}}
return _3},isc.A.parseTextWikiSymbols=function isc_c_MenuEditProxy_parseTextWikiSymbols(_1){var _2=false;var _3=false;var _4=false;var _5=[];for(var i=0;i<_1.length;i++){var c=_1.charAt(i);if(c=='\\'){if((i+1)<_1.length&&_1.charAt(i+1)=='r'){c="<br/>";i++}}else if(c=='['&&_1.indexOf("]",i+1)>0){c="<a href='#'>";_4=true}else if(c==']'){if(_4){c="</a>";_4=false}}else if(c=='*'){if(_3){_3=false;c="</b>"}else{_3=true;c="<b>"}}else if(c=='_'){if(_2){_2=false;c="</i>"}else{_2=true;c="<i>"}}
_5.push(c)}
return _5.join("")},isc.A.menuToWikiText=function isc_c_MenuEditProxy_menuToWikiText(_1){var _2="== "+_1.title+"\n";if(_1.data){var _3=_1.data;for(var i=0;i<_3.length;i++){_2+=isc.MenuEditProxy.menuItemToWikiText(_3[i])+"\n"}}
return _2},isc.A.menuItemToWikiText=function isc_c_MenuEditProxy_menuItemToWikiText(_1){var _2="";if(_1.isSeparator)return"---";if(_1.enabled==false)_2+="-";else if(_1.checked)_2+="x ";_2+=_1.title;if(_1.submenu)_2+=" >";if(_1.keyTitle)_2+=","+_1.keyTitle;return _2});isc.B._maxIndex=isc.C+6;isc.MenuEditProxy.changeDefaults("inlineEditFormDefaults",{minHeight:150});isc.A=isc.MenuEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.A.inlineEditMultiline=true;isc.B.push(isc.A.getInlineEditText=function isc_MenuEditProxy_getInlineEditText(){var _1=this.creator;var _2="";if(isc.isA.MenuButton(_1)){var _3=_1.menu||_1.data;_2+=isc.MenuEditProxy.menuToWikiText({title:_1.title,data:_3})}else{var _4=_1.menus;for(var i=0;i<_4.length;i++){_2+=isc.MenuEditProxy.menuToWikiText(_4[i])}}
return _2},isc.A.setInlineEditText=function isc_MenuEditProxy_setInlineEditText(_1){var _2=this.creator;if(isc.isA.MenuButton(_2)){var _3=isc.MenuEditProxy.parseMenuButtonString(_1);if(_3){_2.editContext.setNodeProperties(_2.editNode,_3)}else{_2.editContext.removeNodeProperties(_2.editNode,["title","menu"])}}else{var _4=_2.editContext.getEditNodeTree(),_5=_4.getChildren(_2.editNode);if(_5&&_5.length>0)_4.removeList(_5);var _6=isc.MenuEditProxy.parseMenuBarString(_1);_2.editContext.setNodeProperties(_2.editNode,{menus:_6})}});isc.B._maxIndex=isc.C+2;isc.defineClass("FormEditProxy","CanvasEditProxy");isc.A=isc.FormEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.defaultDropMargin=5;isc.A.dropMargin=5;isc.A.selectItemsMode="item";isc.A.supportsInlineEdit=true;isc.B.push(isc.A.setEditMode=function isc_FormEditProxy_setEditMode(_1){this.persistCoordinates=(this.creator.itemLayout=="absolute"?true:null);this.Super("setEditMode",arguments);this.creator.resetValues()},isc.A.getOverrideProperties=function isc_FormEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);_1=isc.addProperties({},_1,{canDropItems:true,canAddColumns:true});if(this.isAbsoluteLayout()){_1.childrenSnapToGrid=true;_1.childrenSnapResizeToGrid=true}
return _1},isc.A.willAcceptDrop=function isc_FormEditProxy_willAcceptDrop(_1){var _2=this.creator;var _3=_2.ns.EH.dragTarget;if(_2==_3){return false}
return this.Super("willAcceptDrop",arguments)},isc.A.dropOver=function isc_FormEditProxy_dropOver(){var _1=this.creator;if(_1.canDropItems!=true)return false;if(!this.willAcceptDrop()){if(_1==_1.ns.EH.dragTarget){return}
return false}
this.$69c=null;_1.hideDragLine();if(!this.canDropAtLevel())return;this.$1313(true);return isc.EH.STOP_BUBBLING},isc.A.dropMove=function isc_FormEditProxy_dropMove(){var _1=this.creator;if(!_1.ns.EH.getDragTarget())return false;if(_1.canDropItems!=true)return false;if(!this.willAcceptDrop())return false;this.$146l=_1.ns.EH.getDragRect();var _2=_1.ns.EH.getDragTarget().getDragData();if(isc.isAn.Array(_2))_2=_2[0];if(_2&&(_2.type||_2.className)=="DataSource"||this.isAbsoluteLayout()){_1.hideDragLine();return isc.EH.STOP_BUBBLING}
if(this.shouldPassDropThrough()){_1.hideDragLine();return}
if(_1.getItems().length==0){isc.EditContext.hideAncestorDragDropLines(_1);_1.showDragLineForForm();return isc.EH.STOP_BUBBLING}
var _3=_1.ns.EH.lastEvent,_4=_1.getItemAtPageOffset(_3.x,_3.y),_5=_1.getNearestItem(_3.x,_3.y);if(_5){isc.EditContext.hideAncestorDragDropLines(_1);_1.showDragLineForItem(_5,_3.x,_3.y)}else{_1.hideDragLine()}
this.$69c=_5;return isc.EH.STOP_BUBBLING},isc.A.dropOut=function isc_FormEditProxy_dropOut(){this.creator.hideDragLine();if(!this.canDropAtLevel())return;this.showSelectedAppearance(false);this.$1313(false)},isc.A.drop=function isc_FormEditProxy_drop(){var _1=this.creator,_2=_1.ns.EH.getDragTarget().getDragData();if(isc.isAn.Array(_2))_2=_2[0];if((_2&&(_2.type||_2.className)=="DataSource")||(!this.isAbsoluteLayout()&&_1.getItems().length==0))
{if(this.shouldPassDropThrough()){_1.hideDragLine();return}
this.itemDrop(_1.ns.EH.getDragTarget(),0,0,0);return isc.EH.STOP_BUBBLING}
if(this.isAbsoluteLayout()){var _3=this.$146l,_4=(_3?_3[0]-_1.getPageLeft():_1.getOffsetX()),_5=(_3?_3[1]-_1.getPageTop():_1.getOffsetY());this.itemAbsoluteDrop(_1.ns.EH.getDragTarget(),_1.getItemDropIndex(_6),_5,_4);return isc.EH.STOP_BUBBLING}
if(!this.$69c){isc.logWarn("lastDragOverItem not set, cannot drop","dragDrop");return}
var _6=this.$69c,_7=_1.getItemTableOffsets(_6),_8=_6.dropSide,_9=_6.$69d,_10=_1.getItemDropIndex(_6,_8);this.$69c=null;if(this.shouldPassDropThrough()){_1.hideDragLine();return}
if(_10!=null&&_10>=0){if(_1.parentElement){if(_1.parentElement.hideDropLine)_1.parentElement.hideDropLine()}
var _11=_1.items.$8j.duplicate();this.modifyFormOnDrop(_6,_7.top,_7.left,_8,_11)}
_1.hideDragLine();return isc.EH.STOP_BUBBLING},isc.A.isAbsoluteLayout=function isc_FormEditProxy_isAbsoluteLayout(){return this.creator.$11e()},isc.A.itemDrop=function isc_FormEditProxy_itemDrop(_1,_2,_3,_4,_5,_6){var _7=this.creator;var _8=_1.getDragData();if(_8==null){_8=isc.EH.dragTarget;if(isc.isA.FormItemProxyCanvas(_8)){this.logInfo("The dragTarget is a FormItemProxyCanvas for "+_8.formItem,"editModeDragTarget");_8=_8.formItem}}
if(_7==_8)return;if(!_1.isA("Palette")){var _9=_7.editContext.getEditNodeTree(),_10=_9.getParent(_8.editNode),_11=_9.getChildren(_10).indexOf(_8.editNode),_12=_8.editNode;_12=this.itemDropping(_12,_2,true);if(!_12)return;_7.editContext.removeNode(_12);if(_10==_7.editNode&&_2>_11)_2--;var _13=_7.editContext.addNode(_8.editNode,_7.editNode,_2);if(_13&&_13.liveObject){isc.EditContext.delayCall("selectCanvasOrFormItem",[_13.liveObject,true],200)}
return _13}else{var _14=_1.transferDragData();if(isc.isAn.Array(_14))_14=_14[0];var _12=_7.editContext.makeEditNode(_14);if(_12.loadData&&!_12.isLoaded){var _15=this;_12.loadData(_12,function(_16){_16=_16||_12
_16.isLoaded=true;_15.completeItemDrop(_16,_2,_3,_4,_5,_6);_16.dropped=_12.dropped});return}
this.completeItemDrop(_12,_2,_3,_4,_5,_6)}},isc.A.itemAbsoluteDrop=function isc_FormEditProxy_itemAbsoluteDrop(_1,_2,_3,_4,_5){var _6=this.creator;var _7=_1.getDragData();if(_7==null){_7=isc.EH.dragTarget;if(isc.isA.FormItemProxyCanvas(_7)){this.logInfo("The dragTarget is a FormItemProxyCanvas for "+_7.formItem,"editModeDragTarget");_7=_7.formItem}}
if(_6==_7)return;if(!_1.isA("Palette")){var _8=_6.editContext.getEditNodeTree(),_9=_8.getParent(_7.editNode),_10=_8.getChildren(_9).indexOf(_7.editNode),_11=_7.editNode,_12;_11=this.itemDropping(_11,_2,true);if(!_11)return;if(_9.liveObject!=_6){_6.editContext.removeNode(_11);if(_9==_6.editNode&&_2>_10)_2--;var _13=(!isc.isA.FormItemProxyCanvas(_1)?"children":null);_12=_6.editContext.addNode(_11,_6.editNode,_2,_13)}else{_12=_11}
if(_12&&_12.liveObject){_12.liveObject.editContext.setNodeProperties(_12,{top:_3,left:_4});isc.EditContext.delayCall("selectCanvasOrFormItem",[_12.liveObject,true],200)}
return _12}else{var _14=_1.transferDragData();if(isc.isAn.Array(_14))_14=_14[0];var _11=_6.editContext.makeEditNode(_14);if(_11.loadData&&!_11.isLoaded){var _15=this;_11.loadData(_11,function(_16){_16=_16||_11
_16.isLoaded=true;_15.completeItemAbsoluteDrop(_16,_2,_3,_4,_5)
_16.dropped=_11.dropped});return}
this.completeItemAbsoluteDrop(_11,_2,_3,_4,_5)}},isc.A.completeItemDrop=function isc_FormEditProxy_completeItemDrop(_1,_2,_3,_4,_5,_6){var _7=this.creator,_8=_1.liveObject,_9,_10;if(isc.isA.Button(_8)||isc.isAn.IButton(_8)){_1=_7.editContext.makeEditNode({type:"ButtonItem",title:_8.title,defaults:_1.defaults})}else if(isc.isA.Canvas(_8)){_9=true;_10=_1;_1=_7.editContext.makeEditNode({type:"CanvasItem"});isc.addProperties(_1.defaults,{canvas:_8,showTitle:false,startRow:true,endRow:true,width:"*",colSpan:"*"})}
_1.dropped=true;_1=this.itemDropping(_1,_2,true);if(!_1)return;var _11=_7.editContext.addNode(_1,_7.editNode,_2);if(_11){isc.EditContext.clearSchemaProperties(_11);if(_10){_11=_7.editContext.addNode(_10,_11,0);if(isc.isA.TabSet(_8)){_8.delayCall("showAddTabEditor",[],1000)}}
_7.editContext.getLiveObject(_11);if(_11.liveObject.dataSource){_11.liveObject.editProxy.setDataSource(_11.liveObject.dataSource,null,true)}
if(_7.editingOn){var _12=_11.liveObject;if(_12.setEditMode)_12.setEditMode(true,_12.editContext,_12.editNode)}
isc.EditContext.delayCall("selectCanvasOrFormItem",[_1.liveObject,true],200);if(_9){if(_11.liveObject.inlineEditOnDrop){_11.liveObject.editProxy.delayCall("startInlineEditing")}}else if(_11.showTitle!=false&&_11.liveObject.editProxy){_11.liveObject.editProxy.delayCall("editTitle")}}
if(_6)this.fireCallback(_6,"node",[_11])},isc.A.completeItemAbsoluteDrop=function isc_FormEditProxy_completeItemAbsoluteDrop(_1,_2,_3,_4,_5){var _6=this.creator,_7=_1.liveObject,_8;if(isc.isA.Canvas(_7)){_8="children"}
_1.dropped=true;_1=this.itemDropping(_1,_2,true);if(!_1)return;var _9=_6.editContext.addNode(_1,_6.editNode,_2,_8);if(_9){isc.EditContext.clearSchemaProperties(_9);_6.editContext.getLiveObject(_9);if(_9.liveObject.dataSource){_9.liveObject.editProxy.setDataSource(_9.liveObject.dataSource,null,true)}
_6.editContext.setNodeProperties(_9,{top:_3,left:_4});if(_6.editingOn&&_9.liveObject.setEditMode){var _10=_9.liveObject;_10.setEditMode(true,_10.editContext,_10.editNode)}
isc.EditContext.delayCall("selectCanvasOrFormItem",[_1.liveObject,true],200)}
if(_5)this.fireCallback(_5,"node",[_9])},isc.A.modifyFormOnDrop=function isc_FormEditProxy_modifyFormOnDrop(_1,_2,_3,_4,_5){var _6=this.creator;if(_6.canAddColumns==false)return;var _7=_6.ns.EH.getDragTarget().getDragData(),_8,_9,_10;if(!_7){_7=_6.ns.EH.getDragTarget();if(!isc.isA.FormItemProxyCanvas(_7)){this.logWarn("In modifyFormOnDrop the drag target was not a FormItemProxyCanvas");return}
_7=_7.formItem;var _11=-1;for(var i=0;i<_5.length;i++){for(var j=0;j<_5[i].length;j++){if(_5[i][j]==_11)continue;_11=_5[i][j];if(_6.items[_11]==_7){_9=i;_10=_11;break}}}
var _14=true}else{if(isc.isAn.Array(_7))_7=_7[0];var _15=_7.type||_7.className;var _16=isc.ClassFactory.getClass(_15);if(isc.isA.FormItem(_16)){_7=isc.addProperties({name:"$179v"},_7);_7=_6.createItem(_7,_15)}else{_7=_6.createItem({type:"CanvasItem",showTitle:false},"CanvasItem")}
var _14=false}
_8=this.getAdjustedColSpan(_7);if((_7.startRow&&_7.$71r)||(_7.endRow&&_7.$71n)){_7.editContext.setNodeProperties(_7.editNode,{startRow:null,$71r:null,endRow:null,$71n:null})}
var _17=[];if(_14&&_9){var _18=_5[_9],_11=-1;for(var i=0;i<_18.length;i++){if(_18[i]!=_11){_11=_18[i];if(_6.items[_11]==_7)continue;if(isc.isA.SpacerItem(_6.items[_11])&&_6.items[_11].$71m)
{this.logDebug("Marking spacer "+_6.items[_11].name+" for removal","formItemDragDrop");_17.add(_6.items[_11]);continue}
this.logDebug("Found a non-spacer item on row "+_9+", no spacers will be deleted","formItemDragDrop");_17=null;break}}}
var _19=0;if(_4=="L"||_4=="R"){var _20=true;if(_7.startRow)_20=false;if(_7.endRow&&(_4=="L"||_3<_5[_2].length)){_20=false}
if(_14&&_9==_2)_20=false;if(_20){var _21=_8;var _22=_5[_2][_3];if(_5[_2].contains(_22)){var _23=_6.items[_22];if(!isc.isA.SpacerItem(_23)||!_23.$71m){_22+=_4=="L"?-1:1;_23=_6.items[_22]}
if(_5[_2].contains(_22)){if(isc.isA.SpacerItem(_23)&&_23.$71m){if(_23.colSpan&&_23.colSpan>_21){_23.editContext.setNodeProperties(_23.editNode,{colSpan:_23.colSpan-_21});_21=0}else{_21-=_23.colSpan;_23.editContext.removeNode(_23.editNode);if(_4=="R")_19=-1}}}}
if(_21<=0){_20=false}else if(_5[_2].length+_8<=_6.numCols){_20=false}else{_6.editContext.setNodeProperties(_6.editNode,{numCols:_6.numCols+_21})}}
for(var i=0;i<_5.length;i++){var _22=_5[i][_3];if(_22==null)_22=_6.items.length;else _22+=_19+(_4=="L"?0:1);if(i!=_2){if(!_20)continue;if(_14&&_9&&_2<_9&&i==_9)
{_19--}
if(_17&&_17.length>0&&i==_9){continue}
if(_22>0){var _23=_6.items[_22-1];if(!_23||_23==_7||_23.endRow){continue}}
var _24=this.getAdjustedColSpan(_23);if(_4=="R"&&_3+_24>=_5[i].length){if(!_23.endRow){_23.editContext.setNodeProperties(_23.editNode,{endRow:true,$71n:true})}
continue}
var _25=_6.editContext.makeEditNode({type:"SpacerItem"});isc.addProperties(_25.defaults,{colSpan:_21,height:0,$71m:true});var _26=_6.editContext.addNode(_25,_6.editNode,_22);_19++}else{if(_4=="L"){var _23=_6.items[_22];if(_23&&_23.startRow&&_23.$71r){_23.editContext.setNodeProperties(_23.editNode,{startRow:null,$71r:null})}}else{var _23=_6.items[_22-1];if(_23&&_23.endRow&&_23.$71n){_23.editContext.setNodeProperties(_23.editNode,{endRow:null,$71n:null})}}
this.itemDrop(_6.ns.EH.getDragTarget(),_22,i,_3,_4,function(_36){_6.$72s=_36});if(_9==null||_2<_9)_19++}}}else{var _27,_28;if(isc.isA.SpacerItem(_1)&&_1.$71m){_27=_2}else{_27=_2+(_4=="B"?1:0)}
if(_5[_27])_28=_5[_27][_3];var _29;if(_27>=_5.length)_29=_6.items.length;else _29=_5[_27][0];var _30=_28==null?null:_6.items[_28];if(_30==null||(isc.isA.SpacerItem(_30)&&_30.$71m)){if(_27>_5.length-1||_27<0){if(_3!=0&&!_7.startRow){var _25=_6.editContext.makeEditNode({type:"SpacerItem"});isc.addProperties(_25.defaults,{colSpan:_3,height:0,$71m:true});_6.editContext.addNode(_25,_6.editNode,_29)}
this.itemDrop(_6.ns.EH.getDragTarget(),_29+(_3!=0?1:0),_27,_3,_4,function(_36){_6.$72s=_36})}else if(_30==null){var _31=_5[_27].length-1;if(_31<0){isc.logWarn("Found completely empty row in DynamicForm at position ("+_27+","+(_3)+")");return}
var _32=_5[_27][_31];var _23=_6.items[_32];if(_23==null){isc.logWarn("Null item in DynamicForm at position ("+_27+","+(_3-1)+")");return}
if(_23.endRow&&_23!=_7){_23.editContext.setNodeProperties(_23.editNode,{endRow:false})}
var _33=(_3-_31)-1;if(_14&&_23==_7){_33+=_8}
if(_33>0){var _25=_6.editContext.makeEditNode({type:"SpacerItem"});isc.addProperties(_25.defaults,{colSpan:_33,height:0,$71m:true});_6.editContext.addNode(_25,_6.editNode,_32+1)}
this.itemDrop(_6.ns.EH.getDragTarget(),_32+(_33>0?2:1),_27,_3,_4,function(_36){_6.$72s=_36})}else{var _34=_30.colSpan?_30.colSpan:1,_35=_8;if(_34>_35){_30.editContext.setNodeProperties(_30.editNode,{colSpan:_34-_35});this.itemDrop(_6.ns.EH.getDragTarget(),_28,_27,_3,_4,function(_36){_6.$72s=_36})}else{this.itemDrop(_6.ns.EH.getDragTarget(),_28,_27,_3,_4,function(_36){_6.$72s=_36});_30.editContext.removeNode(_30.editNode)}}}else{if(_3!=0){var _25=_6.editContext.makeEditNode({type:"SpacerItem"});isc.addProperties(_25.defaults,{colSpan:_3,height:0,$71m:true});_6.editContext.addNode(_25,_6.editNode,_29)}
this.itemDrop(_6.ns.EH.getDragTarget(),_29+(_3==0?0:1),_27,_3,_4,function(_36){if(_36&&_36.liveObject&&_36.liveObject.editContext){_36.liveObject.editContext.setNodeProperties(_36,{endRow:true,$71n:true})}
_6.$72s=_36})}}
if(_14&&_17){for(var i=0;i<_17.length;i++){this.logDebug("Removing spacer item "+_17[i].name,"formItemDragDrop");_17[i].editContext.removeNode(_17[i].editNode)}}
if(!_14)_7.destroy();if(_6.$72s&&_6.$72s.liveObject){isc.EditContext.delayCall("selectCanvasOrFormItem",[_6.$72s.liveObject],200)}},isc.A.getAdjustedColSpan=function isc_FormEditProxy_getAdjustedColSpan(_1){if(!_1)return 0;var _2=_1.colSpan!=null?_1.colSpan:1;if(_2=="*")_2=1;if(_1.showTitle!=false&&(_1.titleOrientation=="left"||_1.titleOrientation=="right"||_1.titleOrientation==null))
{_2++}
return _2},isc.A.canAdd=function isc_FormEditProxy_canAdd(_1){if(!this.canDropAtLevel())return false;if(this.creator.getObjectField(_1)!=null)return true;var _2=isc.ClassFactory.getClass(_1);if(_2&&_2.isA("Canvas"))return true;return null},isc.A.itemDropping=function isc_FormEditProxy_itemDropping(_1,_2,_3){var _4=this.creator,_5=_1.liveObject,_6=isc.EditContext.getSchemaInfo(_1);if(!_6.dataSource)return _1;if(!_4.dataSource){_4.editProxy.setDataSource(_6.dataSource);_4.serviceNamespace=_6.serviceNamespace;_4.serviceName=_6.serviceName;return _1}
if(_6.dataSource==isc.DataSource.getDataSource(_4.dataSource).ID&&_6.serviceNamespace==_4.serviceNamespace&&_6.serviceName==_4.serviceName){return _1}
var _7=_4.editContext.makeEditNode({type:"CanvasItem",defaults:{cellStyle:"nestedFormContainer"}});isc.addProperties(_7.defaults,{showTitle:false,colSpan:2});_7.dropped=true;_4.editContext.addNode(_7,_4.editNode,_2);var _8=_4.editContext.makeEditNode({type:"DynamicForm",defaults:{numCols:2,canDropItems:false,dataSource:_6.dataSource,serviceNamespace:_6.serviceNamespace,serviceName:_6.serviceName,doNotUseDefaultBinding:true}});_8.dropped=true;_4.editContext.addNode(_8,_7,0);var _9=_4.editContext.addNode(_1,_8,0);isc.EditContext.clearSchemaProperties(_9)},isc.A.makeFieldPaletteNode=function isc_FormEditProxy_makeFieldPaletteNode(_1,_2,_3,_4){var _5=this.creator.getEditorType(_2),_4=isc.addProperties({},_4,{name:_2.name});_5=_5.substring(0,1).toUpperCase()+_5.substring(1)+"Item";var _6;if(_1){_6=_1.findPaletteNode("type",_5)||_1.findPaletteNode("className",_5)||{type:_5};_6=isc.addProperties({},_6,{defaults:_4})}else{_6={type:_5,autoGen:true,defaults:_4}}
var _7=_3.getAutoTitle(_2.name);if(_2.title!=null&&_2.title!=_7){_6.defaults.title=_2.title}
return _6},isc.A.changed=function isc_FormEditProxy_changed(_1,_2,_3){this.creator.editContext.setNodeProperties(this.creator.editNode,{defaultValue:_3})},isc.A.click=function isc_FormEditProxy_click(){var _1=this.getClickedFormItem(true);if(_1&&_1.editProxy){if(_1.editProxy.click){return _1.editProxy.click(this.creator,_1)}}
this.Super("click",arguments);return isc.EH.STOP_BUBBLING},isc.A.doubleClick=function isc_FormEditProxy_doubleClick(){var _1=this.getClickedFormItem(true);if(_1&&_1.editProxy){if(_1.editProxy.doubleClick){return _1.editProxy.doubleClick(this.creator,_1)}}
this.Super("doubleClick",arguments);return isc.EH.STOP_BUBBLING},isc.A.$ne=function isc_FormEditProxy__getEventTargetItemInfo(){var _1=this.creator,_2=isc.EH.lastEvent,_3=_2.target;if(_3==_1)return _1.$ne();while(_3.parentElement&&!_3.canvasItem)_3=_3.parentElement;return!_3.canvasItem?null:isc.DynamicForm._getItemInfoFromElement(_3.canvasItem.getHandle(),_1)},isc.A.getClickedFormItem=function isc_FormEditProxy_getClickedFormItem(_1){var _2=this.$ne(),_3=(_2?_2.item:null);if(_3&&_3.parentItem)_3=_3.parentItem;return(_3&&(_1||this.selectItemsMode=="itemOrTitle"||!_2.overTitle)?_3:null)},isc.A.startInlineEditing=function isc_FormEditProxy_startInlineEditing(_1){var _2=this.creator.getFields();if(_2&&_2.length==1&&_2[0].editProxy&&_2[0].editProxy.supportsInlineEdit){_2[0].editProxy.startInlineEditing()}});isc.B._maxIndex=isc.C+23;isc.defineClass("FormItemEditProxy","EditProxy");isc.A=isc.FormItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=false;isc.A.valueMapSeparatorChar=",";isc.A.valueMapDisplaySeparatorChar=":";isc.A.valueMapSelectedChar="*";isc.A.valueMapEscapeChar="\\";isc.B.push(isc.A.getOverrideProperties=function isc_FormItemEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);_1=isc.addProperties({},_1,{handleChanged:this.handleChanged,setOptionDataSource:this.setOptionDataSource});return _1},isc.A.handleChanged=function isc_FormItemEditProxy_handleChanged(_1){var _2=this.editContext;_2.setNodeProperties(this.editNode,{defaultValue:_1});this.Super("handleChanged",arguments)},isc.A.setOptionDataSource=function isc_FormItemEditProxy_setOptionDataSource(_1){this.creator.Super("setOptionDataSource",arguments);var _2=this.creator,_3=_2.editNode,_4=(_3.defaults?_3.defaults.name:null);if(_4&&_4.startsWith(_3.type)){var _5=isc.DS.get(_1);if(_5){var _6=_5.getPrimaryKeyFieldName();if(_6){var _7=_2.editContext,_8=_7.getEditNodeTree(),_9=_8.getChildren(_8.getParent(_3)),_10=_6,_11=false,_12=1;do{_11=false;for(var i=0;i<_9.length;i++){if(_9[i].name==_10){_11=true;break}}
if(_11){_10=_6+_12++}}while(_11);isc.Timer.setTimeout(function(){_2.editContext.setNodeProperties(_3,{name:_10,valueField:_6,displayField:_5.getTitleField()})},0)}}}},isc.A.getResizeEdges=function isc_FormItemEditProxy_getResizeEdges(){return(this.creator.form&&this.creator.form.$11e()?["R","B"]:null)},isc.A.click=function isc_FormItemEditProxy_click(_1,_2){if(_1.editProxy.selectItemsMode!="never"){isc.EditContext.selectCanvasOrFormItem(_2,true)}
return isc.EH.STOP_BUBBLING},isc.A.doubleClick=function isc_FormItemEditProxy_doubleClick(_1,_2){if(this.wasFormItemClickOnTitle(_1)){var _3=this.creator;isc.EditContext.selectCanvasOrFormItem(_3,true);this.editTitle(null,function(){var _4=_3.editContext;if(_4)_4.fireSelectedEditNodesUpdated()});return isc.EH.STOP_BUBBLING}
this.Super("doubleClick",arguments);return isc.EH.STOP_BUBBLING},isc.A.wasFormItemClickOnTitle=function isc_FormItemEditProxy_wasFormItemClickOnTitle(_1){var _2=_1.$ne(),_3=(_2?_2.item:null);if(_3&&_3.parentItem)_3=_3.parentItem;return(_3&&_2.overTitle)},isc.A.editTitle=function isc_FormItemEditProxy_editTitle(_1,_2){var _3=this.creator,_4,_5,_6,_7;if(isc.isA.ButtonItem(_3)){_4=_3.canvas.getPageLeft();_5=_3.canvas.getVisibleWidth();_6=_3.canvas.getPageTop();_7=_3.canvas.getHeight()}else{if(isc.isA.StaticTextItem(_3)&&_1=="defaultValue"){_4=_3.getPageLeft();_5=_3.getVisibleWidth()}else{_4=_3.getTitlePageLeft();_5=_3.getVisibleTitleWidth()}
var _8,_9;_8=_3.getTitlePageTop();_9=_3.getTitleVisibleHeight();_7=_3.getVisibleHeight();if(_9==0){_9=_7;_8=_6}
_7=Math.max(_7,_9);_6=(_9==_7?_8:_8+((_9-_7)/2))}
isc.EditContext.manageTitleEditor(_3,_4,_5,_6,_7,null,_1,_2)},isc.A.getInlineEditText=function isc_FormItemEditProxy_getInlineEditText(){},isc.A.setInlineEditText=function isc_FormItemEditProxy_setInlineEditText(_1){});isc.B._maxIndex=isc.C+10;isc.defineClass("TextItemEditProxy","FormItemEditProxy");isc.A=isc.TextItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.getInlineEditText=function isc_TextItemEditProxy_getInlineEditText(){return this.creator.defaultValue},isc.A.setInlineEditText=function isc_TextItemEditProxy_setInlineEditText(_1){this.creator.editContext.setNodeProperties(this.creator.editNode,{defaultValue:_1})});isc.B._maxIndex=isc.C+2;isc.defineClass("TextAreaItemEditProxy","TextItemEditProxy");isc.A=isc.TextAreaItemEditProxy.getPrototype();isc.A.inlineEditMultiline=true;isc.defineClass("ButtonItemEditProxy","FormItemEditProxy");isc.A=isc.ButtonItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.getInlineEditText=function isc_ButtonItemEditProxy_getInlineEditText(){return this.creator.title||this.creator.name},isc.A.setInlineEditText=function isc_ButtonItemEditProxy_setInlineEditText(_1){this.creator.editContext.setNodeProperties(this.creator.editNode,{title:_1})});isc.B._maxIndex=isc.C+2;isc.defineClass("SelectItemEditProxy","FormItemEditProxy");isc.A=isc.SelectItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.A.inlineEditMultiline=true;isc.A.inlineEditInstructions="Enter options, one per line. Use \"*\" to mark the selected option. Use \"StoredValue:Display Value\" to create a mapping between stored values and values displayed to the user.";isc.B.push(isc.A.getInlineEditText=function isc_SelectItemEditProxy_getInlineEditText(){var _1=this.creator;if(!_1.valueMap)return null;var _2=_1.valueMap,_3=_1.getValue()||[],_4=(this.inlineEditMultiline?"\n":this.valueMapSeparatorChar),_5="";if(!isc.isAn.Array(_3))_3=[_3];if(isc.isAn.Array(_2)){for(var i=0;i<_2.length;i++){var _7=_2[i],_8=_3.contains(_7);_7=_7.replace(_4,"\\"+_4);_7=_7.replace(/^\s+/g,"\\ ").replace(/\s+$/g,"\\ ");_5=_5+(_5.length>0?_4:"")+_7+(_8?this.valueMapSelectedChar:"")}}else{for(var _9 in _2){var _7=_2[_9],_8=_3.contains(_9);_9=_9.replace(_4,"\\"+_4);_7=_7.replace(_4,"\\"+_4);_9=_9.replace(/^\s+/g,"\\ ").replace(/\s+$/g,"\\ ");_7=_7.replace(/^\s+/g,"\\ ").replace(/\s+$/g,"\\ ");_5=_5+(_5.length>0?_4:"")+_9+this.valueMapDisplaySeparatorChar+_7+(_8?this.valueMapSelectedChar:"")}}
return _5},isc.A.setInlineEditText=function isc_SelectItemEditProxy_setInlineEditText(_1){var _2=(this.inlineEditMultiline?"\n":this.valueMapSeparatorChar);var _3=isc.EditProxy.parseStringValueMap(_1,_2,this.valueMapEscapeChar,this.valueMapDisplaySeparatorChar,this.valueMapSelectedChar,true);this.creator.editContext.setNodeProperties(this.creator.editNode,{valueMap:_3.valueMap,value:_3.value})},isc.A.createInlineEditForm=function isc_SelectItemEditProxy_createInlineEditForm(){if(this.creator.editContext.isVisualBuilder&&this.creator.optionDataSource&&!isc.isA.MockDataSource(this.creator.optionDataSource))
{var _1=isc.DS.get(this.creator.optionDataSource),_2=this.creator.editContext.creator.creator;var _3=[{name:"editDataSourceButton",type:"button",title:"View / Edit DataSource",endRow:false,click:function(_4,_5){if(_2.showDSEditor)_2.showDSEditor(_1);_4.dismissEditor()}}];var _4=this.createAutoChild("inlineEditForm",{margin:0,padding:10,cellPadding:0,fields:_3,numCols:2,click:function(){this.dismissEditor()},dismissEditor:function(){this.hide()}});return _4}else{return this.Super("createInlineEditForm",arguments)}});isc.B._maxIndex=isc.C+3;isc.defineClass("CheckboxItemEditProxy","FormItemEditProxy");isc.A=isc.CheckboxItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.getInlineEditText=function isc_CheckboxItemEditProxy_getInlineEditText(){var _1=this.creator;return(_1.value?"[x]":"[ ]")},isc.A.setInlineEditText=function isc_CheckboxItemEditProxy_setInlineEditText(_1){_1=_1.replace(/\s+/g,"").toLowerCase();var _2=("[x]"==_1||"true"==_1||"t"==_1||"yes"==_1||"y"==_1||"checked"==_1);this.creator.editContext.setNodeProperties(this.creator.editNode,{value:_2})});isc.B._maxIndex=isc.C+2;isc.defineClass("DateItemEditProxy","FormItemEditProxy");isc.A=isc.DateItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.getInlineEditText=function isc_DateItemEditProxy_getInlineEditText(){var _1=this.creator,_2=_1.defaultValue;if(!_2)return null;if(isc.isA.Date(_2)){_2=_2.toShortDate()}
return _2},isc.A.setInlineEditText=function isc_DateItemEditProxy_setInlineEditText(_1){var _2=isc.DateUtil.parseInput(_1);if(_2){_1=_2}
this.creator.editContext.setNodeProperties(this.creator.editNode,{defaultValue:_1})});isc.B._maxIndex=isc.C+2;isc.defineClass("GridEditProxy","LayoutEditProxy");isc.A=isc.GridEditProxy.getPrototype();isc.A.saveFieldOrder=true;isc.A.saveFieldVisibility=true;isc.A.saveFieldFrozenState=true;isc.A.saveSort=true;isc.A.saveGroupBy=true;isc.A.saveFilterCriteria=true;isc.A.canEditHilites=true;isc.A.canAddFormulaFields=true;isc.A.canAddSummaryFields=true;isc.A.canGroupBy=true;isc.A.canReorderFields=true;isc.A.canResizeFields=true;isc.A.generateEditableHilites=true;isc.A.generateEditableFormulas=true;isc.A.generateEditableSummaries=true;isc.A=isc.GridEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.A.inlineEditMultiline=true;isc.B.push(isc.A.setEditMode=function isc_GridEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);if(_1)this.observeStateChanges();else this.ignoreStateChanges();if(isc.isA.TreeGrid){if(_1){this.createDefaultTreeFieldEditNode()}}},isc.A.canAddToParent=function isc_GridEditProxy_canAddToParent(_1){if(isc.isA.TreeGrid(this.creator)&&_1=="ListGridField")return false;return true},isc.A.getOverrideProperties=function isc_GridEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);return isc.addProperties({},_1,{clearNoDropIndicator:this.clearNoDropIndicator,setNoDropIndicator:this.setNoDropIndicator,addField:this.addField,userAddedField:this.userAddedField})},isc.A.observeStateChanges=function isc_GridEditProxy_observeStateChanges(){var _1=this.creator;if(this.saveSort)this.observe(_1,"sortChanged");this.observe(_1,"fieldStateChanged");if(this.saveGroupBy)this.observe(_1,"groupStateChanged");this.observe(_1,"editHilites");this.observe(_1,"hilitesChanged");if(this.saveFilterCriteria)this.observe(_1,"filterEditorSubmit")},isc.A.ignoreStateChanges=function isc_GridEditProxy_ignoreStateChanges(){var _1=this.creator;if(this.saveSort)this.ignore(_1,"sortChanged");this.ignore(_1,"fieldStateChanged");if(this.saveGroupBy)this.ignore(_1,"groupStateChanged");this.ignore(_1,"editHilites");this.ignore(_1,"hilitesChanged");if(this.saveFilterCriteria)this.ignore(_1,"filterEditorSubmit")},isc.A.sortChanged=function isc_GridEditProxy_sortChanged(){var _1=this.creator,_2=_1.getSort();this.addDefaultFieldEditNodes();if(!_2)_1.editContext.removeNodeProperties(_1.editNode,["initialSort"],true);else _1.editContext.setNodeProperties(_1.editNode,{initialSort:_2},true)},isc.A.fieldStateChanged=function isc_GridEditProxy_fieldStateChanged(){this.addDefaultFieldEditNodes();var _1=this.creator,_2=_1.getAllFields();if(_2&&this.saveFieldOrder){for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.getFieldNode(i);if(_5){var _6=_4[_1.fieldIdProperty],_7=_5.liveObject[_1.fieldIdProperty];if(_6!=_7){var _8=this.getFieldNodeIndexByName(_6),_9=this.getFieldNodeIndexByName(_7);if(_8!=null&&_9!=null&&_9!=_8){_1.editContext.reorderNode(_1.editNode,_8,_9)}}}}}
if(_2){for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.getFieldNode(i);if(!_4||_4.excludeFromState||!_5||!_5.defaults)continue;var _10=_4[_1.fieldIdProperty],_11=_1.getStateForField(_10,false);if(this.saveFieldVisibility){var _12=(_11.visible==false);if(!_12)_1.editContext.removeNodeProperties(_5,["hidden"],true);else _1.editContext.setNodeProperties(_5,{hidden:_12},true)}
if(this.saveFieldFrozenState){var _13=_11.frozen;if(!_13)_1.editContext.removeNodeProperties(_5,["frozen"],true);else _1.editContext.setNodeProperties(_5,{frozen:_13},true)}
var _14=_11.width;if(!_14)_1.editContext.removeNodeProperties(_5,["width"],true);else _1.editContext.setNodeProperties(_5,{width:_14},true)}}},isc.A.groupStateChanged=function isc_GridEditProxy_groupStateChanged(){var _1=this.creator,_2=_1.getGroupByFields();if(!_2)_1.editContext.removeNodeProperties(_1.editNode,"groupByField");else _1.editContext.setNodeProperties(_1.editNode,{groupByField:_2},true);this.addDefaultFieldEditNodes();var _3=_1.getAllFields(),_4=["groupingMode","groupGranularity","groupPrecision"];for(var i=0;i<_3.length;i++){var _6=this.getFieldNode(i);if(_6)_1.editContext.removeNodeProperties(_6,_4)}
if(_2!=null){for(var i=0;i<_2.length;i++){var _7=_3.find("name",_2[i]);if(_7){var _8=_3.indexOf(_7),_6=this.getFieldNode(_8),_9={};if(_7.groupingMode)_9.groupingMode=_7.groupingMode;if(_7.groupGranularity)_9.groupGranularity=_7.groupGranularity;if(_7.groupPrecision)_9.groupPrecision=_7.groupPrecision;_1.editContext.setNodeProperties(_6,_9,true)}}}},isc.A.editHilites=function isc_GridEditProxy_editHilites(){this.$129b=this.creator.getHilites()},isc.A.hilitesChanged=function isc_GridEditProxy_hilitesChanged(){var _1=this.creator,_2=_1.getHilites();if(!_2){_1.editContext.removeNodeProperties(_1.editNode,["hilites"],true)}else{if(!this.generateEditableHilites){for(var i=0;i<_2.length;i++){var _4=_2[i],_5=(this.$129b?this.$129b.contains(_4):false);if(!_5){_4.canEdit=false}}}
_1.editContext.setNodeProperties(_1.editNode,{hilites:_2},true)}},isc.A.filterEditorSubmit=function isc_GridEditProxy_filterEditorSubmit(_1){var _2=this.creator;if(!_1)_2.editContext.removeNodeProperties(_2.editNode,["initialCriteria"],true);else _2.editContext.setNodeProperties(_2.editNode,{initialCriteria:_1},true)},isc.A.clearNoDropIndicator=function isc_GridEditProxy_clearNoDropIndicator(_1){this.Super("clearNoDropIndicator",arguments);var _2=this.creator;if(_2.body&&_2.body.editProxy){_2.body.editProxy.clearNoDropIndicator()}},isc.A.setNoDropIndicator=function isc_GridEditProxy_setNoDropIndicator(){this.Super("setNoDropIndicator",arguments);var _1=this.creator;if(_1.body&&_1.body.editProxy){_1.body.editProxy.setNoDropIndicator()}},isc.A.headerClick=function isc_GridEditProxy_headerClick(_1){var _2=this.creator,_3=this.getFieldNode(_1);if(_3){_3.liveObject.$73a=_2.header.getButton(_1);isc.EditContext.selectCanvasOrFormItem(_3.liveObject)}
_2.$73b=true;return isc.EH.STOP_BUBBLING},isc.A.click=function isc_GridEditProxy_click(){var _1=this.creator;if(_1.editNode){if(_1.$73b)delete _1.$73b;else isc.EditContext.selectCanvasOrFormItem(_1,true);return isc.EH.STOP_BUBBLING}},isc.A.userAddedField=function isc_GridEditProxy_userAddedField(_1){var _2=this.editProxy.getFieldNodeByName(_1.name);if(_2){var _3={title:_1.title,userFormula:_1.userFormula};this.editContext.setNodeProperties(_2,_3,true)}else{_1=isc.addProperties({},_1);delete _1.validators;if(_1.userFormula&&!this.generateEditableFormulas)_1.canEditFormula=false;if(_1.userSummary&&!this.generateEditableSummaries)_1.canEditSummary=false;var _4={type:"ListGridField",defaults:_1},_5=this.editNode;_2=this.editContext.makeEditNode(_4);this.editContext.addNode(_2,_5)}},isc.A.getFieldNode=function isc_GridEditProxy_getFieldNode(_1){var _2=this.creator,_3=_2.editContext.getEditNodeTree(),_4=_3.getChildren(_3.findById(_2.ID)),_5=(isc.isA.TreeGrid(_2)?"TreeGridField":"ListGridField"),_6;var _7=0;for(var i=0;i<_4.length;i++){var _9=_4[i];if(_9.type!=_5){_7--;continue}
if(i+_7==_1){_6=_9;break}}
return _6},isc.A.getFieldNodeByName=function isc_GridEditProxy_getFieldNodeByName(_1){var _2=this.creator,_3=_2.editContext.getEditNodeTree(),_4=_3.getChildren(_3.findById(_2.ID)),_5;for(var i=0;i<_4.length;i++){var _7=_4[i];if(_7.name==_1){_5=_7;break}}
return _5},isc.A.getFieldNodeIndexByName=function isc_GridEditProxy_getFieldNodeIndexByName(_1){var _2=this.creator,_3=_2.editContext.getEditNodeTree(),_4=_3.getChildren(_3.findById(_2.ID)),_5;for(var i=0;i<_4.length;i++){var _7=_4[i];if(_7.name==_1){_5=i;break}}
return _5},isc.A.addDefaultFieldEditNodes=function isc_GridEditProxy_addDefaultFieldEditNodes(){var _1=this.creator;if(!isc.$75u){if(!this.getFieldNode(0)){var _2=_1.getAllFields();for(var i=0;i<_2.length;i++){var _4=_2[i],_5=_1.editProxy.makeFieldPaletteNode(_1.editContext,_4,_1.getDataSource()),_6=_1.editContext.makeEditNode(_5);_1.editContext.addNode(_6,_1.editNode,i,null,true)}}}},isc.A.createDefaultTreeFieldEditNode=function isc_GridEditProxy_createDefaultTreeFieldEditNode(){if(isc.$75u)return;var _1=this.creator;if(_1.dataSource)return;var _2=_1.fields;if(!_2)return;for(var i=0;i<_2.length;i++){if(_2[i].name=="nodeTitle"){var _4={type:"TreeGridField",autoGen:true,defaults:{name:_2[i].name,title:_2[i].title}};var _5=_1.editContext.makeEditNode(_4);_1.editContext.addNode(_5,_1.editNode,null,null,true);return}}},isc.A.addField=function isc_GridEditProxy_addField(_1,_2){if(isc.$75u&&!this.clearedFieldsForAdd){this.creator.setFields([_1]);this.clearedFieldsForAdd=true}else{this.creator.Super("addField",arguments)}
if(isc.$75u){if(_1.treeField){var _3=this.creator.getFields();for(var i=0;i<_3.length;i++){if(_3[i].name!=_1.name&&_3[i].treeField){this.creator.removeField(_3[i]);break}}}}},isc.A.setDataSource=function isc_GridEditProxy_setDataSource(_1,_2,_3){if(!isc.isA.TreeGrid(_4)){this.Super("setDataSource",arguments);return}
if(isc.$75u){this.creator.setDataSource(_1,_2);return}
var _4=this.creator;if(_1==null)return;if(_1==_4.dataSource&&!_3)return;var _2=_4.getFields();if(_2){for(var i=0;i<_2.length;i++){var _6=_2[i];if(_6.treeField){_6.treeField=null;var _7=_6.editNode;break}}}
var _8=_4.getFields();_8.remove(_6);var _9,_2=_1.fields;if(_2&&isc.getKeys(_2).length==1&&_1.fieldIsComplexType(_2[isc.firstKey(_2)].name))
{_9=_1.getSchema(_2[isc.firstKey(_2)].type)}else{_9=_1}
var _2=_9.getFields(),_10=_1.titleField;if(!isc.isAn.Array(_2))_2=isc.getValues(_2);for(var _11=0;_11<_2.length;_11++){if(!this.shouldUseField(_2[_11],_1))continue;if(_10==null||_10==_2[_11].name){var _12=_2[_11];break}}
if(_12)_8.addAt(_12,0);this.baseSetDataSource(_1,_8);var _13=_4.editProxy.makeFieldPaletteNode(_4.editContext,_12,_9);_13.defaults.treeField=true;var _14=_4.editContext.makeEditNode(_13);_4.editContext.addNode(_14,_4.editNode,0,null);if(_7)_4.editContext.removeNode(_7,true)},isc.A.getInlineEditText=function isc_GridEditProxy_getInlineEditText(){var _1=this.creator;if(_1.dataSource){var _2=isc.DS.get(_1.dataSource);if(isc.isA.MockDataSource(_2)){return _2.mockData.replace(/\\/g,"\\").replace(/^\[(.*)\]$/m,"{$1}")}}
return null},isc.A.setInlineEditText=function isc_GridEditProxy_setInlineEditText(_1){var _2=this.creator;if(!_1)_1="";var _3=isc.isA.TreeGrid(this.creator);_1=(_3?_1.trim():_1.trim().replace(/\\/g,"\\").replace("{","[").replace("}","]"));var _4={mockData:_1,mockDataType:(_3?"tree":"grid")};if(_2.dataSource){var _5=isc.DS.get(_2.dataSource);if(_5.fieldNamingConvention){_4.fieldNamingConvention=_5.fieldNamingConvention}}
var _6=isc.MockDataSource.create(_4);var _7=_6.applyGridSettings();delete _7.dataSource;var _8={type:"MockDataSource",defaults:isc.addProperties({},_4,{fields:_6.fields,cacheData:_6.cacheData})};var _9=this.creator.editContext,_10=this.creator.getSort();if(!_7.sortField&&_10&&_10.length>0){_9.removeNodeProperties(this.creator.editNode,["sortField","sortDirection"]);this.creator.clearSort()}else if(_7.sortField){this.creator.setSort({property:_7.sortField,direction:_7.sortDirection||"ascending"})}
_9.setNodeProperties(this.creator.editNode,_7);var _9=this.creator.editContext;var _11=_9.getEditNodeTree(),_12=_11.getChildren(this.creator.editNode);if(_12&&_12.length>0){for(var i=0;i<_12.length;i++){if(isc.isA.DataSource(_12[i].liveObject)){_9.removeNode(_12[i]);break}}
_12=_11.getChildren(this.creator.editNode);for(var i=_12.length-1;i>=0;i--){if(_12[i])_9.removeNode(_12[i])}}
var _14=_9.makeEditNode(_8);_9.addNode(_14,this.creator.editNode);if(this.creator.autoFetchData)this.creator.fetchData()},isc.A.createInlineEditForm=function isc_GridEditProxy_createInlineEditForm(){var _1=(this.creator.dataSource?isc.DS.get(this.creator.dataSource):null),_2=(this.creator.dataSource&&isc.isA.MockDataSource(this.creator.dataSource)),_3=true,_4=this.creator.editContext.getEditNodeTree(),_5=_4.getChildren(this.creator.editNode);if(_2){for(var i=0;i<_5.length;i++){var _7=_5[i];if(_7.ID==_1.ID){_3=!_7.referenceInProject;break}}}
if(this.creator.editContext.isVisualBuilder&&this.creator.dataSource&&(!_2||!_3))
{var _8=this.creator.editContext.creator.creator;var _9=[{name:"editDataSourceButton",type:"button",title:"View / Edit DataSource",endRow:false,click:function(_10,_11){if(_8.showDSEditor)_8.showDSEditor(_1);_10.dismissEditor()}}];var _10=this.createAutoChild("inlineEditForm",{margin:0,padding:10,cellPadding:5,fields:_9,numCols:2,click:function(){this.dismissEditor()},dismissEditor:function(){this.hide()}});return _10}else{return this.Super("createInlineEditForm",arguments)}});isc.B._maxIndex=isc.C+26;isc.defineClass("PortletEditProxy","EditProxy");isc.A=isc.PortletEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.canAdd=function isc_PortletEditProxy_canAdd(_1){if(_1=="Portlet")return null;return this.Super("canAdd",arguments)},isc.A.drop=function isc_PortletEditProxy_drop(){return null},isc.A.dropMove=function isc_PortletEditProxy_dropMove(){return null},isc.A.dropOver=function isc_PortletEditProxy_dropOver(){return null});isc.B._maxIndex=isc.C+4;isc.defineClass("PortalRowEditProxy","LayoutEditProxy");isc.A=isc.PortalRowEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.dropMove=function isc_PortalRowEditProxy_dropMove(){return this.creator.dropMove()},isc.A.dropOver=function isc_PortalRowEditProxy_dropOver(){return this.creator.dropOver()},isc.A.drop=function isc_PortalRowEditProxy_drop(){return this.creator.drop()});isc.B._maxIndex=isc.C+3;isc.defineClass("PortalLayoutEditProxy","LayoutEditProxy");isc.A=isc.PortalLayoutEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.canAdd=function isc_PortalLayoutEditProxy_canAdd(_1){var _2=this.Super("canAdd",_1);return _2||false});isc.B._maxIndex=isc.C+1;isc.defineClass("PortalColumnEditProxy","LayoutEditProxy");isc.A=isc.PortalColumnEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.canAdd=function isc_PortalColumnEditProxy_canAdd(_1){return null},isc.A.drop=function isc_PortalColumnEditProxy_drop(){return null},isc.A.dropMove=function isc_PortalColumnEditProxy_dropMove(){return null},isc.A.dropOver=function isc_PortalColumnEditProxy_dropOver(){return null});isc.B._maxIndex=isc.C+4;isc.defineClass("DrawPaneEditProxy","CanvasEditProxy");isc.A=isc.DrawPaneEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.setEditMode=function isc_DrawPaneEditProxy_setEditMode(_1){this.Super("setEditMode",arguments);var _2=this.creator.editContext.getEditNodeArray().getProperty("liveObject");_2.callMethod("setEditMode",_1,this.creator.editContext);if(!_1)this.creator.editContext.deselectAllComponents()},isc.A.destroy=function isc_DrawPaneEditProxy_destroy(){if(this.$1367){isc.Page.clearEvent("keyPress",this.$1367);delete this.$1367}
this.Super("destroy",arguments)},isc.A.drop=function isc_DrawPaneEditProxy_drop(){var _1=this.creator,_2=_1.ns.EH.getDragTarget();if(!isc.isA.Palette(_2)){return _1.drop.apply(arguments)}
var _3=_2.transferDragData(),_4=(isc.isAn.Array(_3)?_3[0]:_3);if(!_4)return false;var _5=_1.editContext.makeEditNode(_4);if(!_5)return false;var _6=this;_1.editContext.requestLiveObject(_5,function(_5){if(_5){var _7;if(isc.isA.DrawPane(_1)){_7=_1.editContext.addNode(_5,_1.editNode)}else{var _8;if(!_2.isA("Palette")){if(_2.isA("FormItemProxyCanvas")){_2=_2.formItem}
_8=_2._constructor||_2.Class}else{_4.dropped=true;_8=_4.type||_4.className}
var _9=this.findEditNode(_8);if(_9){_9=_9.editNode}
_7=_1.editContext.addWithWrapper(_5,_9,true)}
_7.liveObject.moveTo(_1.getOffsetX(),_1.getOffsetY());if(_6.canSelectChildren&&_7.liveObject.editProxy.canSelect!=false){_1.editContext.selectSingleComponent(_7.liveObject);_6.creator.focus()}}},_2);return isc.EventHandler.STOP_BUBBLING},isc.A.selectedEditNodesUpdated=function isc_DrawPaneEditProxy_selectedEditNodesUpdated(_1,_2){if(_2!=null&&_2.length==1){this.enableKeyMovement(true);var _3=_1.liveObject;if(this.$1474!=null&&_3!=this.$1474){this.ignore(this.$1474.editProxy,"startInlineEditing");this.ignore(this.$1474.editProxy,"inlineEditingComplete")}
this.observe(_3.editProxy,"startInlineEditing","observer.editingStarted()");this.observe(_3.editProxy,"inlineEditingComplete","observer.editingComplete()");this.$1474=_3}else if(_2==null||_2.length!=1){if(this.$1474){this.ignore(this.$1474.editProxy,"startInlineEditing");this.ignore(this.$1474.editProxy,"inlineEditingComplete");this.$1474=null}
this.enableKeyMovement(false)}},isc.A.enableKeyMovement=function isc_DrawPaneEditProxy_enableKeyMovement(_1){if(_1){if(!this.$1367){this.$1367=isc.Page.setEvent("keyPress",this)}}else{if(this.$1367){isc.Page.clearEvent("keyPress",this.$1367);delete this.$1367}}},isc.A.editingStarted=function isc_DrawPaneEditProxy_editingStarted(){this.enableKeyMovement(false)},isc.A.editingComplete=function isc_DrawPaneEditProxy_editingComplete(){this.enableKeyMovement(true);this.creator.focus()},isc.A.pageKeyPress=function isc_DrawPaneEditProxy_pageKeyPress(_1,_2){if(!this.creator.isVisible())return;var _3=this.ns.EH,_4=_3.getKey(),_5=_3.getKeyEventCharacter(),_6=_4==="Enter",_7=_4==="Backspace",_8=this.creator,_9=_8.editContext.getSelectedComponents();if(_9.length!=1)return;var _10=_8.editContext.getRootEditNode().liveObject;if(!_10.containsFocus())return;var _11=_9[0];if(isc.isA.AlphaNumericChar(_5)||_6||_7){var _12=_11.editProxy.inlineEditEvent;if(_12==="dblOrKeypress"){_11.editProxy.startInlineEditing(_6||_7?null:_5,_4);return false}}else{var _1=_11,_13=_3.shiftKeyDown(),_14=(_13?1:_1.drawPane.snapVGap),_15=(_13?1:_1.drawPane.snapHGap),_16=false;switch(_4){case"Arrow_Up":_1.moveBy(0,_14*-1);break;case"Arrow_Down":_1.moveBy(0,_14);break;case"Arrow_Left":_1.moveBy(_15*-1,0);break;case"Arrow_Right":_1.moveBy(_15,0);break;default:_16=null;break}
return _16}});isc.B._maxIndex=isc.C+8;isc.defineClass("DrawItemEditProxy","EditProxy");isc.A=isc.DrawItemEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.supportsInlineEdit=true;isc.B.push(isc.A.getOverrideProperties=function isc_DrawItemEditProxy_getOverrideProperties(){var _1=this.Super("getOverrideProperties",arguments);isc.addProperties(_1,{canDrag:true,cursor:"move"});return _1},isc.A.showEditMask=function isc_DrawItemEditProxy_showEditMask(){this.logWarn("showEditMask called on DrawItem EditProxy - ignored")},isc.A.hideEditMask=function isc_DrawItemEditProxy_hideEditMask(){this.logWarn("hideEditMask called on DrawItem EditProxy - ignored")},isc.A.showSelectedAppearance=function isc_DrawItemEditProxy_showSelectedAppearance(_1){var _2=this.creator;if(_1){var _3=_2.$137g;if(!_3&&_2.getSupportedKnobs){_3=_2.getSupportedKnobs();if(_3)_3.remove("move");_2.$137g=_3}
if(_2.showKnobs)_2.showKnobs(_3);if(_2.bringToFront)_2.bringToFront()}else{_2.hideAllKnobs()}},isc.A.click=function isc_DrawItemEditProxy_click(){var _1=this.creator;if(_1.drawPane.editProxy.canSelectChildren&&this.canSelect!=false){_1.editContext.selectSingleComponent(_1)}
return isc.EH.STOP_BUBBLING},isc.A.dragStart=function isc_DrawItemEditProxy_dragStart(_1,_2){var _3=this.creator;if(!_3.drawPane.editProxy.canSelectChildren||this.canSelect==false){return false}
if(_3.bringToFront)_3.bringToFront();_3.dragStart(_1,_2)},isc.A.dragMove=function isc_DrawItemEditProxy_dragMove(_1,_2,_3){this.creator.dragMove(_1,_2,_3)},isc.A.dragStop=function isc_DrawItemEditProxy_dragStop(_1,_2){var _3=this.creator;_3.dragStop(_1,_2);if(_3.drawPane.editProxy.canSelectChildren&&_3.editProxy.canSelect!=false&&!_3.editContext.isComponentSelected(_3))
{_3.editContext.selectSingleComponent(_3)}},isc.A.getInlineEditText=function isc_DrawItemEditProxy_getInlineEditText(){return this.creator.title},isc.A.setInlineEditText=function isc_DrawItemEditProxy_setInlineEditText(_1){this.creator.editContext.setNodeProperties(this.creator.editNode,{title:!_1?null:_1})});isc.B._maxIndex=isc.C+10;isc.defineClass("DrawLabelEditProxy","DrawItemEditProxy");isc.A=isc.DrawLabelEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.inlineEditMultiline=true;isc.B.push(isc.A.getInlineEditText=function isc_DrawLabelEditProxy_getInlineEditText(){return this.creator.contents},isc.A.setInlineEditText=function isc_DrawLabelEditProxy_setInlineEditText(_1){this.creator.editContext.setNodeProperties(this.creator.editNode,{contents:_1})});isc.B._maxIndex=isc.C+2;isc.defineClass("FacetChartEditProxy","DrawPaneEditProxy");isc.A=isc.FacetChartEditProxy.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.inlineEditMultiline=true;isc.A.dataSeparatorChar=",";isc.A.dataDisplaySeparatorChar=":";isc.A.dataEscapeChar="\\";isc.B.push(isc.A.getInlineEditText=function isc_FacetChartEditProxy_getInlineEditText(){var _1=this.creator,_2="series";var _3="";if(_1.title)_3+="== "+_1.title+"\n";var _4=_1.facets,_5=[],_6=[];for(var i=0;i<_4.length;i++){if(_4[i].inlinedValues){var _8=_4[i].values;for(var j=0;j<_8.length;j++){var _10=_8[j];_5.add(_10.id);_6.add(_10.title||_10.id)}}}
var _11=_1.data,_12=(_1.showDataLabels==false);for(var i=0;i<_11.length;i++){var _13=_11[i][_2];if(_13)_3+="-- "+_13+"\n";var _14="";for(var j=0;j<_5.length;j++){var _10=_11[i][_5[j]];if(_14.length>0)_14+=this.dataSeparatorChar;if(_12)_14+=_10;else _14+=_6[j]+this.dataDisplaySeparatorChar+_10}
_3+=_14+"\n"}
return _3},isc.A.setInlineEditText=function isc_FacetChartEditProxy_setInlineEditText(_1){var _2="series",_3=_1.split("\n"),_4,_5,_6,_7=[],_8=[],_9=true,_10=true;for(var i=0;i<_3.length;i++){var _12=_3[i];if(!_12)continue;_12=_12.trim();if(_12.length==0)continue;if(_12.startsWith("==")||_12.startsWith("--")){if(_4)_5=_4;_4=_12.substring(2).trim()}else{var _13=isc.EditProxy.parseStringValueMap(_12,this.dataSeparatorChar,this.dataEscapeChar,this.dataDisplaySeparatorChar);var _14=_13.valueMap;if(!_6){_6=[];if(isc.isAn.Array(_14)){for(var j=0;j<_14.length;j++){_6.add("value"+j)}
_10=false}else{for(var _16 in _14){_6.add(_16)}}
var _17={inlinedValues:true,values:[]};for(var j=0;j<_6.length;j++){_17.values.add({id:_6[j].toLowerCase(),title:_6[j]});_6[j]=_6[j].toLowerCase()}
_7.add(_17);_7.add({id:_2})}
var _18={};_18[_2]=_4||"";if(!_4)_9=false;if(isc.isAn.Array(_14)){for(var j=0;j<_6.length;j++){var _19=_6[j];_18[_19]=parseFloat(_14[j])||0}}else{for(var _16 in _14){if(_6.contains(_16.toLowerCase())){_18[_16.toLowerCase()]=parseFloat(_14[_16])}}
for(var j=0;j<_6.length;j++){var _19=_6[j];if(_18[_19]==null)_18[_19]=0}}
_8.add(_18);_4=null}}
if(_8.length<=1){_9=false;if(!_5&&_8.length==1&&_8[0][_2]!=_2){_5=_8[0][_2]}}
this.creator.editContext.setNodeProperties(this.creator.editNode,{title:_5,showLegend:_9,showDataLabels:_10,facets:_7,data:_8})});isc.B._maxIndex=isc.C+2;if(isc.DynamicForm){isc.defineClass("PropertySheet","DynamicForm");isc.A=isc.PropertySheet.getPrototype();isc.A.autoChildItems=true;isc.A.browserSpellCheck=false;isc.A.autoChildDefaults={cellStyle:"propSheetValue",titleStyle:"propSheetTitle",showHint:false};isc.A.GroupItemDefaults={cellStyle:null};isc.A.ExpressionItemDefaults={width:"*",height:18,showActionIcon:true};isc.A.ActionMenuItemDefaults={width:"*",height:18};isc.A.SelectItemDefaults={height:20,width:"*"};isc.A.DateItemDefaults={width:"*"};isc.A.TextItemDefaults={width:"*",height:20};isc.A.StaticTextItemDefaults={width:"*",height:20,textBoxStyle:"propSheetField"};isc.A.ColorItemDefaults={width:"*",height:16,pickerIconHeight:16,pickerIconWidth:16,pickerIconSrc:"[SKIN]/DynamicForm/PropSheet_ColorPicker_icon.png",textBoxStyle:"propSheetField"};isc.A.HeaderItemDefaults={cellStyle:"propSheetHeading"};isc.A.TextAreaItemProperties={width:"*"};isc.A.CheckboxItemDefaults={showTitle:true,showLabel:false,getTitleHTML:function(){if(this[this.form.titleField]!=null)return this[this.form.titleField];return this[this.form.fieldIdProperty]}};isc.A.SectionItemDefaults={cellStyle:"propSheetSectionHeaderCell"};isc.A.titleAlign="left";isc.A.titleWidth=120;isc.A.cellSpacing=0;isc.A.cellPadding=0;isc.A.backgroundColor="white";isc.A.requiredTitlePrefix="<span style='color:green'>";isc.A.requiredTitleSuffix="</span>";isc.A.titleSuffix="";isc.A.clipItemTitles=true}
if(isc.ListGrid&&isc.DynamicForm){isc.defineClass("ListEditor",isc.Layout);isc.A=isc.ListEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.vertical=false;isc.A.gridConstructor=isc.ListGrid;isc.A.gridDefaults={editEvent:"click",listEndEditAction:"next",autoParent:"gridLayout",selectionType:isc.Selection.SINGLE,recordClick:"this.creator.recordClick(record)",editorEnter:"if (this.creator.moreButton) this.creator.moreButton.enable()",selectionChanged:function(){if(this.anySelected()&&this.creator.moreButton){this.creator.moreButton.enable()}},contextMenu:{data:[{title:"Remove",click:"target.creator.removeRecord()"}]}};isc.A.gridButtonsDefaults={_constructor:isc.HLayout,autoParent:"gridLayout",height:10,width:10,layoutMargin:6,membersMargin:10,overflow:isc.Canvas.VISIBLE};isc.A.newButtonTitle="New";isc.A.newButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"gridButtons",click:"this.creator.newRecord()"};isc.A.moreButtonTitle="More..";isc.A.moreButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"gridButtons",click:"this.creator.editMore()",disabled:true};isc.A.removeButtonTitle="Remove";isc.A.removeButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"gridButtons",click:"this.creator.removeRecord()"};isc.A.formDefaults={_constructor:isc.DynamicForm,autoParent:"formLayout",overflow:isc.Canvas.AUTO};isc.A.formButtonsDefaults={_constructor:isc.HLayout,autoParent:"formLayout",height:10,width:10,layoutMargin:6,membersMargin:10,overflow:isc.Canvas.VISIBLE};isc.A.saveButtonTitle="Save";isc.A.saveButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"formButtons",click:"this.creator.saveRecord();"};isc.A.cancelButtonTitle="Cancel";isc.A.cancelButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"formButtons",click:"this.creator.cancelChanges()"};isc.A.resetButtonTitle="Reset";isc.A.resetButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"formButtons",click:"this.creator.form.resetValues()"};isc.A.gridLayoutDefaults={_constructor:isc.VLayout};isc.A.gridButtonsOrientation="left";isc.A.formLayoutDefaults={_constructor:isc.VLayout,autoFocus:true};isc.A.animateMembers=true;isc.A.membersMargin=10;isc.A.confirmLoseChangesMessage="Discard changes?";isc.A.formGroup=["formLayout","form","formButtons","saveButton","cancelButton","resetButton"];isc.A.gridButtonsGroup=["gridButtons","newButton","moreButton"];isc.B.push(isc.A.draw=function isc_ListEditor_draw(){if(isc.$cv)arguments.$cw=this;if(!this.readyToDraw())return this;return this.Super("draw",arguments)},isc.A.initWidget=function isc_ListEditor_initWidget(){this.Super("initWidget",arguments);if(!this.inlineEdit)this.showMoreButton=this.showMoreButton||false;this.addAutoChild("gridLayout");this.addAutoChild("grid",{_constructor:this.gridConstructor});this.addAutoChildren(this.gridButtonsGroup);this.addAutoChildren(this.formGroup)},isc.A.configureAutoChild=function isc_ListEditor_configureAutoChild(_1,_2){if(isc.isA.Button(_1))_1.title=this[_2+"Title"];if(_1==this.grid){_1.dataSource=this.dataSource;_1.fields=this.fields;_1.saveLocally=this.saveLocally;_1.canEdit=this.inlineEdit}
if(this.gridButtonsOrientation==isc.Canvas.RIGHT){if(_1==this.gridLayout)_1.vertical=false;if(_1==this.formLayout)_1.vertical=false;if(_1==this.gridButtons)_1.vertical=true;if(_1==this.formButtons)_1.vertical=true}
if(_1==this.form){_1.dataSource=this.dataSource;_1.fields=this.formFields}
if(this.inlineEdit){if(_1==this.formLayout)_1.visibility=isc.Canvas.HIDDEN}else{if(_1==this.gridLayout)_1.showResizeBar=true}},isc.A.setDataSource=function isc_ListEditor_setDataSource(_1,_2){this.dataSource=_1||this.dataSource;if(this.grid!=null){this.grid.setDataSource(_1,_2);this.form.setDataSource(_1,_2)}},isc.A.setData=function isc_ListEditor_setData(_1){if(_1==null)_1=[];if(_1.dataSource)this.setDataSource(_1.dataSource);if(this.grid!=null){this.grid.setData(_1);this.form.clearValues()}else{isc.addProperties(this.gridDefaults,this.gridProperties||{},{data:_1})}},isc.A.getData=function isc_ListEditor_getData(){if(this.inlineEdit)this.grid.endEditing();return this.grid.getData()},isc.A.cancelChanges=function isc_ListEditor_cancelChanges(){this.form.clearValues();this.showList()},isc.A.showList=function isc_ListEditor_showList(){if(this.inlineEdit){this.formLayout.animateHide({effect:"wipe",startFrom:"R"});this.gridLayout.animateShow({effect:"wipe",startFrom:"R"})}},isc.A.showForm=function isc_ListEditor_showForm(){if(this.inlineEdit){this.gridLayout.animateHide({effect:"wipe",startFrom:"R"});this.formLayout.animateShow({effect:"wipe",startFrom:"R"})}},isc.A.recordClick=function isc_ListEditor_recordClick(_1){if(this.inlineEdit)return;var _2=this;var _3=function(_4){if(_4){_2.currentRecord=_1;if(!_2.inlineEdit)_2.form.editRecord(_1);_2.form.setValues(isc.addProperties({},_2.grid.getSelectedRecord()))}}
if(!this.form.valuesHaveChanged())_3(true);else this.confirmLoseChanges(_3)},isc.A.getEditRecord=function isc_ListEditor_getEditRecord(){var _1=this.grid.getEditRow();if(_1!=null){return this.grid.getEditedRecord(_1)}else{return isc.addProperties({},this.grid.getSelectedRecord())}},isc.A.editMore=function isc_ListEditor_editMore(){this.currentRecord=this.getEditRecord();this.showForm();this.form.setValues(this.currentRecord)},isc.A.newRecord=function isc_ListEditor_newRecord(){if(this.inlineEdit)return this.grid.startEditingNew();var _1=this;var _2=function(_3){if(_3){_1.grid.deselectAllRecords();_1.showForm();_1.form.editNewRecord()}}
if(!this.form.valuesHaveChanged())_2(true);else this.confirmLoseChanges(_2)},isc.A.removeRecord=function isc_ListEditor_removeRecord(){this.form.clearValues();this.grid.removeSelectedData()},isc.A.saveRecord=function isc_ListEditor_saveRecord(){if(!this.form.validate())return false;var _1=this.form.getValues();this.showList();if(this.form.saveOperationType=="add"){this.grid.addData(_1)}else{if(this.inlineEdit&&this.grid.getEditRow()!=null){var _2=this.grid.getEditRow();if(this.grid.data[_2]!=null)this.grid.updateData(_1)
else this.grid.setEditValues(_2,_1)}else{this.grid.updateData(_1)}}
return true},isc.A.confirmLoseChanges=function isc_ListEditor_confirmLoseChanges(_1){isc.confirm(this.confirmLoseChangesMessage,_1)},isc.A.validate=function isc_ListEditor_validate(){if(this.form.isVisible()&&this.form.valuesHaveChanged()){return this.form.validate()}
return true});isc.B._maxIndex=isc.C+17}
isc.ClassFactory.defineClass("ViewLoader",isc.Label);isc.A=isc.ViewLoader.getPrototype();isc.A.loadingMessage="Loading View...&nbsp;${loadingImage}";isc.A.align=isc.Canvas.CENTER;isc.A.allowContentAndChildren=true;isc.A.httpMethod="GET";isc.A.useSimpleHttp=true;isc.A.transformXML=true;isc.A.overflow="hidden";isc.A=isc.ViewLoader.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.initWidget=function isc_ViewLoader_initWidget(){this.Super(this.$oc,arguments);if(this.placeholder)this.addChild(this.placeholder);else this.contents=this.getLoadingMessage()},isc.A.draw=function isc_ViewLoader_draw(){if(!this.readyToDraw())return this;this.Super("draw",arguments);if(this.view){this.addChild(this.view);this.view.show()}else if(this.viewURL&&!this.loadingView()){this.setViewURL()}
return this},isc.A.layoutChildren=function isc_ViewLoader_layoutChildren(){this.Super("layoutChildren",arguments);var _1=this.children;if(!_1||_1.length==0)return;var _2=this.children[0],_3=this.getWidth(),_4=this.getHeight();if(_2.$pn!=null)_3=null;if(_2.$po!=null)_4=null;_2.setRect(0,0,_3,_4)},isc.A.destroy=function isc_ViewLoader_destroy(){if(this.placeholder)this.placeholder.destroy();if(this.view)this.view.destroy();this.Super("destroy",arguments)},isc.A.setPlaceholder=function isc_ViewLoader_setPlaceholder(_1){if(this.placeholder)this.placeholder.destroy();this.placeholder=_1;this.addChild(_1);this.placeholder.sendToBack()},isc.A.setViewURL=function isc_ViewLoader_setViewURL(_1,_2,_3){if(_1!=null)this.viewURL=_1;_1=this.viewURL;if(this.placeholder){this.placeholder.show();this.placeholder.bringToFront()}
if(this.view!=null){this.view.hide();this.setContents(this.getLoadingMessage())}
var _4={},_5=this.useSimpleHttp,_6=this.httpMethod,_7=false;if(!isc.rpc.xmlHttpRequestAvailable()){this.logInfo("XMLHttpRequest not available, using frames comm and expecting RPCResponse");_4={};_5=false;_6="POST";_7=false}
var _8=isc.addProperties({showPrompt:false,actionURL:this.viewURL,httpMethod:_6,useSimpleHttp:_5,bypassCache:!this.allowCaching,params:isc.addProperties(_4,this.viewURLParams,_2)},this.viewRPCProperties,_3,{evalResult:_7,suppressAutoDraw:true,willHandleError:true,callback:"if(window."+this.getID()+")"+this.getID()+".$40p(rpcRequest, rpcResponse, data)"});if(!_8.evalVars)_8.evalVars={};_8.evalVars.viewLoader=this;this.$40t=isc.rpc.sendProxied(_8,true).transactionNum},isc.A.loadingView=function isc_ViewLoader_loadingView(){return this.$40t!=null},isc.A.$40p=function isc_ViewLoader__loadViewReply(_1,_2,_3){if(_1.transactionNum!=this.$40t){return}
delete this.$40t;this.$40q=false;if(_2.status!=isc.RPCResponse.STATUS_SUCCESS){if(this.handleError(_1,_2)===false)return}
try{if(_1.actionURL.endsWith(".xml")&&this.transformXML){var _4=isc.Canvas._canvasList;var _5=_4.length;isc.xml.toComponents(_3);if(!this.$40q){for(var i=_4.length;i>=_5;i--){var _7=_4[i];if(_7!=null&&isc.isA.Canvas(_7)&&_7.parentElement==null&&_7.masterElement==null)
{this.setView(this.transformView(_7));break}}}
this.$40r()}else{var _8=this;isc.Class.globalEvalWithCapture(_3,function(_9,_10){isc.Log.logWarn("firing the callback from global eval with...");isc.Log.logWarn('viewLoader is:'+_8);if(_10){_8.handleError(_1,_2,_10)}else{_8.$40r(_9)}},_1.evalVars)}}catch(e){this.handleError(_1,_2,e)}},isc.A.$40r=function isc_ViewLoader__loadViewReplyComplete(_1){if(!this.$40q&&_1){for(var i=_1.length;i>=0;i--){var _3=_1[i];var _4=window[_3];if(_4&&isc.isA.Canvas(_4)&&!_4.canvasItem&&_4.parentElement==null&&_4.masterElement==null)
{this.setView(this.transformView(_4));break}}}
if(!this.$40q){this.logWarn("setView() not explicitly called by loaded view and could not be autodetected for view: "+this.getID())}
this.viewLoaded(this.view)},isc.A.transformView=function isc_ViewLoader_transformView(_1){return _1},isc.A.handleError=function isc_ViewLoader_handleError(_1,_2,_3){this.logWarn("ViewLoader received bad response:\n"+isc.echo(_2.data));this.setView(isc.Label.create({contents:_3?_3.toString():_2.data}));return false},isc.A.setView=function isc_ViewLoader_setView(_1){if(_1!=null&&_1==this.view)return;this.$40q=true;this.setContents("&nbsp;");if(this.view)this.view.destroy();this.view=_1;if(_1==null)return;this.addChild(_1,null,false);this.layoutChildren();_1.draw();this.logInfo("showing view: "+_1);if(this.placeholder)this.placeholder.hide();this.contents="&nbsp;"},isc.A.getView=function isc_ViewLoader_getView(){return this.view},isc.A.viewLoaded=function isc_ViewLoader_viewLoaded(_1){},isc.A.getLoadingMessage=function isc_ViewLoader_getLoadingMessage(){return this.loadingMessage==null?"&nbsp;":this.loadingMessage.evalDynamicString(this,{loadingImage:this.imgHTML(isc.Canvas.loadingImageSrc,isc.Canvas.loadingImageSize,isc.Canvas.loadingImageSize)})});isc.B._maxIndex=isc.C+15;isc.ClassFactory.defineClass("HTMLFlow","Canvas","DataBoundComponent");isc.A=isc.HTMLFlow;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$49v=0;isc.A.$49w=[];isc.B.push(isc.A.executeScript=function isc_c_HTMLFlow_executeScript(_1,_2,_3){this.$49w[this.$49v]={callback:_2,displayErrors:_3};this.$49v++;this.getScript(_1,"isc.HTMLFlow.$49x("+this.$49v+",htmlFragments, scripts);")},isc.A.$49x=function isc_c_HTMLFlow__completeExecuteScript(_1,_2,_3){var _4=this.$49w[_1];delete this.$49w[_1];var _5=true;for(var i=0;i<this.$49w.length;i++){if(this.$49w[i]!=null){_5=false;break}}
if(_5)this.$49v=0;isc.Class.globalEvalWithCapture(_3,_4.callback,null,_4.displayErrors)},isc.A.getScript=function isc_c_HTMLFlow_getScript(_1,_2,_3,_4){var _5=_1;var _6,_7,_8,_9;while((_6=_1.match(/<!--/i))!=null){_7=_1.match(/-->/i);if(_7==null||(_7.index<_6.index)){this.logWarn('HTMLFlow content contains an opening comment tag "<!--" with no closing tag "-->", or vice versa. We recommend you review this HTML (original HTML follows):\n'+_5);if(_7){_8=_7.index;_9=_8+3}else{_8=_6.index;_9=_8+4}}else{_8=_6.index;_9=_7.index+3}
_1=_1.slice(0,_8)+_1.slice(_9,_1.length)}
var _10=[];var _11=[];var _12=[];var _13=_1;_1=null;var _14;while((_14=_13.match(/(<script([^>]*)?>)/i))!=null){var _15=_14[1];_12.add(_13.slice(0,_14.index));_10.add(null);_11.add(null);_13=_13.slice(_14.index+_15.length,_13.length)
var _16=_13.match(/<\/script>/i),_17=_13.match(/(<script([^>]*)?>)/i);if(_16==null||(_17&&(_16.index>_17.index))){this.logWarn("HTMLFlow content contains an opening <script ...> tag with no closing tag, or vice versa. Stripping out this tag:"+_15);continue}
var _18=_13.slice(0,_16.index);_13=_13.slice(_16.index+9,_13.length);var _19=(_15.match(/<script\s*(language|type)/i)==null)||(_15.match(/<script\s*(language|type)\s*=["']?[^'"]*(javascript|ecmascript|jscript)[^'"]*["']?/i)
!=null);if(!this.shouldLoadScript(_15))continue;if(_19){var _20;if((_20=_15.match(/src=('|")?([^'"> ]*)/i))){_11.add(_20[2]);_10.add(null)}else{if(!isc.isA.String(_18)||isc.isAn.emptyString(_18))continue;_10.add(_18);_11.add(null)}
_12.add(null)}else{this.logWarn("html to be evaluated contains non-JS script tags - these will be ignored.  Tag: "+_15)}}
if(_12.length==0)
_12=[_13];else
_12.push(_13);if(_11.length>0&&!_4){if(isc.RPCManager){var _21=false;for(var i=0;i<_11.length;i++){if(_11[i]==null){continue}
isc.RPCManager.sendRequest({actionURL:_11[i],serverOutputAsString:true,httpMethod:"GET",internalClientContext:{scriptIndex:i,scripts:_10,scriptIncludes:_11,callback:_2,htmlFragments:(_3?_12:[_5])},callback:"isc.HTMLFlow.loadedRemoteScriptBlock(data, rpcResponse.internalClientContext)"});_21=true}
if(_21)return}else{this.logWarn("html contains <script src=> blocks with the following target URLs: "+_11+" If you want these to be dynamically loaded, please include the DataBinding module or include the contents of these files in inline <script> blocks.")}}
var _23=_10.join("\n");this.fireCallback(_2,"htmlFragments,dontFetchScripts,scripts",[(_3?_12:[_5]),_4,_10])},isc.A.shouldLoadScript=function isc_c_HTMLFlow_shouldLoadScript(_1){var _2=_1.match(/ISC_([^.]*)\.js/i);if(_2&&isc["module_"+_2[1]])return false;var _2=_1.match(/load_skin\.js/i);if(_2)return false;return true},isc.A.loadedRemoteScriptBlock=function isc_c_HTMLFlow_loadedRemoteScriptBlock(_1,_2){var _3=_2.scriptIndex,_4=_2.scripts,_5=_2.scriptIncludes;_4[_3]=_1;delete _5[_3];for(var i=0;i<_5.length;i++){if(_5[i]!=null)return}
this.fireCallback(_2.callback,"htmlFragments,dontFetchScripts,scripts",[_2.htmlFragments,false,_4])});isc.B._maxIndex=isc.C+5;isc.A=isc.HTMLFlow.getPrototype();isc.A.defaultWidth=200;isc.A.defaultHeight=1;isc.A.allowContentAndChildren=true;isc.A.cursor="auto";isc.A.loadingMessage="&nbsp;${loadingImage}";isc.A.httpMethod="GET";isc.A.useSimpleHttp=true;isc.A.evalScriptBlocks=null;isc.A.captureSCComponents=true;isc.A=isc.HTMLFlow.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$525=0;isc.B.push(isc.A.initWidget=function isc_HTMLFlow_initWidget(){if(this.contentsType=="page"&&this.overflow=="visible")this.setOverflow("auto")},isc.A.draw=function isc_HTMLFlow_draw(){if(!this.readyToDraw())return this;this.Super("draw",arguments);var _1;if(this.containsIFrame())return this;else if(this.canSelectText===_1)this.canSelectText=true;if(this.contentsURL&&!(this.$533==this.contentsURL||this.loadingContent()))
{this.setContentsURL()}
return this},isc.A.setContentsURL=function isc_HTMLFlow_setContentsURL(_1,_2,_3){if(this.contentsType=="page"){return this.invokeSuper(isc.HTMLFlow,"setContentsURL",_1,_2)}
if(_1!=null)this.contentsURL=_1;if(this.loadingMessage){var _4=this.loadingMessage==null?"&nbsp;":this.loadingMessage.evalDynamicString(this,{loadingImage:this.imgHTML(isc.Canvas.loadingImageSrc,isc.Canvas.loadingImageSize,isc.Canvas.loadingImageSize)});this.$23j(_4)}
var _5=isc.addProperties({},this.contentsURLParams,_2),_6=this.useSimpleHttp,_7=this.httpMethod,_8=true;var _9=isc.addProperties({showPrompt:false,actionURL:this.contentsURL,httpMethod:_7,useSimpleHttp:_6,bypassCache:!this.allowCaching,params:_5},this.contentRPCProperties,_3,{willHandleError:true,serverOutputAsString:_8,callback:this.getID()+".$40s(rpcRequest, rpcResponse)"});this.$40t=isc.rpc.sendProxied(_9,true).transactionNum},isc.A.loadingContent=function isc_HTMLFlow_loadingContent(){return this.$40t!=null},isc.A.$40s=function isc_HTMLFlow__loadContentReply(_1,_2){var _3=_2.data;if(_2.status!=isc.RPCResponse.STATUS_SUCCESS){if(this.handleError(_1,_2)===false)return}
if(_1.transactionNum!=this.$40t){return}
this.$939(_3,(this.evalScriptBlocks==null?true:this.evalScriptBlocks))},isc.A.setContents=function isc_HTMLFlow_setContents(_1){if(_1!=null)this.contents=_1;this.$939(this.contents,(this.evalScriptBlocks==null?false:this.evalScriptBlocks))},isc.A.$23j=function isc_HTMLFlow__setContents(_1){this.Super("setContents",arguments)},isc.A.$939=function isc_HTMLFlow__evalContents(_1,_2){if(!_1)return;isc.HTMLFlow.getScript(_1,{target:this,methodName:"$49y"},true,!_2)},isc.A.fetchRelatedData=function isc_HTMLFlow_fetchRelatedData(_1,_2,_3,_4){var _5=this;this.invokeSuper(isc.HTMLFlow,"fetchRelatedData",_1,_2,function(_7,_8,_9){if(_8&&_8.length>0){var _6=isc.DS.get(_9.dataSource);if(_6.descriptionField){_5.setContents(_8[0][_6.descriptionField])}else{isc.logWarn("HTMLFlow.fetchRelatedData() called for DataSource '"+_9.dataSource+"' which does not have a descriptionField set.")}}
if(_3){_3(_7,_8,_9)}},_4)},isc.A.getData=function isc_HTMLFlow_getData(){return this.data},isc.A.$526=function isc_HTMLFlow__captureSCComponentsRelPos(_1){if(!_1.parentElement)this.addChild(_1);var _2="HTMLFlow"+this.$525++;_1.htmlElement=_2;var _3='<DIV id="'+_2+'"></DIV>';return _3},isc.A.$527=function isc_HTMLFlow__captureSCComponentsAbsPos(_1){if(!_1.parentElement)this.addChild(_1);return null},isc.A.$49y=function isc_HTMLFlow__setContentsAndExecute(_1,_2,_3){this.$23j(this.transformHTML(_1.join("")));if(_1.length>1){if(!(_2)){if(this.isDirty())this.redraw();if(this.captureSCComponents){this.$528=isc.Canvas.autoDraw;isc.setAutoDraw(false)}
for(var i=0;i<_1.length;i++){var _5=null;var _6=this;if(this.captureSCComponents)_5=function(_9,_10){if(!_9.length)return;_1[i]=_9.map(function(_11){var _7=window[_11];if(!_7||!isc.isA.Canvas(_7))return null;if(_7.position==isc.Canvas.RELATIVE)
return _6.$526(_7);else return _6.$527(_7)}).join("")};if(_3[i])isc.Class.globalEvalWithCapture(_3[i],_5)}
if(this.captureSCComponents){this.$23j(this.transformHTML(_1.join("")));if(this.$528){isc.setAutoDraw(true);for(var _8 in window)
if(isc.isA.Canvas(_8)&&_8.autoDraw)
_8.markForRedraw()}}}
else{this.logWarn("html returned by server appears to contain <script> blocks.  If you want these to be evaluated, you must set evalScriptBlocks:true.")}}
this.$40u()},isc.A.handleError=function isc_HTMLFlow_handleError(_1,_2){this.logWarn(_2.data)},isc.A.$40u=function isc_HTMLFlow__loadContentsReplyComplete(){this.$533=this.contentsURL;this.$40t=null;this.contentLoaded()},isc.A.transformHTML=function isc_HTMLFlow_transformHTML(_1){return _1},isc.A.contentLoaded=function isc_HTMLFlow_contentLoaded(){},isc.A.modifyContent=function isc_HTMLFlow_modifyContent(){},isc.A.handleKeyPress=function isc_HTMLFlow_handleKeyPress(_1,_2){if(!this.containsIFrame()&&this.selectContentOnSelectAll){var _3=this.ns.EH,_4=_1.keyName;if(_3.modifierKeyDown(_1)&&_4=="A"){if(isc.Browser.$120h){this.getWindow().getSelection().selectAllChildren(this.getHandle())}else{var _5=this.getDocumentBody(true);if(_5!=null&&_5.createTextRange!=null){var _6=_5.createTextRange();_6.moveToElementText(this.getHandle());_6.select()}}
return false}}
return this.Super("handleKeyPress",arguments)});isc.B._maxIndex=isc.C+19;isc.HTMLFlow.registerStringMethods({contentLoaded:""});isc.defineClass("HTMLPane",isc.HTMLFlow);isc.A=isc.HTMLPane.getPrototype();isc.A.overflow=isc.Canvas.AUTO;isc.A.defaultHeight=200;isc.defineClass("FacadeDataSource","DataSource");isc.A=isc.FacadeDataSource.getPrototype();isc.A.dataProtocol="clientCustom";isc.A.queueRequests=false;isc.A.queuedRequests=null;isc.A=isc.FacadeDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$79c=isc.Class.NO_OP;isc.B.push(isc.A.setQueueRequests=function isc_FacadeDataSource_setQueueRequests(_1){this.queueRequests=_1=!!_1;if(!_1){var _2=this.queuedRequests;if(_2!=null){delete this.queuedRequests;var _3=this.superDS();for(var i=0,_5=_2.length;i<_5;++i){_3.execute(_2[i])}}}},isc.A.clearQueue=function isc_FacadeDataSource_clearQueue(){if(this.queueRequests){this.setQueueRequests(false);this.setQueueRequests(true)}},isc.A.transformRequest=function isc_FacadeDataSource_transformRequest(_1){var _2=this;var _3=this.cloneDSRequest(_1,true);_3.showPrompt=false;_3.callback=function(_5,_6,_3){_2.processResponse(_1.requestId,_2.superDS().cloneDSResponse(_5))};if(!this.queueRequests){this.superDS().execute(_3)}else{var _4=this.queuedRequests;if(_4==null)_4=this.queuedRequests=[];_4.add(_3)}
return _1.data});isc.B._maxIndex=isc.C+3;isc.defineClass("WSDataSource","DataSource");isc.A=isc.WSDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.serviceNamespace="urn:operations.smartclient.com";isc.A.operationBindings=[{operationType:"fetch",wsOperation:"fetch",recordXPath:"//data/*"},{operationType:"add",wsOperation:"add",recordXPath:"//data/*"},{operationType:"remove",wsOperation:"remove",recordXPath:"//data/*"},{operationType:"update",wsOperation:"update",recordXPath:"//data/*"}];isc.B.push(isc.A.transformRequest=function isc_WSDataSource_transformRequest(_1){var _2={dataSource:_1.dataSource,operationType:_1.operationType,data:_1.data};if(_1.startRow!=null){_2.startRow=_1.startRow;_2.endRow=_1.endRow}
if(_1.textMatchStyle!=null)_2.textMatchStyle=_1.textMatchStyle;if(_1.operationId!=null)_2.operationId=_1.operationId;if(_1.sortBy!=null)_2.sortBy=_1.sortBy;return _2},isc.A.transformResponse=function isc_WSDataSource_transformResponse(_1,_2,_3){if(!_3||!_3.selectString)return;_1.status=_3.selectString("//status");if(isc.isA.String(_1.status)){var _4=isc.DSResponse[_1.status];if(_1.status==null){this.logWarn("Unable to map response code: "+_4+" to a DSResponse code, setting status to DSResponse.STATUS_FAILURE.");_4=isc.DSResponse.STATUS_FAILURE;_1.data=_3.selectString("//data")}else{_1.status=_4}}
if(_1.status==isc.DSResponse.STATUS_VALIDATION_ERROR){var _5=_3.selectNodes("//errors/*");_1.errors=isc.xml.toJS(_5,null,this)}
_1.totalRows=_3.selectNumber("//totalRows");_1.startRow=_3.selectNumber("//startRow");_1.endRow=_3.selectNumber("//endRow")});isc.B._maxIndex=isc.C+2;isc.defineClass("RestDataSource","DataSource");isc.A=isc.RestDataSource.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.serverType="generic";isc.A.dataFormat="xml";isc.A.xmlRecordXPath="/response/data/*";isc.A.xmlNamespaces={xsi:"http://www.w3.org/2001/XMLSchema-instance"};isc.A.jsonRecordXPath="/response/data";isc.A.prettyPrintJSON=true;isc.A.dataFormatParamName="isc_dataFormat";isc.A.jsonPrefix="<SCRIPT>//'\"]]>>isc_JSONResponseStart>>";isc.A.jsonSuffix="//isc_JSONResponseEnd";isc.A.operationBindings=[{operationType:"fetch",dataProtocol:"getParams"},{operationType:"add",dataProtocol:"postParams"},{operationType:"remove",dataProtocol:"postParams"},{operationType:"update",dataProtocol:"postParams"}];isc.A.sendMetaData=true;isc.A.metaDataPrefix="_";isc.B.push(isc.A.init=function isc_RestDataSource_init(){this.serverType="generic";this.recordXPath=this.recordXPath||(this.dataFormat=="xml"?this.xmlRecordXPath:this.jsonRecordXPath);return this.Super("init",arguments)},isc.A.getProperty=function isc_RestDataSource_getProperty(_1){if(_1=="fetchDataURL")return this.fetchDataURL;var _2=this.$dt(_1);if(_2)return this[_2]();return this[_1]},isc.A.getDataURL=function isc_RestDataSource_getDataURL(_1){var _2=_1.operationType;if(_2=="fetch"&&this.fetchDataURL!=null)
return this.fetchDataURL;if(_2=="update"&&this.updateDataURL!=null)
return this.updateDataURL;if(_2=="add"&&this.addDataURL!=null)
return this.addDataURL;if(_2=="remove"&&this.removeDataURL!=null)
return this.removeDataURL;return this.Super("getDataURL",arguments)},isc.A.getDataProtocol=function isc_RestDataSource_getDataProtocol(_1){var _2=this.Super("getDataProtocol",arguments);if(_2=="postXML")_2="postMessage";return _2},isc.A.transformRequest=function isc_RestDataSource_transformRequest(_1){var _2=this.getDataProtocol(_1);_1.isRestRequest=!(this.disableQueuing||this.clientOnly);_1.dataFormat=(this.clientOnly?"json":this.dataFormat);if(_2=="postMessage"){if(_1.params==null){_1.params={}}
_1.params[this.dataFormatParamName]=this.dataFormat;var _3={dataSource:this.getID()};if(_1.operationType!=null)_3.operationType=_1.operationType;if(_1.operationId!=null)_3.operationId=_1.operationId;if(_1.startRow!=null)_3.startRow=_1.startRow;if(_1.endRow!=null)_3.endRow=_1.endRow;if(_1.sortBy!=null)_3.sortBy=_1.sortBy;if(_1.textMatchStyle!=null)_3.textMatchStyle=_1.textMatchStyle;if(_1.parentNode!=null)_3.parentNode=isc.Tree.getCleanNodeData(_1.parentNode);if(_1.useStrictJSON!=null)_3.useStrictJSON=_1.useStrictJSON;if(this.sendClientContext)_3.clientContext=_1.clientContext;if(_1.componentId)_3.componentId=_1.componentId;if(isc.DataSource.get("$89s")==null){isc.DataSource.create({ID:"$89s",fields:[{name:"_constructor",xmlAttribute:false},{name:"criteria",multiple:true,type:"$89s",childTagName:"criterion"},{name:"oldValues"}]})}
var _4=isc.DataSource.create({fields:[{name:"data",type:"$89s"},{name:"oldValues"}]});if(this.autoConvertRelativeDates==true){if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Calling convertRelativeDates from getServiceInputs - data is\n\n"+isc.echoFull(_1.data))}
var _5=this.convertRelativeDates(_1.data);if(this.logIsInfoEnabled("relativeDates")){this.logInfo("Called convertRelativeDates from getServiceInputs - data is\n\n"+isc.echoFull(_5))}
_1.data=_5}
if(_1.summaryFunctions!=null)_3.summaryFunctions=_1.summaryFunctions;if(_1.groupBy!=null)_3.groupBy=_1.groupBy;_3.data=_1.data;_3.oldValues=_1.oldValues;if(!_1.contentType){_1.contentType=(this.dataFormat=="json"?"application/json":"text/xml")}
var _6;_1.$92v=_1.data;if(_1.dataFormat=="json"){if(_3.data!=null)_3.data=this.serializeFields(_3.data);if(_3.oldValues!=null)_3.oldValues=this.serializeFields(_3.oldValues);var _7={prettyPrint:this.prettyPrintJSON,trimMilliseconds:!!this.trimMilliseconds};_6=isc.JSON.encode(_3,_7)}else{var _8={ignoreConstructor:true,schema:this};_6=_4.xmlSerialize(_3,_8,null,"request")}
_4.destroy();return _6}else{if(_2!="getParams"&&_2!="postParams"){this.logWarn("RestDataSource operation:"+_1.operationID+", of type "+_1.operationType+" has dataProtocol specified as '"+_2+"'. Supported protocols are 'postParams', 'getParams' and 'postMessage' only. Defaulting to 'getParams'.");_1.dataProtocol='getParams'}
var _3=isc.addProperties({},_1.data,_1.params);if(_1.summaryFunctions!=null)_3.summaryFunctions=_1.summaryFunctions;if(_1.groupBy!=null)_3.groupBy=_1.groupBy;if(this.sendMetaData){if(!this.parameterNameMap){var _9={};_9[this.metaDataPrefix+"operationType"]="operationType";_9[this.metaDataPrefix+"operationId"]="operationId";_9[this.metaDataPrefix+"startRow"]="startRow";_9[this.metaDataPrefix+"endRow"]="endRow";_9[this.metaDataPrefix+"sortBy"]="sortBy";_9[this.metaDataPrefix+"useStrictJSON"]="useStrictJSON";_9[this.metaDataPrefix+"textMatchStyle"]="textMatchStyle";_9[this.metaDataPrefix+"oldValues"]="oldValues";_9[this.metaDataPrefix+"componentId"]="componentId";_9[this.metaDataPrefix+"parentNode"]="parentNode";this.parameterNameMap=_9}
for(var _10 in this.parameterNameMap){var _11=_1[this.parameterNameMap[_10]];if(_11!=null){if(_10=="$97q"){_3[_10]=isc.Tree.getCleanNodeData(_11)}else{_3[_10]=_11}}}
_3[this.metaDataPrefix+"dataSource"]=this.getID();_3["isc_metaDataPrefix"]=this.metaDataPrefix}
_3[this.dataFormatParamName]=this.dataFormat;return _3}},isc.A.getUpdatedData=function isc_RestDataSource_getUpdatedData(_1,_2,_3){var _4=_2?_2.data:null;if(_3&&(!_4||isc.isAn.emptyString(_4)||(isc.isA.Array(_4)&&_4.length==0))&&_2.status==0&&this.getDataProtocol(_1)=="postMessage")
{this.logInfo("dsResponse for successful operation of type "+_1.operationType+" did not return updated record[s]. Using submitted request data to update ResultSet cache.","ResultSet");var _5={},_6=_1.originalData;if(_6&&isc.isAn.Object(_6)){if(_1.operationType=="update"){_5=isc.addProperties({},_1.oldValues);if(isc.isAn.Array(_6)){_5=isc.addProperties(_5,_6[0])}else{_5=isc.addProperties(_5,_6)}
_5=[_5]}else{if(!isc.isAn.Array(_6))_6=[_6];_5=[];for(var i=0;i<_6.length;i++){_5[i]=isc.addProperties({},_6[i])}}
if(this.logIsDebugEnabled("ResultSet")){this.logDebug("Submitted data to be integrated into the cache:"+this.echoAll(_5),"ResultSet")}}
return _5}else{return this.Super("getUpdatedData",arguments)}},isc.A.getValidStatus=function isc_RestDataSource_getValidStatus(_1){if(isc.isA.String(_1)){if(parseInt(_1)==_1)_1=parseInt(_1);else{_1=isc.DSResponse[_1];if(_1==null){this.logWarn("Unable to map response code: "+_1+" to a DSResponse code, setting status to DSResponse.STATUS_FAILURE.");_1=isc.DSResponse.STATUS_FAILURE}}}
if(_1==null)_1=isc.DSResponse.STATUS_SUCCESS;return _1},isc.A.getValidInvalidateCache=function isc_RestDataSource_getValidInvalidateCache(_1){if(_1==null)return false;switch(_1.toLowerCase()){case"true":case"yes":case"1":return true;case"false":case"no":case"0":case null:return false;default:return Boolean(_1)}},isc.A.transformResponse=function isc_RestDataSource_transformResponse(_1,_2,_3){if(_1.status<0||!_3){_1.queueStatus=-1;return _1}
if(_2.dataFormat=="json"){if(isc.isAn.Array(_3)){var _4=_3.length==1&&_3[0]&&_3[0].response!=null;this.logWarn("RestDataSource transformResponse(): JSON response text is incorrectly formatted as an Array rather than a simple response object."+(_4?" Array contains a single entry which appears to be a validly formatted response object - using this.":""));if(_4)_3=_3[0]}else if(_3.response==null){this.logWarn("RestDataSouce transformResponse(): JSON response text does not appear to be in standard response format.")}
var _5=_3.response||{};_1.status=this.getValidStatus(_5.status);_1.invalidateCache=_5.invalidateCache==null?false:_5.invalidateCache;_1.queueStatus=this.getValidStatus(_5.queueStatus);if(_1.status==isc.DSResponse.STATUS_VALIDATION_ERROR){var _6=_5.errors;if(isc.isAn.Array(_6)){if(_6.length>1){this.logWarn("server returned an array of errors - ignoring all but the first one")}
_6=_6[0]}
_1.errors=_6;if(_5.data!=null)_1.data=_5.data}else if(_1.status<0){_1.data=_5.data;_1.totalRows=_1.startRow;_1.endRow=_1.startRow}
if(_5.totalRows!=null)_1.totalRows=_5.totalRows;if(_5.startRow!=null)_1.startRow=_5.startRow;if(_5.endRow!=null)_1.endRow=_5.endRow}else{if(_2.clientOnly)return _1;_1.status=this.getValidStatus(_3.selectString("//status"));_1.invalidateCache=this.getValidInvalidateCache(_3.selectString("//invalidateCache"));_1.queueStatus=this.getValidStatus(_3.selectString("//queueStatus"));if(_1.status==isc.DSResponse.STATUS_VALIDATION_ERROR){var _6=_3.selectNodes("//errors");_6=isc.xml.toJS(_6);if(_6.length>1){this.logWarn("server returned an array of errors - ignoring all but the first one")}
_6=_6[0];_1.errors=_6;var _7=_3.selectString("//data");if(_7)_1.data=_7}else if(_1.status<0){_1.data=_3.selectString("//data")}
var _8=_3.selectNumber("//totalRows");if(_8!=null)_1.totalRows=_8;var _9=_3.selectNumber("//startRow");if(_9!=null)_1.startRow=_9;var _10=_3.selectNumber("//endRow");if(_10!=null)_1.endRow=_10}
return _1},isc.A.shouldUseTestDataFetch=function isc_RestDataSource_shouldUseTestDataFetch(){return this.clientOnly==true&&this.cacheAllData!=true&&this.testFileName!=null},isc.A.hasTestData=function isc_RestDataSource_hasTestData(){return this.testFileName!=null},isc.A.getClientOnlyResponse=function isc_RestDataSource_getClientOnlyResponse(_1,_2){if(_1.$92v)_1.data=_1.$92v;var _3=this.Super("getClientOnlyResponse",arguments);if(!isc.isAn.Array(_3.data))_3.data=[_3.data];return _3});isc.B._maxIndex=isc.C+12;isc.DataSource.create({Constructor:"DataSource",allowAdvancedCriteria:true,addGlobalId:"false",ID:"DataSource",fields:[{type:"string",xmlAttribute:"true",name:"ID",validators:[]},{type:"string",xmlAttribute:"true",name:"autoIdField",validators:[]},{title:"Superclass",type:"string",name:"inheritsFrom",validators:[]},{type:"boolean",name:"useParentFieldOrder",validators:[]},{type:"boolean",name:"useLocalFieldsOnly",validators:[]},{type:"boolean",name:"restrictToParentFields",validators:[]},{valueMap:{custom:"Custom Binding",iscServer:"ISC Java Server",json:"JSON Web Service",xml:"XML / WSDL Web Service"},title:"DataFormat",type:"string",xmlAttribute:"true",name:"dataFormat",validators:[]},{type:"boolean",xmlAttribute:"true",name:"useStrictJSON",validators:[]},{type:"boolean",xmlAttribute:"true",name:"noAutoFetch",validators:[]},{valueMap:{exec:"executes a command external to the JVM",generic:"Requests will be delivered to the server and you are expected to write Java code to create a valid response",hibernate:"ISC Server Hibernate Connectors",jpa:"Use SmartClient's built-in JPA 2.0 connector",jpa1:"Use SmartClient's built-in JPA 1.0 connector",rest:"Server-side REST implementation",sql:"ISC Server SQL Connectors",stream:"DataSource connected to a messaging broker"},title:"Server Type",type:"string",xmlAttribute:"true",name:"serverType",validators:[]},{type:"string",xmlAttribute:"true",name:"schemaBean",validators:[]},{title:"Callback Parameter",type:"string",xmlAttribute:"true",name:"callbackParam",validators:[]},{type:"Object",name:"requestProperties",validators:[]},{childTagName:"field",multiple:"true",propertiesOnly:"true",type:"DataSourceField",name:"fields",validators:[]},{title:"Add Global ID",type:"boolean",name:"addGlobalId",validators:[]},{type:"boolean",name:"showPrompt",validators:[]},{title:"DataSource Version",type:"number",visibility:"internal",xmlAttribute:"true",name:"dataSourceVersion",validators:[]},{title:"Database Name",type:"string",xmlAttribute:"true",name:"dbName",validators:[]},{title:"Schema",type:"string",xmlAttribute:"true",name:"schema",validators:[]},{title:"Table Name",type:"string",xmlAttribute:"true",name:"tableName",validators:[]},{title:"Quote Table Name?",type:"boolean",xmlAttribute:"true",name:"quoteTableName",validators:[]},{type:"string",xmlAttribute:"true",name:"tableCode",validators:[]},{type:"boolean",xmlAttribute:"true",name:"strictSQLFiltering",validators:[]},{title:"Stream realtime updates for changes to this datasource?",type:"boolean",xmlAttribute:"true",name:"realtimeUpdates",validators:[]},{type:"ServerObject",name:"serverObject",validators:[]},{type:"string",name:"serverConstructor",validators:[]},{type:"Object",name:"serverConfig",validators:[]},{multiple:"true",type:"OperationBinding",name:"operationBindings",validators:[]},{hidden:"true",propertiesOnly:"true",type:"DataSourceField",moveTo:"fields",name:"field",validators:[]},{hidden:"true",type:"OperationBinding",moveTo:"operationBindings",name:"operationBinding",validators:[]},{type:"string",xmlAttribute:"true",name:"serviceNamespace",validators:[]},{type:"string",xmlAttribute:"true",name:"dataURL",validators:[]},{type:"string",xmlAttribute:"true",name:"dataProtocol",validators:[]},{type:"string",xmlAttribute:"true",name:"dataTransport",validators:[]},{type:"Object",name:"defaultParams",validators:[]},{type:"string",name:"soapAction",validators:[]},{type:"string",name:"jsonPrefix",validators:[]},{type:"string",name:"jsonSuffix",validators:[]},{type:"string",name:"messageTemplate",validators:[]},{propertiesOnly:"true",type:"Object",visibility:"internal",name:"defaultCriteria",validators:[]},{type:"string",visibility:"xmlBinding",name:"tagName",validators:[]},{type:"XPath",name:"recordXPath",validators:[]},{type:"string",name:"recordName",validators:[]},{type:"Object",name:"xmlNamespaces",validators:[]},{type:"boolean",name:"dropExtraFields",validators:[]},{type:"string",visibility:"internal",xmlAttribute:"true",name:"schemaNamespace",validators:[]},{type:"boolean",visibility:"internal",name:"mustQualify",validators:[]},{type:"boolean",visibility:"internal",name:"xsdSimpleContent",validators:[]},{type:"boolean",visibility:"internal",name:"xsdAnyElement",validators:[]},{type:"boolean",visibility:"internal",name:"xsdAbstract",validators:[]},{title:"Title",type:"string",name:"title",validators:[]},{title:"Title Field",type:"string",name:"titleField",validators:[]},{title:"Plural Title",type:"string",name:"pluralTitle",validators:[]},{title:"Client Only",type:"boolean",xmlAttribute:"true",name:"clientOnly",validators:[]},{title:"Test File Name",type:"URL",xmlAttribute:"true",name:"testFileName",validators:[]},{type:"URL",xmlAttribute:"true",name:"dbImportFileName",validators:[]},{multiple:"true",skipSerialization:"true",type:"Object",name:"testData",validators:[]},{multiple:"true",type:"Object",name:"cacheData",validators:[]},{type:"boolean",xmlAttribute:"true",name:"cacheAllData",validators:[]},{type:"boolean",xmlAttribute:"true",name:"cacheAcrossOperationIds",validators:[]},{type:"boolean",xmlAttribute:"true",name:"mockMode",validators:[]},{type:"integer",xmlAttribute:"true",name:"mockDataRows",validators:[]},{multiple:"true",type:"Criterion",name:"mockDataCriteria",validators:[]},{multiple:"true",propertiesOnly:"true",type:"DataSourceField",uniqueProperty:"ID",visibility:"internal",name:"types",validators:[]},{multiple:"true",type:"string",visibility:"internal",name:"groups",validators:[]},{multiple:"true",type:"MethodDeclaration",visibility:"internal",name:"methods",validators:[]},{type:"boolean",name:"showSuperClassActions",validators:[]},{type:"boolean",name:"createStandalone",validators:[]},{type:"boolean",name:"useFlatFields",validators:[]},{type:"boolean",xmlAttribute:"true",name:"showLocalFieldsOnly",validators:[]},{type:"boolean",xmlAttribute:"true",name:"showSuperClassEvents",validators:[]},{type:"Object",name:"globalNamespaces",validators:[]},{type:"boolean",xmlAttribute:"true",name:"autoDeriveSchema",validators:[]},{type:"boolean",xmlAttribute:"true",name:"autoDeriveFKs",validators:[]},{type:"boolean",name:"useLocalValidators",validators:[]},{type:"boolean",name:"autoDeriveTitles",validators:[]},{type:"boolean",xmlAttribute:"true",name:"qualifyColumnNames",validators:[]},{type:"boolean",name:"validateRelatedRecords",validators:[]},{type:"boolean",name:"requiresAuthentication",validators:[]},{type:"string",name:"requiresRole",validators:[]},{type:"string",name:"requires",validators:[]},{type:"string",name:"ownerIdField",validators:[]},{type:"string",name:"guestUserId",validators:[]},{type:"string",xmlAttribute:"true",name:"beanClassName",validators:[]},{type:"boolean",xmlAttribute:"true",name:"autoJoinTransactions",validators:[]},{type:"boolean",name:"useAnsiJoins",validators:[]},{type:"boolean",xmlAttribute:"true",name:"useSpringTransaction",validators:[]},{type:"boolean",name:"sparseUpdates",validators:[]},{type:"boolean",name:"noNullUpdates",validators:[]},{type:"boolean",name:"canExport",validators:[]},{type:"boolean",name:"progressiveLoading",validators:[]},{type:"boolean",name:"autoConvertRelativeDates",validators:[]},{type:"boolean",xmlAttribute:"true",name:"allowAdvancedCriteria",validators:[]},{type:"boolean",xmlAttribute:"true",name:"dropUnknownCriteria",validators:[]},{type:"string",name:"scriptImport",validators:[]},{idAllowed:"true",type:"Object",name:"script",validators:[]},{type:"boolean",name:"allowClientRequestedSummaries",validators:[]},{multiple:"true",type:"string",name:"patternMultiWildcard",validators:[]},{multiple:"true",type:"string",name:"patternSingleWildcard",validators:[]},{type:"string",valueMap:{dropOnChange:"Drop on criteria change",dropOnShortening:"Drop if criteria became more restrictive"},name:"criteriaPolicy",validators:[]},{type:"string",name:"substituteClasses",validators:[]},{type:"string",name:"idClassName",validators:[]},{type:"boolean",name:"supportTransactions",validators:[]},{type:"boolean",name:"creatorOverrides",validators:[]},{type:"boolean",xmlAttribute:"true",name:"loadParents",validators:[]},{type:"string",name:"loadID",validators:[]},{type:"boolean",name:"audit",validators:[]},{type:"string",name:"auditDataSourceID",validators:[]},{type:"string",name:"auditDSConstructor",validators:[]},{type:"string",name:"auditRevisionFieldName",validators:[]},{type:"string",name:"auditTimeStampFieldName",validators:[]},{type:"string",name:"auditTypeFieldName",validators:[]},{type:"string",name:"auditUserFieldName",validators:[]},{type:"boolean",name:"autoCreateAuditTable",validators:[]},{type:"string",valueMap:{full:"Inherit fields by copying them onto the inheriting DataSource's underlying table.",none:"Do not physically inherit fields onto the inheriting DataSource's SQL table"},name:"inheritanceMode",validators:[]},{type:"boolean",name:"quoteColumnNames",validators:[]},{type:"string",xmlAttribute:"true",name:"generatedBy",validators:[]},{type:"boolean",name:"useUTCDateTimes",validators:[]},{type:"boolean",name:"useOfflineStorage",validators:[]},{type:"string",name:"enumOrdinalProperty",validators:[]},{type:"string",valueMap:{bean:"Translates to/from a Javascript object containing one property for each property defined within the enum.",ordinal:"Translates to/from an integer matching the ordinal number of the constant within the enumeration",string:"Translates to/from a String matching the constant name."},name:"enumTranslateStrategy",validators:[]},{type:"boolean",name:"xmlFromConfig",validators:[]},{type:"boolean",name:"translatePatternOperators",validators:[]},{type:"string",name:"fileNameField",validators:[]},{type:"string",name:"fileTypeField",validators:[]},{type:"string",name:"fileFormatField",validators:[]},{type:"string",name:"fileSizeField",validators:[]},{type:"string",name:"fileLastModifiedField",validators:[]},{type:"string",name:"fileContentsField",validators:[]},{type:"string",name:"projectFileKey",validators:[]},{childTagName:"location",multiple:"true",type:"string",name:"projectFileLocations",validators:[]},{type:"string",name:"defaultTextMatchStyle",validators:[]},{type:"boolean",name:"ignoreTextMatchStyleCaseSensitive",validators:[]},{valueMap:{always:"PK always required no matter what",clientRequest:"PK required for client requests only",never:"PK never required",rpcManager:"PK required for requests associated with RPCManager"},type:"string",xmlAttribute:"true",name:"defaultMultiUpdatePolicy",validators:[]},{type:"string",name:"maxFileSizeExceededMessage",validators:[]},{title:"Required Message",type:"string",xmlAttribute:"true",name:"requiredMessage",validators:[]},{type:"AdvancedCriteria",xmlAttribute:"true",name:"implicitCriteria",validators:[]}]})
isc.DataSource.create({allowAdvancedCriteria:true,addGlobalId:"false",ID:"DataSourceField",fields:[{basic:"true",title:"Name",type:"string",required:"true",xmlAttribute:"true",primaryKey:"true",name:"name",validators:[]},{basic:"true",title:"Type",type:"string",xmlAttribute:"true",name:"type",validators:[]},{title:"Disabled",type:"boolean",name:"disabled",validators:[]},{title:"ID Allowed",type:"boolean",xmlAttribute:"true",name:"idAllowed",validators:[]},{title:"Required",type:"boolean",xmlAttribute:"true",name:"required",validators:[]},{title:"Required Message",type:"string",xmlAttribute:"true",name:"requiredMessage",validators:[]},{type:"ValueMap",name:"valueMap",validators:[]},{multiple:"true",propertiesOnly:"true",type:"Validator",name:"validators",validators:[]},{title:"Length",type:"integer",xmlAttribute:"true",name:"length",validators:[]},{title:"Decimal Pad",type:"integer",xmlAttribute:"true",name:"decimalPad",validators:[]},{title:"Decimal Precision",type:"integer",xmlAttribute:"true",name:"decimalPrecision",validators:[]},{type:"boolean",visibility:"internal",name:"xmlRequired",validators:[]},{type:"string",visibility:"internal",name:"xmlMaxOccurs",validators:[]},{type:"integer",visibility:"internal",name:"xmlMinOccurs",validators:[]},{type:"boolean",visibility:"internal",name:"xmlNonEmpty",validators:[]},{type:"boolean",visibility:"internal",name:"xsElementRef",validators:[]},{title:"User can hide",type:"boolean",name:"canHide",validators:[]},{type:"boolean",visibility:"internal",name:"xmlAttribute",validators:[]},{type:"boolean",visibility:"internal",name:"mustQualify",validators:[]},{type:"boolean",visibility:"internal",name:"xmlExplicitTypes",validators:[]},{title:"Value XPath",type:"XPath",xmlAttribute:"true",name:"valueXPath",validators:[]},{type:"boolean",name:"childrenProperty",validators:[]},{title:"Title",type:"string",xmlAttribute:"true",name:"title",validators:[]},{type:"string",xmlAttribute:"true",name:"prompt",validators:[]},{title:"Detail",type:"boolean",xmlAttribute:"true",name:"detail",validators:[]},{title:"Can Edit",type:"boolean",xmlAttribute:"true",name:"canEdit",validators:[]},{title:"Can Save",type:"boolean",xmlAttribute:"true",name:"canSave",validators:[]},{title:"Can View",type:"boolean",xmlAttribute:"true",name:"canView",validators:[]},{inapplicable:"true",title:"Inapplicable",type:"boolean",name:"inapplicable",validators:[]},{inapplicable:"true",title:"Advanced",type:"boolean",name:"advanced",validators:[]},{inapplicable:"true",title:"Visibility",type:"string",name:"visibility",validators:[]},{inapplicable:"true",title:"Hidden",type:"boolean",xmlAttribute:"true",name:"hidden",validators:[]},{type:"boolean",xmlAttribute:"true",name:"isRuleCriteria",validators:[]},{title:"Is Primary Key",type:"boolean",xmlAttribute:"true",name:"primaryKey",validators:[]},{title:"Foreign Key",type:"string",xmlAttribute:"true",name:"foreignKey",validators:[]},{valueMap:{inner:"A regular inner join",outer:"An outer join"},type:"string",xmlAttribute:"true",name:"joinType",validators:[]},{type:"string",xmlAttribute:"true",name:"displayField",validators:[]},{type:"boolean",xmlAttribute:"true",name:"useLocalDisplayFieldValue",validators:[]},{title:"Tree Root Value",type:"string",xmlAttribute:"true",name:"rootValue",validators:[]},{title:"Include From",type:"string",xmlAttribute:"true",name:"includeFrom",validators:[]},{title:"Include Via",type:"string",xmlAttribute:"true",name:"includeVia",validators:[]},{title:"Related Table Alias",type:"string",xmlAttribute:"true",name:"relatedTableAlias",validators:[]},{type:"boolean",xmlAttribute:"true",name:"showFileInline",validators:[]},{type:"boolean",xmlAttribute:"true",name:"escapeHTML",validators:[]},{type:"integerOrIdentifier",xmlAttribute:"true",name:"imageWidth",validators:[]},{type:"integerOrIdentifier",xmlAttribute:"true",name:"imageHeight",validators:[]},{hidden:"true",title:"Native Name",type:"string",name:"nativeName",validators:[]},{hidden:"true",title:"Native Foreign Key",type:"string",xmlAttribute:"true",name:"nativeFK",validators:[]},{hidden:"true",type:"boolean",xmlAttribute:"true",name:"autoDeriveFKs",validators:[]},{hidden:"true",title:"Field Name",type:"string",name:"fieldName",validators:[]},{hidden:"true",uniqueProperty:"name",childTagName:"field",multiple:"true",propertiesOnly:"true",type:"DataSourceField",name:"fields",validators:[]},{type:"boolean",xmlAttribute:"true",name:"multiple",validators:[]},{type:"boolean",xmlAttribute:"true",name:"validateEachItem",validators:[]},{multiple:"true",type:"Object",name:"pickListFields",validators:[]},{valueMap:{json:"JSON serialisation",none:"No transformation is applied to values",simpleString:"Delimeter-separated string"},type:"string",xmlAttribute:"true",name:"multipleStorage",validators:[]},{type:"boolean",xmlAttribute:"true",name:"canFilter",validators:[]},{type:"boolean",name:"ignore",validators:[]},{type:"boolean",visibility:"internal",name:"skipSerialization",validators:[]},{type:"boolean",xmlAttribute:"true",name:"unknownType",validators:[]},{type:"boolean",xmlAttribute:"true",name:"canSortClientOnly",validators:[]},{type:"string",xmlAttribute:"true",name:"childTagName",validators:[]},{type:"boolean",name:"basic",validators:[]},{type:"integer",name:"maxFileSize",validators:[]},{title:"Frozen",type:"boolean",xmlAttribute:"true",name:"frozen",validators:[]},{type:"boolean",xmlAttribute:"true",name:"canExport",validators:[]},{type:"string",xmlAttribute:"true",name:"exportTitle",validators:[]},{type:"string",xmlAttribute:"true",name:"exportFormat",validators:[]},{type:"string",xmlAttribute:"true",name:"sqlStorageStrategy",validators:[]},{type:"boolean",xmlAttribute:"true",name:"encodeInResponse",validators:[]},{type:"string",xmlAttribute:"true",name:"mimeType",validators:[]},{type:"boolean",xmlAttribute:"true",name:"ignoreTextMatchStyle",validators:[]},{type:"boolean",xmlAttribute:"true",name:"lenientXPath",validators:[]},{type:"string",xmlAttribute:"true",name:"summaryFunction",validators:[]},{type:"string",xmlAttribute:"true",name:"includeSummaryFunction",validators:[]},{type:"string",xmlAttribute:"true",name:"joinString",validators:[]},{type:"string",xmlAttribute:"true",name:"joinPrefix",validators:[]},{type:"string",xmlAttribute:"true",name:"joinSuffix",validators:[]},{type:"boolean",name:"allowClientRequestedSummaries",validators:[]},{type:"any",xmlAttribute:"true",name:"defaultValue",validators:[]},{type:"string",xmlAttribute:"true",name:"group",validators:[]},{type:"string",xmlAttribute:"true",name:"ID",validators:[]},{type:"string",xmlAttribute:"true",name:"inheritsFrom",validators:[]},{type:"string",xmlAttribute:"true",name:"javaClass",validators:[]},{type:"string",xmlAttribute:"true",name:"javaCollectionClass",validators:[]},{type:"string",xmlAttribute:"true",name:"javaKeyClass",validators:[]},{valueMap:{MD5:"Message Digest algorithm 5",SHA:"Secure Hashing Algorithm (SHA-1)"},type:"string",xmlAttribute:"true",name:"storeWithHash",validators:[]},{type:"string",name:"sqlDateFormat",validators:[]},{type:"boolean",name:"storeMilliseconds",validators:[]},{type:"boolean",name:"initRequiresAuthentication",validators:[]},{type:"boolean",name:"viewRequiresAuthentication",validators:[]},{type:"boolean",name:"editRequiresAuthentication",validators:[]},{type:"boolean",name:"updateRequiresAuthentication",validators:[]},{type:"string",name:"initRequiresRole",validators:[]},{type:"string",name:"viewRequiresRole",validators:[]},{type:"string",name:"editRequiresRole",validators:[]},{type:"string",name:"updateRequiresRole",validators:[]},{type:"string",name:"initRequires",validators:[]},{type:"string",name:"viewRequires",validators:[]},{type:"string",name:"editRequires",validators:[]},{type:"string",name:"updateRequires",validators:[]},{type:"string",name:"customSelectExpression",validators:[]},{type:"string",name:"customCriteriaExpression",validators:[]},{type:"string",name:"customInsertExpression",validators:[]},{type:"string",name:"customUpdateExpression",validators:[]},{type:"boolean",name:"customSQL",validators:[]},{type:"boolean",name:"autoQuoteCustomExpressions",validators:[]},{type:"boolean",name:"creatorOverrides",validators:[]},{type:"string",name:"valueWriteXPath",validators:[]},{type:"boolean",name:"useJoin",validators:[]},{type:"string",name:"tableName",validators:[]},{type:"string",name:"multipleStorageSeparator",validators:[]},{type:"boolean",name:"defineSQLColumnAsNotNull",validators:[]},{type:"string",name:"valueMapEnum",validators:[]},{type:"string",name:"sqlFalseValue",validators:[]},{type:"string",name:"sqlTrueValue",validators:[]},{type:"string",name:"sortByField",validators:[]},{type:"string",xmlAttribute:"true",name:"columnCode",validators:[]},{type:"boolean",xmlAttribute:"true",name:"stringInBrowser",validators:[]},{type:"boolean",name:"nillable",validators:[]},{multiple:"true",type:"string",name:"validOperators",validators:[]},{type:"string",name:"fieldTypeProperty",validators:[]},{type:"string",name:"moveTo",validators:[]},{type:"string",name:"uploadFieldName",validators:[]},{type:"string",name:"batchUploadOperationId",validators:[]},{type:"boolean",name:"batchUploadCaseSensitive",validators:[]}]})
isc.DataSource.create({strictValidation:"false",allowAdvancedCriteria:true,addGlobalId:"false",ID:"Validator",fields:[{type:"string",name:"type",validators:[]},{type:"string",name:"name",validators:[]},{type:"string",name:"description",validators:[]},{type:"boolean",name:"stopIfFalse",validators:[]},{type:"boolean",name:"stopOnError",validators:[]},{type:"boolean",name:"validateOnChange",validators:[]},{type:"boolean",name:"clientOnly",validators:[]},{type:"string",name:"errorMessage",validators:[]},{type:"float",name:"max",validators:[]},{type:"float",name:"min",validators:[]},{type:"boolean",name:"exclusive",validators:[]},{type:"regexp",name:"mask",validators:[]},{type:"regexp",name:"transformTo",validators:[]},{type:"integer",name:"precision",validators:[]},{type:"string",name:"expression",validators:[]},{type:"string",name:"otherField",validators:[]},{multiple:"true",type:"text",name:"list",validators:[]},{type:"ValueMap",name:"valueMap",validators:[]},{type:"text",name:"substring",validators:[]},{type:"text",name:"operator",validators:[]},{type:"integer",name:"count",validators:[]},{type:"AdvancedCriteria",name:"applyWhen",validators:[]},{multiple:"true",type:"string",name:"dependentFields",validators:[]},{type:"string",name:"scriptImport",validators:[]},{type:"boolean",name:"caseSensitive",validators:[]},{type:"string",name:"operationId",validators:[]},{idAllowed:"true",type:"Object",name:"serverCondition",validators:[]},{type:"ServerObject",name:"serverObject",validators:[]},{type:"string",name:"fieldName",validators:[]},{type:"string",name:"triggerEvent",validators:[]},{type:"string",name:"message",validators:[]},{type:"string",name:"severity",validators:[]},{type:"string",name:"displayMode",validators:[]},{type:"integer",name:"duration",validators:[]},{type:"string",name:"formula",validators:[]},{type:"ValueMap",name:"formulaVars",validators:[]}]})
isc.DataSource.create({inheritsFrom:"DataSourceField",Constructor:"SimpleType",allowAdvancedCriteria:true,addGlobalId:false,ID:"SimpleType",fields:[{name:"inheritsFrom",type:"string",validators:[]},{name:"editorType",type:"string",validators:[]}]})
isc.DataSource.create({inheritsFrom:"DataSource",Constructor:"XSComplexType",allowAdvancedCriteria:true,addGlobalId:false,ID:"XSComplexType",fields:[]})
isc.DataSource.create({inheritsFrom:"DataSource",Constructor:"XSElement",allowAdvancedCriteria:true,addGlobalId:false,ID:"XSElement",fields:[]})
isc.DataSource.create({Constructor:"SchemaSet",allowAdvancedCriteria:true,addGlobalId:false,ID:"SchemaSet",fields:[{name:"schemaNamespace",type:"url",validators:[]},{multiple:true,name:"schemaImports",type:"Object",validators:[]},{name:"qualifyAll",type:"boolean",validators:[]},{multiple:true,name:"schema",type:"DataSource",validators:[]}]})
isc.DataSource.create({inheritsFrom:"DataSource",Constructor:"WSDLMessage",allowAdvancedCriteria:true,addGlobalId:false,ID:"WSDLMessage",fields:[]})
isc.DataSource.create({Constructor:"WebService",allowAdvancedCriteria:true,addGlobalId:false,ID:"WebService",fields:[{name:"location",type:"url",validators:[]},{name:"targetNamespace",type:"url",validators:[]},{multiple:true,name:"schemaImports",type:"Object",validators:[]},{multiple:true,name:"wsdlImports",type:"Object",validators:[]},{multiple:true,name:"operations",type:"WebServiceOperation",validators:[]},{multiple:true,name:"portTypes",type:"Object",validators:[]},{multiple:true,name:"bindings",type:"Object",validators:[]},{multiple:true,name:"messages",type:"WSDLMessage",validators:[]},{name:"globalNamespaces",type:"Object",validators:[]}]})
isc.DataSource.create({allowAdvancedCriteria:true,addGlobalId:false,ID:"WebServiceOperation",fields:[{name:"name",title:"Operation Name",required:true,validators:[]},{name:"soapAction",title:"SOAPAction Header",validators:[]},{name:"inputMessage",title:"Input Message",validators:[]},{name:"outputMessage",title:"Output Message",validators:[]},{multiple:true,name:"inputHeaders",type:"WSOperationHeader",validators:[]},{multiple:true,name:"outputHeaders",type:"WSOperationHeader",validators:[]}]})
isc.DataSource.create({allowAdvancedCriteria:true,addGlobalId:false,ID:"WSOperationHeader",fields:[{name:"encoding",validators:[]},{name:"message",validators:[]},{name:"part",validators:[]}]})
isc.defineClass("Operators","Class");isc.A=isc.Operators;isc.A.equalsTitle="equals (match case)";isc.A.iEqualsTitle="equals";isc.A.notEqualTitle="not equal (match case)";isc.A.iNotEqualTitle="not equal";isc.A.greaterThanTitle="greater than";isc.A.lessThanTitle="less than";isc.A.greaterOrEqualTitle="greater than or equal to";isc.A.lessOrEqualTitle="less than or equal to";isc.A.betweenTitle="between (match case)";isc.A.iBetweenTitle="between";isc.A.betweenInclusiveTitle="between (inclusive, match case)";isc.A.iBetweenInclusiveTitle="between (inclusive)";isc.A.startsWithTitle="starts with (match case)";isc.A.iStartsWithTitle="starts with";isc.A.endsWithTitle="ends with (match case)";isc.A.iEndsWithTitle="ends with";isc.A.containsTitle="contains (match case)";isc.A.iContainsTitle="contains";isc.A.notContainsTitle="does not contain (match case)";isc.A.iNotContainsTitle="does not contain";isc.A.notStartsWithTitle="does not start with (match case)";isc.A.iNotStartsWithTitle="does not start with";isc.A.notEndsWithTitle="does not end with (match case)";isc.A.iNotEndsWithTitle="does not end with";isc.A.regexpTitle="matches expression (match case)";isc.A.iregexpTitle="matches expression";isc.A.matchesPatternTitle="matches pattern (match case)";isc.A.iMatchesPatternTitle="matches pattern";isc.A.containsPatternTitle="contains pattern (match case)";isc.A.iContainsPatternTitle="contains pattern";isc.A.equalsFieldTitle="matches other field (match case)";isc.A.iEqualsFieldTitle="matches other field";isc.A.notEqualFieldTitle="differs from field (match case)";isc.A.iNotEqualFieldTitle="differs from field";isc.A.greaterThanFieldTitle="greater than field";isc.A.lessThanFieldTitle="less than field";isc.A.greaterOrEqualFieldTitle="greater than or equal to field";isc.A.lessOrEqualFieldTitle="less than or equal to field";isc.A.containsFieldTitle="contains another field value (match case)";isc.A.iContainsFieldTitle="contains another field value";isc.A.startsWithFieldTitle="starts with another field value (match case)";isc.A.iStartsWithFieldTitle="starts with another field value";isc.A.endsWithFieldTitle="ends with another field value (match case)";isc.A.iEndsWithFieldTitle="ends with another field value";isc.A.notContainsFieldTitle="does not contain another field value (match case)";isc.A.iNotContainsFieldTitle="does not contain another field value";isc.A.notStartsWithFieldTitle="does not start with another field value (match case)";isc.A.iNotStartsWithFieldTitle="does not start with another field value";isc.A.notEndsWithFieldTitle="does not end with another field value (match case)";isc.A.iNotEndsWithFieldTitle="does not end with another field value";isc.A.startsWithPatternTitle="starts with pattern (match case)";isc.A.iStartsWithPatternTitle="starts with pattern";isc.A.endsWithPatternTitle="ends with pattern (match case)";isc.A.iEndsWithPatternTitle="ends with pattern";isc.A.andTitle="and";isc.A.notTitle="not";isc.A.orTitle="or";isc.A.inSetTitle="is one of";isc.A.notInSetTitle="is not one of";isc.A.isBlankTitle="is blank";isc.A.notBlankTitle="is not blank";isc.A.isNullTitle="is null";isc.A.notNullTitle="is not null";if(isc.DynamicForm){isc.defineClass("DynamicFilterForm","SearchForm");isc.A=isc.DynamicFilterForm.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$10j="Enter";isc.B.push(isc.A.handleKeyPress=function isc_DynamicFilterForm_handleKeyPress(_1,_2){var _3=this.getFocusSubItem();if(isc.isA.TextItem(_3))_2.firedOnTextItem=true;if(_1.keyName!=this.$10j){return this.Super("handleKeyPress",[_1,_2])}},isc.A.itemChanged=function isc_DynamicFilterForm_itemChanged(_1,_2,_3){if(this.creator.itemChanged)this.creator.itemChanged()},isc.A.getDefaultOptionDataSource=function isc_DynamicFilterForm_getDefaultOptionDataSource(_1){if(this.creator&&this.creator.getDefaultOptionDataSource){return this.creator.getDefaultOptionDataSource(_1)}
return this.Super("getDefaultOptionDataSource",arguments)},isc.A.validate=function isc_DynamicFilterForm_validate(){var _1=(this.Super("validate",arguments)==false);for(var i=0;i<this.items.length;i++){var _3=this.items[i];if(_3.isVisible()&&isc.isA.CanvasItem(_3)&&isc.isA.DynamicForm(_3.canvas)){_1=(_3.canvas.validate()==false)||_1}}
return!_1});isc.B._maxIndex=isc.C+4;isc.defineClass("FilterClause","Layout");isc.A=isc.FilterClause.getPrototype();isc.A.orientation="horizontal";isc.A.defaultWidth=20;isc.A.height=20;isc.A.showFieldTitles=true;isc.A.validateOnChange=true;isc.A.fieldPickerWidth="*";isc.A.operatorPickerWidth=150;isc.A.valueItemWidth=150;isc.A.fieldPickerDefaults={name:"fieldName",showTitle:false,textMatchStyle:"startsWith",changed:function(){this.form.creator.fieldNameChanged(this.form)}};isc.A.fieldPickerTitle="Field Name";isc.A.operatorPickerDefaults={name:"operator",editorType:"SelectItem",showTitle:false,addUnknownValues:false,defaultToFirstOption:true,changed:function(){this.form.creator.operatorChanged(this.form)}};isc.A.operatorPickerTitle="Operator";isc.A.valueItemTitle="Value";isc.A.valueSetHint="Comma-separated values";isc.A.valueItemTextHint="Enter a value";isc.A.valueItemListHint="Select a value";isc.A.valueItemFieldHint="Select a field";isc.A.clauseConstructor=isc.DynamicFilterForm;isc.A.showRemoveButton=true;isc.A.removeButtonPrompt="Remove";isc.A.excludeNonFilterableFields=true;isc.A.removeButtonDefaults={_constructor:isc.ImgButton,width:18,height:18,layoutAlign:"center",src:"[SKIN]/actions/remove.png",showRollOver:false,showDown:false,click:function(){this.creator.remove()},getHoverHTML:function(){var _1=this.creator.creator;if(!_1.allowEmpty&&_1.clauses&&_1.clauses.length==1)return _1.lastClausePrompt;return this.prompt}};isc.A.dynamicValueButtonDefaults={_constructor:isc.ImgButton,width:18,height:18,layoutAlign:"center",src:"[SKIN]/actions/dynamic.png",showRollOver:false,showDown:false,showDisabled:false,click:function(){this.creator.dynamicValueButtonClick(this.fieldName,this.fieldTitle)}};isc.A.flattenItems=true;isc.A=isc.FilterClause.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.customGetValuesFunction="getCriterion";isc.A.valueAttribute="value";isc.A.rangeStartAttribute="start";isc.A.rangeEndAttribute="end";isc.A.operatorAttribute="operator";isc.A.setCustomValuseFunction="setCriterion";isc.A.dynamicValueWindowConstructor=isc.Window;isc.A.dynamicValueWindowDefaults={autoSize:true,width:600,autoCenter:true,isModal:true,bodyProperties:{layoutMargin:5,membersMargin:5},okButtonClick:function(){var _1=this.ruleScopeGrid.getSelectedRecord();if(_1&&this.valueSelected){this.valueSelected(_1.criteriaPath||_1.name)}
this.closeClick()}};isc.A.ruleScopeGridConstructor=isc.ListGrid;isc.A.ruleScopeGridDefaults={height:400,width:"100%",autoFetchData:true,dataFetchMode:"local",selectionType:"single",initWidget:function(){this.fields=[{name:"name",type:"text",title:"Path",hidden:(this.pathField!="name")},{name:"title",type:"text",title:"Path",hidden:(this.pathField!="title")},{name:"value",type:"text",title:"Current value",hidden:true}];this.Super("initWidget",arguments)},formatCellValue:function(_1,_2,_3,_4){if(_1==null&&_4==0)return this.clearValueText;return(_2.enabled==false||this.multiDSFieldFormat==isc.FilterBuilder.QUALIFIED?_1:"&nbsp;&nbsp;"+_1)},recordDoubleClick:function(){this.parentElement.parentElement.okButtonClick()}};isc.B.push(isc.A.initWidget=function isc_FilterClause_initWidget(){this.Super("initWidget",arguments);this.setupClause()},isc.A.destroy=function isc_FilterClause_destroy(){if(this.fieldPicker&&this.fieldPicker&&this.fieldPicker.optionDataSource&&this.fieldPicker.optionDataSource.$172q){this.fieldPicker.optionDataSource.destroy()}
this.Super("destroy",arguments)},isc.A.getFilterBuilder=function isc_FilterClause_getFilterBuilder(){return this.filterBuilder},isc.A.getTopLevelFilterBuilder=function isc_FilterClause_getTopLevelFilterBuilder(){var _1=this.filterBuilder;while(_1.filterBuilder!=null){_1=_1.filterBuilder}
return _1},isc.A.getPrimaryDS=function isc_FilterClause_getPrimaryDS(_1){if(this.dataSources){if(_1==null){return isc.DataSource.get(this.dataSources[0])}
if(isc.isAn.Object(_1)){if(_1.$93k!=null){_1=_1.$93k}
for(var i=0;i<this.dataSources.length;i++){var _3=isc.getValues(this.dataSources[i].getFields());if(_3.contains(_1))return this.dataSources[i]}
_1=_1.name}
if(_1.contains(".")){return isc.DataSource.getDataSourceForField(_1,this.dataSources)}}
if(this.dataSource)return this.getDataSource();else if(this.fieldDataSource)return this.fieldDataSource},isc.A.getDefaultOptionDataSource=function isc_FilterClause_getDefaultOptionDataSource(_1){return this.getPrimaryDS(_1)},isc.A.getField=function isc_FilterClause_getField(_1){if(_1==null)return null;if(isc.isAn.Object(_1))return _1;var _2;if(this.dataSources){for(var i=0;i<this.dataSources.length;i++){var _4=this.dataSources[i],_5=_4.fields;for(var j=0;j<_5.length;j++){}}
_2=isc.DataSource.getFieldFromDataSources(_1,this.dataSources)}else if(this.dataSource){_2=this.getDataSource().getField(_1);if(_2==null){_2=this.getDataSource().getFieldForDataPath(_1)}}else{if(this.clause){_2=this.fieldData?this.fieldData[_1]:null;if(!_2)_2=this.clause.getField("fieldName").getSelectedRecord();if(!_2)_2=this.field;else this.field=_2}}
if(!_2&&this.createRuleCriteria){var _7=this.getTopLevelFilterBuilder().$167n,_8=_7.getRuleScopeDataBoundComponents(),_9=_1.split("."),_10=(_9.length>0?_9[0]:null),_11=(_9.length>1?_9[_9.length-1]:null);if(_10&&_11){for(var i=0;i<_8.length;i++){var _12=_8[i].getID();if(_12==_10){_2=_8[i].getField(_11);break}}}}
return _2},isc.A.getFieldNames=function isc_FilterClause_getFieldNames(){if(this.dataSources){return isc.DataSource.getCombinedDataSourceFields(this.dataSources)}
if(this.dataSource)return this.getDataSource().getFieldNames(true)},isc.A.getFieldOperatorMap=function isc_FilterClause_getFieldOperatorMap(_1,_2,_3,_4){var _5=this.$198w(_1),_6=this.getPrimaryDS(_1),_7=_6.getFieldOperatorMap(_1,_2,_3,_4,_5);return _7},isc.A.getSearchOperator=function isc_FilterClause_getSearchOperator(_1,_2){return this.getPrimaryDS(_2).getSearchOperator(_1)},isc.A.combineFieldData=function isc_FilterClause_combineFieldData(_1,_2){var _3=this.getPrimaryDS(_2),_4=this.getField(_2);if(_4)
return _3.combineFieldData(_1,_2);else return _1},isc.A.setupClause=function isc_FilterClause_setupClause(){this.$85y=true;if(this.dataSource&&!isc.isA.DataSource(this.dataSource))
this.dataSource=isc.DataSource.get(this.dataSource);if(this.fieldDataSource&&!isc.isA.DataSource(this.fieldDataSource))
this.fieldDataSource=isc.DataSource.get(this.fieldDataSource);this.fieldPickerDefaults.title=this.fieldPickerTitle;this.operatorPickerDefaults.title=this.operatorPickerTitle;var _1={};if(this.showClause!=false){if(this.topOperatorAppearance=="inline"){if(this.topOperator=="and"){var _2={and:this.creator.inlineAndTitle,not:this.creator.inlineAndNotTitle}}else{var _2={or:this.creator.inlineOrTitle,not:this.creator.inlineAndNotTitle}}
var _3=0;this.topOperatorFormProperties={layoutAlign:"top"};if(this.creator.showSelectionCheckbox){isc.addProperties(this.topOperatorFormProperties,{numCols:2,width:120,colWidths:["20%","80%"]});this.topOperatorFormProperties.items=[{name:"select",type:"checkbox",showTitle:false,showLabel:false,defaultValue:false,showIf:function(){return this.form.creator.showSelectionCheckbox}},isc.addProperties({width:this.topOperatorItemWidth},this.topOperatorItemDefaults,this.topOperatorItemProperties)];_3=1}else{this.topOperatorFormProperties.items=[isc.addProperties({width:this.topOperatorItemWidth},this.topOperatorItemDefaults,this.topOperatorItemProperties)]}
this.addAutoChild("topOperatorForm");this.topOperatorForm.items[_3].valueMap=_2;this.topOperatorForm.items[_3].defaultValue=this.negated?"not":this.topOperator;this.updateInlineTopOperator()}
var _4=[];_4.add(isc.addProperties({},this.fieldPickerDefaults,{width:this.fieldPickerWidth,sortField:(this.sortFields?"fieldName":null)},this.fieldPickerProperties,{name:"fieldName"}));_4.add(isc.addProperties({},this.operatorPickerDefaults,{width:this.operatorPickerWidth},this.operatorPickerProperties,{name:"operator",showIf:this.missingField?"false":"true"}));var _5=this.criterion,_6=this.getFieldNames(),_7;if(this.fieldName&&(this.dataSource||this.dataSources)){var _8=this.fieldName;var _9=this.getField(_8),_10;isc.addProperties(_4[0],{type:"staticText",clipValue:true,wrap:false});if(this.missingField){_10=isc.DataSource.getCriterionDescription(this.criterion,this.dataSource||this.dataSources)}else if(!_9||(this.excludeNonFilterableFields&&_9.canFilter==false)){_8=_6[0]}else if(this.showFieldTitles){_10=_9.summaryTitle||_9.title||_8}
_4[0].defaultValue=_8;if(_10!=null){var _11={};_11[_8]=_10;_4[0].valueMap=_11}
_7=_8}else{if(this.fieldDataSource){var _12;if(this.fieldPickerProperties){_12=this.fieldPickerProperties.pickListFields}
if(!_12)_12=this.pickListFields;isc.addProperties(_4[0],{type:"ComboBoxItem",completeOnTab:true,addUnknownValues:false,optionDataSource:this.fieldDataSource,valueField:"name",displayField:this.showFieldTitles?"title":"name",pickListFields:_12,optionCriteria:{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:"canFilter",operator:"notEqual",value:false}]},pickListProperties:{reusePickList:function(){return false}}});if(this.field){_4[0].defaultValue=_4[0].defaultValue||this.field.name}}else if(this.dataSources!=null&&this.createRuleCriteria){var _13=this,_14=(this.multiDSFieldFormat==isc.FilterBuilder.SEPARATED?"title":"name"),_15=(this.showFieldTitles?"title":"name"),_16=this.getTopLevelFilterBuilder().$167n,_17=this.getTopLevelFilterBuilder().targetComponent,_18=this.getMultiDSFieldDataSource(_16.getRuleContext(),_17);isc.addProperties(_4[0],{width:200,optionDataSource:_18,valueField:"name",displayField:_14,pickListFields:[{name:"name",type:"text",hidden:(_14!="name")},{name:"title",type:"text",hidden:(_14!="title")}],pickListProperties:{reusePickList:function(){return false},formatCellValue:function(_33,_34,_35,_36){return(_34.enabled==false||_13.multiDSFieldFormat==isc.FilterBuilder.QUALIFIED?_33:"&nbsp;&nbsp;"+_33)}}})}else if(_6){var _19=(this.dataSources!=null),_20=this.multiDSFieldFormat;var _21="";for(var i=0;i<_6.length;i++){var _23=_6[i],_9=this.getField(_23);if(this.excludeNonFilterableFields&&_9.canFilter==false)continue;if(_19){if(_20=="separated"){var _18=_23.split(".")[0];if(_18!=_21){}
_1[_23]="&nbsp;&nbsp;"+(_9.summaryTitle||_9.title||isc.DS.getAutoTitle(_23))}else{_1[_23]=_23}}else if(this.showFieldTitles){_1[_23]=_9.summaryTitle||_9.title||_23}else{_1[_23]=_23}}
_4[0].valueMap=_1;_4[0].defaultValue=_4[0].defaultValue||isc.firstKey(_1)}}
this.fieldPicker=_4[0];var _24=_4[0],_25=_4[1];if(!this.fieldName){if(_5&&_5.fieldName){if(this.fieldDataSource){_24.defaultValue=_5.fieldName}else{if(_6&&_6.contains(_5.fieldName)){_24.defaultValue=_5.fieldName}else if(_6&&_6.contains(isc.Canvas.$177s(_5.fieldName))){_24.defaultValue=isc.Canvas.$177s(_5.fieldName)}else{isc.logWarn("Criterion specified field "+_5.fieldName+", which is not in the record. Using the first record field ("+(_1?isc.firstKey(_1):_6[0])+") instead");_24.defaultValue=_1?isc.firstKey(_1):_6[0]}}}
_7=_24.defaultValue}
if(_7){var _9=this.field||this.getField(_7);if(!this.missingField&&_9){var _18=this.getPrimaryDS();var _26=_18&&_18.$570&&_18.$570[_9.type]!=null;var _11=_9?this.getFieldOperatorMap(_9,_26,"criteria",true):null;_25.valueMap=_11;if(_11){if(_5&&_5.operator){_25.defaultValue=_5.operator}else{var _18=this.getPrimaryDS();if(_18){_25.defaultValue=_18.getFieldDefaultOperator(_9.name)}else{_25.defaultValue=isc.SimpleType.getDefaultOperator(_9.type)}}}
this.$74o=_7;var _27=this.getSearchOperator(_25.defaultValue,_9);var _28=isc.getKeys(_11).length;if(_28>0&&(!_27||!_11[_27.ID])){isc.logWarn("Criterion specified unknown operator "+(_5?_5.operator:"[null criterion]")+". Using the first valid operator ("+isc.firstKey(_11)+") instead");_25.defaultValue=isc.firstKey(_11);_27=this.getSearchOperator(_25.defaultValue,_9)}
var _29=this.buildValueItemList(_9,_27,_7);if(_5){if(_5.value!=null&&_29.containsProperty("name","value")){_29.find("name","value").defaultValue=_5.value}
if(_5.start!=null&&_29.containsProperty("name","start")){_29.find("name","start").defaultValue=_5.start}
if(_5.end!=null&&_29.containsProperty("name","end")){_29.find("name","end").defaultValue=_5.end}
if(_5.valuePath!=null){var _30=_29.find("name","valuePath");if(_30){var _31=this.getTopLevelFilterBuilder();var _32=_31.$167n;if(_32&&_32.ruleScope){_30.defaultValue=_5.valuePath.replace(/\//,".");_30.visible=true;_29.find("name","value").visible=false}else{isc.logWarn("Criterion specified field "+_5.fieldName+" with valuePath "+_5.valuePath+" but no targetRuleScope was provided - ignoring valuePath.");_5.valuePath=_5.value=null}}}}
if(_29)_4.addList(_29)}}else{_25.disabled=true}
if(this.showRemoveButton){this.addAutoChild("removeButton",{prompt:this.removeButtonPrompt})}
this.addMember(this.removeButton);this.addAutoChild("clause",{sortFields:this.sortFields,flattenItems:this.flattenItems,$76z:true,items:_4,height:10,width:100,numCols:5,colWidths:[100,this.operatorPickerWidth,"*",25,"*"]});this.addMember(this.clause);if(this.allowRuleScopeValues){var _11=_24.valueMap,_10=(_11?_11[_7]:null)||_7;this.addAutoChild("dynamicValueButton",{prompt:this.dynamicValueButtonPrompt,fieldName:_7,fieldTitle:_10});if(!_4.find("name","valuePath")){this.dynamicValueButton.hide()}}
this.addMember(this.dynamicValueButton);this.fieldPicker=this.clause.getItem("fieldName");this.operatorPicker=this.clause.getItem("operator")}
this.addMember(this.topOperatorForm,0)},isc.A.updateInlineTopOperator=function isc_FilterClause_updateInlineTopOperator(){if(this.topOperatorAppearance!="inline")return;var _1=this.creator.showSelectionCheckbox?1:0;if(this.creator.isFirstClause(this)){this.topOperatorForm.items[_1].hide()}else{this.topOperatorForm.items[_1].show()}},isc.A.getEditorType=function isc_FilterClause_getEditorType(_1,_2){if(isc.isA.FilterBuilder(this.filterBuilder)){return this.filterBuilder.getEditorType(_1,_2)}else{return isc.FilterBuilder.getDefaultEditorType(_1,this.getPrimaryDS(),_2)}},isc.A.buildValueItemList=function isc_FilterClause_buildValueItemList(_1,_2,_3){if(_2==null)this.logWarn("buildValueItemList passed null operator");var _4=this.getEditorType(_1,_2.ID);var _5=_2?_2.valueType:"text",_6,_7,_8=[],_9;if(_1==null){_6="text"}else{if(_3==null)_3=_1.name;_6=_1.type}
_7=isc.SimpleType.getType(_6)||isc.SimpleType.getType("text");var _10=isc.SimpleType.inheritsFrom(_6,"date")||isc.SimpleType.inheritsFrom(_6,"datetime");while(_7.getAtomicValue!=null){var _11=_7.inheritsFrom||"text";_7=isc.SimpleType.getType(_11)}
_7=_7.name;var _12=this.valueItemWidth;if(_1){var _13={$93k:_1};isc.addProperties(_13,_1);_13.canEdit=_1.canFilter;_1=_13;if(_1.userFormula||_1.userSummary){_1.canFilter=true;_1.canEdit=true}
if(_1.editorProperties&&_1.editorProperties.width!=null){_12=_1.editorProperties.width}}
_4=this.getEditorType(_1,_2.ID);if(_4=="staticText"&&!this.excludeNonFilterableFields)_4="text";var _14=this.getValueItemHintText(_5,_7);if(_5=="fieldType"||_5=="custom"||_5=="valueSet"){var _15=_7;var _16=this.getValueFieldProperties(_6,_3,_2.ID,"value");if(_16&&_16.editorType){_4=_16.editorType}
var _17=isc.addProperties({type:_15,valueType:_5,name:_1?_1.name:null,showTitle:false,title:this.valueItemTitle,width:_12,hint:_14,showHintInField:(_14!=null),changed:function(){this.form.creator.valueChanged(this,this.form)}},_16);if(_4)_17.editorType=_4;if(_5=="valueSet"){_17.multiple=true;_17.parseEditorValue=function(_22,_37,_38){if(_22==null)return _22;var _18=_38.multipleValueSeparator.trim();var _19=new RegExp("[\\s]*["+_18+"][\\s]*","g");return _22.split(_19)};_17.formatEditorValue=function(_22,_37,_38,_39){if(_22==null)return"";if(isc.isAn.Array(_22)){return _22.join(_39.multipleValueSeparator)}
return _22}}
if(_1!=null&&_5!="custom"){_17=this.combineFieldData(_17,_1)}
_17.name="value";_17.dataPath=null;if(_6=="enum"){_17=isc.addProperties(_17,{valueMap:_1.valueMap})}
if(_7=="boolean"){_17=isc.addProperties(_17,{showLabel:false,defaultValue:true,align:this.isRTL()?"right":"left"})}
if(_1&&_1.editorProperties){var _20=_1.editorProperties;for(var _21 in _20){var _22=_20[_21];if(isc.isAn.Array(_22)||isc.isA.Date(_22)){_22=_22.duplicate()}else if(isc.isAn.Object(_22)){_22=isc.shallowClone(_22)}
_17[_21]=_22}}
if(_1.displayField!=null||_1.optionDataSource!=null){if(_1.foreignKey){var _23=_1.foreignKey,_24=_23.indexOf(".");if(!_1.optionDataSource)_17.optionDataSource=_23.substring(0,_24);if(!_1.valueField)_17.valueField=_23.substring(_24+1)}else{if(!_1.valueField)_17.valueField=_1.name}}
_8.add(_17);_8.add({name:"valuePath",type:"staticText",showTitle:false,visible:false,valuePrefix:"<nobr>"+this.dynamicValuePrefix,valueSuffix:"</nobr>",formatValue:function(_22,_37,_38,_39){if(_38.creator&&_38.creator.creator&&_38.creator.creator.targetComponent){var _25=_38.creator.creator.targetComponent.ID+".values.";if(_22!=null&&_22.startsWith(_25))_22=_22.replace(_25,"")}
return(_22!=null?this.valuePrefix+_22+this.valueSuffix:null)}})}else if(_5=="fieldName"){_9=isc.addProperties({},this.fieldPickerDefaults,{showTitle:false,addUnknownValues:false,editorType:this.fieldDataSource?"ComboBoxItem":"SelectItem",valueType:_5,width:_12,textMatchStyle:this.fieldPicker.textMatchStyle,changed:function(){this.form.creator.valueChanged(this,this.form)}});if(this.sortFields)_9.sortField="value";if(this.fieldDataSource){_9=isc.addProperties(_9,{completeOnTab:true,optionDataSource:this.fieldDataSource,valueField:"name",displayField:this.showFieldTitles?"title":"name",pickListProperties:{reusePickList:function(){return false}}})}else if(this.dataSources!=null&&this.createRuleCriteria){var _26=this,_27=(this.multiDSFieldFormat==isc.FilterBuilder.SEPARATED?"title":"name"),_28=(this.showFieldTitles?"title":"name"),_29=this.getTopLevelFilterBuilder().$167n,_30=this.getTopLevelFilterBuilder().targetComponent,_31=this.getMultiDSFieldDataSource(_29.getRuleContext(),_30);_9=isc.addProperties(_9,{optionDataSource:_31,valueField:"name",displayField:_27,pickListFields:[{name:"name",type:"text",hidden:(_27!="name")},{name:"title",type:"text",hidden:(_27!="title")}],pickListProperties:{reusePickList:function(){return false},formatCellValue:function(_22,_37,_38,_39){return(_37.enabled==false||_26.multiDSFieldFormat==isc.FilterBuilder.QUALIFIED?_22:"&nbsp;&nbsp;"+_22)}}})}else{var _32=this.getFieldNames(true);_32.remove(_3);var _33={};for(var i=0;i<_32.length;i++){var _35=_32[i];if(this.showFieldTitles){var _36=this.getField(_35);_33[_35]=_36.summaryTitle||_36.title||_35}else{_33[_35]=_35}}
_9=isc.addProperties(_9,{valueMap:_33})}
_8.add(isc.addProperties(_9,this.getValueFieldProperties(_6,_3,_2.ID,"name"),this.fieldPickerProperties,{name:"value"}))}else if(_5=="valueRange"){_9=this.combineFieldData(isc.addProperties({type:_7,editorType:_4,showTitle:false,width:_12,changed:function(){this.form.creator.valueChanged(this,this.form)}}),_1);if(_14){_9.showHintInField=true;_9.hint=_14}
_8.addList([isc.addProperties({},_9,{name:"start"},this.getValueFieldProperties(_6,_3,_2.ID,"start"),!_10?{}:{rangePosition:"start"}),isc.addProperties({type:"staticText",name:"rangeSeparator",showTitle:false,width:null,wrap:false,clipValue:false,clipStaticValue:false,shouldSaveValue:false,defaultValue:this.filterBuilder?this.filterBuilder.rangeSeparator:null,changed:function(){this.form.creator.valueChanged(this,this.form)}},this.getRangeSeparatorProperties(_6,_3,_2.ID)),isc.addProperties({},_9,{name:"end"},this.getValueFieldProperties(_6,_3,_2.ID,"end"),!_10?{}:{rangePosition:"end"})])}
for(var i=0;i<_8.length;i++){if(!_8[i].criteriaField)_8[i].criteriaField=_3;if(!_8[i].operator)_8[i].operator=_2.ID}
if(this.validateOnChange){for(var i=0;i<_8.length;i++){isc.addProperties(_8[i],{blur:function(_37,_38){if(!_37.creator.itemsInError)_37.creator.itemsInError=[];if(!_37.validate(null,null,true)){_38.focusInItem();if(!_37.creator.itemsInError.contains(_38)){_37.creator.itemsInError.add(_38)}}else{if(_37.creator.itemsInError.contains(_38)){_37.creator.itemsInError.remove(_38)}}}})}}
for(var i=0;i<_8.length;i++){if(_8[i].showIf!=null)delete _8[i].showIf;if(_8[i].type=="text"&&isc.Browser.isTouch&&_2.ID!="equals"&&_2.ID!="notEqual"&&_2.ID!="iEquals"&&_2.ID!="iNotEqual")
{_8[i].browserAutoCorrect=false}}
return _8},isc.A.getValueItemHintText=function isc_FilterClause_getValueItemHintText(_1,_2){if(_1=="fieldName")return this.valueItemFieldHint;if(_1=="valueSet")return this.valueSetHint;if(_1=="fieldType"||_1=="custom"||_1=="valueRange"){if(!isc.SimpleType.inheritsFrom(_2,"boolean")&&!isc.SimpleType.inheritsFrom(_2,"date"))
{return this.valueItemTextHint}}
return null},isc.A.getValueFieldProperties=function isc_FilterClause_getValueFieldProperties(_1,_2,_3,_4){if(this.filterBuilder){return this.filterBuilder.getValueFieldProperties(_1,_2,_3,_4)}},isc.A.getRangeSeparatorProperties=function isc_FilterClause_getRangeSeparatorProperties(_1,_2,_3){if(this.filterBuilder)return this.filterBuilder.getRangeSeparatorProperties(_1,_2,_3)},isc.A.remove=function isc_FilterClause_remove(){this.markForDestroy()},isc.A.getValues=function isc_FilterClause_getValues(){var _1=this.clause;return _1.getValues()},isc.A.getFieldName=function isc_FilterClause_getFieldName(_1){var _2=this.getFieldNameFromPicker(this.fieldPicker,_1);if(_2)return _2;return this.fieldName},isc.A.getFieldNameFromPicker=function isc_FilterClause_getFieldNameFromPicker(_1,_2){if(_1){var _3=_1.optionDataSource!=null;if(!_3)return _1.getValue();var _4=_1.getSelectedRecord();if(_4)return _2?_4.name:(_4.dataPath||_4.name);var _5=_1.getValue();if(_5)return _5}
return null},isc.A.getCriterion=function isc_FilterClause_getCriterion(_1){if(!this.clause)return null;var _2=this.getFieldName(),_3=this.operatorPicker?this.operatorPicker.getValue():null;if(!_2)return null;if(isc.isA.String(_3))_3=this.getSearchOperator(_3,_2);if(_3==null){return}
var _4=this.getClauseValues(_2,_3,_1);if(_4&&!_1&&_4.valuePath==null){if(!_3||(_3.valueType!="none"&&_3.valueType!="valueRange"&&!isc.DS.isAdvancedCriteria(_4)&&(_4.value==null||(isc.isA.String(_4.value)&&_4.value==""))))
{return null}
if(_3.valueType=="valueRange"&&!_4.start&&!_4.end){return null}}
return _4},isc.A.getClauseValues=function isc_FilterClause_getClauseValues(_1,_2,_3){var _4=this.clause,_5={},_6=_4.getField("value"),_7=_4.getField("valuePath"),_8=_4.getField("start"),_9=_4.getField("end"),_10=_2.valueAttribute||this.valueAttribute,_11=_2.rangeStartAttribute||this.rangeStartAttribute,_12=_2.rangeEndAttribute||this.rangeEndAttribute;_5[this.operatorAttribute]=_4.getValue("operator");if(_1!=null)_5.fieldName=_1;if(_5&&_7&&_7.isVisible()){_5["valuePath"]=_7.getValue()}else{if(_2[this.customGetValuesFunction]&&isc.isA.Function(_2[this.customGetValuesFunction]))
{if(_6){_5=_2[this.customGetValuesFunction](_1,_6,_3);if(_5&&_2&&_2.condition){if(_2.ID&&_2.ID!=_5[this.operatorAttribute]){_5[this.operatorAttribute]=_2.ID}}}else if(_8&&_9){var _13=_2[this.customGetValuesFunction](_1,_8),_14=_2[this.customGetValuesFunction](_1,_9);_5.fieldName=_13.fieldName;_5[this.operatorAttribute]=_13.operator;_5[_11]=_13.value;_5[_12]=_14.value}}else{if(_6)_5[_10]=_6.getValue();if(_8)_5[_11]=_8.getValue();if(_9)_5[_12]=_9.getValue()}}
var _15=this.getField(_1);if(_5&&isc.isA.Date(_5[this.valueAttribute])&&(!_15||!isc.SimpleType.inheritsFrom(_15.type,"datetime")))
{_5[_10].logicalDate=true}
return _5},isc.A.setClauseValues=function isc_FilterClause_setClauseValues(_1,_2,_3){if(this.clause==null)return;var _4=this.clause,_5=_4.getField("value"),_6=_4.getField("start"),_7=_4.getField("end"),_8=_2.valueAttribute||this.valueAttribute,_9=_2.rangeStartAttribute||this.rangeStartAttribute,_10=_2.rangeEndAttribute||this.rangeEndAttribute;if(_2[this.customSetValuesFunction]&&isc.isA.Function(_2[this.customSetValuesFunction]))
{if(_5){_2[this.customSetValuesFunction](_1,_5,_3)}else{_2[this.customSetValuesFunction](_1,_6,_3);_2[this.customSetValuesFunction](_1,_7,_3)}}else{if(_5)_5.setValue(_3[_8]);if(_6)_6.setValue(_3[_9]);if(_7)_7.setValue(_3[_10])}},isc.A.setDefaultFocus=function isc_FilterClause_setDefaultFocus(){if(!this.clause)return;if(isc.isA.Function(this.clause.focusInItem))this.clause.focusInItem("fieldName")},isc.A.validate=function isc_FilterClause_validate(){return this.clause?this.clause.validate(null,null,true):true},isc.A.itemChanged=function isc_FilterClause_itemChanged(){if(this.creator&&isc.isA.Function(this.creator.itemChanged))this.creator.itemChanged()},isc.A.valueChanged=function isc_FilterClause_valueChanged(_1,_2){},isc.A.fieldNameChanged=function isc_FilterClause_fieldNameChanged(){var _1=this.clause.getValue("fieldName")!=null&&this.clause.getValue("fieldName")!="";this.clause.getItem("operator").disabled=!_1;this.updateFields()},isc.A.removeValueFields=function isc_FilterClause_removeValueFields(_1){if(!this.clause)return;this.removeValueField("value",_1);this.removeValueField("valuePath",_1);this.removeValueField("rangeSeparator",_1);this.removeValueField("start",_1);this.removeValueField("end",_1)},isc.A.removeValueField=function isc_FilterClause_removeValueField(_1,_2){var _3=this.clause,_4=_3.getItem(_1);if(_4){var _5=_4.getValue()
_3.removeItem(_4);if(!_2)_3.setValue(_1,_5)}},isc.A.operatorChanged=function isc_FilterClause_operatorChanged(){if(!this.clause)return;var _1=this.clause,_2=this.fieldName||_1.getValue("fieldName");if(_2==null)return;var _3=this.getField(_2);var _4=this.getSearchOperator(_1.getValue("operator"),_3);this.updateValueItems(_3,_4,_2)},isc.A.updateValueItems=function isc_FilterClause_updateValueItems(_1,_2,_3){var _4=this.clause;var _5=_4.getItem("value");var _6=_5?_5.valueType:null;var _7=_5?_5.getValue():null;_5=null;this.removeValueFields();if(_3)_4.removeExtraAdvancedCriteriaFields([_3]);var _8=this.buildValueItemList(_1,_2,_3)
_4.addItems(_8);var _9=_4.getItem("value");var _10=_4.getItem("valuePath");var _11=_9?_9.valueType:null;var _12=_9!=null&&_11!=null&&this.retainValuesAcrossFields;if(_12){if(_9.optionDataSource||(_11!=_6&&(_6!="fieldType"&&_11!="valueSet"))||(_9.getValueMap()&&_9.$193&&!_9.$193(_7)))
{_12=false}}
if(!_12){if(_9)_9.clearValue();if(_10)_10.clearValue()}
if(this.dynamicValueButton){if(_10){this.dynamicValueButton.show()}else{this.dynamicValueButton.hide()}}},isc.A.updateOperatorDefault=function isc_FilterClause_updateOperatorDefault(_1){var _2=this.clause.getItem("operator");if(_2){var _3=this.getPrimaryDS(_1);if(_3){_2.defaultValue=_3.getFieldDefaultOperator(_1.name);var _4=this.$198w(_1);if(_4&&_4.length>0){if(!_4.contains(_2.defaultValue))_2.defaultValue=_4[0];if(!_4.contains(_2.getValue()))_2.clearValue()}}else{_2.defaultValue=isc.SimpleType.getDefaultOperator(_1.type)}}},isc.A.updateFields=function isc_FilterClause_updateFields(){if(!this.clause)return;var _1=this.clause,_2=this.$74o,_3=this.fieldName||_1.getValue("fieldName");if(_3==null)return;if(_3==_2)return;var _4=this.getField(_3),_5=this.getField(_2);if(!_4)return;this.updateOperatorDefault(_4);_1.getItem("operator").setValueMap(this.getFieldOperatorMap(_4,false,"criteria",true));var _6=_1.getValue("operator");if(_6==null||_1.getValue("operator")!=_6){if(_1.getValue("operator")==null){var _7=_1.getField("operator");_7.setValue(_7.defaultValue||_7.getFirstOptionValue())}
_6=_1.getValue("operator")}
_6=this.getSearchOperator(_6,_4);var _8;if(_1.getItem("value")){var _9=_1.getItem("value").type,_10=_4.type||"text";var _11=_10=="intEnum"||_10=="enum"||isc.SimpleType.inheritsFrom(_10,"enum")||isc.SimpleType.inheritsFrom(_10,"intEnum");_8=_11||_9!=_10}
this.removeValueFields(_8);if(_2)this.clause.removeExtraAdvancedCriteriaFields([_2]);_1.addItems(this.buildValueItemList(_4,_6,_3));if(this.dynamicValueButton){if(_1.getItem("valuePath")){this.dynamicValueButton.show()}else{this.dynamicValueButton.hide()}}
var _12=_1.getItem("value");if(!_8){var _13=((_4.valueMap||_4.optionDataSource)||(_5&&(_5.valueMap||_5.optionDataSource))||!this.retainValuesAcrossFields);if(_12&&_13)_12.clearValue()}
if(_12)_12.validate();if(_1.getItem("start")){_1.setValue("start",null);_1.getItem("start").validate()}
if(_1.getItem("end")){_1.setValue("end",null);_1.getItem("end").validate()}
if(_1.getValue("valuePath")!=null){_1.getItem("value").hide();_1.getItem("valuePath").show()}
this.$74o=_3},isc.A.$198w=function isc_FilterClause__getFieldOperators(_1){var _2=_1&&_1.name;return this.getFieldOperators(_2,_1)},isc.A.getFieldOperators=function isc_FilterClause_getFieldOperators(_1,_2){var _3=this.getFilterBuilder();if(!_3)return null;_2=_2||this.getField(_1);return _3.getFieldOperators(_1,_2)},isc.A.topOperatorChanged=function isc_FilterClause_topOperatorChanged(_1){},isc.A.dynamicValueButtonClick=function isc_FilterClause_dynamicValueButtonClick(_1,_2){if(!this.dynamicPathWindow){var _3=(this.multiDSFieldFormat==isc.FilterBuilder.SEPARATED?"title":"name"),_4=this.clause.getValue("valuePath"),_5=function(_6){this.creator.setClauseValuePath(_6)};this.createDynamicValueWindow(_1,_2,_3,_4,_5)}
this.dynamicValueWindow.show()});isc.evalBoundary;isc.B.push(isc.A.setClauseFieldName=function isc_FilterClause_setClauseFieldName(_1){var _2=this.clause,_3=_2.getValue("fieldName");if(_3!=_1){_2.setValue("fieldName",_1);this.fieldNameChanged()}},isc.A.setClauseValuePath=function isc_FilterClause_setClauseValuePath(_1){var _2=this.clause;if(_1!=null){_2.setValue("valuePath",_1);_2.getItem("value").defaultValue=null;_2.getItem("value").clearValue()}else{_2.getItem("valuePath").defaultValue=null;_2.getItem("valuePath").clearValue()}
if(_1){_2.getItem("valuePath").show();_2.getItem("value").hide()}else{_2.getItem("valuePath").hide();_2.getItem("value").show()}},isc.A.createDynamicValueWindow=function isc_FilterClause_createDynamicValueWindow(_1,_2,_3,_4,_5){var _6=this,_7=this.getTopLevelFilterBuilder().$167n,_8=this.getTopLevelFilterBuilder().targetComponent,_9=this.getMultiDSFieldDataSource(_7.getRuleContext(),_8);if(_4!=null){_9.testData.addAt({name:null},0)}
var _10=this.createAutoChild("ruleScopeGrid",{dataSource:_9,pathField:_3,clearValueText:this.dynamicValueClearValueText}),_11=isc.IButton.create({title:"OK",click:function(){_6.dynamicValueWindow.okButtonClick()}}),_12=isc.IButton.create({title:"Cancel",click:function(){_6.dynamicValueWindow.closeClick()}});this.dynamicValueWindow=this.createAutoChild("dynamicValueWindow",{title:this.dynamicValueWindowTitle.evalDynamicString(this,{fieldTitle:_2}),items:[_10,isc.HLayout.create({height:1,layoutAlign:"right",membersMargin:5,members:[_11,_12]})],ruleScopeDS:_9,ruleScopeGrid:_10,selectedValuePath:_4,valueSelected:_5,init:function(){this.Super("init",arguments);this.observe(_10,"dataArrived","observer.$171r()")},destroy:function(){if(this.ruleScopeDS){this.ruleScopeDS.destroy()}
this.Super("destroy",arguments)},$171r:function(){if(!this.selectedValuePath)return;var _13=this.ruleScopeGrid,_14=this.ruleScopeGrid.data,_15=this.selectedValuePath;if(_14){var _16=_13.data.find("name",_15);if(!_16)_16=_13.data.find("criteriaPath",_15);if(_16)_13.selectSingleRecord(_16);this.selectedValuePath=null}}})},isc.A.getMultiDSFieldDataSource=function isc_FilterClause_getMultiDSFieldDataSource(_1,_2){var _3=this.$171s,_4=this.getTopLevelFilterBuilder().excludedRuleScope,_5=this.getTopLevelFilterBuilder().$167n,_6=isc.Canvas.getRuleScopeDataSourceOwners(_5),_7=[],_8=[],_9=false,_10=[],_11="";for(var i=0;i<_3.length;i++){var _13=_3[i];if(isc.isA.String(_13))_13=isc.DataSource.get(_13);if(_13==null){this.logWarn("getMultiDSFieldDataSource() - unable to locate dataSource:"+_3[i]);continue}
var _14=_13.getID(),_15=_13.getFieldNames(),_16=(this.multiDSFieldFormat==isc.FilterBuilder.SEPARATED);var _17=_10;if(_2){if(_13.criteriaBasePath){var _18=_13.criteriaBasePath.split(".")[0];if(_18==_2.ID){_17=_8}}else if(_2.dataSource&&_2.dataSource.getID()==_14){_17=_7}}
if(_16&&_11!=_14){var _19=(_13.criteriaBasePath?"":"<i>"),_20=(_13.criteriaBasePath?"":"</i>"),_21=_13.pluralTitle||_13.title||_14,_22=_19+(_17==_7&&_13.criteriaBasePath?"Current Component":_21)+_20+" Fields",_23=_6[_13.ID],_24=(_23?isc.Canvas.getRuleScopeSourceFromComponent(_23):null);if(_23&&_24)_22+=" ("+_24+" in <i>"+_23.getID()+"</i>)";if(_23==_2&&_24)_9=true;_17[_17.length]={name:_14,title:_22,type:"text",enabled:false};_11=_14}
for(var j=0;j<_15.length;j++){var _26=_14+"."+_15[j],_27=_13.fields[_15[j]],_28=(_16?_27.title:_26);var _29={name:_26,title:_28,type:_27.type};if(_13.criteriaBasePath){_29.criteriaPath=_27.criteriaPath||_26.replace(_14,_13.criteriaBasePath);if(_4&&_4.contains(_29.criteriaPath)){continue}
if(_17==_7&&!_27.criteriaPath){var _30=_27.criteriaBasePath||_13.criteriaBasePath,_31=_29.criteriaPath;_29.criteriaPath=_29.criteriaPath.replace(_30,"");if(_29.criteriaPath.startsWith("."))_29.criteriaPath=_29.criteriaPath.substring(1)}}else if(_4&&_4.contains(_26)){continue}
if(_1){_29.value=isc.DataSource.getPathValue(_1,_26)}
_17[_17.length]=_29}}
if(!_9&&_7.length>(_16?1:0)){_10.addListAt(_7,0)}
if(_8.length>(_16?1:0)){_10.addListAt(_8,0)}
var _32=isc.DS.create({$172q:true,clientOnly:true,fields:[{name:"name",type:"text"},{name:"title",type:"text"}],testData:_10});return _32});isc.B._maxIndex=isc.C+44;isc.FilterClause.registerStringMethods({remove:""});isc.defineClass("FilterBuilder","Layout");isc.A=isc.FilterBuilder;isc.A.missingFieldPrompt="[missing field definition]";isc.A.SEPARATED="separated";isc.A.QUALIFIED="qualified";isc.A=isc.FilterBuilder;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getFilterDescription=function isc_c_FilterBuilder_getFilterDescription(_1,_2){return isc.DataSource.getAdvancedCriteriaDescription(_1,_2)});isc.B._maxIndex=isc.C+1;isc.A=isc.FilterBuilder.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.vertical=false;isc.A.vPolicy="none";isc.A.height=1;isc.A.defaultWidth=400;isc.A.sortFields=true;isc.A.fieldPickerDefaults={name:"fieldName",textMatchStyle:"startsWith",showTitle:false,hint:"Choose a field",showHintInField:true,changed:function(){this.form.creator.fieldNameChanged(this.form)}};isc.A.fieldPickerTitle="Field Name";isc.A.operatorPickerDefaults={name:"operator",editorType:"SelectItem",showTitle:false,addUnknownValues:false,defaultToFirstOption:true,changed:function(){this.form.creator.operatorChanged(this.form)}};isc.A.operatorPickerTitle="Operator";isc.A.fieldPickerWidth="*";isc.A.operatorPickerWidth=150;isc.A.valueItemWidth=150;isc.A.multiDSFieldFormat=isc.FilterBuilder.SEPARATED;isc.A.dynamicValuePrefix="Dynamic: ";isc.A.dynamicValueButtonPrompt="Select dynamic value";isc.A.dynamicValueWindowTitle="Choose dynamic value for field ${fieldTitle}";isc.A.dynamicValueClearValueText="&lt;Use static value instead&gt;";isc.A.showFieldTitles=true;isc.A.validateOnChange=true;isc.A.showRemoveButton=true;isc.A.removeButtonPrompt="Remove";isc.A.lastClausePrompt="The last clause cannot be removed";isc.A.removeButtonDefaults={_constructor:isc.ImgButton,width:18,height:18,layoutAlign:"center",src:"[SKIN]/actions/remove.png",showRollOver:false,showDown:false,click:function(){this.creator.removeButtonClick(this.clause)}};isc.A.showAddButton=true;isc.A.addButtonPrompt="Add";isc.A.addButtonDefaults={_constructor:isc.ImgButton,autoParent:"buttonBar",width:18,height:18,src:"[SKIN]/actions/add.png",showRollOver:false,showDown:false,click:function(){this.creator.addButtonClick(this.clause)}};isc.A.buttonBarDefaults={_constructor:isc.HStack,autoParent:"clauseStack",membersMargin:4,defaultLayoutAlign:"center",height:1};isc.A.retainValuesAcrossFields=true;isc.A.topOperatorOptions=["and","or","not"];isc.A.topOperator="and";isc.A.topOperatorAppearance="bracket";isc.A.radioOperatorLayoutDefaults={autoParent:"clauseStack",_constructor:isc.HLayout,height:1,width:1};isc.A.radioOperatorFormDefaults={autoParent:"radioOperatorLayout",height:1,numCols:1,colWidths:["*"],width:275,items:[{name:"operator",type:"radioGroup",showTitle:false,title:"Overall Operator",vertical:false,changed:function(_1,_2,_3){_1.creator.topOperatorChanged(_3)}}]};isc.A.radioOperatorFormConstructor=isc.DynamicForm;isc.A.modeSwitcherDefaults={height:30,autoFit:true,wrap:false,cursor:"pointer",click:function(){this.creator.switchMode()}};isc.A.modeSwitcherConstructor=isc.Label;isc.A.radioOperatorTitle="Overall Operator";isc.A.topOperatorFormDefaults={height:1,width:80,numCols:1,colWidths:["*"],layoutAlign:"center",_constructor:isc.DynamicForm};isc.A.topOperatorItemDefaults={name:"operator",editorType:"SelectItem",showTitle:false,changed:function(_1,_2,_3){_1.creator.topOperatorChanged(_3)}};isc.A.topOperatorItemWidth="*";isc.A.topOperatorTitle="Clause Operator";isc.A.defaultSubClauseOperator="or";isc.A.matchAllTitle="Match All";isc.A.matchNoneTitle="Match None";isc.A.matchAnyTitle="Match Any";isc.A.inlineAndTitle="and";isc.A.inlineOrTitle="or";isc.A.inlineAndNotTitle="and not";isc.A.modeSwitcherAdvancedMessage="Advanced..";isc.A.modeSwitcherSimpleMessage="Simple Mode..";isc.A.modeSwitcherFlattenWarningMessage="Criteria will be modified to fit in simpler editing interface";isc.A.clauseStackDefaults={_constructor:isc.VStack,height:1,membersMargin:1,animateMembers:true,animateMemberTime:150};isc.A.clauseConstructor="FilterClause";isc.A.rangeSeparator="and";isc.A.subClauseButtonTitle="+()";isc.A.subClauseButtonPrompt="Add Subclause";isc.A.subClauseButtonDefaults={_constructor:"IButton",autoParent:"buttonBar",autoFit:true,click:function(){this.creator.addSubClause(this.clause)}};isc.A.bracketDefaults={styleName:"bracketBorders",width:10};isc.A.$175q=null;isc.A.$175r=null;isc.A.$10j="Enter";isc.A.allowEmptyValues=false;isc.B.push(isc.A.setDataSource=function isc_FilterBuilder_setDataSource(_1){var _2=isc.DataSource.get(_1);if(!this.dataSource||(isc.DataSource.get(this.dataSource).ID!=_2.ID)){this.dataSource=_2;if(this.clauses)this.clearCriteria();else this.rebuild()}},isc.A.setDataSources=function isc_FilterBuilder_setDataSources(_1){this.dataSources=_1;if(this.clauses)this.clearCriteria();else this.rebuild()},isc.A.addButtonClick=function isc_FilterBuilder_addButtonClick(){this.addNewClause()},isc.A.removeButtonClick=function isc_FilterBuilder_removeButtonClick(_1){if(!_1)return;this.removeClause(_1)},isc.A.removeClause=function isc_FilterBuilder_removeClause(_1){this.clauses.remove(_1);if(this.clauseStack)this.clauseStack.hideMember(_1,function(){_1.destroy()});this.updateFirstRemoveButton();if(this.clauses[0]&&this.clauses[0].updateInlineTopOperator)this.clauses[0].updateInlineTopOperator();_1.filterBuilder=null;if(isc.isA.Function(this.filterChanged))this.filterChanged()},isc.A.updateFirstRemoveButton=function isc_FilterBuilder_updateFirstRemoveButton(){var _1=this.clauses[0];if(!_1||!_1.removeButton)return;if(this.clauses.length==1&&!this.allowEmpty){_1.removeButton.disable()}else if(this.clauses.length>1){_1.removeButton.enable()}},isc.A.isFirstClause=function isc_FilterBuilder_isFirstClause(_1){return this.clauses[0]==_1},isc.A.setTopOperator=function isc_FilterBuilder_setTopOperator(_1){this.topOperator=_1;var _2=this.topOperatorAppearance;if(_2=="bracket"){this.topOperatorForm.setValue("operator",_1)}else if(_2=="radio"){this.radioOperatorForm.setValue("operator",_1)}},isc.A.topOperatorChanged=function isc_FilterBuilder_topOperatorChanged(_1){this.topOperator=_1;if(isc.isA.Function(this.filterChanged))this.filterChanged()},isc.A.setTopOperatorAppearance=function isc_FilterBuilder_setTopOperatorAppearance(_1){if(this.topOperatorAppearance==_1)return;var _2=this.getCriteria(true);if(this.topOperatorAppearance=="bracket"&&_1=="radio"){_2=isc.DataSource.flattenCriteria(_2)}
this.topOperatorAppearance=_1;this.$1243(_2)},isc.A.getPrimaryDS=function isc_FilterBuilder_getPrimaryDS(_1){if(this.dataSources){if(_1==null){return isc.DataSource.get(this.dataSources[0])}
if(isc.isAn.Object(_1)){if(_1.$93k!=null){_1=_1.$93k}
for(var i=0;i<this.dataSources.length;i++){var _3=isc.getValues(this.dataSources[i].getFields());if(_3.contains(_1))return this.dataSources[i]}
_1=_1.name}
return isc.DataSource.getDataSourceForField(_1,this.dataSources)}
if(this.dataSource)return this.getDataSource();else if(this.fieldDataSource)return this.fieldDataSource},isc.A.getTopOperatorMap=function isc_FilterBuilder_getTopOperatorMap(_1){var _2=this.getPrimaryDS(),_3=_1=="bracket"?_2?_2.getTypeOperatorMap("text",true,"criteria"):null:null;if(!_3){_3={"and":this.matchAllTitle,"or":this.matchAnyTitle,"not":this.matchNoneTitle}}
var _4=this.topOperator,_5=this.topOperatorOptions,_6={};if(!_5.contains(_4))this.topOperator=_5[0];if(_3){for(var i=0;i<_5.length;i++){if(_3[_5[i]])_6[_5[i]]=_3[_5[i]]}}
return _6},isc.A.initWidget=function isc_FilterBuilder_initWidget(){this.Super("initWidget",arguments);if(this.targetRuleScope){if(this.allowRuleScopeValues!=false)this.allowRuleScopeValues=true;var _1=this.targetRuleScope;this.$167n=(isc.isA.String(_1)?window[_1]:this.targetRuleScope);if(!this.$171s){this.$171s=isc.Canvas.getAllRuleScopeDataSources(this.$167n);this.$172r=true}
if(this.createRuleCriteria){this.dataSource=null;this.dataSources=this.$171s}}
this.rebuild()},isc.A.destroy=function isc_FilterBuilder_destroy(){if(this.$171s&&this.$172r){for(var i=0;i<this.$171s.length;i++){var _2=this.$171s[i];if(_2.criteriaBasePath){_2.destroy()}}}
this.Super("destroy",arguments)},isc.A.rebuild=function isc_FilterBuilder_rebuild(){if(isc.isA.String(this.fieldDataSource))
this.fieldDataSource=isc.DS.get(this.fieldDataSource);if(isc.isA.String(this.dataSource))
this.dataSource=isc.DS.get(this.dataSource);if(!this.getPrimaryDS())this.logWarn("No available DataSources.");if(this.fieldDataSource&&this.criteria)this.$75v=true;this.fieldPickerDefaults.title=this.fieldPickerTitle;if(this.radioOptions)this.topOperatorOptions=this.radioOptions.duplicate();delete this.radioOptions;this.addButtonDefaults.prompt=this.addButtonPrompt;this.removeButtonDefaults.prompt=this.removeButtonPrompt;this.subClauseButtonDefaults.prompt=this.subClauseButtonPrompt;this.subClauseButtonDefaults.title=this.subClauseButtonTitle;this.$211()},isc.A.$1243=function isc_FilterBuilder__recreateForm(_1){this.criteria=_1;delete this.showSubClauseButton;this.topOperatorForm=this.bracket=this.clauseStack=null;this.radioOperatorForm=this.radioOperatorLayout=this.modeSwitcher=null;this.buttonBar=this.addButton=this.subClauseButton=null;for(var i=0,_3=this.clauses;i<_3.length;i++){_3[i].destroy()}
var _4=this.getMembers().duplicate();for(var i=0;i<_4.length;i++){this.removeMember(_4[i]);_4[i].destroy()}
this.$211()},isc.A.$211=function isc_FilterBuilder__createForm(){var _1;if(this.showSubClauseButton==_1){this.showSubClauseButton=(this.topOperatorAppearance!="radio"&&this.topOperatorAppearance!="inline")}
this.clauses=[];var _2=this.topOperatorAppearance;var _3=this.getPrimaryDS(),_4=this.getTopOperatorMap(_2);if(this.showModeSwitcher){var _5="<span style='color:blue;text-decoration:underline;'>"+(_2=="radio"?this.modeSwitcherAdvancedMessage:this.modeSwitcherSimpleMessage)+"</span>";this.modeSwitcher=this.createAutoChild("modeSwitcher",{contents:_5})}
if(_2=="bracket"){if(this.showTopRemoveButton){var _6=this.removeButton=this.createAutoChild("removeButton",{click:function(){this.creator.parentClause.removeButtonClick(this.creator)}});this.addMember(_6)}
var _7={items:[isc.addProperties({width:this.topOperatorItemWidth},this.topOperatorItemDefaults,this.topOperatorItemProperties)]};this.addAutoChild("topOperatorForm",_7);this.topOperatorForm.items[0].title=this.topOperatorTitle;this.topOperatorForm.items[0].valueMap=_4;this.topOperatorForm.items[0].defaultValue=this.topOperator;this.addAutoChild("bracket")}
this.addAutoChild("clauseStack");this.clauseStack.hide();if(_2=="radio"){this.addAutoChild("radioOperatorLayout");this.addAutoChild("radioOperatorForm");var _8=_4;this.radioOperatorForm.items[0].title=this.radioOperatorTitle;this.radioOperatorForm.items[0].valueMap=_8;this.radioOperatorForm.items[0].defaultValue=this.topOperator;if(this.showModeSwitcher)this.radioOperatorLayout.addMember(this.modeSwitcher)}
this.addAutoChildren(["buttonBar","addButton","subClauseButton"]);if(this.showModeSwitcher&&_2=="bracket"){this.buttonBar.addMember(isc.LayoutSpacer.create({width:20}));this.buttonBar.addMember(this.modeSwitcher)}
this.stripNullCriteria(this.criteria);this.$155t(this.criteria)},isc.A.switchMode=function isc_FilterBuilder_switchMode(){if(this.topOperatorAppearance=="bracket"){var _1=this.getCriteria(true);if(!isc.DataSource.canFlattenCriteria(_1)){var _2=this;isc.confirm(this.modeSwitcherFlattenWarningMessage,function(_3){if(_3)_2.setTopOperatorAppearance("radio")});return}
this.setTopOperatorAppearance("radio")}else{this.setTopOperatorAppearance("bracket")}},isc.A.addNewClause=function isc_FilterBuilder_addNewClause(_1,_2,_3){var _4=this.createAutoChild("clause",isc.addProperties({},this.inheritedClauseProperties,{visibility:"hidden",flattenItems:true,criterion:_1,dataSources:this.dataSources,dataSource:this.dataSource,fieldDataSource:this.fieldDataSource,$171s:this.$171s,sortFields:this.sortFields,validateOnChange:this.validateOnChange,showFieldTitles:this.showFieldTitles,showRemoveButton:this.showRemoveButton,removeButtonPrompt:this.removeButtonPrompt,retainValuesAcrossFields:this.retainValuesAcrossFields,field:_2,fieldData:this.fieldData,fieldPickerDefaults:this.fieldPickerDefaults,fieldPickerProperties:this.fieldPickerProperties,fieldPickerWidth:this.fieldPickerWidth,operatorPickerWidth:this.operatorPickerWidth,valueItemWidth:this.valueItemWidth,operatorPickerDefaults:this.operatorPickerDefaults,operatorPickerProperties:this.operatorPickerProperties,remove:function(){this.creator.removeClause(this)},fieldNameChanged:function(){this.Super("fieldNameChanged",arguments);this.creator.fieldNameChanged(this)},topOperatorAppearance:this.topOperatorAppearance,topOperator:this.topOperator,topOperatorOptions:this.topOperatorOptions,topOperatorFormDefaults:this.topOperatorFormDefaults,topOperatorFormProperties:this.topOperatorFormProperties,topOperatorItemDefaults:this.topOperatorItemDefaults,topOperatorItemProperties:this.topOperatorItemProperties,topOperatorItemWidth:this.topOperatorItemWidth,showSelectionCheckbox:this.showSelectionCheckbox,negated:_3,filterBuilder:this,width:"100%",multiDSFieldFormat:this.multiDSFieldFormat,dynamicValuePrefix:this.dynamicValuePrefix,dynamicValueButtonPrompt:this.dynamicValueButtonPrompt,dynamicValueWindowTitle:this.dynamicValueWindowTitle,dynamicValueClearValueText:this.dynamicValueClearValueText,allowRuleScopeValues:this.allowRuleScopeValues,createRuleCriteria:this.createRuleCriteria,inheritedClauseProperties:this.inheritedClauseProperties}));var _5=this.$74e(_4);_4.updateInlineTopOperator();return _5},isc.A.addClause=function isc_FilterBuilder_addClause(_1){if(!_1)return _1;var _2=this;_1.fieldDataSource=this.fieldDataSource;_1.remove=function(){_2.removeClause(this)};_1.fieldNameChanged=function(){this.Super("fieldNameChanged",arguments);_2.fieldNameChanged(this)};var _3=this.$74e(_1);_1.updateInlineTopOperator();return _3},isc.A.$74e=function isc_FilterBuilder__addClause(_1){_1.filterBuilder=this;_1.updateFields();this.clauses.add(_1);var _2=this.clauseStack,_3=Math.max(0,_2.getMemberNumber(this.buttonBar)),_4=this;_2.addMember(_1,_3);_2.showMember(_1,function(){if(!_4.$845)_1.setDefaultFocus()});this.updateFirstRemoveButton();if(isc.isA.Function(this.filterChanged))this.filterChanged();return _1},isc.A.getChildFilters=function isc_FilterBuilder_getChildFilters(){var _1=[];for(var i=0;i<this.clauses.length;i++){var _3=this.clauses[i];if(isc.isA.FilterBuilder(_3))_1.add(_3)}
return _1},isc.A.setFocus=function isc_FilterBuilder_setFocus(_1){if(_1&&this.clauses&&this.clauses[0])this.clauses[0].setDefaultFocus();else this.Super("setFocus",arguments)},isc.A.getFilterDescription=function isc_FilterBuilder_getFilterDescription(){return isc.DataSource.getAdvancedCriteriaDescription(this.getCriteria(),(this.dataSources||this.dataSource))},isc.A.validate=function isc_FilterBuilder_validate(){var _1=true;for(var i=0;i<this.clauses.length;i++){if(!this.clauses[i].validate(null,null,true))_1=false}
return _1},isc.A.getFieldOperators=function isc_FilterBuilder_getFieldOperators(_1,_2){_2=_2||_1;var _3=this.getPrimaryDS(_2);return _3?_3.getFieldOperators(_2):null},isc.A.getValueFieldProperties=function isc_FilterBuilder_getValueFieldProperties(_1,_2,_3,_4){if(this.filterBuilder){return this.filterBuilder.getValueFieldProperties(_1,_2,_3,_4)}},isc.A.getRangeSeparatorProperties=function isc_FilterBuilder_getRangeSeparatorProperties(_1,_2,_3){return this.rangeSeparatorProperties},isc.A.childResized=function isc_FilterBuilder_childResized(){this.Super("childResized",arguments);if(this.clauseStack&&this.bracket)this.bracket.setHeight(this.clauseStack.getVisibleHeight())},isc.A.draw=function isc_FilterBuilder_draw(){this.Super("draw",arguments);if(this.clauseStack&&this.bracket)this.bracket.setHeight(this.clauseStack.getVisibleHeight());if(this.showModeSwitcher&&this.topOperatorAppearance=="bracket"){var _1=this.getCriteria(true);if(isc.DataSource.canFlattenCriteria(_1))this.setTopOperatorAppearance("radio")}},isc.A.resized=function isc_FilterBuilder_resized(){if(this.clauseStack&&this.bracket)this.bracket.setHeight(this.clauseStack.getVisibleHeight())},isc.A.addSubClause=function isc_FilterBuilder_addSubClause(_1){var _2;if(_1){_2=_1.operator}
var _3=this.createAutoChild("subClause",{dataSource:this.dataSource,dataSources:this.dataSources,showFieldTitles:this.showFieldTitles,filterBuilder:this,parentClause:this,retainValuesAcrossFields:this.retainValuesAcrossFields,topOperatorAppearance:"bracket",topOperator:_2||this.defaultSubClauseOperator||this.topOperator,topOperatorOptions:this.topOperatorOptions,clauseConstructor:this.clauseConstructor,topOperatorFormDefaults:this.topOperatorFormDefaults,topOperatorFormProperties:this.topOperatorFormProperties,topOperatorItemDefaults:this.topOperatorItemDefaults,topOperatorItemProperties:this.topOperatorItemProperties,topOperatorItemWidth:this.topOperatorItemWidth,fieldPickerDefaults:this.fieldPickerDefaults,fieldPickerProperties:this.fieldPickerProperties,subClauseButtonTitle:this.subClauseButtonTitle,subClauseButtonPrompt:this.subClauseButtonPrompt,fieldPickerWidth:this.fieldPickerWidth,operatorPickerWidth:this.operatorPickerWidth,valueItemWidth:this.valueItemWidth,operatorPickerProperties:this.operatorPickerProperties,operatorPickerDefaults:this.operatorPickerDefaults,fieldDataSource:this.fieldDataSource,fieldData:this.fieldData,sortFields:this.sortFields,showRemoveButton:this.showRemoveButton,showAddButton:this.showAddButton,showSubClauseButton:this.showSubClauseButton,showTopRemoveButton:this.showSubClauseButton,visibility:"hidden",saveOnEnter:this.saveOnEnter,validateOnChange:this.validateOnChange,dontCreateEmptyChild:_1!=null,multiDSFieldFormat:this.multiDSFieldFormat,dynamicValuePrefix:this.dynamicValuePrefix,dynamicValueButtonPrompt:this.dynamicValueButtonPrompt,dynamicValueWindowTitle:this.dynamicValueWindowTitle,dynamicValueClearValueText:this.dynamicValueClearValueText,allowRuleScopeValues:this.allowRuleScopeValues,createRuleCriteria:this.createRuleCriteria,filterChanged:function(){var _4=this.filterBuilder;while(_4.filterBuilder!=null){_4=_4.filterBuilder}
if(isc.isA.Function(_4.filterChanged)){_4.filterChanged()}},getFieldOperators:function(_5,_6){var _4=this.filterBuilder;while(_4.filterBuilder!=null){_4=_4.filterBuilder}
if(isc.isA.Function(_4.getFieldOperators)){return _4.getFieldOperators(_5,_6)}},inheritedClauseProperties:this.inheritedClauseProperties},this.Class);this.clauses.add(_3);this.clauseStack.addMember(_3,this.clauses.length-1);this.clauseStack.showMember(_3,function(){_3.topOperatorForm.focusInItem("operator");_3.bracket.setHeight(_3.getVisibleHeight())});this.updateFirstRemoveButton();return _3},isc.A.getCriteria=function isc_FilterBuilder_getCriteria(_1){if(this.$75v){return this.criteria}
if(this.topOperatorAppearance=="inline"){return this.getInlineCriteria(_1)}
var _2={_constructor:"AdvancedCriteria",operator:this.topOperator,criteria:[]};for(var i=0;i<this.clauses.length;i++){var _4=this.clauses[i],_5,_6=false;if(isc.isA.FilterBuilder(_4)){_5=_4.getCriteria(_1)}else{_5=_4.getCriterion(_1);_6=(_5==null)}
if(!_6){_2.criteria.add(_5)}}
if(this.createRuleCriteria){_2=this.$175s(_2)}else{_2=isc.clone(_2)}
return _2},isc.A.getInlineCriteria=function isc_FilterBuilder_getInlineCriteria(_1){var _2={_constructor:"AdvancedCriteria",operator:this.topOperator,criteria:[]};if(this.topOperator=="or"){var _3;for(var i=0;i<this.clauses.length;i++){if(this.clauses[i].topOperatorForm.getValue("operator")=="not"){_3=true;break}}
if(_3){_2.operator="and";var _5={operator:"or",criteria:[]}
_2.criteria.add(_5)}}
for(var i=0;i<this.clauses.length;i++){var _6=this.clauses[i];var _7=_6.topOperatorForm.getValue("operator");if(_7==this.topOperator){if(_3){_5.criteria.add(_6.getCriterion(_1))}else{_2.criteria.add(_6.getCriterion(_1))}}else{_2.criteria.add({operator:"not",criteria:[_6.getCriterion(_1)]})}}
return _2},isc.A.filterReady=function isc_FilterBuilder_filterReady(){},isc.A.setCriteria=function isc_FilterBuilder_setCriteria(_1){this.$155t(_1);if(this.showModeSwitcher){var _2=this.topOperatorAppearance,_3=isc.DataSource.canFlattenCriteria(_1);if(_2=="bracket"&&_3){this.setTopOperatorAppearance("radio")}if(_2!="bracket"&&!_3){this.setTopOperatorAppearance("bracket")}}},isc.A.$155t=function isc_FilterBuilder__setCriteria(_1){this.clearCriteria(true);var _2=this.clauseStack?this.clauseStack.animateMembers:null;if(this.clauseStack)this.clauseStack.animateMembers=false;this.stripNullCriteria(_1);this.$845=true;if(!this.$76t&&this.fieldDataSource&&_1){if(isc.isA.String(this.fieldDataSource)){this.fieldDataSource=isc.DS.getDataSource(this.fieldDataSource)}
var _3=this,_4=this.fieldDataSource.getCriteriaFields(_1),_5={};if(_4&&_4.length>0){_5={_constructor:"AdvancedCriteria",operator:"or",criteria:[]};for(i=0;i<_4.length;i++){var _6=_4[i],_7=this.fieldData?this.fieldData[_6]:null;if(!_7){_5.criteria[_5.criteria.length]={fieldName:"name",operator:"equals",value:_6}}}
if(_5.criteria.length!=0){this.$76t=true;this.fieldDataSource.fetchData(_5,function(_11){_3.fetchFieldsReply(_11,_1)});return}}}
if(!_1){if(!this.allowEmpty&&!this.dontCreateEmptyChild)this.addNewClause();this.clauseStack.show();this.redraw();this.filterReady();return}
if(!isc.DataSource.isAdvancedCriteria(_1,this.getPrimaryDS())){_1=isc.DataSource.convertCriteria(_1,"substring")}
if(this.topOperatorAppearance=="inline"){return this.setInlineCriteria(_1,_2)}
this.setTopOperator(_1.operator);if(this.createRuleCriteria){_1=this.$175t(_1)}
if((!_1.criteria||_1.criteria.length==0)&&!this.topOperatorOptions.contains(_1.operator))
{this.logWarn("Found top-level AdvancedCriteria with no sub-criteria. Converting to a top-level 'and' with a single sub-criterion");this.setTopOperator(this.topOperator);this.addNewClause(_1)}else{for(var i=0;i<_1.criteria.length;i++){var _9=_1.criteria[i],_10=this.fieldData?this.fieldData[_9.fieldName]:null;this.addCriterion(_9,_10)}
if(this.clauses.length==0&&!this.allowEmpty)this.addNewClause()}
delete this.$75v;this.$76t=false;this.$845=false;this.clauseStack.show();this.delayCall("redraw");if(this.clauseStack)this.clauseStack.animateMembers=_2;this.filterReady()},isc.A.$175s=function isc_FilterBuilder__translateFieldNamesToCriteriaPaths(_1){this.$175u();if(!isc.isA.emptyObject(this.$175q)){_1=isc.DataSource.copyCriteria(_1);this.$175v(_1,this.$175q,"ID",true)}
return _1},isc.A.$175t=function isc_FilterBuilder__translateCriteriaPathsToFieldNames(_1){this.$175u();if(!isc.isA.emptyObject(this.$175r)){_1=isc.DataSource.copyCriteria(_1);this.$175v(_1,this.$175r,"criteriaBasePath")}
return _1},isc.A.$175v=function isc_FilterBuilder__translateFieldNames(_1,_2,_3,_4){var _5=this.$179k(_1,_2,_3,_4,"fieldName");var _6=this.getPrimaryDS(_5);if(_6){var _7=_6.getSearchOperator(_1.operator);if(_7&&_7.valueType=="fieldName"){this.$179k(_1,_2,_3,_4,"value")}}
if(_1.criteria){for(var i=0;i<_1.criteria.length;i++){this.$175v(_1.criteria[i],_2,_3,_4)}}},isc.A.$179k=function isc_FilterBuilder__mapCriteriaFieldName(_1,_2,_3,_4,_5){var _6=_1[_5];if(_6&&!_6.contains(".")){_6=this.$177t(_6,_3)}
if(_6&&_2[_6]){_1[_5]=_2[_6];if(_4&&_1[_5].contains(".")&&_6!=isc.Canvas.$177s(_6)){var _7=this.targetComponent.ID+".values.";_1[_5]=_1[_5].replace(_7,"")}}
return _6},isc.A.$177t=function isc_FilterBuilder__globalizeFieldName(_1,_2){var _3=this.$171s;if(_3){var _4=this.targetComponent.ID+".values";for(var i=0;i<_3.length;i++){if(_3[i].criteriaBasePath==_4){_1=_3[i][_2]+"."+_1;break}}}
return _1},isc.A.$175u=function isc_FilterBuilder__populateCriteriaPathMaps(){if(this.$175q)return;var _1=this.$171s,_2={},_3={};if(_1){for(var i=0;i<_1.length;i++){if(!_1[i].criteriaBasePath)continue;var _5=_1[i],_6=_5.criteriaBasePath,_7=isc.getKeys(_5.getFields());for(var j=0;j<_7.length;j++){var _9=_5.fields[_7[j]],_10=_5.ID+"."+_9.name,_11=_9.criteriaPath||(_6+"."+_9.name);_2[_10]=_11;_3[_11]=_10}}}
this.$175q=_2;this.$175r=_3},isc.A.setInlineCriteria=function isc_FilterBuilder_setInlineCriteria(_1,_2){var _3=true,_4=false,_5=false;if(_1.operator=="and"){for(var i=0;i<_1.criteria.length;i++){var _7=_1.criteria[i];if(!_7.criteria){_4=true}else{if(_7.operator=="or"){_5=true;for(var j=0;j<_7.criteria.length;j++){var _9=_7.criteria[j];if(_9.criteria){_3=false;break}}}else{if(_7.operator=="not"){if(_7.criteria.length!=1||_7.criteria[0].criteria){_3=false}}else{_3=false}}}}}else{_3=false}
if(_3)_3=!(_4&&_5);if(_3)_3=_4||_5;if(!_3){isc.logWarn("Trying to load an AdvancedCriteria into an 'inline' FilterBuilder, but the criteria is too complex to be represented in 'inline' format");return}
this.setTopOperator(_4?"and":"or");if(_4){for(var i=0;i<_1.criteria.length;i++){var _7=_1.criteria[i],_10=this.fieldData?this.fieldData[_7.fieldName]:null;if(!_7.criteria){this.addCriterion(_7,_10)}else{_10=this.fieldData?this.fieldData[_7.criteria[0].fieldName]:null;this.addNewClause(_7.criteria[0],_10,true)}}}else{for(var i=0;i<_1.criteria.length;i++){var _7=_1.criteria[i],_10=this.fieldData?this.fieldData[_7.fieldName]:null;if(_7.operator=="or"){for(var j=0;j<_7.criteria.length;j++){var _9=_7.criteria[j];_10=this.fieldData?this.fieldData[_9.fieldName]:null;this.addCriterion(_9,_10)}}else{_10=this.fieldData?this.fieldData[_7.criteria[0].fieldName]:null;this.addNewClause(_7.criteria[0],_10,true)}}}
delete this.$75v;this.$76t=false;this.$845=false;this.clauseStack.show();this.delayCall("redraw");if(this.clauseStack)this.clauseStack.animateMembers=_2;this.filterReady()},isc.A.stripNullCriteria=function isc_FilterBuilder_stripNullCriteria(_1){if(_1&&_1.criteria&&_1.criteria.length>0){for(var i=_1.criteria.length-1;i>=0;i--){if(_1.criteria[i]==null){_1.criteria.removeAt(i)}else{if(_1.criteria[i].criteria)this.stripNullCriteria(_1.criteria[i])}}}},isc.A.fetchFieldsReply=function isc_FilterBuilder_fetchFieldsReply(_1,_2){if(this.fieldData){var _3=isc.getValues(this.fieldData);_3.addList(_1.data);this.fieldData=_3.makeIndex("name")}else this.fieldData=_1.data.makeIndex("name");this.$155t(_2)},isc.A.clearCriteria=function isc_FilterBuilder_clearCriteria(_1){var _2=this.clauseStack?this.clauseStack.animateMembers:null;if(this.clauseStack)this.clauseStack.animateMembers=false;while(this.clauses.length>0){this.removeClause(this.clauses[0])}
if(!_1&&!this.allowEmpty)this.addNewClause();if(this.clauseStack)this.clauseStack.animateMembers=_2},isc.A.addCriterion=function isc_FilterBuilder_addCriterion(_1,_2){if(_1.criteria){var _3=this.addSubClause(_1);for(var _4=0;_4<_1.criteria.length;_4++){_2=this.fieldData?this.fieldData[_1.criteria[_4].fieldName]:null;_3.addCriterion(_1.criteria[_4],_2)}}else{this.addNewClause(_1,_2)}},isc.A.handleKeyPress=function isc_FilterBuilder_handleKeyPress(_1,_2){if(_1.keyName==this.$10j){if(this.saveOnEnter){if(_2.firedOnTextItem){if(!this.creator&&this.search){this.search(this.getCriteria());return isc.EH.STOP_BUBBLING}}}}},isc.A.itemChanged=function isc_FilterBuilder_itemChanged(){if(this.creator&&isc.isA.Function(this.creator.itemChanged)){this.creator.itemChanged()}else{if(isc.isA.Function(this.filterChanged)){this.filterChanged()}}},isc.A.fieldNameChanged=function isc_FilterBuilder_fieldNameChanged(_1){},isc.A.getEditorType=function isc_FilterBuilder_getEditorType(_1,_2){var _3=this.getPrimaryDS(_1);return isc.FilterBuilder.getDefaultEditorType(_1,_3,_2)},isc.A.getSelectedClauses=function isc_FilterBuilder_getSelectedClauses(){var _1=[];if(this.showSelectionCheckbox){for(var i=0;i<this.clauses.length;i++){var c=this.clauses[i];if(c.topOperatorForm&&c.topOperatorForm.getValue("select")){_1.add(c)}}}
return _1});isc.B._maxIndex=isc.C+53;isc.A=isc.FilterBuilder;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getDefaultEditorType=function isc_c_FilterBuilder_getDefaultEditorType(_1,_2,_3){var _4;var _5={};isc.addProperties(_5,_1);_5.canEdit=_1.canFilter;_1=_5;var _6=_2.getSearchOperator(_3,_1);if(_6.editorType){_4=_6.editorType}else if(_6.getEditorType&&isc.isA.Function(_6.getEditorType)){_4=_6.getEditorType()}else{var _7=_6?_6.valueType:"text";if(_7=="fieldName"){_4=null}else if(_7=="valueSet"){_4="TextAreaItem"}else if(_7=="custom"&&_6&&_6.editorType){_4=_6.editorType}
if(_1){var _8=(_3=="equals"||_3=="notEqual"||_3=="lessThan"||_3=="greaterThan"||_3=="iBetween"||_3=="iBetweenInclusive"||_3=="between"||_3=="betweenInclusive"||_3=="greaterOrEqual"||_3=="lessOrEqual")?"RelativeDateItem":"DateRangeItem";if(!this.internalSearchForm){this.internalSearchForm=isc.SearchForm.create({visibility:"hidden",autoDraw:false,useAllDataSourceFields:false,dataSource:_2,fields:[_1],defaultDateEditorType:_8})}else{this.internalSearchForm.defaultDateEditorType=_8;this.internalSearchForm.setDataSource(_2,[_1])}
_4=this.internalSearchForm.getEditorType(_1)}else{_4=isc.FormItemFactory.getItemClassName({},"text",null)}}
return _4});isc.B._maxIndex=isc.C+1;isc.FilterBuilder.registerStringMethods({search:"criteria",filterChanged:""})}
isc.ClassFactory.defineClass("MockupContainer","Canvas");isc.A=isc.MockupContainer.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.defaultWidth="100%";isc.A.defaultHeight="100%";isc.A.autoMaskChildren=true;isc.A.editProxyProperties={childrenSnapToGrid:true,childrenSnapAlign:true,persistCoordinates:true};isc.B.push(isc.A.init=function isc_MockupContainer_init(){if(!this.children&&this.components){this.children=this.components}
if(this.dataSources){this.createDataSources()}
this.Super("init",arguments)},isc.A.createDataSources=function isc_MockupContainer_createDataSources(){if(!this.dataSources)return;for(var i=0;i<this.dataSources.length;i++){isc.ClassFactory.newInstance(this.dataSources[i]._constructor,this.dataSources[i])}});isc.B._maxIndex=isc.C+2;isc.overwriteClass("MockupElement","Img");isc.A=isc.MockupElement.getPrototype();isc.A.controlName="MockupElement";isc.A.defaultWidth=16;isc.A.defaultHeight=28;isc.A.measuredW=-1;isc.A.measuredH=-1;isc.A=isc.MockupElement.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.initWidget=function isc_MockupElement_initWidget(){this.Super(this.$oc,arguments);var _1=isc.Page.getToolsDir()+"visualBuilder/mockups/";var _2=this.controlName.substr(this.controlName.indexOf("::")+2,this.controlName.length)+".png";this.src=_1+_2;if(this.title!=null){this.addChild(isc.Label.create({ID:this.getID()+"_titleLabel",autoDraw:true,left:10,top:0,width:this.width,height:this.height,zIndex:this.getZIndex(true)+1,contents:this.title}))}});isc.B._maxIndex=isc.C+1;isc.defineClass("RuleEditor","VLayout");isc.A=isc.RuleEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.height=100;isc.A.validatorIsRule=true;isc.A.availableTypes=["matchesField","isOneOf","lengthRange","contains","doesntContain","substringCount","regexp","mask","floatPrecision","readOnly","isUnique","hasRelatedRecord","range","message","populate","setRequired"];isc.A.nameItemTitle="Name";isc.A.descriptionItemTitle="Description";isc.A.triggerEventTitle="On event";isc.A.fieldPickerTitle="For field";isc.A.applyWhenTitle="If";isc.A.applyWhenPlaceholder=".. conditional ..";isc.A.validatorTitle="Do";isc.A.errorMessageTitle="Message";isc.A.width=400;isc.A.components=["nameForm","mainForm","applyWhenForm","validatorForm","messageForm"];isc.A.showNameForm=false;isc.A.nameFormConstructor="DynamicForm";isc.A.nameFormDefaults={numCols:2};isc.A.nameItemDefaults={editorType:"TextItem"};isc.A.descriptionItemDefaults={editorType:"TextAreaItem"};isc.A.mainFormConstructor="DynamicForm";isc.A.mainFormDefaults={numCols:2,height:20};isc.A.fieldPickerConstructor="SelectItem";isc.A.fieldPickerDefaults={name:"fieldName",multiple:true,showIf:function(){return this.creator.shouldShowFieldPicker()},pickListProperties:{showHeader:true,canSelectAll:false},getClientPickListData:function(){var _1=[];var _2=this.form.creator.locatorMap;if(_2!=null){if(isc.isAn.Array(_2)){for(var i=0;i<_2.length;i++){_1.add({name:_2[i],title:_2[i],type:"locator"})}}else{for(var _4 in _2){_1.add({name:_4,title:_2[_4],type:"locator"})}}}
var _5=this.form.creator.getFieldData();_1.addList(_5);return _1},valueField:"name",displayField:"title",pickListWidth:300,pickListFields:[{name:"title",title:"Target",width:80},{name:"type",title:"Type",width:80},{name:"name",title:"Identifier",autoFitWidth:true}],changed:function(_1,_2,_3){if(this.pickList&&this.pickList.isVisible())this.filterPickList();var _4=null,_5=null;if(_3!=null){if(!isc.isAn.Array(_3))_3=[_3];for(var i=0;i<_3.length;i++){var _7=this.form.creator.getField(_3[i],true);if(_7==null){if(_4==null)_4=[];_4.add(_3[i])}else{if(_5==null)_5=[];_5.add(_3[i])}}}
if(this.creator.warnOnInvalidFieldSelection&&_3!=null&&!isc.isAn.emptyArray(_3)&&(this.creator.getSupportedTypes(_5,_4).length==0))
{isc.warn(this.creator.invalidFieldSelectionWarning)}
this.creator.updateFieldName(_5,_4)}};isc.A.warnOnInvalidFieldSelection=true;isc.A.invalidFieldSelectionWarning="None of the available validators can be applied to the selected set of fields.";isc.A.editStartEventTitle="Edit start";isc.A.editStartAndChangedEventTitle="Edit start/changed";isc.A.editorEnterEventTitle="Editor enter";isc.A.editorExitEventTitle="Editor exit";isc.A.changedEventTitle="Changed";isc.A.submitEventTitle="Submit";isc.A.manualEventTitle="Manual";isc.A.triggerEventPickerConstructor="SelectItem";isc.A.triggerEventPickerDefaults={name:"event",startRow:true,changed:function(_1,_2,_3){this.creator.updateTriggerEvent(_3)},showIf:function(){return this.creator.shouldShowTriggerEventPicker()}};isc.A.applyWhenFormConstructor="DynamicForm";isc.A.applyWhenFormDefaults={numCols:2,fixedColWidths:true,height:20};isc.A.applyWhenItemDefaults={showLabel:true,editorType:"CheckboxItem",width:20,showTitle:false,align:"right",vAlign:"top",changed:"this.form.creator.updateConditionalForm(value)",init:function(){if(this.form){var _1=this.form,_2=_1.getTitleOrientation(),_3=(_2=="right"?_1.rightTitlePrefix:_1.titlePrefix),_4=(_2=="right"?_1.rightTitleSuffix:_1.titleSuffix);this.title=_3+this.title+_4}
this.Super("init",arguments)}};isc.A.filterTopOperatorAppearance="radio";isc.A.conditionalFormConstructor="FilterBuilder";isc.A.conditionalFormDefaults={showFieldTitles:false,fieldPickerProperties:{},showModeSwitcher:true,multiDSFieldFormat:"qualified"};isc.A.validatorFormConstructor="DynamicForm";isc.A.validatorFormDefaults={numCols:2,fixedColWidths:true,height:20};isc.A.typePickerConstructor="SelectItem";isc.A.typePickerDefaults={name:"type",width:"*",pickListProperties:{sortField:0},showIf:function(){var _1=this.form.creator;return _1.showTypePicker==false?false:true},getValueMap:function(){return this.creator.getTypeValueMap()},changed:function(_1,_2,_3){this.creator.updateValidatorType(_3)}};isc.A.messageFormConstructor="DynamicForm";isc.A.messageFormDefaults={numCols:2,width:"100%",height:20};isc.A.errorMessageItemDefaults={editorType:"TextItem",width:"*"};isc.A.valuesFormConstructor="FilterClause";isc.A.valuesFormDefaults={customGetValuesFunction:"getAttributesFromEditor",customSetValuesFunction:"setEditorAttributes",operatorAttribute:"type",fieldPickerProperties:{showIf:"return false"},getEditorType:function(_1,_2){var _3=this.creator.getValidatorDefinition(_2);if(_3&&_3.valueType=="custom"&&_3.editorType)
{return _3.editorType}
if(_1&&isc.SimpleType.inheritsFrom(_1.type,"date"))return"RelativeDateItem";if(_2=="readOnly"){return"ReadOnlyRuleEditor"}
return null}};isc.B.push(isc.A.initWidget=function isc_RuleEditor_initWidget(){var _1=this.rule||this.validator;if(_1!=null){this.setRule(_1,true)}
if(this.showTypePicker==null&&this.validatorType!=null){this.showTypePicker=false}
this.addAutoChildren(this.components);if(this.nameForm!=null&&_1!=null){this.nameForm.setValue("name",_1.name);this.nameForm.setValue("description",_1.description)}
if(this.mainForm){this.fieldPicker=this.mainForm.getItem("fieldName");if(this.fieldName!=null)this.fieldPicker.setValue(this.fieldName);this.triggerEventPicker=this.mainForm.getItem("event");if(this.triggerEvent)this.triggerEventPicker.setValue(this.triggerEvent);if(!this.validatorIsRule){this.mainForm.setVisibility(isc.Canvas.HIDDEN)}}
if(this.applyWhenForm){if(this.applyWhen!=null){this.applyWhenForm.setValue("applyWhen",true);this.updateConditionalForm(true)}}
if(this.validatorForm){this.typePicker=this.validatorForm.getItem("type");if(this.validatorType!=null)this.typePicker.setValue(this.validatorType);if(this.validatorType!=null){this.updateValidatorType(this.validatorType,true)}}
if(this.messageForm){if(this.rule&&this.rule.errorMessage){this.messageForm.setValue("errorMessage",this.rule.errorMessage)}}
if(_1!=null){this.setClauseAttributes(_1)}
return this.Super("initWidget",arguments)},isc.A.getDynamicDefaults=function isc_RuleEditor_getDynamicDefaults(_1){switch(_1){case"nameForm":var _2=(this.nameItemTitle?{title:this.nameItemTitle}:null),_3=(this.descriptionItemTitle?{title:this.descriptionItemTitle}:null),_4=isc.addProperties({name:"name"},this.nameItemDefaults,this.nameItemProperties,_2),_5=isc.addProperties({name:"description"},this.descriptionItemDefaults,this.descriptionItemProperties,_3);return{items:[_4,_5]};case"mainForm":var _6=(this.fieldPickerTitle?{title:this.fieldPickerTitle}:null),_7=(this.triggerEventTitle?{title:this.triggerEventTitle}:null),_8={valueMap:{"editStart":this.editStartEventTitle,"editStartAndChanged":this.editStartAndChangedEventTitle,"editorEnter":this.editorEnterEventTitle,"editorExit":this.editorExitEventTitle,"changed":this.changedEventTitle,"submit":this.submitEventTitle,"manual":this.manualEventTitle}},_9=isc.addProperties({creator:this,editorType:this.fieldPickerConstructor},this.fieldPickerDefaults,this.fieldPickerProperties,_6),_10=isc.addProperties({creator:this,editorType:this.triggerEventPickerConstructor},this.triggerEventPickerDefaults,_8,this.triggerEventPickerProperties,_7)
return{items:[_9,_10]};case"applyWhenForm":var _11=(this.applyWhenTitle?{title:this.applyWhenTitle}:null),_12=isc.addProperties({name:"applyWhen"},this.applyWhenItemDefaults,this.applyWhenItemDefaults,_11),_13={type:"StaticTextItem",name:"placeholder",showTitle:false,value:this.applyWhenPlaceholder},_14={type:"CanvasItem",showTitle:false,name:"conditionalItem",showIf:"false",createCanvas:function(){return this.form.creator.createConditionalForm()}};return{items:[_12,_13,_14]};case"validatorForm":var _11=(this.validatorTitle?{title:this.validatorTitle}:null);var _15=isc.addProperties({creator:this,editorType:this.typePickerConstructor},this.typePickerDefaults,this.typePickerProperties,_11);var _16={name:"valuesItem",editorType:"CanvasItem",showTitle:true,title:null,showIf:"false",canvas:this.getValuesForm(this.validatorType)}
return{disabled:(this.fieldName==null),items:[_15,_16]};case"messageForm":var _11=(this.errorMessageTitle?{title:this.errorMessageTitle}:null),_17=isc.addProperties({name:"errorMessage"},this.errorMessageItemDefaults,this.errorMessageItemDefaults,_11);return{items:[_17]}}},isc.A.shouldShowFieldPicker=function isc_RuleEditor_shouldShowFieldPicker(){if(this.showFieldPicker!=null)return this.showFieldPicker;return this.validatorIsRule},isc.A.getField=function isc_RuleEditor_getField(_1,_2){return this.dataSource?this.dataSource.getField(_1):isc.DataSource.getFieldFromDataSources(_1,this.dataSources,_2)},isc.A.getFieldData=function isc_RuleEditor_getFieldData(){if(this.$89u==null){var _1=this.dataSources;if(_1!=null){this.$89u=isc.DataSource.getCombinedDataSourceFields(this.dataSources)}else if(this.dataSource){var _2=isc.getKeys(this.dataSource.getFields());this.$89u=_2.duplicate()}
this.$896=[];for(var i=0;i<this.$89u.length;i++){var _4=this.$89u[i],_5=this.getField(_4);this.$896[i]={name:_4,title:_5.title||_5.name,type:_5.type||"text"}}}
return this.$896},isc.A.updateFieldName=function isc_RuleEditor_updateFieldName(_1,_2){this.fieldName=_1;this.locator=_2;var _3=_1!=null&&(!isc.isAn.Array(_1)||_1.length>0),_4=_2!=null&&(!isc.isAn.Array(_2)||_2.length>0),_5=(_3||_4)?this.getSupportedTypes(_1,_2):[],_6;if(this.validatorType!=null&&_5.length>0){_6=_5.contains(this.validatorType)}
if(this.validatorForm){if(!_6){this.validatorForm.setValue("type",null);this.validatorType=null}
if(_5.length==0){this.validatorForm.setDisabled(true)}else{this.typePicker.setValueMap(_5);this.validatorForm.setDisabled(false)}}
if((_4||_3)&&this.validatorType!=null){var _7=false;if(!_4){var _8=this.$91p;if(_8==null){_7=true}else{_7=true;for(var i=0;i<_8.length;i++){var _10=_8[i];if(isc.isAn.Array(_1)?(_1.contains(_10)):(_1==_10))
{_7=false;break}}}}
this.$91p=(_1==null)?null:(isc.isAn.Array(_1)?_1:[_1]);if(this.valuesForm.clause.getValue("operator")!=this.validatorType){_7=true}
if(isc.isAn.Array(_1))_1=_1[0];this.valuesForm.fieldName=_1;this.valuesForm.clause.setValue("fieldName",_1);this.valuesForm.clause.setValue("operator",this.validatorType);if(_7){var _11=this.getValidatorDefinition(this.validatorType);this.valuesForm.updateValueItems(this.valuesForm.getField(_1),_11,_1)}}
this.updateValuesFormVisibility()},isc.A.updateValuesFormVisibility=function isc_RuleEditor_updateValuesFormVisibility(){if(this.valuesForm){if((this.fieldName==null&&this.locator==null)||this.validatorType==null){this.validatorForm.getItem("valuesItem").hide()}else{if(!this.valuesForm.isVisible()){this.validatorForm.getItem("valuesItem").show()}}}},isc.A.shouldShowTriggerEventPicker=function isc_RuleEditor_shouldShowTriggerEventPicker(){if(this.showTriggerEventPicker!=null)return this.showTriggerEventPicker;return this.validatorIsRule},isc.A.createConditionalForm=function isc_RuleEditor_createConditionalForm(){var _1=this.filterTopOperatorAppearance||"radio";this.conditionalForm=this.createAutoChild("conditionalForm",{dataSource:this.dataSource,dataSources:this.dataSources,topOperatorAppearance:_1});this.conditionalForm.fieldPickerProperties.pickListWidth=this.conditionalForm.getWidth();return this.conditionalForm},isc.A.updateConditionalForm=function isc_RuleEditor_updateConditionalForm(_1){var _2=this.applyWhenForm.getItem("placeholder"),_3=this.applyWhenForm.getItem("conditionalItem");if(!_1){_2.show();_3.hide()}else{var _4=this.applyWhen||{};this.conditionalForm.setCriteria(_4);_2.hide();_3.show()}
this.conditionalForm.setTopOperatorAppearance(isc.DataSource.isFlatCriteria(_4)?"radio":"bracket")},isc.A.getTypeValueMap=function isc_RuleEditor_getTypeValueMap(){return this.getSupportedTypes(this.fieldName,this.locator)},isc.A.getSupportedTypes=function isc_RuleEditor_getSupportedTypes(_1,_2){var _3=this.availableTypes,_4={};_1=_1||[];_2=_2||[];if(!isc.isAn.Array(_1))_1=[_1];if(!isc.isAn.Array(_2))_2=[_2];if(_3.length==0||_1.length==0&&_2.length==0){return[]}
var _5=null,_6={date:true,"float":true,integer:true,time:true};for(var i=0;i<_3.length;i++){var _8=this.getValidatorDefinition(_3[i])||{},_9=true;if(_2.length>0){if(!_8.isRule){_9=false}else{for(var _10=0;_10<_2.length;_10++){var _11=isc.AutoTest.getLocatorObjectType(_2[_10]),_12=_8.supportedTargets||["FormItem"];if(!_12.contains(_11)){_9=false;break}}}}
if(!_9)continue;if(_1.length>0){for(var _10=0;_10<_1.length;_10++){var _13=this.getField(_1[_10]);if(_13==null){this.logWarn("unable to retrieve field for:"+_1[_10]);continue}
var _14=isc.SimpleType.getBaseType(_13.type||"text");if(_3[i]=="range"){if(!_6[_14]||(_5!=null&&_5!=_14))
{_9=false;break}else{_5=_14}}else{if(_8.dataType!=null&&_8.dataType!="none"&&_8.dataType!=_14){_9=false;break}}}}
if(_9){var _15=this.getValidatorDefinition(_3[i]);var _16=_15.description||isc.DataSource.getAutoTitle(_3[i]);_4[_3[i]]=_16}}
return _4},isc.A.updateValidatorType=function isc_RuleEditor_updateValidatorType(_1,_2){if(this.validatorType==_1&&!_2)return;this.validatorType=_1;if(_1!=null){var _3=this.valuesForm,_4=this.getValuesForm(_1);if(_3!=_4){this.valuesForm=_4;this.validatorForm.getItem("valuesItem").setCanvas(this.valuesForm)}}
this.updateValuesFormVisibility()},isc.A.resolveValidatorType=function isc_RuleEditor_resolveValidatorType(_1){if(_1==null)_1=this.validatorType;if(_1==null)return null;if(_1=="range"){var _2=this.fieldName,_3;if(_2!=null){if(!isc.isAn.Array(_2))_2=[_2];var _4=false;for(var i=0;i<_2.length;i++){var _6=this.getField(_2[i]),_7=_6.type||"integer";_7=isc.SimpleType.getBaseType(_7);if(_3==null){_3=_7}else{if(_7!=_3&&(_7!="date"&&_3!="datetime"&&_7!="datetime"&&_3!="date"))
{_4=true;_3="integer"}}}
if(_4){this.logWarn("'range' validator for fields with differing types:"+this.echo(this.fieldName)+". Defaulting to integer type data","RuleEditor")}else{this.logDebug("'range' validator for field[s]:"+this.echo(this.fieldName)+". Assuming "+_3+" type data","RuleEditor")}}else{this.logInfo("Attempting to get 'range' validator with no field type - defaulting to integer","RuleEditor");_3="integer"}
if(_3=="date"||_3=="datetime"){_1="dateRange"}else if(_3=="time"){_1="timeRange"}else if(_3=="float"){_1="floatRange"}else{_1="integerRange"}}
return _1},isc.A.getValidatorDefinition=function isc_RuleEditor_getValidatorDefinition(_1){_1=this.resolveValidatorType(_1);return isc.Validator.$74u[_1]},isc.A.getValuesForm=function isc_RuleEditor_getValuesForm(_1){if(_1!=null){var _2=this.getValidatorDefinition(_1),_3=_2.valueType;_2.ID=_1}
var _4=this.fieldName;if(isc.isAn.Array(_4))_4=_4[0];if(this.valuesForm){var _5=_4?this.valuesForm.getField(_4):null;this.valuesForm.updateValueItems(_5,_2,_4);this.valuesForm.clause.setValue("operator",_1);return this.valuesForm}else{var _6=this.valuesForm=this.createAutoChild("valuesForm",{visibility:(this.fieldName||this.locator?"inherit":"hidden"),showRemoveButton:false,dataSources:this.dataSources,dataSource:this.dataSource,fieldName:_4,operatorType:_1});var _7=_6.clause;_7.getItem("operator").hide();_7.getItem("operator").addUnknownValues=true;return _6}},isc.A.setValidatorType=function isc_RuleEditor_setValidatorType(_1){this.validatorForm.setValue("type",_1);this.updateValidatorType(_1)},isc.A.setFieldName=function isc_RuleEditor_setFieldName(_1){var _2=this.locator;if(this.fieldPicker){var _3=_1
if(_2!=null){if(!isc.isAn.Array(_2))_3=[_2];else _3=_2.duplicate();if(isc.isAn.Array(_1)){_3.addList(_1)}else if(_1!=null){_3.add(_1)}}
this.fieldPicker.setValue(_3)}
this.updateFieldName(_1,this.locator)},isc.A.setLocator=function isc_RuleEditor_setLocator(_1){if(this.fieldPicker){var _2=this.fieldName,_3=_1;if(_2!=null){if(!isc.isAn.Array(_2))_3=[_2];else _3=_2.duplicate();if(isc.isAn.Array(_1)){_3.addList(_1)}else if(_1!=null){_3.add(_1)}}
this.fieldPicker.setValue(_3)}
this.updateFieldName(this.fieldName,_1)},isc.A.setTriggerEvent=function isc_RuleEditor_setTriggerEvent(_1){if(this.triggerEventPicker){this.triggerEventPicker.setValue(_1)}
this.updateTriggerEvent(_1)},isc.A.updateTriggerEvent=function isc_RuleEditor_updateTriggerEvent(_1){this.triggerEvent=_1},isc.A.setApplyWhen=function isc_RuleEditor_setApplyWhen(_1){this.applyWhen=_1;this.applyWhenForm.setValue("applyWhen",(this.applyWhen!=null));this.updateConditionalForm(_1!=null)},isc.A.getApplyWhen=function isc_RuleEditor_getApplyWhen(){if(this.applyWhenForm.getValue("applyWhen")){this.applyWhen=this.conditionalForm.getCriteria()}else{this.applyWhen=null}
return this.applyWhen},isc.A.getAttributesFromClause=function isc_RuleEditor_getAttributesFromClause(){var _1=this.getValidatorDefinition();var _2=this.fieldName,_3=this.valuesForm;if(isc.isAn.Array(_2))_2=_2[0];var _4=_3.getClauseValues(_2,_1);return _4},isc.A.setClauseAttributes=function isc_RuleEditor_setClauseAttributes(_1){if(this.valuesForm==null)return;var _2=this.getValidatorDefinition();var _3=this.fieldName;if(isc.isAn.Array(_3))_3=_3[0];this.valuesForm.setClauseValues(_3,_2,_1)},isc.A.getValidator=function isc_RuleEditor_getValidator(){return this.getRule()},isc.A.getRule=function isc_RuleEditor_getRule(){if(this.validatorType==null||(this.fieldName==null&&this.locator==null))return null;var _1={};_1.type=this.resolveValidatorType(this.validatorType);if(this.nameForm!=null){var _2=this.nameForm.getValue("name");if(_2!=null)_1.name=_2;var _3=this.nameForm.getValue("description");if(_3!=null)_1.description=_3}
if(this.valuesForm!=null){var _4=this.getAttributesFromClause();for(var _5 in _4){if(_5=="type")continue;_1[_5]=_4[_5]}}
if(this.validatorIsRule){if(this.fieldName)_1.fieldName=this.fieldName;if(this.locator)_1.locator=this.locator;if(this.triggerEvent)_1.triggerEvent=this.triggerEvent}else{delete _1.fieldName}
_1.errorMessage=this.messageForm.getValue("errorMessage");var _6=this.getApplyWhen();if(_6!=null)_1.applyWhen=_6;if(!this.showNameForm){_1.description=this.createRuleDescription(_1)}
return _1},isc.A.createRuleDescription=function isc_RuleEditor_createRuleDescription(_1){if(!_1.type)return null;var _2=this.getValidatorDefinition(_1.type),_3=_2.title||isc.DataSource.getAutoTitle(_1.type),_4=this.triggerEventPicker.valueMap,_5=_3+" for field "+_1.fieldName+" on "+_4[_1.triggerEvent];if(_1.applyWhen){_5+=" if "+isc.DataSource.getAdvancedCriteriaDescription(_1.applyWhen,this.dataSources||this.dataSource)}
return _5},isc.A.validate=function isc_RuleEditor_validate(){var _1=false;if(this.nameForm)_1=this.nameForm.validate()==false;if(this.mainForm)_1=(this.mainForm.validate()==false)||_1;if(this.applyWhenForm&&this.applyWhenForm.getValue("applyWhen")){_1=(this.conditionalForm.validate()==false)||_1}
if(this.validatorForm){_1=(this.validatorForm.validate()==false)||_1;if(this.valuesForm)_1=(this.valuesForm.validate()==false)||_1}
if(this.messageForm)_1=(this.messageForm.validate()==false)||_1;return!_1},isc.A.setRule=function isc_RuleEditor_setRule(_1,_2){this.validator=this.rule=_1;if(_2){this.validatorType=_1.type;this.applyWhen=_1.applyWhen;this.fieldName=_1.fieldName;this.locator=_1.locator;this.triggerEvent=_1.triggerEvent}else{if(this.nameForm){this.nameForm.setValue("name",_1.name);this.nameForm.setValue("description",_1.description)}
if(_1.fieldName!=null||_1.locator!=null){this.setFieldName(_1.fieldName);this.setLocator(_1.locator)}
this.setTriggerEvent(_1.triggerEvent);this.setValidatorType(_1.type);this.setApplyWhen(_1.applyWhen);this.messageForm.setValue("errorMessage",_1.errorMessage);this.setClauseAttributes(_1)}},isc.A.setValidator=function isc_RuleEditor_setValidator(_1){this.setRule(_1)},isc.A.clearRule=function isc_RuleEditor_clearRule(){this.rule=this.validator=null;this.setFieldName(null);this.setValidatorType(null);this.setApplyWhen(null);this.setTriggerEvent(null);if(this.nameForm)this.nameForm.clearValues();if(this.messageForm)this.messageForm.clearValue("errorMessage")},isc.A.clearValidator=function isc_RuleEditor_clearValidator(){return this.clearRule()});isc.B._maxIndex=isc.C+33;if(isc.DynamicForm){isc.defineClass("PopulateRuleEditor","BlurbItem");isc.A=isc.PopulateRuleEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.emptyFormulaText="Click the icon to select a formula";isc.A.formulaVarsTitle="Formula Variables:";isc.A.formulaTitle="Formula:";isc.A.editFormulaPrompt="Click to edit formula";isc.A.icons=[{click:"item.showFormulaWindow()"}];isc.A.formulaWindowConstructor="Window";isc.A.formulaWindowDefaults={title:"Formula Editor",showMinimizeButton:false,showMaximizeButton:false,isModal:true,showModalMask:true,autoSize:true,autoCenter:true,autoDraw:true,headerIconProperties:{padding:1,src:"[SKINIMG]ListGrid/formula_menuItem.png"},closeClick:function(){this.items.get(0).completeEditing(true)}};isc.A.formulaBuilderConstructor="FormulaBuilder";isc.A.formulaBuilderDefaults={width:300,showTitleField:false,showAutoHideCheckBox:false,showSaveAddAnotherButton:false,fireOnClose:function(){this.creator.userEditComplete(!this.cancelled)}};isc.B.push(isc.A.formatValue=function isc_PopulateRuleEditor_formatValue(_1,_2,_3,_4){if(_1==null||_1.formula==null){return this.emptyFormulaText}
var _5=_1.formulaVars,_6=isc.getKeys(_5).sort(),_7="";for(var i=0;i<_6.length;i++){var _9=_6[i];_7+=_9+":&nbsp;"+_5[_9]+"\n"}
return"<table class="+this.getTextBoxStyle()+"><tr><td>"+this.formulaVarsTitle+"</td><td>"+_7+"</td></tr><tr><td>"+this.formulaTitle+"</td><td>"+_1.formula+"</td></tr></table>"},isc.A.init=function isc_PopulateRuleEditor_init(){this.icons[0].prompt=this.editFormulaPrompt;return this.Super("init",arguments)},isc.A.showFormulaWindow=function isc_PopulateRuleEditor_showFormulaWindow(){if(this.formulaBuilder==null){this.formulaBuilder=this.createAutoChild("formulaBuilder",{dataSource:this.form.creator.dataSource,dataSources:this.form.creator.dataSources,mathFunctions:isc.MathFunction.getDefaultFunctionNames()});this.formulaWindow=this.createAutoChild("formulaWindow",{items:[this.formulaBuilder]})}
this.formulaBuilder.setValue("");this.formulaWindow.show()},isc.A.userEditComplete=function isc_PopulateRuleEditor_userEditComplete(_1){if(_1){var _2=this.formulaBuilder.getBasicValueObject(),_3,_4;if(_2!=null){_3=_2.text;_4=_2.formulaVars}
if(_3!=null){this.storeValue({formula:_3,formulaVars:_4})}else{this.storeValue(null)}
this.redraw()}
this.formulaWindow.clear()});isc.B._maxIndex=isc.C+4;isc.defineClass("ReadOnlyRuleEditor","SelectItem");isc.A=isc.ReadOnlyRuleEditor.getPrototype();isc.A.defaultValue=isc.Validator.READONLY;isc.A.valueMap=[isc.Validator.HIDDEN,isc.Validator.DISABLED,isc.Validator.READONLY]}
isc.defineClass("ValidatorEditor","VLayout");isc.A=isc.ValidatorEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.height=100;isc.A.availableTypes=["matchesField","isOneOf","lengthRange","contains","doesntContain","substringCount","regexp","mask","floatPrecision","isUnique","hasRelatedRecord","range"];isc.A.applyWhenTitle="Apply When";isc.A.applyWhenPlaceholder="[always applied]";isc.A.applyWhenPlaceholderHintStyle="staticTextItemDisabled";isc.A.validatorTitle="Validator Type";isc.A.errorMessageTitle="Error Message";isc.A.errorMessageHint="[leave blank to use default error message]";isc.A.defaultEditorTitle="Value";isc.A.width=400;isc.A.components=["validatorForm","messageForm","applyWhenForm"];isc.A.applyWhenFormConstructor="DynamicForm";isc.A.applyWhenFormDefaults={numCols:2,fixedColWidths:true,height:20};isc.A.applyWhenItemDefaults={showLabel:true,editorType:"CheckboxItem",width:20,showTitle:false,align:"right",vAlign:"top",changed:"this.form.creator.updateConditionalForm(value)",init:function(){if(this.form){var _1=this.form,_2=_1.getTitleOrientation(),_3=(_2=="right"?_1.rightTitlePrefix:_1.titlePrefix),_4=(_2=="right"?_1.rightTitleSuffix:_1.titleSuffix);this.title=_3+this.title+_4}
this.Super("init",arguments)}};isc.A.filterTopOperatorAppearance="radio";isc.A.conditionalFormConstructor="FilterBuilder";isc.A.conditionalFormDefaults={showFieldTitles:false,fieldPickerProperties:{},showModeSwitcher:true};isc.A.validatorFormConstructor="DynamicForm";isc.A.validatorFormDefaults={numCols:2,fixedColWidths:true,height:20};isc.A.typePickerConstructor="SelectItem";isc.A.typePickerDefaults={name:"type",width:"*",hoverWidth:200,pickListProperties:{sortField:0,canHover:true,showHover:true,hoverWidth:200,cellHoverHTML:function(_1){return _1.description?_1.description:null}},init:function(){this.$179f=isc.DS.create({clientOnly:true,fields:[{name:"type"},{name:"shortName"},{name:"description"}],cacheData:this.creator.getSupportedTypeRecords()});this.optionDataSource=this.$179f;this.valueField="type";this.displayField="shortName";this.Super("init",arguments)},destroy:function(){if(this.$179g)this.$179g.destroy();this.Super("destroy",arguments)},showIf:function(){var _1=this.form.creator;return _1.showTypePicker==false?false:true},changed:function(_1,_2,_3){this.creator.updateValidatorType(_3)},itemHoverHTML:function(){var _1=this.getSelectedRecord();if(!_1)return"";return _1.description}};isc.A.messageFormConstructor="DynamicForm";isc.A.messageFormDefaults={numCols:2,width:"100%",height:20};isc.A.errorMessageItemDefaults={editorType:"TextItem",width:"*"};isc.A.valuesFormConstructor="FilterClause";isc.A.valuesFormDefaults={clauseProperties:{cellPadding:0,cellSpacing:0},customGetValuesFunction:"getAttributesFromEditor",customSetValuesFunction:"setEditorAttributes",operatorAttribute:"type",fieldPickerProperties:{showIf:"return false"},getEditorType:function(_1,_2){var _3=this.creator.getValidatorDefinition(_2);if(_3&&_3.valueType=="custom"&&_3.editorType)
{return _3.editorType}
if(_1&&isc.SimpleType.inheritsFrom(_1.type,"date"))return"RelativeDateItem";if(_2=="readOnly"){return"ReadOnlyRuleEditor"}
return null}};isc.B.push(isc.A.initWidget=function isc_ValidatorEditor_initWidget(){var _1=this.validator;if(_1!=null){this.setValidator(_1,true)}
this.addAutoChildren(this.components);if(this.applyWhenForm){if(this.applyWhen!=null){this.applyWhenForm.setValue("applyWhen",true);this.updateConditionalForm(true)}}
if(this.validatorForm){this.typePicker=this.validatorForm.getItem("type");if(this.validatorType!=null)this.typePicker.setValue(this.validatorType);if(this.validatorType!=null){this.updateValidatorType(this.validatorType,true)}}
if(this.messageForm){if(_1&&_1.errorMessage){this.messageForm.setValue("errorMessage",_1.errorMessage)}}
if(_1!=null){this.setClauseAttributes(_1)}
return this.Super("initWidget",arguments)},isc.A.getDynamicDefaults=function isc_ValidatorEditor_getDynamicDefaults(_1){switch(_1){case"applyWhenForm":var _2=(this.applyWhenTitle?{title:this.applyWhenTitle}:null),_3=isc.addProperties({name:"applyWhen"},this.applyWhenItemDefaults,this.applyWhenItemDefaults,_2),_4={type:"StaticTextItem",name:"placeholder",showTitle:false,value:this.applyWhenPlaceholder,textBoxStyle:this.applyWhenPlaceholderHintStyle},_5={type:"CanvasItem",showTitle:false,name:"conditionalItem",visible:false,createCanvas:function(){return this.form.creator.createConditionalForm()}};return{items:[_3,_4,_5]};case"validatorForm":var _2=(this.validatorTitle?{title:this.validatorTitle}:null);var _6=isc.addProperties({creator:this,editorType:this.typePickerConstructor},this.typePickerDefaults,this.typePickerProperties,_2);var _7={name:"valuesItem",editorType:"CanvasItem",showTitle:true,title:null,visible:false,canvas:this.getValuesForm(this.validatorType)}
return{disabled:(this.fieldName==null),items:[_6,_7]};case"messageForm":var _2=(this.errorMessageTitle?{title:this.errorMessageTitle}:null),_8={showHintInField:true,hint:this.errorMessageHint},_9=isc.addProperties({name:"errorMessage"},this.errorMessageItemDefaults,this.errorMessageItemDefaults,_2,_8);return{items:[_9]}}},isc.A.getField=function isc_ValidatorEditor_getField(_1){if(this.field)return this.field;return this.dataSource.getField(_1)},isc.A.updateFieldName=function isc_ValidatorEditor_updateFieldName(_1){this.fieldName=_1;var _2=_1!=null,_3=_2?this.getSupportedTypeRecords():[],_4;if(this.validatorType!=null&&_3.length>0){_4=(_3.find("type",this.validatorType)!=null)}
if(this.validatorForm){if(!_4){this.validatorForm.setValue("type",null);this.validatorType=null}
if(_3.length==0){this.validatorForm.setDisabled(true)}else{this.typePicker.optionDataSource.setCacheData(_3);this.validatorForm.setDisabled(false)}}
if(_2&&this.validatorType!=null){var _5=this.$74o,_6=(_5==null||_1!=_5);this.$74o=(_1==null?null:_1);if(this.valuesForm.clause.getValue("operator")!=this.validatorType){_6=true}
this.valuesForm.fieldName=_1;this.valuesForm.clause.setValue("fieldName",_1);this.valuesForm.clause.setValue("operator",this.validatorType);if(_6){var _7=this.getValidatorDefinition(this.validatorType);this.valuesForm.updateValueItems(this.valuesForm.getField(_1),_7,_1)}}
this.updateValuesFormVisibility()},isc.A.updateValuesFormVisibility=function isc_ValidatorEditor_updateValuesFormVisibility(){if(this.valuesForm){if(this.validatorType==null){this.validatorForm.getItem("valuesItem").hide();this.valuesForm.hide()}else{var _1=this.validatorForm.getItem("valuesItem").canvas.clause,_2=_1.items,_3=false;_2.map(function(_4){_3=_3||(_4.name!="fieldName"&&_4.isVisible())});if(_3)this.validatorForm.getItem("valuesItem").show();else this.validatorForm.getItem("valuesItem").hide()}}},isc.A.createConditionalForm=function isc_ValidatorEditor_createConditionalForm(){var _1=this.filterTopOperatorAppearance||"radio";this.conditionalForm=this.createAutoChild("conditionalForm",{dataSource:this.dataSource,topOperatorAppearance:_1});this.conditionalForm.fieldPickerProperties.pickListWidth=this.conditionalForm.getWidth();return this.conditionalForm},isc.A.updateConditionalForm=function isc_ValidatorEditor_updateConditionalForm(_1){var _2=this.applyWhenForm.getItem("placeholder"),_3=this.applyWhenForm.getItem("conditionalItem");if(!_1){_2.show();_3.hide()}else{var _4=this.applyWhen||{};this.conditionalForm.setCriteria(_4);_2.hide();_3.show()}
this.conditionalForm.setTopOperatorAppearance(isc.DataSource.isFlatCriteria(_4)?"radio":"bracket")},isc.A.getSupportedTypeRecords=function isc_ValidatorEditor_getSupportedTypeRecords(){var _1=this.fieldName,_2=this.availableTypes,_3=[];if(_2.length==0||_1==null){return[]}
var _4=null,_5={date:true,"float":true,integer:true,time:true};for(var i=0;i<_2.length;i++){var _7=this.getValidatorDefinition(_2[i])||{},_8=true;if(_7.isRule)continue;var _9=this.getField(_1);if(_9==null){this.logWarn("unable to retrieve field for:"+_1)}else{var _10=isc.SimpleType.getBaseType(_9.type||"text");if(_2[i]=="range"){if(!_5[_10]||(_4!=null&&_4!=_10))
{_8=false}else{_4=_10}}else{if(_7.dataType!=null&&_7.dataType!="none"&&_7.dataType!=_10)
{_8=false}}}
if(_8){var _11=this.getValidatorDefinition(_2[i]);var _12=_11.shortName||isc.Validator.getShortName(_11.type);_3.add({type:_2[i],shortName:_12,description:_11.description})}}
return _3},isc.A.updateValidatorType=function isc_ValidatorEditor_updateValidatorType(_1,_2){if(this.validatorType==_1&&!_2)return;this.validatorType=_1;if(_1!=null){var _3=this.valuesForm,_4=this.getValuesForm(_1);if(_3!=_4){this.valuesForm=_4;this.validatorForm.getItem("valuesItem").setCanvas(this.valuesForm)}
var _5=this.getValidatorDefinition(_1);var _6=_5.editorTitle||this.defaultEditorTitle;this.validatorForm.getItem("valuesItem").title=_6;this.validatorForm.getItem("valuesItem").redraw()}
this.updateValuesFormVisibility()},isc.A.resolveValidatorType=function isc_ValidatorEditor_resolveValidatorType(_1){if(_1==null)_1=this.validatorType;if(_1==null)return null;if(_1=="range"){var _2=this.fieldName,_3;if(_2!=null){var _4=false,_5=this.getField(_2),_6=_5.type||"integer";_3=isc.SimpleType.getBaseType(_6);this.logDebug("'range' validator for field:"+this.echo(this.fieldName)+". Assuming "+_3+" type data","ValidatorEditor")}else{this.logInfo("Attempting to get 'range' validator with no field type - defaulting to integer","ValidatorEditor");_3="integer"}
if(_3=="date"||_3=="datetime"){_1="dateRange"}else if(_3=="time"){_1="timeRange"}else if(_3=="float"){_1="floatRange"}else{_1="integerRange"}}
return _1},isc.A.getValidatorDefinition=function isc_ValidatorEditor_getValidatorDefinition(_1){_1=this.resolveValidatorType(_1);return isc.Validator.$74u[_1]},isc.A.getValuesForm=function isc_ValidatorEditor_getValuesForm(_1){if(_1!=null){var _2=this.getValidatorDefinition(_1),_3=_2.valueType;_2.ID=_1}
var _4=this.fieldName;if(this.valuesForm){var _5=_4?this.valuesForm.getField(_4):null;this.valuesForm.updateValueItems(_5,_2,_4);this.valuesForm.clause.setValue("operator",_1);return this.valuesForm}else{var _6=this.valuesForm=this.createAutoChild("valuesForm",{visibility:(this.fieldName?"inherit":"hidden"),showRemoveButton:false,dataSources:this.dataSources,dataSource:this.dataSource,fieldName:_4,operatorType:_1});var _7=_6.clause;_7.getItem("operator").hide();_7.getItem("operator").addUnknownValues=true;return _6}},isc.A.setValidatorType=function isc_ValidatorEditor_setValidatorType(_1){this.validatorForm.setValue("type",_1);this.updateValidatorType(_1)},isc.A.setFieldName=function isc_ValidatorEditor_setFieldName(_1){if(this.fieldPicker){this.fieldPicker.setValue(_1)}
this.updateFieldName(_1)},isc.A.setApplyWhen=function isc_ValidatorEditor_setApplyWhen(_1){this.applyWhen=_1;this.applyWhenForm.setValue("applyWhen",(this.applyWhen!=null));this.updateConditionalForm(_1!=null)},isc.A.getApplyWhen=function isc_ValidatorEditor_getApplyWhen(){if(this.applyWhenForm.getValue("applyWhen")){this.applyWhen=this.conditionalForm.getCriteria()}else{this.applyWhen=null}
return this.applyWhen},isc.A.getAttributesFromClause=function isc_ValidatorEditor_getAttributesFromClause(){var _1=this.getValidatorDefinition(),_2=this.valuesForm.getClauseValues(null,_1);return _2},isc.A.setClauseAttributes=function isc_ValidatorEditor_setClauseAttributes(_1){if(this.valuesForm==null)return;var _2=this.getValidatorDefinition();this.valuesForm.setClauseValues(this.fieldName,_2,_1)},isc.A.getValidator=function isc_ValidatorEditor_getValidator(){if(this.validatorType==null)return null;var _1={};_1.type=this.resolveValidatorType(this.validatorType);if(this.valuesForm!=null){var _2=this.getAttributesFromClause();for(var _3 in _2){if(_3=="type")continue;_1[_3]=_2[_3]}}
var _4=this.messageForm.getValue("errorMessage");if(_4)_1.errorMessage=_4;var _5=this.getApplyWhen();if(_5!=null)_1.applyWhen=_5;return _1},isc.A.validate=function isc_ValidatorEditor_validate(){var _1=false;if(this.applyWhenForm&&this.applyWhenForm.getValue("applyWhen")){_1=(this.conditionalForm.validate()==false)||_1}
if(this.validatorForm){_1=(this.validatorForm.validate()==false)||_1;if(this.valuesForm)_1=(this.valuesForm.validate()==false)||_1}
if(this.messageForm)_1=(this.messageForm.validate()==false)||_1;return!_1},isc.A.setValidator=function isc_ValidatorEditor_setValidator(_1,_2){this.validator=_1;if(_2){this.validatorType=_1.type;this.applyWhen=_1.applyWhen}else{this.setValidatorType(_1.type);this.setApplyWhen(_1.applyWhen);this.messageForm.setValue("errorMessage",_1.errorMessage);this.setClauseAttributes(_1)}},isc.A.clearValidator=function isc_ValidatorEditor_clearValidator(){this.validator=null;this.setValidatorType(null);this.setApplyWhen(null);if(this.messageForm)this.messageForm.clearValue("errorMessage")});isc.B._maxIndex=isc.C+22;isc.defineClass("ValidatorsEditor","VLayout");isc.A=isc.ValidatorsEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.mainLayoutDefaults={_constructor:isc.SectionStack,height:"100%",visibilityMode:"multiple",overflow:"auto",canReorderSections:true,membersChanged:function(){this.creator.updateSectionControls()}};isc.A.addButtonDefaults={_constructor:isc.ImgButton,src:"[SKIN]actions/add.png",size:16,showFocused:false,showRollOver:false,showDown:false,click:"this.creator.addValidator();return false;"};isc.A.removeButtonDefaults={_constructor:isc.ImgButton,src:"[SKIN]actions/remove.png",size:16,showFocused:false,showRollOver:false,showDown:false,click:"this.creator.removeValidator(this.validatorDetail);return false;"};isc.A.validatorDetailDefaults={_constructor:isc.ValidatorEditor,height:50,saveOperationType:"add",getSaveOperationType:function(){return this.saveOperationType},setSaveOperationType:function(_1){this.saveOperationType=_1},clearValidator:function(){this.setSaveOperationType("add");this.Super("clearValidator",arguments)},setValidator:function(_1){this.setSaveOperationType("update");this.Super("setValidator",arguments)}};isc.B.push(isc.A.initWidget=function isc_ValidatorsEditor_initWidget(){this.Super("initWidget",arguments);if(this.fieldName.contains(".")){var _1=this.fieldName.split(".");this.fieldName=_1[_1.length-1]}
this.addAutoChild("mainLayout");if(this.validators)this.setValidators(this.validators.duplicate());this.addValidator()},isc.A.moveSection=function isc_ValidatorsEditor_moveSection(_1,_2){this.Super("moveSection",arguments);this.updateSectionControls()},isc.A.updateSectionControls=function isc_ValidatorsEditor_updateSectionControls(){var _1=this.mainLayout.getSections();for(var i=0;i<_1.length;i++){var _3=this.mainLayout.getSectionHeader(_1[i]),_4=_3.controls[0],_5=_4.getMember(0);if(i==_1.length-1){_5.show()}else{_5.hide()}}},isc.A.addValidator=function isc_ValidatorsEditor_addValidator(_1){var _2="[New Validator]";if(_1)_2=_1.shortName||isc.Validator.getShortName(_1.type);var _3={fieldName:this.fieldName,dataSource:this.dataSource,validator:_1}
var _4=this.createAutoChild("validatorDetail",_3);var _5=this.createAutoChild("addButton");var _6=this.createAutoChild("removeButton",{validatorDetail:_4});var _7=isc.HLayout.create({height:16,width:16,align:"right",members:[_5,_6]});var _8=(_1&&_1._generated&&_1.$174l);this.mainLayout.addSection({title:_2,items:[_4],expanded:!_1,hidden:_8,validator:_1,controls:[_7]});this.updateSectionControls()},isc.A.removeValidator=function isc_ValidatorsEditor_removeValidator(_1){var _2=this.mainLayout.sectionForItem(_1),_3=this.mainLayout.getSectionHeader(_2),_4=(_3.controls[0].getMembers().length>1);this.removeValidatorInSection(_2.name);var _5=this.mainLayout.getSections();if(_5.length==0){this.addValidator()}
this.updateSectionControls()},isc.A.removeValidatorInSection=function isc_ValidatorsEditor_removeValidatorInSection(_1){var _2=this.mainLayout;this.mainLayout.collapseSection(_1,function(){_2.removeSection(_1)})},isc.A.validate=function isc_ValidatorsEditor_validate(){var _1=false,_2=this.mainLayout.getSections();for(var i=0;i<_2.length;i++){var _4=_2[i],_5=this.mainLayout.getSectionHeader(_4),_6=_5.items[0];_1=(_6.validate()==false)||_1}
return!_1},isc.A.getValidators=function isc_ValidatorsEditor_getValidators(){var _1=this.mainLayout.getSections(),_2=[];for(var i=0;i<_1.length;i++){var _4=_1[i],_5=this.mainLayout.getSectionHeader(_4),_6=_5.items[0],_7=_6.getValidator();if(_5.hidden)_7=_5.validator;if(_7)_2.add(_7)}
return _2},isc.A.setValidators=function isc_ValidatorsEditor_setValidators(_1){this.validators=_1;var _2=this;var _3=function(_1){for(var i=0;i<_1.length;i++){_2.addValidator(_1[i])}};var _5=this.mainLayout.getSections();if(_5&&_5.length>0){this.mainLayout.collapseSection(_5,function(){this.mainLayout.removeSection(_5);_3(_1)})}else{_3(_1)}});isc.B._maxIndex=isc.C+9;if(isc.DynamicForm){isc.defineClass("SubstringCountEditor","CanvasItem");isc.A=isc.SubstringCountEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.countFieldHint="Times";isc.A.operatorFieldTitle="Operator";isc.A.canvasConstructor="DynamicForm";isc.A.canvasDefaults={numCols:3};isc.A.substringFieldDefaults={name:"substring",showTitle:false,type:"text",colSpan:"*",width:"*",required:true};isc.A.countFieldDefaults={name:"count",showTitle:false,showHintInField:true,width:50,type:"integer",required:true};isc.A.operatorFieldDefaults={name:"operator",editorType:"SelectItem",width:50,defaultValue:"==",allowEmptyValue:false,valueMap:["==","!=","<","<=",">",">="]};isc.B.push(isc.A.createCanvas=function isc_SubstringCountEditor_createCanvas(_1,_2){var _3=isc.addProperties({},this.substringFieldDefaults,this.substringFieldProperties),_4=isc.addProperties({},this.countFieldDefaults,this.countFieldProperties,{hint:this.countFieldHint}),_5=isc.addProperties({},this.operatorFieldDefaults,this.operatorFieldProperties,{title:this.operatorFieldTitle});return this.canvas=this.createAutoChild("canvas",{items:[_3,_5,_4]})});isc.B._maxIndex=isc.C+1;isc.defineClass("FloatRangeEditor","CanvasItem");isc.A=isc.FloatRangeEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.minFieldHint="Min";isc.A.maxFieldHint="Max";isc.A.exclusiveFieldTitle="Exclusive";isc.A.exclusiveFieldPrompt="Range is exclusive (does not include min/max values)";isc.A.canvasConstructor="DynamicForm";isc.A.canvasDefaults={numCols:2};isc.A.minFieldDefaults={name:"min",showTitle:false,type:"float",showHintInField:true};isc.A.maxFieldDefaults={name:"max",showTitle:false,type:"float",showHintInField:true};isc.A.exclusiveFieldDefaults={name:"exclusive",colSpan:"*",type:"boolean",editorType:"CheckboxItem",defaultValue:false};isc.B.push(isc.A.createCanvas=function isc_FloatRangeEditor_createCanvas(_1,_2){var _3=isc.addProperties({},this.minFieldDefaults,this.minFieldProperties,{hint:this.minFieldHint}),_4=isc.addProperties({},this.maxFieldDefaults,this.maxFieldProperties,{hint:this.maxFieldHint}),_5=isc.addProperties({},this.exclusiveFieldDefaults,this.exclusiveFieldProperties,{title:this.exclusiveFieldTitle,prompt:this.exclusiveFieldPrompt});return this.canvas=this.createAutoChild("canvas",{items:[_3,_4,_5]})});isc.B._maxIndex=isc.C+1;isc.defineClass("FloatPrecisionEditor","CanvasItem");isc.A=isc.FloatPrecisionEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.precisionFieldHint="Precision";isc.A.roundFieldTitle="Round to precision";isc.A.canvasConstructor="DynamicForm";isc.A.canvasDefaults={numCols:1};isc.A.precisionFieldDefaults={name:"precision",showTitle:false,type:"float",showHintInField:true,required:true};isc.A.roundFieldDefaults={showTitle:false,name:"roundToPrecision",type:"boolean",editorType:"CheckboxItem",defaultValue:false};isc.B.push(isc.A.createCanvas=function isc_FloatPrecisionEditor_createCanvas(_1,_2){var _3=isc.addProperties({},this.precisionFieldDefaults,this.precisionFieldProperties,{hint:this.precisionFieldHint}),_4=isc.addProperties({},this.roundFieldDefaults,this.roundFieldProperties,{title:this.roundFieldTitle});return this.canvas=this.createAutoChild("canvas",{items:[_3,_4]})});isc.B._maxIndex=isc.C+1;isc.defineClass("MaskRuleEditor","CanvasItem");isc.A=isc.MaskRuleEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.maskFieldHint="mask";isc.A.transformFieldHint="transformTo";isc.A.canvasConstructor="DynamicForm";isc.A.canvasDefaults={numCols:1};isc.A.maskFieldDefaults={name:"mask",editorType:"TextItem",showTitle:false,showHintInField:true};isc.A.transformFieldDefaults={name:"transformTo",editorType:"TextItem",showTitle:false,showHintInField:true};isc.B.push(isc.A.createCanvas=function isc_MaskRuleEditor_createCanvas(_1,_2){var _3=isc.addProperties({},this.maskFieldDefaults,this.maskFieldProperties,{hint:this.maskFieldHint}),_4=isc.addProperties({},this.transformFieldDefaults,this.transformFieldProperties,{hint:this.transformFieldHint});return this.canvas=this.createAutoChild("canvas",{items:[_3,_4]})});isc.B._maxIndex=isc.C+1}
isc.defineClass("FilePickerForm","VLayout");isc.A=isc.FilePickerForm.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoDraw=false;isc.A.width="100%";isc.A.padding=10;isc.A.showSelectForm=true;isc.A.showUploadForm=true;isc.A.showPasteForm=true;isc.A.showFetchForm=true;isc.A.formsDefaults={titleWidth:140,cellPadding:6,width:"100%"};isc.A.selectFormDefaults={selectFileDialogDefaults:{actionStripControls:["spacer:10","pathLabel","previousFolderButton","spacer:10","upOneLevelButton","spacer:10","refreshButton","spacer:2"],directoryListingProperties:{canEdit:false},title:"Select File",webrootOnly:true,width:"100%",showModalMask:true,isModal:true,checkFile:function(_1){return true},loadFile:function(_1){if(this.checkFile(_1)){var _2=this.creator;if(this.currentDir.endsWith("/")){_2.setValue("fileName",this.currentDir+_1)}else{_2.setValue("fileName",this.currentDir+"/"+_1)}
if(this.filePickerForm.uploadForm){this.filePickerForm.uploadForm.disable()}
if(this.filePickerForm.pasteForm){this.filePickerForm.pasteForm.disable()}
if(this.filePickerForm.fetchForm){this.filePickerForm.fetchForm.disable()}
this.hide()}}},selectFileDialogConstructor:"LoadFileDialog",fields:[{name:"fileName",title:"Select file from local disk",editorType:isc.TLinkItem||isc.LinkItem,target:"javascript",defaultValue:"select file",canEdit:false,width:"*",colSpan:"*",click:function(_1,_2){var _3=isc.addProperties({filePickerForm:_1.creator},_1.selectFileDialogDefaults,_1.selectFileDialogProperties);_1.createAutoChild("selectFileDialog",_3).show()}}]};isc.A.selectFormConstructor="DynamicForm";isc.A.uploadFormDefaults={saveOperationType:"add",fields:[{name:"file",title:"Upload file",editorType:isc.TUploadItem||isc.UploadItem,hoverWidth:200,width:"*",colSpan:"*",startRow:true,itemHoverHTML:function(){return"Upload file to server and proceed."},titleHoverHTML:function(){return this.itemHoverHTML()},change:function(_1,_2,_3,_4){if(_1.creator.selectForm){_1.creator.selectForm.setDisabled(_3!=null)}
if(_1.creator.pasteForm){_1.creator.pasteForm.setDisabled(_3!=null)}
if(_1.creator.fetchForm){_1.creator.fetchForm.setDisabled(_3!=null)}
return true}}]};isc.A.uploadFormConstructor="DynamicForm";isc.A.pasteFormDefaults={fields:[{name:"pasteData",type:"TextAreaItem",title:"Paste Data",width:"*",change:function(_1,_2,_3,_4){var _5=_1.creator;if(_5.selectForm){_5.selectForm.setDisabled(_3!=null)}
if(_5.uploadForm){_5.uploadForm.setDisabled(_3!=null)}
if(_5.fetchForm){_5.fetchForm.setDisabled(_3!=null)}
return true}}]};isc.A.pasteFormConstructor="DynamicForm";isc.A.fetchFormDefaults={fields:[{name:"fileURL",type:"text",width:"*",title:"Fetch file from URL",startRow:true,change:function(_1,_2,_3,_4){var _5=_1.creator;if(_5.selectForm){_5.selectForm.setDisabled(_3!=null)}
if(_5.uploadForm){_5.uploadForm.setDisabled(_3!=null)}
if(_5.pasteForm){_5.pasteForm.setDisabled(_3!=null)}
return true}}]};isc.A.fetchFormConstructor="DynamicForm";isc.A.orLabelDefaults={contents:"OR",height:20,align:"right"};isc.A.orLabelConstructor="Label";isc.A.showOrLabel=true;isc.A.pickButtonDefaults={name:"pickButton",title:"Pick",layoutAlign:"right",click:function(_1,_2){_1.creator.saveData()}};isc.A.pickButtonConstructor="Button";isc.A.useBuiltinRPC=false;isc.B.push(isc.A.initWidget=function isc_FilePickerForm_initWidget(){this.Super("initWidget",arguments);var _1=false;if(this.valuesManager==null)this.valuesManager=isc.ValuesManager.create();var _2=isc.addProperties(this.formsDefaults,this.formsProperties);if(this.showSelectForm){this.addAutoChild("selectForm",isc.addProperties({valuesManager:this.valuesManager},_2));_1=true}
if(this.showUploadForm){if(_1&&this.showOrLabel){this.addMember(this.createAutoChild("orLabel",{width:_2.titleWidth}))}
this.addAutoChild("uploadForm",isc.addProperties({},_2));_1=true}
if(this.showPasteForm){if(_1&&this.showOrLabel){this.addMember(this.createAutoChild("orLabel",{width:_2.titleWidth}))}
this.addAutoChild("pasteForm",isc.addProperties({valuesManager:this.valuesManager},_2));_1=true}
if(this.showFetchForm){if(_1&&this.showOrLabel){this.addMember(this.createAutoChild("orLabel",{width:_2.titleWidth}))}
this.addAutoChild("fetchForm",isc.addProperties({valuesManager:this.valuesManager},_2))}
this.addAutoChild("pickButton")},isc.A.setDataSource=function isc_FilePickerForm_setDataSource(_1){if(this.selectForm)this.selectForm.dataSource=_1;if(this.uploadForm)this.uploadForm.dataSource=_1;if(this.pasteForm)this.pasteForm.dataSource=_1;if(this.fetchForm)this.fetchForm.dataSource=_1},isc.A.setValues=function isc_FilePickerForm_setValues(_1){this.valuesManager.setValues(_1)},isc.A.setOutOfBandValues=function isc_FilePickerForm_setOutOfBandValues(_1){if(this.selectForm)this.selectForm.setValues(_1);if(this.uploadForm)this.uploadForm.setValues(_1);if(this.pasteForm)this.pasteForm.setValues(_1);if(this.fetchForm)this.fetchForm.setValues(_1)},isc.A.getValues=function isc_FilePickerForm_getValues(){var _1=isc.addProperties(this.valuesManager.getValues(),this.uploadForm.getValues());return _1},isc.A.saveData=function isc_FilePickerForm_saveData(_1,_2){var _3=this;var _4=function(_5,_6,_7){if(_3.selectForm){_3.selectForm.reset();_3.selectForm.enable()}
if(_3.uploadForm){_3.uploadForm.clearValues();_3.uploadForm.enable()}
if(_3.pasteForm){_3.pasteForm.enable()}
if(_3.fetchForm){_3.fetchForm.enable()}
if(_1)_3.fireCallback(_1,"dsResponse,data,dsRequest",[_5,_6,_7])}
if(this.selectForm&&this.selectForm.getValue("fileName")&&this.selectForm.getField("fileName").defaultValue!=this.selectForm.getValue("fileName"))
{if(this.useBuiltinRPC){isc.DMI.callBuiltin({appID:"isc_builtin",className:"com.isomorphic.tools.BuiltinRPC",methodName:"importData",arguments:[this.selectForm.getValues()],callback:function(_5){_4(_5,_5.data)}})}else{this.selectForm.saveData(_4,_2)}}
if(this.uploadForm&&this.uploadForm.getValue("file")){this.uploadForm.saveData(_4,_2)}
if(this.pasteForm&&this.pasteForm.getValue("pasteData")){this.pasteForm.saveData(_4,_2)}
if(this.fetchForm&&this.fetchForm.getValue("fileURL")){if(this.useBuiltinRPC){isc.DMI.callBuiltin({appID:"isc_builtin",className:"com.isomorphic.tools.BuiltinRPC",methodName:"importData",arguments:[this.fetchForm.getValues()],callback:function(_5){_4(_5,_5.data)}})}else{this.fetchForm.saveData(_4,_2)}}});isc.B._maxIndex=isc.C+6;isc.setScreenReaderMode=function(_1){isc.screenReader=_1}
isc.liteAria=null;isc.A=isc.Canvas;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.ariaEnabled=function isc_c_Canvas_ariaEnabled(){return isc.screenReader||isc.screenReader!==false&&((isc.Browser.isIE&&isc.Browser.version>=8)||!isc.Browser.isIE)},isc.A.useLiteAria=function isc_c_Canvas_useLiteAria(){if(isc.liteAria!=null)return isc.liteAria;if(isc.screenReader==true)return false;return(isc.Browser.isIE&&isc.Browser.version<9)},isc.A.setAriaRole=function isc_c_Canvas_setAriaRole(_1,_2){if(!_1)return;if(this.logIsDebugEnabled("aria")){this.logDebug("ARIA role changed to: "+_2+" on element: "+this.echoLeaf(_1),"aria")}
_1.setAttribute("role",_2)},isc.A.setAriaState=function isc_c_Canvas_setAriaState(_1,_2,_3){if(!_1)return;if(this.logIsInfoEnabled("aria")){this.logInfo("ARIA state: "+_2+": "+_3+", set on element: "+isc.echoLeaf(_1),"aria")}
_1.setAttribute("aria-"+_2,_3==null?"":_3)},isc.A.setAriaStates=function isc_c_Canvas_setAriaStates(_1,_2){if(!_1)return;if(_2==null)return;for(var _3 in _2){this.setAriaState(_1,_3,_2[_3])}},isc.A.clearAriaState=function isc_c_Canvas_clearAriaState(_1,_2){if(!_1)return;_1.removeAttribute("aria-"+_2)},isc.A.getAriaStateAttributes=function isc_c_Canvas_getAriaStateAttributes(_1){var _2="";if(_1){for(var _3 in _1){var _4=_1[_3];_2+=" aria-"+_3+"='"+String.asAttValue(_4)+"'"}}
return _2});isc.B._maxIndex=isc.C+7;isc.A=isc.Canvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.setAriaRole=function isc_Canvas_setAriaRole(_1){isc.Canvas.setAriaRole(this.getClipHandle(),_1)},isc.A.setAriaState=function isc_Canvas_setAriaState(_1,_2){isc.Canvas.setAriaState(this.getClipHandle(),_1,_2)},isc.A.setAriaStates=function isc_Canvas_setAriaStates(_1){isc.Canvas.setAriaStates(this.getClipHandle(),_1)},isc.A.clearAriaState=function isc_Canvas_clearAriaState(_1){isc.Canvas.clearAriaState(this.getClipHandle(),_1)},isc.A.getAriaState=function isc_Canvas_getAriaState(){var _1=isc.addProperties({},this.ariaState);if(this.isDisabled())_1.disabled=true;return _1},isc.A.getAriaStateAttributes=function isc_Canvas_getAriaStateAttributes(){return isc.Canvas.getAriaStateAttributes(this.getAriaState())});isc.B._maxIndex=isc.C+6;if(isc.StatefulCanvas){isc.A=isc.StatefulCanvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaState={};isc.B.push(isc.A.getAriaState=function isc_StatefulCanvas_getAriaState(){var _1=this.Super("getAriaState",arguments);var _2=this.getAriaLabel();if(_2!=null)_1.label=_2;return _1});isc.B._maxIndex=isc.C+1}
if(isc.Progressbar){isc.Progressbar.changeDefaults("ariaState",{valuemin:0,valuemax:100});isc.A=isc.Progressbar.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="progressbar";isc.B.push(isc.A.getAriaState=function isc_Progressbar_getAriaState(){var _1=this.Super("getAriaState",arguments);_1.valuenow=this.percentDone;return _1});isc.B._maxIndex=isc.C+1}
if(isc.DynamicForm){isc.A=isc.DynamicForm.getPrototype();isc.A.rightTitlePrefix="<span aria-hidden='true'>:&nbsp;</span>";isc.A.titleSuffix="<span aria-hidden='true'>&nbsp;:</span>";isc.A.requiredRightTitlePrefix="<b><span aria-hidden='true'>:&nbsp;</span>";isc.A.requiredTitleSuffix="<span aria-hidden='true'>&nbsp;:</span></b>";isc.A=isc.FormItem.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.setAriaRole=function isc_FormItem_setAriaRole(_1){var _2=this.getFocusElement();if(_2!=null)isc.Canvas.setAriaRole(_2,_1)},isc.A.setOuterAriaRole=function isc_FormItem_setOuterAriaRole(_1){var _2=this.getHandle();if(_2!=null)isc.Canvas.setAriaRole(_2,_1)},isc.A.setAriaState=function isc_FormItem_setAriaState(_1,_2){var _3;if(this.outerAriaRole){_3=this.getHandle()}else{_3=this.getFocusElement()}
if(_3!=null)isc.Canvas.setAriaState(_3,_1,_2)},isc.A.setAriaStates=function isc_FormItem_setAriaStates(_1){var _2;if(this.outerAriaRole){_2=this.getHandle()}else{_2=this.getFocusElement()}
if(_2!=null)isc.Canvas.setAriaStates(_2,_1)},isc.A.clearAriaState=function isc_FormItem_clearAriaState(_1){var _2;if(this.outerAriaRole){_2=this.getHandle()}else{_2=this.getFocusElement()}
if(_2!=null)isc.Canvas.clearAriaState(_2,_1)},isc.A.getAriaState=function isc_FormItem_getAriaState(){var _1={};if(this.required&&this.form&&this.form.hiliteRequiredFields)_1.required=true;if(this.hasErrors()){_1.invalid=true;if(!this.form.showInlineErrors||this.shouldShowErrorText()){var _2=this.$158i();_1.describedby=_2}else if(this.form.showInlineErrors&&this.shouldShowErrorIcon()){var _3=this.getErrorIconId();_1.describedby=_3}}
if(_1.describedby==null&&!this.$712()){var _4=this.getHint();if(_4){var _5=this.$59s();_1.describedby=_5}}
if(this.isDisabled())_1.disabled=true;if(isc.isA.CheckboxItem(this))_1.checked=!!this.getValue();return _1},isc.A.addContentRoles=function isc_FormItem_addContentRoles(){if(!isc.Canvas.ariaEnabled()||isc.Canvas.useLiteAria())return;if(!this.$kk()||!this.ariaRole)return;this.setAriaRole(this.ariaRole);var _1;if(this.outerAriaRole){_1=this.getHandle();if(_1!=null)isc.Canvas.setAriaRole(_1,this.outerAriaRole)}
var _2=this.getTitle();if(_2){var _3=this.$1568(),_4=this.getDocument().getElementById(_3);var _5;if(this.hasDataElement()){_5=this.getDataElement()}else if(this.outerAriaRole){_5=_1!=null?_1:this.getHandle()}else if(isc.isA.ContainerItem(this)){_5=this.$11o()}else{_5=this.$15h()}
if(_5!=null){if(_4!=null){isc.Canvas.setAriaState(_5,"labelledby",_3)}else{isc.Canvas.setAriaState(_5,"label",String.htmlStringToString(_2))}}}
if(this.ariaState)this.setAriaStates(this.ariaState);this.setAriaStates(this.getAriaState());if(isc.isA.SelectItem(this)&&this.outerAriaRole==="listbox"){var _6=this.$15h();if(_6!=null){isc.Canvas.setAriaStates(_6,{selected:true})}}});isc.B._maxIndex=isc.C+7;isc.A=isc.TextAreaItem.getPrototype();isc.A.ariaState={multiline:true};isc.A=isc.RadioItem.getPrototype();isc.A.ariaRole="radio";isc.A=isc.ComboBoxItem.getPrototype();isc.A.ariaState={autocomplete:"list",expanded:false};isc.A.ariaRole="combobox";isc.A=isc.SelectItem.getPrototype();isc.A.ariaRole="option";isc.A.outerAriaRole="listbox";isc.A.ariaState={expanded:false,haspopup:true};isc.A.emptyDisplayValue="<span aria-hidden='true'>&nbsp;</span>";isc.A=isc.StaticTextItem.getPrototype();isc.A.ariaRole="textbox";isc.A.ariaState={disabled:true};if(isc.PickListMenu){isc.A=isc.PickListMenu.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="listbox";isc.A.rowRole="option";isc.A.$156u=[null,"_row_",null,null,null,null,null];isc.B.push(isc.A.getRowElementId=function isc_PickListMenu_getRowElementId(_1){var _2=this.$156u;_2[0]=this.getID();isc.$bk(_2,_1,2,5);return _2.join(isc.emptyString)});isc.B._maxIndex=isc.C+1}
isc.A=isc.ContainerItem.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.setAriaRole=function isc_ContainerItem_setAriaRole(_1){var _2=this.$11o();if(_2!=null)isc.Canvas.setAriaRole(_2,_1)},isc.A.setAriaState=function isc_ContainerItem_setAriaState(_1,_2){var _3=this.$11o();if(_3!=null)isc.Canvas.setAriaState(_3,_1,_2)},isc.A.setAriaStates=function isc_ContainerItem_setAriaStates(_1){var _2=this.$11o();if(_2!=null)isc.Canvas.setAriaStates(_2,_1)},isc.A.clearAriaState=function isc_ContainerItem_clearAriaState(_1){var _2=this.$11o();if(_2!=null)isc.Canvas.clearAriaState(_2,_1)});isc.B._maxIndex=isc.C+4;isc.A=isc.RadioGroupItem.getPrototype();isc.A.ariaRole="radiogroup"}
if(isc.MultiComboBoxItem){isc.MultiComboBoxItem.changeDefaults("buttonProperties",{ariaState:{hidden:true},getAriaState:function(){var _1=this.getClass().$b4.getAriaState.apply(this,arguments);_1.hidden=!this.isVisible();return _1}})}
if(isc.GridRenderer){isc.A=isc.GridRenderer.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.setRowAriaState=function isc_GridRenderer_setRowAriaState(_1,_2,_3){var _4=this.getTableElement(_1);if(_4==null)return;isc.Canvas.setAriaState(_4,_2,_3)},isc.A.setRowAriaStates=function isc_GridRenderer_setRowAriaStates(_1,_2){var _3=this.getTableElement(_1);if(_3==null)return;isc.Canvas.setAriaStates(_3,_2)});isc.B._maxIndex=isc.C+2;isc.A=isc.ListGrid.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="list";isc.A.rowRole="listitem";isc.B.push(isc.A.getRowRole=function isc_ListGrid_getRowRole(_1,_2){if(_2&&_2.isSeparator)return"separator";return this.rowRole},isc.A.getRowAriaState=function isc_ListGrid_getRowAriaState(_1,_2){if(!isc.Canvas.ariaEnabled()||isc.Canvas.useLiteAria())return;var _3;if(!this.showAllRecords&&this.data!=null){_3={setsize:this.getTotalRows(),posinset:_1+1}}
var _4=this.selectionManager,_5=_2!=null?_2:_1;if(_4&&_4.isSelected&&_4.isSelected(_5)){if(_3==null)_3={}
_3.selected=true}
if(_2!=null){if(this.canExpandRecords&&this.canExpandRecord(_2,_1)){if(_3==null)_3={}
_3.expanded=this.isExpanded(_2)}else if(this.isGrouped&&this.isGroupNode(_2)){if(_3==null)_3={}
var _6=isc.isA.Tree(this.data)?this.data:null;if(_6)_3.expanded=_6.isOpen(_2)}}
return _3});isc.B._maxIndex=isc.C+2;isc.A=isc.TreeGrid.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="tree";isc.A.rowRole="treeitem";isc.B.push(isc.A.getRowRole=function isc_TreeGrid_getRowRole(_1,_2){return this.rowRole},isc.A.getRowAriaState=function isc_TreeGrid_getRowAriaState(_1,_2){if(!isc.Canvas.ariaEnabled()||isc.Canvas.useLiteAria())return;var _3=this.data,_4=this.selectionManager,_5=!!(_4&&_4.isSelected&&_4.isSelected(_2,true)),_6=_3.getLevel(_2);var _7={selected:_5,level:_6,setsize:this.getTotalRows(),posinset:_1+1};if(_3.isFolder(_2))_7.expanded=!!_3.isOpen(_2);return _7});isc.B._maxIndex=isc.C+2;isc.A=isc.Menu.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="menu";isc.A.screenReaderCellSeparator=null;isc.B.push(isc.A.getRowRole=function isc_Menu_getRowRole(_1,_2){if(!_2||_2.isSeparator)return"separator";if(_2.checked||_2.checkIf||_2.checkable)return"menuitemcheckable";if(_2.radio)return"menuitemradio";return"menuitem"},isc.A.getRowAriaState=function isc_Menu_getRowAriaState(_1){if(this.hasSubmenu(this.getItem(_1)))return{haspopup:true}});isc.B._maxIndex=isc.C+2;isc.A=isc.MenuButton.getPrototype();isc.A.ariaRole="button";isc.A.ariaState={haspopup:true};isc.A=isc.MenuBar.getPrototype();isc.A.ariaRole="menubar"}
if(isc.RichTextEditor){isc.A=isc.ListPropertiesSampleTile.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaState={};isc.A.$118a={"disc":"Bullets","circle":"Circles","square":"Filled squares","decimal":"Numbers","upper-roman":"Uppercase Roman numerals","lower-roman":"Lowercase Roman numerals","upper-alpha":"Uppercase letters","lower-alpha":"Lowercase letters"};isc.A.$118b="Other bulleted style";isc.A.$118c="Other numbered style";isc.B.push(isc.A.getAriaState=function isc_ListPropertiesSampleTile_getAriaState(){var _1=isc.addProperties({},this.ariaState);var _2=this.$1177,_3=_2.style;if(_3=="custom-image"){var _4=_2.image;var _5=_4.lastIndexOf('/');if(_5>=0){_4=_4.substring(_5+1)}
_1.label="Custom bullet image '"+_4+"'"}else if(this.$118a.hasOwnProperty(_3)){_1.label=this.$118a[_3]}else{var _6=isc.ListPropertiesPane.getListType(_2)=="unordered";_1.label=_6?this.$118b:this.$118c}
return _1},isc.A.getAriaStateAttributes=function isc_ListPropertiesSampleTile_getAriaStateAttributes(){return isc.Canvas.getAriaStateAttributes(this.getAriaState())});isc.B._maxIndex=isc.C+2;isc.A=isc.ListPropertiesPane.getPrototype();isc.A.sampleTileLayoutAriaLabel="List style";isc.ListPropertiesPane.changeDefaults("sampleTileLayoutDefaults",{ariaRole:"radiogroup",ariaState:{haspopup:false},init:function(){this.Super("init",arguments);this.ariaState=isc.addProperties({},this.ariaState,{label:this.creator.sampleTileLayoutAriaLabel})}});isc.ListPropertiesPane.changeDefaults("sampleTileDefaults",{ariaRole:"radio",setSelected:function(){this.Super("setSelected",arguments);this.setAriaState("checked",this.isSelected())}})}
if(isc.SectionStack){isc.A=isc.SectionStack.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaRole="tablist";isc.A.ariaState={multiselectable:false};isc.A.sectionHeaderAriaRole="tab";isc.B.push(isc.A.getAriaState=function isc_SectionStack_getAriaState(){var _1=isc.addProperties({},this.ariaState);_1.multiselectable=(this.visibilityMode!="mutex");return _1});isc.B._maxIndex=isc.C+1;isc.SectionStack.changeDefaults("tabPanelDefaults",{ariaRole:"tabpanel",ariaState:{hidden:true,labelledby:null,owns:null},getAriaState:function(){var _1=isc.addProperties({},this.ariaState);var _2=this.$159h;if(_2!=null){_1.hidden=_2.hidden||!_2.expanded;_1.labelledby=_2.$16aj();var _3=_2.items;if(_3!=null&&_3.length>0){var _4=_3.callMethod("$16aj");_1.owns=_4.join(" ")}}
return _1}});isc.$159i={ariaState:{controls:null},getAriaState:function(){var _1;if(isc.isA.SectionHeader(this)){_1=this.Super("getAriaState",arguments)}else{_1=isc.addProperties({},_1);if(isc.isA.StatefulCanvas(this.background)&&this.background.label!=null){_1.labelledby=this.background.label.$16aj()}else if(this.background!=null){_1.labelledby=this.background.$16aj()}}
var _2=this.layout;if(isc.isA.SectionStack(_2)){var _3=(_2.visibilityMode!="mutex");if(_3){_1.expanded=!!this.expanded}else{_1.selected=!!this.expanded}}
var _4=this.$159g;if(_4!=null){_1.controls=_4.$16aj()}
if(this.canCollapse==false){_1.disabled=true}
return _1}};isc.SectionHeader.addProperties(isc.$159i)
isc.ImgSectionHeader.addProperties(isc.$159i)}
if(isc.SplitPaneSidePanel){isc.A=isc.SplitPaneSidePanel.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaState={hidden:true};isc.B.push(isc.A.getAriaState=function isc_SplitPaneSidePanel_getAriaState(){var _1=isc.addProperties({},this.ariaState);_1.hidden=!this.onScreen;return _1});isc.B._maxIndex=isc.C+1}
isc.$167y=function(){var _1=this.Super("getAriaLabel",arguments);var _2=this.parentElement;if(isc.isA.TabBar(_2)){var _3=_2.parentElement;if(isc.isA.TabSet(_3)){var _4=_3.canCloseTab(this);if(_4&&_3.ariaCloseableSuffix){_1=_1==null?_3.ariaCloseableSuffix:_1+_3.ariaCloseableSuffix}}}
return _1};if(isc.ImgTab){isc.A=isc.ImgTab.getPrototype();isc.A.getAriaLabel=isc.$167y}
if(isc.SimpleTabButton){isc.A=isc.SimpleTabButton.getPrototype();isc.A.getAriaLabel=isc.$167y}
if(isc.Window){isc.A=isc.Window.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.ariaState={labelledby:null,describedby:null};isc.B.push(isc.A.getAriaState=function isc_Window_getAriaState(){var _1=this.Super("getAriaState",arguments);var _2=this.headerLabel;if(_2!=null&&_2.isVisible())_1.labelledby=_2.$16aj();var _3=this.body;if(_3!=null&&_3.isVisible())_1.describedby=_3.$16aj();return _1});isc.B._maxIndex=isc.C+1}
if(isc.Dialog){isc.A=isc.Dialog.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getAriaState=function isc_Dialog_getAriaState(){var _1=this.Super("getAriaState",arguments);var _2=this.messageLabel;if(_2!=null&&_2.isVisible())_1.describedby=_2.$16aj();return _1});isc.B._maxIndex=isc.C+1}
(function(){var _1={Button:"button",StretchImgButton:"button",ImgButton:"button",Label:"label",SectionHeader:"heading",ImgSectionHeader:"heading",CheckboxItem:"checkbox",Slider:"slider",TextItem:"textbox",TextAreaItem:"textbox",Window:"dialog",Dialog:"alertdialog",Toolbar:"toolbar",HTMLFlow:"article",HTMLPane:"article",TabBar:"tablist",PaneContainer:"tabpanel",ImgTab:"tab",EdgedCanvas:"presentation",BackMask:"presentation"}
for(var _2 in _1){var _3=isc.ClassFactory.getClass(_2);if(_3)_3.addProperties({ariaRole:_1[_2]})}})();if(isc.ListGrid!=null&&isc.DynamicForm!=null){isc.ClassFactory.defineClass("DataSourceFieldPicker","DynamicForm");isc.A=isc.DataSourceFieldPicker;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.FOREIGN_KEY_WARNING="Could not guess which foreignKey to use. Determine which of your fields is the foreign key, and make its foreignKey property point to a field in ";isc.B.push(isc.A.getForeignKeyWarning=function isc_c_DataSourceFieldPicker_getForeignKeyWarning(_1){return isc.DataSourceFieldPicker.FOREIGN_KEY_WARNING+"'"+_1+"'."});isc.B._maxIndex=isc.C+1;isc.A=isc.DataSourceFieldPicker.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.fields=[{name:"DataSource",type:"Select",titleStyle:"formTitle",allowEmptyValue:true,valueField:"ID",getClientPickListData:function(){return this.form.getDatasourcePickListData()},changed:function(_1,_2,_3){_1.handleDsNameChanged(_3)}},{name:"Field",type:"Select",titleStyle:"formTitle",changed:function(_1,_2,_3){_1.handleChanged()}}];isc.B.push(isc.A.getDatasourcePickListData=function isc_DataSourceFieldPicker_getDatasourcePickListData(){if(!this.$97r){this.$97r=[""];if(this.validDsNames&&this.validDsNames.getLength()>0){this.$97r.addList(this.validDsNames.map(function(_1){return{ID:_1}}))}
if(this.allDsRecords&&this.allDsRecords.getLength()>0){if(this.$97r.getLength()>0){this.$97r.add({isSeparator:true})}
this.$97r.addList(this.allDsRecords)}}
return this.$97r},isc.A.setValidDsNames=function isc_DataSourceFieldPicker_setValidDsNames(_1){this.validDsNames=_1;this.$97r=null},isc.A.setAllDsRecords=function isc_DataSourceFieldPicker_setAllDsRecords(_1){this.allDsRecords=_1;this.$97r=null},isc.A.setWarnIfNoForeignKey=function isc_DataSourceFieldPicker_setWarnIfNoForeignKey(_1){this.warnIfNoForeignKey=_1},isc.A.setCombinedValue=function isc_DataSourceFieldPicker_setCombinedValue(_1){var _2=this.getItem("DataSource");var _3=this.getItem("Field");var _4=(_1||"").split(".");_2.setValue(_4[0]);_3.setValue(_4[1]);this.handleDsNameChanged(_4[0])},isc.A.getCombinedValue=function isc_DataSourceFieldPicker_getCombinedValue(){var _1=this.getValue("DataSource");var _2=this.getValue("Field");if(_2)_1=_1+"."+_2;return _1},isc.A.initWidget=function isc_DataSourceFieldPicker_initWidget(){this.Super("initWidget",arguments);if(this.combinedValue)this.setCombinedValue(this.combinedValue)},isc.A.$97s=function isc_DataSourceFieldPicker__warnIfCannotGuessForeignKey(_1){var _2=this.warnIfNoForeignKey;if(!_2||!_2.fields)return;var _3=_2.fields.map(function(_4){return _4.foreignKey?_4.foreignKey.split('.')[0]:null});if(_3.contains(_1.ID))return;_3=_1.getFieldNames().map(function(_7){var _4=_1.getField(_7);return _4.foreignKey?_4.foreignKey.split('.')[0]:null});if(_3.contains(_2.ID))return;var _5=_2.fields.getProperty("name");var _6=_1.getFieldNames();if(_5.intersect(_6).getLength()>0)return;this.addFieldErrors("DataSource",isc.DataSourceFieldPicker.getForeignKeyWarning(this.getValue("DataSource")),true)},isc.A.handleLiveDs=function isc_DataSourceFieldPicker_handleLiveDs(_1){var _2=[];var _3=this.getField("Field");if(_1){_2=_1.getFieldNames();if(this.requiredBaseType){var _4=this;_2=_2.findAll(function(_3){var _5=isc.SimpleType.getBaseType(_1.getField(_3).type,_1);return _5==_4.requiredBaseType})}
if(_2.getLength()==1){_3.setValue(_2[0]);this.handleChanged()}
if(!_2.contains(_3.getValue())){_3.setValue("");this.handleChanged()}
if(this.warnIfNoForeignKey)this.$97s(_1)}
_3.setValueMap(_2)},isc.A.handleDsNameChanged=function isc_DataSourceFieldPicker_handleDsNameChanged(_1){if(!_1)this.getField("Field").setValue("");this.handleChanged();this.getField("Field").setValueMap([]);this.clearFieldErrors("DataSource",true);if(_1){var _2=isc.DS.get(_1);if(_2){this.handleLiveDs(_2)}else{var _3=this;isc.DS.load(_1,function(){_2=isc.DS.get(_1);if(!_2)_3.logWarn("Loading dataSource from server was unsuccessful for "+_1);_3.handleLiveDs(_2)},false,true)}}},isc.A.handleChanged=function isc_DataSourceFieldPicker_handleChanged(){if(this.changed)this.changed(this,this.getCombinedValue())});isc.B._maxIndex=isc.C+11;isc.DataSourceFieldPicker.registerStringMethods({changed:"form, value"});isc.ClassFactory.defineClass("DataSourceEditor","VLayout");isc.A=isc.DataSourceEditor.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.overflow="visible";isc.A.mainEditorDefaults={_constructor:"ComponentEditor",autoDraw:false,numCols:8,overflow:"visible",dataSource:"DataSource",fields:[{name:"ID",title:"ID",required:true},{type:"section",defaultValue:"XPath Binding",showIf:"values.dataFormat != 'iscServer' && values.serverType != 'sql'",itemIds:["dataURL","selectBy","recordXPath","recordName"]},{name:"dataURL",showIf:"values.dataFormat != 'iscServer'"},{name:"selectBy",title:"Select Records By",shouldSaveValue:false,valueMap:{tagName:"Tag Name",xpath:"XPath Expression"},defaultValue:"xpath",redrawOnChange:true,showIf:"values.dataFormat == 'xml'"},{name:"recordXPath",showIf:"values.dataFormat != 'iscServer' && form.getItem('selectBy').getValue() == 'xpath'"},{name:"recordName",showIf:"values.dataFormat == 'xml' && values.selectBy == 'tagName'"},{type:"section",defaultValue:"SQL Binding",showIf:"values.serverType == 'sql' || values.serverType == 'hibernate'",itemIds:["dbName","schema","tableName"]},{name:"dbName",showIf:"values.serverType == 'sql'"},{name:"schema",showIf:"values.serverType == 'sql'"},{name:"tableName",showIf:"values.serverType == 'sql' || values.serverType == 'hibernate'"},{type:"section",defaultValue:"Record Titles",sectionExpanded:false,itemIds:["title","pluralTitle"]},{name:"title"},{name:"pluralTitle"},{type:"section",defaultValue:"Advanced",sectionExpanded:false,itemIds:["dropExtraFields","autoDeriveSchema","quoteTableName","beanClassName","titleField"]},{name:"dropExtraFields"},{name:"autoDeriveSchema"},{name:"quoteTableName",showIf:"values.serverType == 'sql'"},{name:"beanClassName",showIf:"values.serverType == 'sql' || values.serverType == 'hibernate'"},{name:"titleField"}],itemHoverStyle:"docHover",titleHoverHTML:function(_1){if(isc.jsdoc.hasData()){var _2=isc.jsdoc.hoverHTML("DataSource",_1.name);if(_2)return _2}
return"<nobr><code><b>"+_1.name+"</b></code> (no doc available)</nobr>"}};isc.A.fieldEditorDefaults={_constructor:"ListEditor",autoDraw:false,inlineEdit:true,dataSource:"DataSourceField",saveLocally:true,gridButtonsOrientation:"right",fields:[{name:"name",treeField:true,formatCellValue:function(_1,_2,_3,_4,_5){if(!_2)_2={};var _6=this.$97t(_1,_2.includeFrom);if(_2.includeFrom){_6+=" <i>["+_2.includeFrom+"]</i>"}
return _6},$97t:function(_1,_2){if(_1){return _1}else{var _3=_2.lastIndexOf(".");if(_3==-1){return _1}else{return _2.substring(_3+1)}}},formatEditorValue:function(_1,_2,_3,_4){if(!_2)_2={};return this.$97t(_1,_2.includeFrom)},parseEditorValue:function(_1,_2,_3,_4,_5){if(!_2)_2={};return this.$97t(_1,_2.includeFrom)}},{name:"title"},{name:"type",width:60},{name:"required",title:"Req.",width:40,canToggle:true},{name:"hidden",width:40},{name:"length",width:60},{name:"primaryKey",title:"is PK",width:40}],formProperties:{numCols:4,initialGroups:10},formFields:[{name:"name",canEdit:false},{name:"type"},{name:"title"},{name:"primaryKey"},{name:"valueXPath",colSpan:2,showIf:function(){var _1=this.form.creator,_2=_1?_1.creator.mainEditor:null;return(_2&&_2.getValues().dataFormat!='iscServer')}},{type:"section",defaultValue:"Value Constraints",itemIds:["required","length","valueMap"]},{name:"valueMap",rowSpan:2},{name:"required"},{name:"length"},{type:"section",defaultValue:"Component Binding",itemIds:["hidden","detail","canEdit"]},{name:"canEdit"},{name:"hidden"},{name:"detail"},{type:"section",defaultValue:"Relations",sectionExpanded:true,itemIds:["foreignKey","rootValue","includeFrom"]},{name:"foreignKey",type:"staticText",showPickerIcon:true,pickerConstructor:"DataSourceFieldPicker",pickerProperties:{width:160,changed:function(_1,_2){_1.creator.setValue(_2)}},showPicker:function(){var _1=this;while(_1&&!isc.isA.DataSourceEditor(_1))_1=_1.creator;if(!_1){this.logWarn("Could not find the DataSourceEditor");return}
if(!_1.knownDataSources){this.logWarn("DataSourceEditor.knownDataSources has not been set");return}
this.Super("showPicker",arguments);var _2=_1.getDatasourceData();var _3=_1.knownDataSources.findAll({dsType:_2.serverType});this.picker.setValidDsNames(_3.getProperty("ID"));var _4=isc.DS.get(_2.ID);this.picker.requiredBaseType=isc.SimpleType.getBaseType(this.form.getValue("type"),_4);this.picker.setCombinedValue(this.getValue())},destroy:function(){if(this.picker)this.picker.destroy();this.Super("destroy",arguments)}},{name:"rootValue"},{name:"includeFrom",type:"staticText",showPickerIcon:true,pickerConstructor:"DataSourceFieldPicker",pickerProperties:{changed:function(_1,_2){_1.creator.setValue(_2)}},showPicker:function(){var _1=this;while(_1&&!isc.isA.DataSourceEditor(_1))_1=_1.creator;if(!_1){this.logWarn("Could not find the DataSourceEditor");return}
var _2=_1.getDatasourceData();var _3=_2.fields;var _4=_3.findAll(function(_8){return _8.foreignKey})||[];var _5=_4.map(function(_8){return _8.foreignKey.split(".")[0]}).getUniqueItems();var _6=null;if(_1.knownDataSources){var _7=_2.serverType;if(_7){_6=_1.knownDataSources.findAll({dsType:_7})}else{_6=_1.knownDataSources}}
this.Super("showPicker",arguments);this.picker.setValidDsNames(_5);if(_6)this.picker.setAllDsRecords(_6);this.picker.setWarnIfNoForeignKey(_2);this.picker.setCombinedValue(this.getValue())},destroy:function(){if(this.picker)this.picker.destroy();this.Super("destroy",arguments)}}],gridDefaults:{editEvent:"click",listEndEditAction:"next",autoParent:"gridLayout",selectionType:isc.Selection.SINGLE,recordClick:"this.creator.recordClick(record)",modalEditing:true,editorEnter:"if (this.creator.moreButton) this.creator.moreButton.enable(); if (this.creator.creator.validatorsButton) this.creator.creator.validatorsButton.enable()",selectionChanged:function(){if(this.anySelected()&&this.creator.moreButton){this.creator.moreButton.enable()}
if(this.anySelected()&&this.creator.creator.validatorsButton){this.creator.creator.validatorsButton.enable()}},contextMenu:{data:[{title:"Remove",click:"target.creator.removeRecord()"}]},styleName:"rightBorderOnly",validateByCell:true,leaveScrollbarGap:false,alternateRecordStyles:true,canRemoveRecords:true,canEdit:true,canEditCell:function(_1,_2){var _3=this.getRecord(_1),_4=this.getField(_2),_5=_4[this.fieldIdProperty],_6=(_5=="name"||_5=="title");if(isc.isA.TreeGrid(this)){if(_3.isFolder&&!(_6||_5=="required"||_5=="hidden")){return false}}
else{if(this.getDataSource().fieldIsComplexType(_4)&&!_6)
return false}
return this.Super('canEditCell',arguments)},editComplete:function(_1,_2,_3,_4,_5){var _6;if(_4&&_4.name!=null&&_3.name!=_6&&_4.name!=_3.name){var _7=this.getRecord(_1);this.creator.$1882(_4.name,_3.name)}
if(_4&&_4.type!=null&&_3.type!=_6&&_4.type!=_3.type){var _7=this.getRecord(_1);this.creator.$1883(_7)}},removeRecordClick:function(_1){var _2=this.getRecord(_1);this.creator.fieldDeleted(_2);this.Super("removeRecordClick",arguments)}},$1882:function(_1,_2){var _3=this.grid,_4=_3.data,_5=(isc.isA.Tree(_4)?_4.getAllNodes():_4);for(var i=0;i<_5.length;i++){var _7=_5[i];if(_7.validators&&_7.validators.length>0){for(var j=0;j<_7.validators.length;j++){this.updateValidatorFieldNames(_7.validators[j],_1,_2)}}}
var _9=this.renames;if(!_9){_9=this.renames={}}
var _10=(_1==null?_1:isc.getKeyForValue(_1,_9));if(_10==_2)delete _9[_10];else _9[_10]=_2;this.fieldNameChanged(_1,_2)},fieldNameChanged:function(_1,_2){},$1883:function(_1){if(_1.validators&&_1.validators.length>0){isc.confirm("Changing the field type may cause some validators to be invalid. Clear field validators?",function(_2){if(_2){delete _1.validators}})}
this.fieldTypeChanged(_1)},fieldTypeChanged:function(_1){},fieldDeleted:function(_1){var _2=this.grid,_3=_2.data,_4=(isc.isA.Tree(_3)?_3.getAllNodes():_3),_5=_1.name,_6=false;for(var i=0;i<_4.length;i++){var _1=_4[i];if(_1.validators&&_1.validators.length>0){for(var j=0;j<_1.validators.length;j++){_6=this.validatorReferencesField(_1.validators[j],_5)||_6}}}
if(_6){isc.warn("Deletion of field "+_5+" affects one or more other fields with validators that referenced this field. These affected criterion will be ignored.")}},updateValidatorFieldNames:function(_1,_2,_3){var _4=_1.applyWhen;if(!_4||isc.isA.emptyObject(_4))return;this.$178b(_4,_2,_3)},$178b:function(_1,_2,_3){var _4=_1.operator,_5=false;if(_4=="and"||_4=="or"){var _6=_1.criteria;for(var i=0;i<_6.length;i++){if(this.$178b(_6[i],_2,_3)){_5=true}}}else{if(_1.fieldName!=null&&_1.fieldName==_2){_1.fieldName=_3;_5=true}}
return _5},validatorReferencesField:function(_1,_2){var _3=_1.applyWhen;if(!_3||isc.isA.emptyObject(_3))return false;return this.$178c(_3,_2)},$178c:function(_1,_2){var _3=_1.operator;if(_3=="and"||_3=="or"){var _4=_1.criteria;for(var i=0;i<_4.length;i++){if(this.$178c(_4[i],_2)){return true}}}else{if(_1.fieldName!=null&&_1.fieldName==_2){return true}}
return false},newRecord:function(){if(this.creator.canEditChildSchema){var _1=this.grid,_2=_1.data,_3=this.getSelectedNode();if(!_3)_3=_2.root;var _4=_2.getParent(_3)
if(_3){if(!_3.isFolder)_3=_4;var _5={name:this.getNextUniqueFieldName(_3,"field"),id:this.getNextUnusedNodeId(),parentId:_3?_3.id:null};this.addNode(_5,_3)}}else this.Super("newRecord",arguments)},getSelectedNode:function(){return this.grid.getSelectedRecord()},addNode:function(_1,_2){var _3=this.grid.data;_3.linkNodes([_1])},getNextUniqueFieldName:function(_1,_2){var _3=_1?_1.fields||[]:[],_4=1;if(!_2||_2.length==0)_2="field";if(_3&&_3.length>0){for(var i=0;i<_3.length;i++){var _6=_3.get(i),_7=_6.name;if(_7.substring(0,_2.length)==_2&&_7.length>_2.length){var _8=parseInt(_7.substring(_2.length));if(!isNaN(_8)&&_8>=_4)
_4=_8+1}}}
return _2+_4},getNextUnusedNodeId:function(){var _1=this.grid.data;for(var i=1;i<10000;i++){var _3=_1.findById(i);if(!_3)return i}
return 1}};isc.A.mockEditorDefaults={_constructor:"DynamicForm",minWidth:80,minHeight:20,width:"100%",height:"100%",numCols:1,fields:[{name:"edit",type:"TextArea",allowNativeResize:true,width:"*",height:"*",showTitle:false}]};isc.A.newButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"gridButtons",title:"New Field",click:"this.creator.newRecord()"};isc.A.moreButtonDefaults={_constructor:isc.AutoFitButton,autoParent:"gridButtons",click:"this.creator.editMore()",disabled:true};isc.A.buttonLayoutDefaults={_constructor:"HLayout",width:"100%",membersMargin:5};isc.A.saveButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Save",autoFit:true,autoParent:"buttonLayout",click:function(){this.creator.save()}};isc.A.addTestDataButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Add Test Data",autoFit:true,click:function(){var _1=isc.addProperties({},this.creator.mainEditor?this.creator.mainEditor.getValues():this.creator.mainEditorValues)
var _2=isc.DataImportDialog.create({ID:"dataImportDialog",targetDataSource:_1.ID});_2.show()}};isc.A.validatorsButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Validators..",autoFit:true,disabled:true,click:function(){var _1=this.creator.fieldEditor,_2=_1.grid,_3=_2.data,_4=_2.getSelectedRecord()||_3.root,_5=(isc.isA.Tree(_3)?_3.getParent(_4):null);if(_4&&!_4.isFolder&&_5==_3.root){var _6=this;while(_6&&!isc.isA.DataSourceEditor(_6))_6=_6.creator;if(!_6){this.logWarn("Could not find the DataSourceEditor");return}
_6.editFieldValidators(_4)}}};isc.A.addChildButtonDefaults={_constructor:"IButton",autoDraw:false,title:"Add Child Object",autoFit:true,click:function(){var _1=this.creator.fieldEditor,_2=_1.grid,_3=_2.data,_4=_2.getSelectedRecord()||_3.root,_5=_3.getParent(_4),_6={isFolder:true,children:[],multiple:true,childTagName:"item"};if(_4){if(!_4.isFolder)_4=_5;_6.name=_1.getNextUniqueFieldName(_4,"child"),_6.id=_1.getNextUnusedNodeId(),_6.parentId=_4.id;_3.linkNodes([_6],_5);_3.openFolder(_6)}}};isc.A.mainStackDefaults={_constructor:"SectionStack",overflow:"visible",width:"100%",height:"100%",visibilityMode:"multiple"};isc.A.instructionsSectionDefaults={_constructor:"SectionStackSection",title:"Instructions",expanded:true,canCollapse:true};isc.A.instructionsDefaults={_constructor:"HTMLFlow",autoFit:true,padding:10};isc.A.mainSectionDefaults={_constructor:"SectionStackSection",title:"DataSource Properties",expanded:true,canCollapse:false,showHeader:false};isc.A.fieldSectionDefaults={_constructor:"SectionStackSection",title:"DataSource Fields &nbsp;<span style='color:#BBBBBB'>(click to edit or press New)</span>",expanded:true,canCollapse:true};isc.A.mockSectionDefaults={_constructor:"SectionStackSection",title:"MockDataSource Data",expanded:true,canCollapse:false,showHeader:false,hidden:true};isc.A.deriveFieldsSectionDefaults={_constructor:"SectionStackSection",title:"Derive Fields From SQL",expanded:false,canCollapse:true};isc.A.bodyProperties={overflow:"auto",layoutMargin:10};isc.A.deriveFormDefaults={_constructor:"DynamicForm"};isc.A.previewGridDefaults={_constructor:"ListGrid",showFilterEditor:true};isc.A.canEditChildSchema=false;isc.A.canAddChildSchema=false;isc.A.validatorsWindowDefaults={_constructor:isc.Window,autoCenter:true,height:550,width:800,isModal:true,showModalMask:true,showHeaderIcon:false,showMinimizeButton:false,keepInParentRect:true,close:function(){this.Super("close",arguments);this.markForDestroy()},destroy:function(){if(this.dataSource)this.dataSource.destroy();this.Super("destroy",arguments)}};isc.A.validatorsLayoutDefaults={_constructor:isc.ValidatorsEditor,addAsChild:true,width:"100%",height:"100%"};isc.A.validatorsToolbarDefaults={_constructor:isc.HLayout,width:"100%",height:30,padding:10,align:"right",membersMargin:4,members:[{_constructor:isc.Button,title:"Save",icon:"[SKIN]actions/save.png",width:75,click:function(){this.parentElement.saveValidators()}},{_constructor:isc.Button,title:"Cancel",icon:"[SKIN]actions/cancel.png",width:75,click:function(){this.topElement.destroy()}}]};isc.B.push(isc.A.editNew=function isc_DataSourceEditor_editNew(_1,_2,_3){this.addTestDataButton.hide();if(_1&&_1.defaults){this.paletteNode=_1;this.start(_1.defaults,_2,true,_3)}else{this.start(_1,_2,true,_3)}},isc.A.editSaved=function isc_DataSourceEditor_editSaved(_1,_2,_3){if(!isc.isA.MockDataSource(_1)){this.addTestDataButton.show()}else{this.addTestDataButton.hide()}
this.start(_1,_2,false,_3)},isc.A.start=function isc_DataSourceEditor_start(_1,_2,_3,_4){if(_4){this.mainStack.showSection(0);this.instructions.setContents(_4)}else{this.mainStack.hideSection(0)}
if(isc.isA.MockDataSource(_1)){this.mainStack.hideSection(1);this.mainStack.hideSection(2);this.mainStack.showSection(3)}else{this.mainStack.showSection(1);this.mainStack.showSection(2);this.mainStack.hideSection(3)}
if(this.mainEditor)this.mainEditor.clearValues();if(this.fieldEditor)this.fieldEditor.setData(null);this.$179s=_1;this.$1875=null;this.saveCallback=_2;this.logWarn("editing "+(_3?"new ":"")+"DataSource: "+this.echo(_1));if(!_1){return this.show()}
this.dsClass=_1.Class;if(_3){if(isc.isA.DataSource(_1)){var _5=_1.sfName;_1=_1.getSerializeableFields();if(_5)_1.sfName=_5;this.logWarn("editing new DataSource from live DS, data: "+this.echo(_1))}else{_1.ID=this.getUniqueDataSourceID()}
this.$31u(_1)}else{var _6=this;this.dsDataSource.getFile({fileName:_1.ID,fileType:"ds",fileFormat:"xml"},function(_7,_8,_9){isc.DMI.callBuiltin({methodName:"xmlToJS",arguments:[_8],callback:function(_10,_8){_6.$37p(_8)}})})}},isc.A.getUniqueDataSourceID=function isc_DataSourceEditor_getUniqueDataSourceID(){return"newDataSource"},isc.A.$37p=function isc_DataSourceEditor__loadSchemaReply(_1){isc.captureDefaults=true;var _2=isc.eval(_1);isc.captureDefaults=null;var _3=_2.defaults;this.logWarn("captured DS defaults: "+this.echo(_3));if(_3.serverType=="sql")_3.dataFormat="iscServer";if(_3.recordXPath!=null&&_3.dataFormat==null){_3.dataFormat="xml"}
this.$31u(_3)},isc.A.$31u=function isc_DataSourceEditor__startEditing(_1){if(this.mainEditor)this.mainEditor.setValues(_1);else this.mainEditorValues=_1;var _2=_1.fields;if(!isc.isAn.Array(_2))_2=isc.getValues(_1.fields);if(this.fieldEditor){if(this.canEditChildSchema){this.setupIDs(_2,1,null);var _3=isc.Tree.create({modelType:"parent",childrenProperty:"fields",titleProperty:"name",idField:"id",nameProperty:"id",root:{id:0,name:"root"},data:_2});_3.openAll();this.fieldEditor.setData(_3)}else this.fieldEditor.setData(_2);this.fieldEditor.formLayout.hide();this.fieldEditor.gridLayout.show()}
if(this.mockEditor&&_1&&_1.mockData){this.mockEditor.setValue("edit",_1.mockData.replace(/\\/g,"\\").replace(/^\[(.*)\]$/m,"{$1}"))}
this.show()},isc.A.setupIDs=function isc_DataSourceEditor_setupIDs(_1,_2,_3){var _4=_2,_5,_6;if(!_4)_4=1;for(var i=0;i<_1.length;i++){var _5=_1.get(i);_5.parentId=_3;_5.id=_4++;if(_5.fields){if(!isc.isAn.Array(_5.fields))_5.fields=isc.getValues(_5.fields);_4=this.setupIDs(_5.fields,_4,_5.id)}}
return _4},isc.A.getDatasourceData=function isc_DataSourceEditor_getDatasourceData(){var _1=this.dsClass||"DataSource",_2=isc.addProperties({},this.mainEditor?this.mainEditor.getValues():this.mainEditorValues);if(this.canEditChildSchema){var _3=this.fieldEditor.grid.data,_4=_3.getCleanNodeData(_3.getRoot(),true).fields;_2.fields=this.getExtraCleanNodeData(_4)}else{_2.fields=this.fieldEditor.getData()}
if(_1=="MockDataSource"){var _5=this.mockEditor.getValue("edit"),_6=_2.mockDataType||"grid";_2.mockData=(_6=="tree"?_5.trim():_5.trim().replace(/\\/g,"\\").replace("{","[").replace("}","]"));delete _2.cacheData;delete _2.fields}
return _2},isc.A.editFieldValidators=function isc_DataSourceEditor_editFieldValidators(_1){var _2=this.getDatasourceData();delete _2.ID;_2.fields=isc.clone(_2.fields);var _3=this.createLiveDSInstance(_2);var _4={title:"Validators for "+_1.name,dataSource:_3}
var _5=this.createAutoChild("validatorsWindow",_4);var _6={fieldName:_1.name,dataSource:_3,validators:_1.validators};this.validatorsLayout=this.createAutoChild("validatorsLayout",_6);var _7={window:_5,editor:this.validatorsLayout,saveValidators:function(){if(this.editor.validate()){var _8=this.editor.getValidators();_1.validators=_8;this.window.markForDestroy()}}};this.validatorsToolbar=this.createAutoChild("validatorsToolbar",_7);_5.addItem(this.validatorsLayout);_5.addItem(this.validatorsToolbar);_5.show()},isc.A.createLiveDSInstance=function isc_DataSourceEditor_createLiveDSInstance(_1){var _2=this.dsClass||"DataSource",_3;if(isc.DS.isRegistered(_2)){_3=isc.DS.get(_2)}else{_3=isc.DS.get("DataSource");_1._constructor=_2}
var _4=isc.ClassFactory.getClass(_2).create(_1);return _4},isc.A.save=function isc_DataSourceEditor_save(){var _1=true;if(this.showMainEditor!=false)_1=this.mainEditor.validate();var _2=this.fieldEditor;if(!_1||!_2.validate()){return false}
if(_2.isVisible()){_2.saveRecord()}
var _3=this.getDatasourceData();if(_3.serverType=="sql"||_3.serverType=="hibernate"){if(!_3.fields.getProperty("primaryKey").or()){var _4=false;if(isc.isA.DataSource(this.$179s)){var _5=this.$179s.getFields(),_6=this.$179s.getLocalFields();for(var _7 in _5){var _8=_5[_7];if(_8.primaryKey&&!_3.fields.find("name",_7)){_4=true;break}}}
if(!_4){isc.warn("SQL / Hibernate DataSources must have a field marked as the primary key");return false}}}
["recordXPath","dataURL","dbName","schema","tableName","quoteTableName","beanClassName","dropExtraFields","autoDeriveSchema"].map(function(_9){if(_3[_9]==null)delete _3[_9]});if(_3._constructor=="DatabaseBrowser")delete _3._constructor;this.doneEditing(_3);return true},isc.A.getExtraCleanNodeData=function isc_DataSourceEditor_getExtraCleanNodeData(_1,_2){if(_1==null)return null;var _3=[],_4=false;if(!isc.isAn.Array(_1)){_1=[_1];_4=true}
for(var i=0;i<_1.length;i++){var _6=_1[i],_7={};for(var _8 in _6){if(_8=="id"||_8=="parentId"||_8=="isFolder")continue;_7[_8]=_6[_8];if(_8==this.fieldEditor.grid.data.childrenProperty&&isc.isAn.Array(_7[_8])){_7[_8]=this.getExtraCleanNodeData(_7[_8])}}
_3.add(_7)}
if(_4)return _3[0];return _3},isc.A.doneEditing=function isc_DataSourceEditor_doneEditing(_1){var _2=this.dsClass||"DataSource",_3;if(isc.DS.isRegistered(_2)){_3=isc.DS.get(_2)}else{_3=isc.DS.get("DataSource");_1._constructor=_2}
var _4=_3.xmlSerialize(_1);this.logWarn("saving DS with XML: "+_4);var _5=this;this.dsDataSource.saveFile({fileName:_1.ID,fileType:"ds",fileFormat:"xml"},_4,function(){if(_5.$179s){isc.DataSource.load(_5.$179s.ID,null,true,true)}});var _6=isc.ClassFactory.getClass(_2).create(_1);this.fireCallback(this.saveCallback,"dataSource",[_6]);this.saveCallback=null},isc.A.clear=function isc_DataSourceEditor_clear(){if(this.mainEditor)this.mainEditor.clearValues();else this.mainEditorValues=null;this.fieldEditor.setData([])},isc.A.getFieldRenames=function isc_DataSourceEditor_getFieldRenames(){return this.fieldEditor.renames},isc.A.initWidget=function isc_DataSourceEditor_initWidget(){this.Super('initWidget',arguments);this.addAutoChildren(["mainStack","instructions","mainEditor","mockEditor","buttonLayout"]);this.buttonLayout.addMember(this.createAutoChild("saveButton"));this.addTestDataButton=this.createAutoChild("addTestDataButton");this.buttonLayout.addMember(this.addTestDataButton);if(this.dsDataSource)this.dsDataSource=isc.DataSource.get(this.dsDataSource);if(this.canAddChildSchema){this.canEditChildSchema=true;this.addAutoChild("addChildButton")}
this.validatorsButton=this.createAutoChild("validatorsButton");this.addAutoChild("fieldEditor",{formConstructor:isc.TComponentEditor||isc.ComponentEditor,gridConstructor:this.canEditChildSchema?isc.TreeGrid:isc.ListGrid,showMoreButton:this.showMoreButton,newButtonTitle:"New Field",newButtonDefaults:this.newButtonDefaults,newButtonProperties:this.newButtonProperties,moreButtonDefaults:this.moreButtonDefaults,moreButtonProperties:this.moreButtonProperties});this.moreButton=this.fieldEditor.moreButton;this.newButton=this.fieldEditor.newButton;this.fieldEditor.gridButtons.addMember(this.validatorsButton);if(this.canAddChildSchema)this.fieldEditor.gridButtons.addMember(this.addChildButton);var _1=this.mainStack;_1.addSections([isc.addProperties(this.instructionsSectionDefaults,this.instructionsSectionProperties,{items:[this.instructions]})]);_1.addSections([isc.addProperties(this.mainSectionDefaults,this.mainSectionProperties,{items:[this.mainEditor]})]);if(this.showMainEditor==false)_1.hideSection(1);_1.addSections([isc.addProperties(this.fieldSectionDefaults,this.fieldSectionProperties,{items:[this.fieldEditor]})]);_1.addSections([isc.addProperties(this.mockSectionDefaults,this.mockSectionProperties,{items:[this.mockEditor]})]);var _2=this;this.deriveForm=this.createAutoChild("deriveForm",{fields:[{name:"sql",showTitle:false,formItemType:"AutoFitTextAreaItem",width:"*",height:40,colSpan:"*",keyPress:function(_3,_4,_5){if(_5=='Enter'&&isc.EH.ctrlKeyDown()){if(isc.Browser.isSafari)_3.setValue(_3.getElementValue());_2.execSQL();if(isc.Browser.isSafari)return false}}},{type:"button",title:"Execute",startRow:true,click:this.getID()+".execSQL()"}]});_1.addSections({expanded:true,showHeader:false,items:[this.saveButton]})},isc.A.execSQL=function isc_DataSourceEditor_execSQL(){var _1=this.deriveForm.getValue("sql");if(_1){_1=_1.trim().replace(/(.*);+/,"$1");var _2=isc.DataSource.get("DataSourceStore");_2.performCustomOperation("dsFromSQL",{dbName:this.mainEditor.getValue("dbName"),sql:_1},this.getID()+".deriveDSLoaded(data)")}},isc.A.deriveDSLoaded=function isc_DataSourceEditor_deriveDSLoaded(_1){var _2=_1.ds;this.dsLoaded(_1.ds)},isc.A.dsLoaded=function isc_DataSourceEditor_dsLoaded(_1){var _2=isc.DataSource.create(_1);this.currentDS=_2;this.deriveFields(_2);this.previewGrid.setDataSource(_2)},isc.A.deriveFields=function isc_DataSourceEditor_deriveFields(_1){var _2=_1.getFieldNames();var _3=[];for(var i=0;i<_2.length;i++){var _5=_2[i]
var _6={};var _7=_1.getField(_5);for(var _8 in _7){if(isc.isA.String(_8)&&_8.startsWith("_"))continue;_6[_8]=_7[_8]}
_3.add(_6)}
var _9=isc.Tree.create({modelType:"parent",childrenProperty:"fields",titleProperty:"name",idField:"id",nameProperty:"id",root:{id:0,name:"root"},data:_3});this.fieldEditor.setData(_9)});isc.B._maxIndex=isc.C+20}
isc._nonDebugModules=(isc._nonDebugModules!=null?isc._nonDebugModules:[]);isc._nonDebugModules.push('DataBinding');isc.checkForDebugAndNonDebugModules();isc._moduleEnd=isc._DataBinding_end=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc.Log&&isc.Log.logIsInfoEnabled('loadTime'))isc.Log.logInfo('DataBinding module init time: '+(isc._moduleEnd-isc._moduleStart)+'ms','loadTime');delete isc.definingFramework;if(isc.Page)isc.Page.handleEvent(null,"moduleLoaded",{moduleName:'DataBinding',loadTime:(isc._moduleEnd-isc._moduleStart)});}else{if(window.isc&&isc.Log&&isc.Log.logWarn)isc.Log.logWarn("Duplicate load of module 'DataBinding'.");}
