This repository was archived by the owner on Jan 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathsprestlib-ui.bundle.js
3 lines (3 loc) · 140 KB
/
sprestlib-ui.bundle.js
1
2
3
/* SpRestLib 1.10.0-beta-20190212 */
!function(e){function r(){}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function i(n,r){for(;3===n._state;)n=n._value;return 0===n._state?void n._deferreds.push(r):(n._handled=!0,void o._immediateFn(function(){var e=1===n._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(n._value)}catch(e){return void s(r.promise,e)}a(r.promise,t)}else(1===n._state?a:s)(r.promise,n._value)}))}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void l(t);if("function"==typeof n)return void c((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,l(t)}catch(e){s(t,e)}var r,i}function s(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null}function u(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function c(e,t){var n=!1;try{e(function(e){n||(n=!0,a(t,e))},function(e){n||(n=!0,s(t,e))})}catch(e){if(n)return;n=!0,s(t,e)}}var t=setTimeout;o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(r);return i(this,new u(e,t,n)),n},o.all=function(e){var s=Array.prototype.slice.call(e);return new o(function(r,i){function o(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){o(t,e)},i)}s[t]=e,0==--a&&r(s)}catch(e){i(e)}}if(0===s.length)return r([]);for(var a=s.length,e=0;e<s.length;e++)o(e,s[e])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(n){return new o(function(e,t){t(n)})},o.race=function(i){return new o(function(e,t){for(var n=0,r=i.length;n<r;n++)i[n].then(e,t)})},o._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){t(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},"undefined"!=typeof module&&module.exports?module.exports=o:e.Promise||(e.Promise=o)}(this),function(){var r={0:"List",1:"Library",3:"Discussion Board",4:"Survey",5:"Issue"},c={0:"None",1:"User",2:"Distribution List",4:"Security Group",8:"SharePoint Group",15:"All"},d={baseUrl:"undefined"!=typeof _spPageContextInfo&&_spPageContextInfo.webServerRelativeUrl?_spPageContextInfo.webServerRelativeUrl:"..",busySpinnerHtml:'<div class="sprlib-spinner"><div class="sprlib-bounce1"></div><div class="sprlib-bounce2"></div><div class="sprlib-bounce3"></div></div>',cache:!1,cleanColHtml:!0,currencyChar:"$",debug:!1,language:"en",maxRetries:2,maxRows:5e3,metadata:!1,nodeEnabled:!1,nodeCookie:"",nodeServer:"",overwriteUploads:!1,queryLimit:null,retryAfter:1e3},l=null,t=/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/i,n=0;function f(t){var e=(t=t||{}).status||"UNK",n="",r=t.responseText||"UNK",i={};if(t.responseText&&"string"==typeof t.responseText)try{(i=JSON.parse(t.responseText)).error&&i.error.message&&i.error.message.value?(n=i.error.code.split(",")[0],r=i.error.message.value):i.error&&i.error.message&&"string"==typeof i.error.message&&(n=i.error.code,r=i.error.message)}catch(e){d.debug&&(console.warn("Unable to parse jqXHR response!"),console.log(t.responseText))}return"("+e+") "+(n?"["+n+"] ":"")+r}this.sprLib={},sprLib.version="1.10.0-beta-20190212",sprLib.auth=function(e){e=e||{};"undefined"!=typeof document&&document.getElementById("__REQUESTDIGEST")&&document.getElementById("__REQUESTDIGEST").value;return{}},sprLib.renewSecurityToken=function(){return new Promise(function(n,t){sprLib.rest({url:"_api/contextinfo",type:"POST"}).then(function(e){var t=e&&e[0]&&e[0].GetContextWebInformation&&e[0].GetContextWebInformation.FormDigestValue?e[0].GetContextWebInformation.FormDigestValue:null;"undefined"!=typeof document&&document.getElementById("__REQUESTDIGEST")&&(document.getElementById("__REQUESTDIGEST").value=t),n(t)}).catch(function(e){t(e)})})},sprLib.options=function(e){if(!(e&&"object"==typeof e&&(e.hasOwnProperty("baseUrl")||e.hasOwnProperty("queryLimit")||e.hasOwnProperty("nodeEnabled")||e.hasOwnProperty("nodeCookie")||e.hasOwnProperty("nodeServer")||e.hasOwnProperty("debug"))))return{baseUrl:d.baseUrl,nodeCookie:d.nodeCookie,nodeEnabled:d.nodeEnabled,nodeServer:d.nodeServer,queryLimit:d.queryLimit};if(e.baseUrl&&"string"!=typeof e.baseUrl)console.warn("Warning: `baseUrl` should be a string");else if(e.nodeCookie&&"string"!=typeof e.nodeCookie)console.warn("Warning: `nodeCookie` should be a string");else if(e.nodeEnabled&&"boolean"!=typeof e.nodeEnabled)console.warn("Warning: `nodeEnabled` should be a boolean");else if(e.nodeServer&&"string"!=typeof e.nodeServer)console.warn("Warning: `nodeServer` should be a string");else{if(!e.queryLimit||"number"==typeof e.queryLimit)return e.baseUrl&&(d.baseUrl=e.baseUrl.replace(/\/+$/,"")),e.nodeCookie&&(d.nodeCookie=e.nodeCookie),e.nodeServer&&(d.nodeServer=e.nodeServer),"boolean"==typeof e.nodeEnabled&&(d.nodeEnabled=e.nodeEnabled),void 0!==e.queryLimit&&(d.queryLimit=e.queryLimit),"boolean"==typeof e.debug?(d.debug=e.debug,{debug:d.debug}):{baseUrl:d.baseUrl,nodeCookie:d.nodeCookie,nodeEnabled:d.nodeEnabled,nodeServer:d.nodeServer,queryLimit:d.queryLimit};console.warn("Warning: `queryLimit` should be a number")}},sprLib.baseUrl=function(e){if("string"!=typeof e||""==e||!e)return d.baseUrl;d.baseUrl=e.replace(/\/+$/,""),d.debug&&console.log("APP_OPTS.baseUrl = "+d.baseUrl)},sprLib.nodeConfig=function(e){e=e&&"object"==typeof e?e:{},d.nodeEnabled=void 0===e.nodeEnabled||e.nodeEnabled,d.nodeCookie=e.cookie||"",d.nodeServer=e.server||""},sprLib.file=function(e){var t={},i="";(e=e||{}).requestDigest||"undefined"!=typeof document&&document.getElementById("__REQUESTDIGEST")&&document.getElementById("__REQUESTDIGEST").value;if(e&&"string"==typeof e)i=encodeURI(e);else{if(!e||"object"!=typeof e||!e.hasOwnProperty("name"))return console.error("ERROR: A 'fileName' is required! EX: `sprLib.file('Documents/Sample.docx')` or `sprLib.file({ 'name':'Documents/Sample.docx' })`"),console.error("ARGS:"),console.error(e),null;i=encodeURI(e.name)}return i=i.replace(/\/$/gi,""),_fileName=i.substring(i.lastIndexOf("/")+1),0!=i.indexOf("/")&&_spPageContextInfo&&_spPageContextInfo.webServerRelativeUrl&&(i=_spPageContextInfo.webServerRelativeUrl+i),t.checkin=function(e){return new Promise(function(t,n){(e=e||{}).comment=e.comment||"",e.type&&-1==["major","minor","overwrite"].indexOf(e.type.toLowerCase())?(console.warn("Check your options! Available checkin() `type` options are: `major`,`minor`,`overwrite`"),e.type="1"):e.type=(e.type||"major").toLowerCase().replace("major",1).replace("minor",0).replace("overwrite",2),sprLib.rest({type:"POST",url:"_api/web/GetFileByServerRelativeUrl('"+i+"')/CheckIn(comment='"+e.comment+"',checkintype="+e.type+")"}).then(function(e){t(!0)}).catch(function(e){n(e)})})},t.checkout=function(){return new Promise(function(t,n){sprLib.rest({type:"POST",url:"_api/web/GetFileByServerRelativeUrl('"+i+"')/CheckOut"}).then(function(e){t(!0)}).catch(function(e){n(e)})})},t.delete=function(){return new Promise(function(t,n){sprLib.rest({type:"POST",headers:{"X-HTTP-Method":"DELETE"},url:"_api/web/GetFileByServerRelativeUrl('"+i+"')",metadata:!1}).then(function(e){t(!0)}).catch(function(e){n(e)})})},t.get=function(){return new Promise(function(t,n){sprLib.rest({url:"_api/web/GetFileByServerRelativeUrl('"+i+"')/$value",headers:{binaryStringResponseBody:!0},metadata:!1}).then(function(e){"undefined"!=typeof Blob?t(new Blob([e],{type:"application/octet-stream"})):t(Buffer.from(e,"binary"))}).catch(function(e){n(e)})})},t.info=function(r){return new Promise(function(e,t){var n={};if(r&&r.hasOwnProperty("version")&&isNaN(Number(r.version)))return console.error("ERROR: 'version' should be a number! EX: `sprLib.file('Sample.docx').info({ version:12 })`"),console.error("ARGS:"),console.error(r),null;sprLib.rest({url:"_api/web/GetFileByServerRelativeUrl('"+i+"')",queryCols:["Author/Id","CheckedOutByUser/Id","LockedByUser/Id","ModifiedBy/Id","CheckInComment","CheckOutType","ETag","Exists","Length","MajorVersion","MinorVersion","Name","ServerRelativeUrl","TimeCreated","TimeLastModified","UniqueId","UIVersionLabel"],metadata:!1}).then(function(e){return n=e&&0<e.length?e[0]:{},["Author","CheckedOutByUser","LockedByUser","ModifiedBy"].forEach(function(e){n[e]&&n[e].__deferred&&delete n[e].__deferred,n[e]&&n[e].__metadata&&delete n[e].__metadata,n[e]&&Array.isArray(n[e])&&0==n[e].length&&(n[e]={})}),n.TimeCreated&&(n.Created=n.TimeCreated,delete n.TimeCreated),n.TimeLastModified&&(n.Modified=n.TimeLastModified,delete n.TimeLastModified),r&&r.version?sprLib.rest({url:"_api/web/GetFileByServerRelativeUrl('"+i+"')/versions("+512*Number(r.version)+")",queryCols:["CheckInComment","Created","IsCurrentVersion","Length","VersionLabel"],metadata:!1}).catch(function(e){throw e}):null}).then(function(t){t&&t[0]&&t[0].VersionLabel&&(Object.keys(t[0]).forEach(function(e){"VersionLabel"!=e&&(n[e]=t[0][e])}),n.MajorVersion=t[0].VersionLabel.split(".")[0],n.MinorVersion=t[0].VersionLabel.split(".")[1],n.UIVersionLabel=t[0].VersionLabel),e(n)}).catch(function(e){t(e)})})},t.perms=function(){return new Promise(function(t,n){sprLib.rest({url:"_api/web/GetFileByServerRelativeUrl('"+i+"')/ListItemAllFields/RoleAssignments",queryCols:["PrincipalId","Member/PrincipalType","Member/Title","RoleDefinitionBindings/Name","RoleDefinitionBindings/Hidden"],metadata:!1}).then(function(e){e.forEach(function(e,t){Object.defineProperty(e,"Roles",Object.getOwnPropertyDescriptor(e,"RoleDefinitionBindings")),delete e.RoleDefinitionBindings,e.Member.PrincipalId=e.PrincipalId,delete e.PrincipalId,e.Member.PrincipalType=c[e.Member.PrincipalType]||e.Member.PrincipalType}),t(e||[])}).catch(function(e){n(e)})})},t.recycle=function(){return new Promise(function(t,n){sprLib.rest({type:"POST",url:"_api/web/GetFileByServerRelativeUrl('"+i+"')/recycle()",metadata:!1}).then(function(e){t(!0)}).catch(function(e){n(e)})})},t},sprLib.folder=function(e){var t={},o="";if((e=e||{})&&"string"==typeof e)o=encodeURI(e);else{if(!e||"object"!=typeof e||!e.hasOwnProperty("name"))return console.error("ERROR: A 'folderName' is required! EX: `sprLib.folder('Documents/Finance')` or `sprLib.folder({ 'name':'Documents/Finance' })`"),console.error("ARGS:"),console.error(e),null;o=encodeURI(e.name)}return o=o.replace(/\/$/gi,""),t.add=function(i){return new Promise(function(n,t){var e,r=0==d.baseUrl.indexOf("http")||0==d.baseUrl.indexOf("/")?d.baseUrl:_spPageContextInfo&&_spPageContextInfo.webServerRelativeUrl?_spPageContextInfo.webServerRelativeUrl:d.baseUrl;if(!(i=i||null)||"string"!=typeof i)return console.error("Error: `folder().add()` requires a string folder name!"),null;e=0==i.indexOf("http")||0==i.indexOf("/")?i:encodeURI(o+"/"+i),sprLib.rest({type:"POST",url:r+"/_api/web/folders/add('"+e+"')",metadata:!1}).then(function(e){var t=e&&e[0]?e[0]:null;n(t)}).catch(function(e){t(e)})})},t.delete=function(){return new Promise(function(t,n){sprLib.rest({type:"POST",headers:{"X-HTTP-Method":"DELETE"},url:"_api/web/GetFolderByServerRelativeUrl('"+o+"')",metadata:!1}).then(function(e){t(!0)}).catch(function(e){n(e)})})},t.files=function(){return new Promise(function(t,n){sprLib.rest({url:"_api/web/GetFolderByServerRelativeUrl('"+o+"')/Files",queryCols:["Author/Id","CheckedOutByUser/Id","LockedByUser/Id","ModifiedBy/Id","Author/Title","CheckedOutByUser/Title","LockedByUser/Title","ModifiedBy/Title","CheckInComment","CheckOutType","ETag","Exists","Length","MajorVersion","MinorVersion","Name","ServerRelativeUrl","TimeCreated","TimeLastModified","Title","UniqueId"],metadata:!1}).then(function(e){e.forEach(function(e){e.Created=e.TimeCreated,delete e.TimeCreated,e.Modified=e.TimeLastModified,delete e.TimeLastModified,e.Length&&!isNaN(Number(e.Length))&&(e.Length=Number(e.Length)),e.CheckedOutByUser&&Array.isArray(e.CheckedOutByUser)&&0==e.CheckedOutByUser.length&&(e.CheckedOutByUser=null),e.LockedByUser&&Array.isArray(e.LockedByUser)&&0==e.LockedByUser.length&&(e.LockedByUser=null)}),t(e||[])}).catch(function(e){n(e)})})},t.folders=function(){return new Promise(function(t,n){sprLib.rest({url:"_api/web/GetFolderByServerRelativeUrl('"+o+"')/Folders",queryCols:["Name","ItemCount","ServerRelativeUrl","Properties/vti_x005f_timecreated","Properties/vti_x005f_timelastmodified","Properties/vti_x005f_hassubdirs","Properties/vti_x005f_isbrowsable","Properties/vti_x005f_foldersubfolderitemcount","Properties/vti_x005f_listname"],metadata:!1}).then(function(e){e.forEach(function(e){e.Properties&&(e.Created=e.Properties.vti_x005f_timecreated?e.Properties.vti_x005f_timecreated:null,e.FolderCount=e.Properties.vti_x005f_foldersubfolderitemcount?e.Properties.vti_x005f_foldersubfolderitemcount:0,e.ItemCount=e.ItemCount?e.ItemCount:0,e.GUID=e.Properties.vti_x005f_listname?e.Properties.vti_x005f_listname:null,e.HasSubdirs=!!e.Properties.vti_x005f_hassubdirs&&"true"==e.Properties.vti_x005f_hassubdirs,e.Hidden=!!e.Properties.vti_x005f_isbrowsable&&"false"==e.Properties.vti_x005f_isbrowsable,e.Modified=e.Properties.vti_x005f_timelastmodified?e.Properties.vti_x005f_timelastmodified:null,delete e.Properties)}),t(e||[])}).catch(function(e){n(e)})})},t.info=function(){return new Promise(function(t,n){var r=null;sprLib.rest({url:"_api/web/GetFolderByServerRelativeUrl('"+o+"')",queryCols:["Name","ItemCount","ServerRelativeUrl","StorageMetrics/TotalSize","Properties/vti_x005f_parentid","Properties/vti_x005f_listtitle","Properties/vti_x005f_listname","Properties/vti_x005f_timecreated","Properties/vti_x005f_timelastmodified","Properties/vti_x005f_hassubdirs","Properties/vti_x005f_isbrowsable","Properties/vti_x005f_foldersubfolderitemcount"],metadata:!1}).then(function(e){return(r=e&&0<e.length?e[0]:{}).Properties&&(r.Created=r.Properties.vti_x005f_timecreated?r.Properties.vti_x005f_timecreated:null,r.FolderCount=r.Properties.vti_x005f_foldersubfolderitemcount?r.Properties.vti_x005f_foldersubfolderitemcount:0,r.ItemCount=r.ItemCount?r.ItemCount:0,r.ListGUID=r.Properties.vti_x005f_listname?r.Properties.vti_x005f_listname:null,r.HasSubdirs=!!r.Properties.vti_x005f_hassubdirs&&"true"==r.Properties.vti_x005f_hassubdirs,r.Hidden=!!r.Properties.vti_x005f_isbrowsable&&"false"==r.Properties.vti_x005f_isbrowsable,r.Modified=r.Properties.vti_x005f_timelastmodified?r.Properties.vti_x005f_timelastmodified:null,delete r.Properties),r.StorageMetrics&&r.StorageMetrics.TotalSize&&(r.TotalSize=Number(r.StorageMetrics.TotalSize)||0,delete r.StorageMetrics),r.ListGUID?sprLib.rest({url:"_api/web/Lists(guid'"+r.ListGUID.replace(/\{|\}/g,"")+"')/rootFolder/Folders",queryCols:["ListItemAllFields/Id"],metadata:!1}):null}).then(function(e){return e&&e[0]&&e[0].ListItemAllFields&&e[0].ListItemAllFields.Id?sprLib.rest({url:"_api/web/Lists(guid'"+r.ListGUID.replace(/\{|\}/g,"")+"')/items('"+e[0].ListItemAllFields.Id+"')/HasUniqueRoleAssignments",metadata:!1}):null}).then(function(e){e&&e[0]&&(r.HasUniqueRoleAssignments=e[0].HasUniqueRoleAssignments),t(r)}).catch(function(e){n(e)})})},t.perms=function(){return new Promise(function(t,n){sprLib.rest({url:"_api/web/GetFolderByServerRelativeUrl('"+o+"')/Properties",queryCols:["vti_x005f_listtitle"],metadata:!1}).then(function(e){return e&&e[0]&&e[0].vti_x005f_listtitle?e[0].vti_x005f_listtitle:sprLib.rest({url:"_api/web/GetFolderByServerRelativeUrl('"+o+"')/ListItemAllFields/RoleAssignments",queryCols:["PrincipalId","Member/PrincipalType","Member/Title","RoleDefinitionBindings/Name","RoleDefinitionBindings/Hidden"],metadata:!1})}).then(function(e){"string"==typeof e?t(sprLib.list({baseUrl:o.substring(0,o.lastIndexOf("/")),name:e}).perms()):Array.isArray(e)&&(e.forEach(function(e,t){Object.defineProperty(e,"Roles",Object.getOwnPropertyDescriptor(e,"RoleDefinitionBindings")),delete e.RoleDefinitionBindings,e.Member.PrincipalId=e.PrincipalId,delete e.PrincipalId,e.Member.PrincipalType=c[e.Member.PrincipalType]||e.Member.PrincipalType}),t(e||[]))}).catch(function(e){n(e)})})},t.recycle=function(){return new Promise(function(t,n){sprLib.rest({type:"POST",url:"_api/web/GetFolderByServerRelativeUrl('"+o+"')/recycle()",metadata:!1}).then(function(e){t(!0)}).catch(function(e){n(e)})})},t.upload=function(e){return new Promise(function(t,n){0==d.baseUrl.indexOf("http")||0==d.baseUrl.indexOf("/")?d.baseUrl:_spPageContextInfo&&_spPageContextInfo.webServerRelativeUrl?_spPageContextInfo.webServerRelativeUrl:d.baseUrl;(e=e||null).digest=e.requestDigest||("undefined"!=typeof document&&document.getElementById("__REQUESTDIGEST")?document.getElementById("__REQUESTDIGEST").value:null),e.overwrite=void 0!==e.overwrite&&null!=e.overwrite?e.overwrite:d.overwriteUploads,sprLib.rest({url:"_api/web/GetFolderByServerRelativeUrl('"+o+"')/Files/add(url='"+e.name+"',overwrite="+e.overwrite+")",type:"POST",requestDigest:e.digest,data:e.data}).then(function(e){t(e&&e[0]?e[0]:e||"HELP:No File?!")}).catch(function(e){n(e)})})},t},sprLib.list=function(o){var e={},l="_api/lists",u=(o=o||{}).requestDigest||("undefined"!=typeof document&&document.getElementById("__REQUESTDIGEST")?document.getElementById("__REQUESTDIGEST").value:null);if(o.guid&&(o.name=o.guid),o&&"string"==typeof o)l+=t.test(o)?"(guid'"+o+"')":"/getbytitle('"+o.replace(/\s/gi,"%20")+"')";else{if(!o||"object"!=typeof o||!o.hasOwnProperty("name"))return console.error("ERROR: A List/Library 'name' or 'GUID' is required! EX: `sprLib.list('Employees')` or `sprLib.list({ 'name':'Employees' })`"),console.error("ARGS:"),console.error(o),null;l=o.baseUrl?o.baseUrl.replace(/\/+$/,"")+"/_api/lists":l,l+=t.test(o.name)?"(guid'"+o.name+"')":"/getbytitle('"+o.name.replace(/\s/gi,"%20")+"')"}function a(){return new Promise(function(t,n){sprLib.rest({url:l+"?$select=ListItemEntityTypeFullName",metadata:!1}).then(function(e){e&&Array.isArray(e)&&1==e.length?t({type:e[0].ListItemEntityTypeFullName}):n("Invalid result!")}).catch(function(e){n(e)})})}return e.cols=function(){return new Promise(function(n,t){var r=["LinkTitleNoMenu","LinkTitle","ItemChildCount","FolderChildCount","AppAuthor","AppEditor","ComplianceAssetId"];sprLib.rest({url:l+"?$select=Fields&$expand=Fields",queryLimit:5e3,metadata:!1}).then(function(e){var t=[];(e&&e[0]&&e[0].Fields?e[0].Fields:[]).filter(function(e){return!e.Hidden&&"Edit"!=e.InternalName&&"DocIcon"!=e.InternalName&&0!=e.InternalName.indexOf("_")&&-1==r.indexOf(e.InternalName)}).forEach(function(e){t.push({dispName:e.Title,dataName:e.InternalName,dataType:e.TypeAsString,isAppend:e.AppendOnly||!1,isNumPct:-1<e.SchemaXml.toLowerCase().indexOf('percentage="true"'),isReadOnly:e.ReadOnlyField,isRequired:e.Required,isUnique:e.EnforceUniqueValues,defaultValue:e.DefaultValue||null,maxLength:e.MaxLength||null,choiceValues:e.Choices&&e.Choices.results?e.Choices.results:e.Choices?e.Choices:null,allowFillInChoices:1==e.FillInChoice||0==e.FillInChoice?e.FillInChoice:null})}),n(t)}).catch(function(e){t(e)})})},e.info=function(){return new Promise(function(t,n){sprLib.rest({url:l+"?$select=Id,AllowContentTypes,BaseTemplate,BaseType,Created,Description,DraftVersionVisibility,EnableAttachments,EnableFolderCreation,EnableVersioning,ForceCheckout,HasUniqueRoleAssignments,Hidden,ItemCount,LastItemDeletedDate,LastItemModifiedDate,LastItemUserModifiedDate,ListItemEntityTypeFullName,Title",metadata:!1}).then(function(e){t(e&&0<e.length?e[0]:[])}).catch(function(e){n(e)})})},e.perms=function(e){return new Promise(function(t,n){sprLib.rest({url:l+"/RoleAssignments?$select=",queryCols:["PrincipalId","Member/PrincipalType","Member/Title","RoleDefinitionBindings/Name","RoleDefinitionBindings/Hidden"],metadata:!1}).then(function(e){e.forEach(function(e,t){Object.defineProperty(e,"Roles",Object.getOwnPropertyDescriptor(e,"RoleDefinitionBindings")),delete e.RoleDefinitionBindings,e.Member.PrincipalId=e.PrincipalId,delete e.PrincipalId,e.Member.PrincipalType=c[e.Member.PrincipalType]||e.Member.PrincipalType}),t(e||[])}).catch(function(e){n(e)})})},e.items=function(a){var s="";return new Promise(function(t,i){if(""!=(a=a||{})&&a!=[]||(a={}),a.queryFilter&&(a.queryFilter=a.queryFilter.replace(/\"/gi,"'")),"string"==typeof a||"number"==typeof a){var e={};e[a.toString()]={dataName:a.toString()},a={listCols:e}}else if(Array.isArray(a)){var r={};a.forEach(function(e,t){var n=-1<e.indexOf("/")?e.substring(0,e.indexOf("/")):e;e&&(r[n]=r[n]?{dataName:r[n].dataName+","+e}:{dataName:e})}),a={listCols:r}}else if("string"==typeof a.listCols){var n={};Object.keys(a).forEach(function(e,t){n[e]=a[e]}),a.listCols=[a.listCols];r={};a.listCols.forEach(function(e,t){var n=-1<e.indexOf("/")?e.substring(0,e.indexOf("/")):e;e&&(r[n]=r[n]?{dataName:r[n].dataName+","+e}:{dataName:e})}),n.listCols=r,a=n}else if(Array.isArray(a.listCols)){n={};Object.keys(a).forEach(function(e,t){n[e]=a[e]});r={};a.listCols.filter(function(e,t,n){return n.indexOf(e)===t}).forEach(function(e,t){var n=-1<e.indexOf("/")?e.substring(0,e.indexOf("/")):e;e&&(r[n]=r[n]?{dataName:r[n].dataName+","+e}:{dataName:e})}),n.listCols=r,a=n}else a.listCols||(a.listCols={});a.spArrData=[],a.spObjData={},"object"==typeof a.listCols&&0<Object.keys(a.listCols).length&&Object.keys(a.listCols).forEach(function(e){a.listCols[e].getVersions&&(a.metadata=!0)}),Promise.resolve().then(function(){return new Promise(function(e,t){var r={url:l+"/items",type:"GET",cache:"boolean"==typeof a.cache?a.cache:d.cache,metadata:"boolean"==typeof a.metadata?a.metadata:d.metadata,headers:{"X-RequestDigest":u}},i=[],o="";a.queryNext&&("object"==typeof a.queryNext&&a.queryNext.prevId&&a.queryNext.maxItems||(a.queryNext=null,console.log('ERROR: queryNext should be an object with `prevId` and `maxItems`. EX: `{"prevId":200,"maxItems":100}`'))),a.queryNext&&a.listCols&&0<Object.keys(a.listCols).length?r.url+="?%24skiptoken=Paged%3dTRUE%26p_ID%3d"+a.queryNext.prevId+"&%24select=":a.listCols&&0<Object.keys(a.listCols).length&&(r.url+="?$select="),Object.keys(a.listCols).forEach(function(e){var t=a.listCols[e];if(t.dataName&&("="==r.url.substring(r.url.length-1)?r.url+=t.dataName:r.url+=r.url.lastIndexOf(",")==r.url.length-1?t.dataName:","+t.dataName,-1<t.dataName.indexOf("/"))){var n=t.dataName.substring(0,t.dataName.indexOf("/"));-1==i.indexOf(n)&&(i.push(n),o+=(""==o?"":",")+n)}}),o&&(r.url+=(-1<r.url.indexOf("?")?"&":"?")+"$expand="+o),a.queryFilter&&(r.url+=(-1<r.url.indexOf("?")?"&":"?")+"$filter="+(-1==a.queryFilter.indexOf("%")?encodeURI(a.queryFilter):a.queryFilter)),a.queryOrderby&&(r.url+=(-1<r.url.indexOf("?")?"&":"?")+"$orderby="+a.queryOrderby),a.queryNext?r.url+="&p_ID="+a.queryNext.prevId+"&$top="+a.queryNext.maxItems:a.queryLimit&&(r.url+=(-1<r.url.indexOf("?$")?"&":"?")+"$top="+a.queryLimit),sprLib.rest(r).then(function(n){if((!a.listCols||0==Object.keys(a.listCols).length)&&0<n.length){var r={};Object.keys(n[0]).forEach(function(e,t){n[0][e]&&"object"==typeof n[0][e]&&n[0][e].__deferred?d.debug&&console.log('FYI: Skipping "select all" column: '+e):r[e]={dataName:e}}),a.listCols=r}n.forEach(function(i,e){var o={},t=0;i.__metadata&&(o.__metadata=i.__metadata,i.__metadata.uri&&(-1<i.__metadata.uri.indexOf("/Items(")&&(t=Number(i.__metadata.uri.split("/Items(").pop().replace(")",""))),!s&&-1<i.__metadata.uri.indexOf("guid'")&&(s=i.__metadata.uri.split("guid'").pop().split("')/")[0]))),i.__next&&(o.__next=i.__next),Object.keys(a.listCols).forEach(function(e){var t=a.listCols[e],n=[],r="";if(t.dataName&&-1<t.dataName.indexOf("/")&&i[t.dataName.split("/")[0]]&&i[t.dataName.split("/")[0]].results){if(o[e])return;r=[],i[t.dataName.split("/")[0]].results.forEach(function(e,t){e.__metadata&&delete e.__metadata,r.push(e)})}else t.dataName&&-1<t.dataName.indexOf("/")?(n=t.dataName.split("/"),i[n[0]]&&i[n[0]].__metadata&&delete i[n[0]].__metadata,i[n[0]]&&i[n[0]].__deferred&&delete i[n[0]].__deferred,(r=e!=n[0]&&e!=t.dataName?i[n[0]]&&Array.isArray(i[n[0]])?i[n[0]]:i[n[0]]?i[n[0]][n[1]]:null:i[n[0]])&&"object"==typeof r&&!Array.isArray(r)&&0==Object.keys(r).length&&(r=null)):t.dataName?r=i[t.dataName]:t.dataFunc&&(r=t.dataFunc(i));o[e]=d.cleanColHtml&&"string"==t.listDataType?r.replace(/<div(.|\n)*?>/gi,"").replace(/<\/div>/gi,""):r,t.getVersions&&(o[e]=[])}),a.spArrData.push(o),t&&(a.spObjData[t]=o)}),e()}).catch(function(e){t(e)})})}).then(function(){var n=[],r=[];Object.keys(a.listCols).forEach(function(e){var t=a.listCols[e];t.getVersions&&(t.keyName=e,n.push(t),r.push(t.dataName))}),s&&n.length?sprLib.rest({url:(o.baseUrl?o.baseUrl+"/":"")+"_vti_bin/owssvr.dll?Cmd=Display&List=%7B"+s+"%7D&XMLDATA=TRUE&IncludeVersions=TRUE&Query=ID%20"+r.toString().replace(/\,/g,"%20")+"%20Modified%20Editor%20&SortField=Modified&SortDir=ASC"}).then(function(e){e&&e[0]&&e[0].documentElement&&e[0].documentElement.querySelectorAll("row").forEach(function(o){n.forEach(function(e,t){var n=o.getAttribute("ows_ID"),r="";if(a.spObjData[n]&&o.getAttribute("ows_"+e.dataName)){var i=o.getAttribute("ows_"+e.dataName)||"";i&&(i!=r?(a.spObjData[n][e.keyName].push({verDate:new Date(o.getAttribute("ows_Modified").replace(" ","T")).toISOString(),verName:o.getAttribute("ows_Editor").substring(o.getAttribute("ows_Editor").indexOf("#")+1),verText:i}),r=i):(a.spObjData[n][e.keyName].pop(),a.spObjData[n][e.keyName].push({verDate:new Date(o.getAttribute("ows_Modified").replace(" ","T")).toISOString(),verName:o.getAttribute("ows_Editor").substring(o.getAttribute("ows_Editor").indexOf("#")+1),verText:i})))}})}),t(a.spArrData)}).catch(function(e){i(e)}):t(a.spArrData)}).catch(function(e){i(e)})})},e.getItems=e.items,e.create=function(r){return new Promise(function(t,n){r&&!Array.isArray(r)&&"object"==typeof r&&0!=Object.keys(r).length||n("Object type expected! Ex: `{Title:'New Emp'}`");try{JSON.stringify(r)}catch(e){n("`JSON.stringify(jsonData)` failed! Send valid JSON Please. Ex: `{'Name':'Brent'}`")}r.__metadata=r.__metadata||{},delete r.__metadata.etag,delete r.__next,Promise.resolve().then(function(){return r.__metadata.type?null:a()}).then(function(e){e&&e.type&&(r.__metadata=e),sprLib.rest({type:"POST",url:l+"/items",data:JSON.stringify(r),metadata:!0,headers:{"X-RequestDigest":u}}).then(function(e){e&&e[0]?(r.Id=e[0].Id,r.ID=e[0].ID,r.__metadata=r.__metadata||e[0].__metadata||{},r.__metadata.etag=r.__metadata.etag||(e[0].__metadata?e[0].__metadata.etag:null)):r=null,t(r)}).catch(function(e){n(e)})}).catch(function(e){n(e)})})},e.update=function(i){return new Promise(function(t,n){i&&!Array.isArray(i)&&"object"==typeof i&&0!=Object.keys(i).length||n("Object type expected! Ex: `{Title:'Brent'}`"),i.ID||i.Id||i.iD||i.id||n("Object must have an `Id` property! Ex: `{Id:99}`");try{JSON.stringify(i)}catch(e){n("`JSON.stringify(jsonData)` failed! Send valid object. Ex: `{'Title':'Brent'}`")}var r=i.ID||i.Id||i.iD||i.id;delete i.ID,delete i.Id,delete i.iD,delete i.id,i.__metadata=i.__metadata||{},""!=i.__metadata.etag&&null!=i.__metadata.etag||delete i.__metadata.etag,delete i.__next,Promise.resolve().then(function(){return i.__metadata.type?null:a()}).then(function(e){e&&e.type&&(i.__metadata.type=e.type),sprLib.rest({type:"POST",url:l+"/items("+r+")",data:JSON.stringify(i),metadata:!0,headers:{"X-HTTP-Method":"MERGE","X-RequestDigest":u,"IF-MATCH":i.__metadata.etag?i.__metadata.etag:"*"}}).then(function(e){i.Id=r,i.ID=r,i.__metadata.etag&&(i.__metadata.etag='"'+(Number(i.__metadata.etag.replace(/[\'\"]+/gi,""))+1)+'"'),t(i)}).catch(function(e){n(e)})})})},e.delete=function(i){return new Promise(function(t,n){i&&!Array.isArray(i)&&"object"==typeof i&&0!=Object.keys(i).length||n("Object type expected! Ex: `{'ID':123}`"),i.ID||i.Id||i.iD||i.id||n("Object data must have an `Id` property! Ex: `{'ID':123}`");try{JSON.stringify(i)}catch(e){n("`JSON.stringify(jsonData)` failed! Please pass a valid object. Ex: `{'ID':123}`")}var r=i.ID||i.Id||i.iD||i.id;delete i.ID,delete i.Id,delete i.iD,delete i.id,i.__metadata=i.__metadata||{},""!=i.__metadata.etag&&null!=i.__metadata.etag||delete i.__metadata.etag,delete i.__next,Promise.resolve().then(function(){return i.__metadata.type?null:a()}).then(function(e){e&&e.type&&(i.__metadata.type=e.type),sprLib.rest({type:"DELETE",url:l+"/items("+r+")",metadata:!0,headers:{"X-RequestDigest":u,"X-HTTP-Method":"MERGE","IF-MATCH":i.__metadata.etag?i.__metadata.etag:"*"}}).then(function(){t(r)}).catch(function(e){n(e)})})})},e.recycle=function(r){return new Promise(function(e,t){r&&!Array.isArray(r)&&"object"==typeof r&&0!=Object.keys(r).length||t("Object type expected! Ex: `{'ID':123}`"),r.ID||r.Id||r.iD||r.id||t("Object data must have an `Id` property! Ex: `{'ID':123}`");try{JSON.stringify(r)}catch(e){t("`JSON.stringify(jsonData)` failed! Please pass a valid object. Ex: `{'ID':123}`")}var n=r.ID||r.Id||r.iD||r.id;delete r.ID,delete r.Id,delete r.iD,delete r.id,r.__metadata=r.__metadata||{},""!=r.__metadata.etag&&null!=r.__metadata.etag||delete r.__metadata.etag,delete r.__next,sprLib.rest({type:"POST",url:l+"/items("+n+")/recycle()",metadata:!0,headers:{"X-RequestDigest":u}}).then(function(){e(Number(n))}).catch(function(e){t(e)})})},e},sprLib.rest=function(u){return new Promise(function(i,t){(u=u||{}).spArrData=[],u.cache="boolean"==typeof u.cache?u.cache:d.cache,u.digest=u.requestDigest||("undefined"!=typeof document&&document.getElementById("__REQUESTDIGEST")?document.getElementById("__REQUESTDIGEST").value:null),u.queryLimit=u.queryLimit||d.queryLimit||null,u.type=u.restType||u.type||"GET",u.url=(u.restUrl||u.url||d.baseUrl).replace(/\"/g,"'"),u.headers=u.headers||{},u.headers.Accept||(u.headers.Accept="application/json;odata=verbose"),0==u.metadata?u.headers.Accept="application/json;odata=nometadata":(u.metadata||"POST"==u.type)&&(u.headers.Accept="application/json;odata=verbose"),u.digest&&(u.headers["X-RequestDigest"]=u.digest);var r=[],o="",a={url:u.url,type:u.type,cache:u.cache,headers:u.headers};if(u.data&&(a.data=u.data),"POST"==a.type&&(a.headers.contentType||(a.headers["content-type"]="application/json;odata=verbose"),a.headers["X-RequestDigest"]||(a.headers["X-RequestDigest"]=u.digest)),a.url=0==u.url.toLowerCase().indexOf("http")||0==u.url.indexOf("/")?"":d.baseUrl,a.url+=(0!=u.url.toLowerCase().indexOf("http")&&0!=u.url.indexOf("/")?"/":"")+u.url,u.queryCols){if(-1==a.url.toLowerCase().indexOf("$select")&&(a.url+="?$select="),"string"==typeof u.queryCols&&(u.queryCols=[u.queryCols]),Array.isArray(u.queryCols)){var s={};u.queryCols.forEach(function(e,t){var n=-1<e.indexOf("/")?e.substring(0,e.indexOf("/")):e;s[n]=s[n]?{dataName:s[n].dataName+","+e}:{dataName:e}}),u.queryCols=s}"object"==typeof u.queryCols&&Object.keys(u.queryCols).forEach(function(e){var t=u.queryCols[e];if(t.dataName&&("="==a.url.substring(a.url.length-1)?a.url+=t.dataName:a.url+=a.url.lastIndexOf(",")==a.url.length-1?t.dataName:","+t.dataName,-1<t.dataName.indexOf("/"))){t.dataName.substring(0,t.dataName.indexOf("/"));var n=t.dataName.substring(0,t.dataName.lastIndexOf("/"));-1==r.indexOf(n)&&(r.push(n),o+=(""==o?"":",")+n)}})}(u.queryFilter||-1<a.url.toLowerCase().indexOf("$select"))&&"GET"==u.type&&-1==u.url.toLowerCase().indexOf("$top")&&u.queryLimit&&(a.url+=(0<a.url.indexOf("?")?"&":"?")+"$top="+u.queryLimit),-1==u.url.toLowerCase().indexOf("$filter")&&u.queryFilter&&(a.url+=(0<a.url.indexOf("?")?"&":"?")+"$filter="+(-1==u.queryFilter.indexOf("%")?encodeURI(u.queryFilter):u.queryFilter)),-1==u.url.toLowerCase().indexOf("$orderby")&&u.queryOrderby&&(a.url+=(0<a.url.indexOf("?")?"&":"?")+"$orderby="+u.queryOrderby),-1==u.url.toLowerCase().indexOf("$expand")&&o&&(a.url+=(0<a.url.indexOf("?")?"&":"?")+"$expand="+o),Promise.resolve().then(function(){return new Promise(function(n,r){if(d.nodeEnabled){if(!l)try{l=require("https")}catch(e){throw console.error("Unable to load `https`"),"LIB-MISSING-HTTPS"}a.headers.Cookie=d.nodeCookie,a.data&&(a.headers["Content-Length"]=a.data.length);var e={hostname:d.nodeServer,path:a.url,method:a.type,headers:a.headers},t=l.request(e,function(e){var t="";e.setEncoding(u.headers&&u.headers.binaryStringResponseBody?"binary":"utf8"),e.on("data",function(e){t+=e}),e.on("end",function(){-1<t.indexOf("HTTP Error")?r():-1<t.indexOf('{"error"')&&-1<t.indexOf('{"code"')?(d.debug&&console.error("REST ERROR!\n\n`objAjaxQuery.url`: "+a.url),r(JSON.parse(t).error.message.value)):n(t)}),e.on("error",function(e){d.debug&&console.error("REST ERROR!\n\n`objAjaxQuery.url`: "+a.url),r(JSON.parse(t).error.message.value)})});a.data&&t.write(a.data),t.end()}else{t=new XMLHttpRequest;u.headers&&u.headers.binaryStringResponseBody&&(t.responseType="arraybuffer"),t.open(a.type,a.url,!0),Object.keys(a.headers||{}).forEach(function(e){t.setRequestHeader(e,a.headers[e])}),t.onload=function(){200<=t.status&&t.status<400?u.headers&&u.headers.binaryStringResponseBody?n(t.response):n(t.responseXML||t.responseText):(d.debug&&console.error("REST ERROR!\n\n`objAjaxQuery.url`: "+a.url),r(f(t)))},t.onerror=function(){d.debug&&console.error("REST ERROR!\n\n`objAjaxQuery.url`: "+a.url),r(f(t))},t.send(a.data?a.data:null)}}).catch(function(e){t(e)})}).then(function(e){if(u.headers&&u.headers.binaryStringResponseBody)i(e);else{var t=[];if((e="string"==typeof e&&0==e.indexOf("{")?JSON.parse(e):e)&&e.d?t=e.d.results?e.d.results:Array.isArray(e.d)?e.d:[e.d]:e&&e.value?t=Array.isArray(e.value)?e.value:[e.value]:e&&"object"==typeof e&&(t=e),-1<a.url.toLowerCase().indexOf("owssvr.dll")&&-1<a.url.toLowerCase().indexOf("includeversions=true"))u.spArrData.push(e);else if(t&&Array.isArray(t)||e&&e.d&&e.d.results&&Array.isArray(e.d.results))(t||e.d.results).forEach(function(l){var n={};if(u.queryCols?Array.isArray(u.queryCols)?u.queryCols.forEach(function(e){n[e]=d.cleanColHtml&&"string"==col.listDataType?colVal.replace(/<div(.|\n)*?>/gi,"").replace(/<\/div>/gi,""):colVal}):Object.keys(u.queryCols).forEach(function(o){var a=u.queryCols[o],e=[],s="";if(a.dataName&&-1<a.dataName.indexOf("/")&&!l[a.dataName.split("/")[0]])l[a.dataName.split("/")[0]]=null;else if(a.dataName&&-1<a.dataName.indexOf("/")&&l[a.dataName.split("/")[0]]&&l[a.dataName.split("/")[0]].results){if(n[o])return;s=[],l[a.dataName.split("/")[0]].results.forEach(function(e){s.push(e)})}else a.dataName&&-1<a.dataName.indexOf("/")?(a.dataName.split(",").forEach(function(e,t){var n=e.split("/");l[n[0]]&&l[n[0]].__metadata&&delete l[n[0]].__metadata,l[n[0]]&&l[n[0]].__deferred&&delete l[n[0]].__deferred;var r=null;if(2==n.length)(r=l[n[0]])&&"object"==typeof r&&"results"==Object.keys(r)[0]&&(l[n[0]]=r.results),s=o!=n[0]&&o!=a.dataName?l[n[0]][n[1]]:l[n[0]];else if(3==n.length)(r=l[n[0]][n[1]])&&"object"==typeof r&&"results"==Object.keys(r)[0]&&(l[n[0]][n[1]]=r.results),s=o!=n[0]&&o!=a.dataName?l[n[0]][n[1]][n[2]]:l[n[0]];else if(4==n.length){var i="";Array.isArray(l[n[0]][n[1]])?i=l[n[0]][n[1]]:l[n[0]]&&l[n[0]][n[1]]&&l[n[0]][n[1]][n[2]]?i=l[n[0]][n[1]][n[2]]:l[n[0]]&&l[n[0]][n[1]]&&l[n[0]][n[1]][n[2]]&&l[n[0]][n[1]][n[2]][n[3]]&&(i=l[n[0]][n[1]][n[2]][n[3]]),s=o!=n[0]&&o!=a.dataName?i:l[n[0]]}else 4<n.length&&console.log("This is madness!!")}),"object"!=typeof s||Array.isArray(s)||0!=Object.keys(s).length||(s=[])):a.dataName&&(e=a.dataName.split("/"),s=1<e.length?l[e[0]][e[1]]:l[e[0]]);n[o]=d.cleanColHtml&&"string"==a.listDataType?s.replace(/<div(.|\n)*?>/gi,"").replace(/<\/div>/gi,""):s}):l&&("string"==typeof l?n.value=l:"object"==typeof l&&0<Object.keys(l).length&&Object.keys(l).forEach(function(e){var t=l[e]||null;n[e]=t})),e.d&&e.d.__next||e["odata.nextLink"]){var r={prevId:"",maxItems:""};(e.d?e.d.__next:e["odata.nextLink"]).split("&").forEach(function(e,t){-1<e.indexOf("p_ID%3d")?r.prevId=e.split("&")[0].split("%3d")[2]:-1<e.indexOf("%24top=")&&(r.maxItems=e.substring(e.lastIndexOf("=")+1))}),r.prevId&&r.maxItems&&(n.__next=r)}u.spArrData.push(n)});else if((e&&e.d?e.d:e||0)&&"object"==typeof(e.d||e)&&0<Object.keys(e.d||e).length){var n={},r=e.d||e;Object.keys(r).forEach(function(e){var t=r[e];n[e]=t}),u.spArrData.push(n)}else e&&e.value&&(n[key]=e.value,u.spArrData.push(n));i(u.spArrData)}}).catch(function(e){!d.nodeEnabled&&"string"==typeof e&&-1<e.indexOf("(403)")&&n<=d.maxRetries?Promise.resolve().then(function(){return sprLib.renewSecurityToken()}).then(function(){var e=document&&document.getElementById("__REQUESTDIGEST")?document.getElementById("__REQUESTDIGEST").value:null;d.debug&&console.log("err-403: token renewed"),u.headers&&u.headers["X-RequestDigest"]&&(u.headers["X-RequestDigest"]=e),n++,sprLib.rest(u)}):(n=0,t(e))})})},sprLib.site=function(a){var e={},s=a?(a+"/").replace(/\/+$/g,"/"):"";return e.group=function(i){return e.group.create=function(r){return new Promise(function(t,n){var e=r||{};e.__metadata={type:"SP.Group"},e&&e.Title||(console.warn('`Title` is required. Usage: `site().group().create({ Title:"Dev Users" })`'),n("MISSING-OPTION")),sprLib.rest({url:s+"_api/web/SiteGroups",type:"POST",data:JSON.stringify(e),metadata:!0}).then(function(e){t(e&&0<e.length?e[0]:{})}).catch(function(e){n(e)})})},e.group.delete=function(e){return new Promise(function(t,n){if(i&&0<Object.keys(i).length&&!i.hasOwnProperty("id"))return console.warn("Warning..: Check your options! Available `site().group()` options are: `id`"),console.warn("Result...: Invalid group option: `null` will be returned"),void n("MISSING-OPTION");sprLib.rest({url:s+"_api/web/sitegroups/removebyid("+i.id+")",type:"POST",metadata:!0}).then(function(e){t(!0)}).catch(function(e){n(e)})})},e.group.addUser=function(r){return new Promise(function(n,t){return i&&0<Object.keys(i).length&&!i.hasOwnProperty("id")?(console.warn("Warning..: Check your options! Available `site().group()` options are: `id`"),console.warn("Result...: Invalid group option: `null` will be returned"),void t("MISSING-OPTION")):r?!(r&&0<Object.keys(r).length)||r.hasOwnProperty("id")||r.hasOwnProperty("email")||r.hasOwnProperty("login")||r.hasOwnProperty("title")?void Promise.resolve().then(function(){if(r&&!r.login)return sprLib.user(r).info()}).then(function(e){return e&&(r.login=e.LoginName),sprLib.rest({url:s+"_api/web/SiteGroups("+i.id+")/users",type:"POST",data:"{ '__metadata':{'type':'SP.User'}, 'LoginName':'"+r.login+"' }",metadata:!0})}).then(function(e){var t={};e&&e[0]&&(t.id=e[0].Id||-1,t.email=e[0].Email||"",t.login=e[0].LoginName||"",t.title=e[0].Title||""),n(t)}).catch(function(e){t(e)}):(console.warn("Warning: Unknown option(s) passed. Available `site().group().add()` options are: `id`,`email`,`login`,`title`"),void t("INVALID-OPTION")):(console.warn('Missing option. Usage: `site().group(99).add({ login:"i:0#.f|membership|brent@microsoft.com" })`'),void t("MISSING-OPTION"))})},e.group.removeUser=function(r){return new Promise(function(t,n){return i&&0<Object.keys(i).length&&!i.hasOwnProperty("id")?(console.warn("Warning..: Check your options! Available `site().group()` options are: `id`"),console.warn("Result...: Invalid group option: `null` will be returned"),void n("MISSING-OPTION")):r?!(r&&0<Object.keys(r).length)||r.hasOwnProperty("id")||r.hasOwnProperty("email")||r.hasOwnProperty("login")||r.hasOwnProperty("title")?void Promise.resolve().then(function(){if(r&&!r.id&&!r.login)return sprLib.user(r).info()}).then(function(e){return e&&(r.id=e.Id,r.login=encodeURIComponent(e.LoginName)),r.id?sprLib.rest({url:s+"_api/web/SiteGroups("+i.id+")/users/removebyid("+r.id+")",type:"POST",metadata:!0}):r.login?sprLib.rest({url:s+"_api/web/SiteGroups("+i.id+")/users/removebyloginname(@v)?@v='"+r.login.replace(/#/g,"%23")+"'",type:"POST",metadata:!0}):void 0}).then(function(e){t(!0)}).catch(function(e){n(e)}):(console.warn("Warning: Unknown option(s) passed. Available `site().group().remove()` options are: `id`,`email`,`login`,`title`"),void n("INVALID-OPTION")):(console.warn("Missing option. Usage: `site().group(99).remove({ id:99 })`"),void n("MISSING-OPTION"))})},e.group},e.groups=function(i){return new Promise(function(t,n){var r=[];if(i&&0<Object.keys(i).length&&!i.hasOwnProperty("id")&&!i.hasOwnProperty("title")&&(console.warn("Warning..: Check your options! Available `site().groups()` options are: `id`,`title`"),console.warn("Result...: Invalid filter option: All site groups will be returned"),i=null),a){var e="Member/PrincipalType eq 8";i&&i.id?e="Member/Id eq "+i.id:i&&i.title&&(e="Member/Title eq '"+i.title+"'"),sprLib.rest({url:s+"_api/web/RoleAssignments",queryCols:["Member/Id","Member/Title","Member/Description","Member/OwnerTitle","Member/PrincipalType","Member/AllowMembersEditMembership","Member/Users/Id","Member/Users/LoginName","Member/Users/Title"],queryFilter:e,queryLimit:d.maxRows,metadata:!1}).then(function(e){e.forEach(function(e,t){r.push({Id:e.Member.Id,Title:e.Member.Title,Description:e.Member.Description,OwnerTitle:e.Member.OwnerTitle,PrincipalType:c[e.Member.PrincipalType]||e.Member.PrincipalType,AllowMembersEditMembership:e.Member.AllowMembersEditMembership,Users:e.Member.Users.map(function(e){return e.__metadata&&delete e.__metadata,e})})}),t(r||[])}).catch(function(e){n(e)})}else{e="";i&&i.id?e="Id eq "+i.id:i&&i.title&&(e="Title eq '"+i.title+"'"),sprLib.rest({url:s+"_api/web/SiteGroups",queryCols:["Id","Title","Description","OwnerTitle","PrincipalType","AllowMembersEditMembership","Users/Id","Users/LoginName","Users/Title"],queryFilter:e,queryLimit:d.maxRows,metadata:!1}).then(function(e){e&&Array.isArray(e)&&(e=e.filter(function(e){return-1==e.Title.indexOf("SharingLinks")})),e.forEach(function(e,t){e.PrincipalType=c[e.PrincipalType]||e.PrincipalType}),t(e||[])}).catch(function(e){n(e)})}})},e.info=function(){return new Promise(function(n,t){Promise.all([sprLib.rest({url:s+"_api/web",queryCols:["Id","Title","Description","Language","Created","LastItemModifiedDate","LastItemUserModifiedDate","RequestAccessEmail","SiteLogoUrl","Url","WebTemplate","AssociatedOwnerGroup/Id","AssociatedMemberGroup/Id","AssociatedVisitorGroup/Id","AssociatedOwnerGroup/OwnerTitle","AssociatedMemberGroup/OwnerTitle","AssociatedVisitorGroup/OwnerTitle","AssociatedOwnerGroup/Title","AssociatedMemberGroup/Title","AssociatedVisitorGroup/Title"],cache:!1,metadata:!1}),sprLib.rest({url:s+"_api/site",queryCols:["Owner/Email","Owner/LoginName","Owner/Title","Owner/IsSiteAdmin"],cache:!1,metadata:!1})]).then(function(e){var t=e[0][0];t.Owner=e[1][0].Owner,delete t.Owner.__metadata,delete t.AssociatedMemberGroup.__metadata,delete t.AssociatedOwnerGroup.__metadata,delete t.AssociatedVisitorGroup.__metadata,t.hasOwnProperty("LastItemUserModifiedDate")&&!t.LastItemUserModifiedDate&&delete t.LastItemUserModifiedDate,n(t)}).catch(function(e){t(e)})})},e.lists=function(){return new Promise(function(t,n){sprLib.rest({url:s+"_api/web/lists",queryCols:["Id","Title","Description","ItemCount","BaseType","BaseTemplate","Hidden","ImageUrl","ParentWebUrl","RootFolder/ServerRelativeUrl"],metadata:!1}).then(function(e){e.forEach(function(e,t){e.ServerRelativeUrl=e.RootFolder&&e.RootFolder.ServerRelativeUrl?e.RootFolder.ServerRelativeUrl:null,e.RootFolder&&delete e.RootFolder,e.BaseType=r[e.BaseType]||e.BaseType}),t(e||[])}).catch(function(e){n(e)})})},e.perms=function(){return new Promise(function(t,n){sprLib.rest({url:s+"_api/web/roleAssignments",queryCols:["PrincipalId","Member/PrincipalType","Member/Title","RoleDefinitionBindings/Name","RoleDefinitionBindings/Hidden"],metadata:!1}).then(function(e){e.forEach(function(e,t){Object.defineProperty(e,"Roles",Object.getOwnPropertyDescriptor(e,"RoleDefinitionBindings")),delete e.RoleDefinitionBindings,e.Member.PrincipalId=e.PrincipalId,delete e.PrincipalId,e.Member.PrincipalType=c[e.Member.PrincipalType]||e.Member.PrincipalType}),t(e||[])}).catch(function(e){n(e)})})},e.roles=function(){return new Promise(function(t,n){sprLib.rest({url:s+"_api/web/roleDefinitions",queryCols:["Id","Name","Description","RoleTypeKind","Hidden"],metadata:!1}).then(function(e){t(e||[])}).catch(function(e){n(e)})})},e.subsites=function(){return new Promise(function(t,n){sprLib.rest({url:s+"_api/web/webs",queryCols:{Id:{dataName:"Id",dispName:"Id"},Name:{dataName:"Title",dispName:"Subsite Name"},UrlAbs:{dataName:"Url",dispName:"Absolute URL"},UrlRel:{dataName:"ServerRelativeUrl",dispName:"Relative URL"},Created:{dataName:"Created",dispName:"Date Created"},Modified:{dataName:"LastItemModifiedDate",dispName:"Date Last Modified"},Language:{dataName:"Language",dispName:"Language"},SiteLogoUrl:{dataName:"SiteLogoUrl",dispName:"Site Logo URL"}},metadata:!1}).then(function(e){t(e||[])}).catch(function(e){n(e)})})},e.users=function(o){return new Promise(function(i,t){o&&0<Object.keys(o).length&&!o.hasOwnProperty("id")&&!o.hasOwnProperty("title")&&(console.warn("Warning..: Check your options! Available `site().users()` options are: `id`,`title`"),console.warn("Result...: Invalid filter option: All site users will be returned"),o=null),a?Promise.all([sprLib.rest({url:s+"_api/web/RoleAssignments",queryCols:["Member/Id","Member/Email","Member/LoginName","Member/Title","Member/IsSiteAdmin"],queryFilter:"Member/PrincipalType eq 1",queryLimit:d.maxRows,metadata:!1}),sprLib.rest({url:s+"_api/web/RoleAssignments",queryCols:["Member/Id","Member/Title","Member/Users/Id","Member/Users/Email","Member/Users/LoginName","Member/Users/Title","Member/Users/IsSiteAdmin"],queryFilter:"Member/PrincipalType eq 8",queryLimit:d.maxRows,metadata:!1})]).then(function(e){var n=[],r={};e[0].forEach(function(e){e.Member.Groups=[],(!o||o&&o.id&&o.id==e.Member.Id||o&&o.title&&o.title==e.Member.Title)&&(n.push(e.Member),r[e.Member.Id]=e.Member)}),e[1].forEach(function(t){t.Member.Users&&0<t.Member.Users.length&&t.Member.Users.forEach(function(e){e.__metadata&&delete e.__metadata,(!o||o&&o.id&&o.id==e.Id||o&&o.title&&o.title==e.Title)&&(e.Groups||(e.Groups=[]),e.Groups.push({Id:t.Member.Id,Title:t.Member.Title}),r[e.Id]?(r[e.Id].Groups||(r[e.Id].Groups=[]),r[e.Id].Groups.push({Id:t.Member.Id,Title:t.Member.Title})):(n.push(e),r[e.Id]=t.Member))})}),i(n||[])}).catch(function(e){t(e)}):sprLib.rest({url:s+"_api/web/SiteUsers",queryCols:["Id","Email","LoginName","Title","IsSiteAdmin","Groups/Id","Groups/Title"],queryFilter:"PrincipalType eq 1",queryLimit:d.maxRows,metadata:!1}).then(function(e){var t=[];e.forEach(function(e){(!o||o&&o.id&&o.id==e.Id||o&&o.title&&o.title==e.Title)&&-1==e.Title.indexOf("spocrwl")&&e.Id<1e9&&t.push(e)}),i(t||[])}).catch(function(e){t(e)})})},e},sprLib.user=function(o){var e={},t="_api/Web",a="_api",r="/CurrentUser?";return!(o&&0<Object.keys(o).length)||o.hasOwnProperty("id")||o.hasOwnProperty("email")||o.hasOwnProperty("login")||o.hasOwnProperty("title")||o.hasOwnProperty("baseUrl")||(console.warn("Warning: Unknown option(s) passed. Available `user()` options are: `baseUrl`,`id`,`email`,`login`,`title`"),console.warn("Result: The current user is being returned"),o={}),(o=o||{}).hasOwnProperty("baseUrl")&&(t=o.baseUrl.toString().replace(/\/+$/,"")+"/_api/Web",a=o.baseUrl.toString().replace(/\/+$/,"")+"/_api"),o&&o.id?r="/siteusers?$filter=Id%20eq%20"+o.id+"&":o&&o.email?r="/siteusers?$filter=Email%20eq%20%27"+o.email+"%27&":o&&o.login?r="/siteusers?$filter=LoginName%20eq%20%27"+o.login.replace(/#/g,"%23")+"%27&":o&&o.title&&(r="/siteusers?$filter=Title%20eq%20%27"+o.title+"%27&"),r=t+r,e.info=function(){return new Promise(function(e,t){sprLib.rest({url:r+"$select=Id,Title,Email,LoginName,IsSiteAdmin,PrincipalType",type:"GET",cache:!1,metadata:!1}).then(function(n){var r={};(n&&Array.isArray(n)&&n[0]&&0<Object.keys(n[0]).length?Object.keys(n[0]):[]).forEach(function(e,t){r[e]=n[0][e]}),e(r)}).catch(function(e){t(e)})})},e.groups=function(){return new Promise(function(n,t){sprLib.rest({url:r+"$select=Groups/Id,Groups/Title,Groups/Description,Groups/LoginName,Groups/OwnerTitle&$expand=Groups",type:"GET",cache:!1,metadata:!1}).then(function(e){var t=[];(e&&e[0]&&e[0].Groups&&e[0].Groups?e[0].Groups:[]).forEach(function(e){t.push({Id:e.Id,Title:e.Title,Description:e.Description,OwnerTitle:e.OwnerTitle,LoginName:e.LoginName})}),n(t)}).catch(function(e){t(e)})})},e.profile=function(r){return new Promise(function(e,t){var i=Array.isArray(r)?r:"string"==typeof r?[r]:null,n=o&&o.login?encodeURIComponent(o.login):null;Promise.resolve().then(function(){if(o&&!o.login)return sprLib.user(o).info()}).then(function(e){return e&&(n=encodeURIComponent(e.LoginName)),n?Array.isArray(i)&&1==i.length?sprLib.rest({url:a+"/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyname='"+i[0]+"')?@v='"+n+"'",metadata:!1}):Array.isArray(i)&&1<i.length?sprLib.rest({url:a+"/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)/UserProfileProperties?@v='"+n+"'",metadata:!1}):sprLib.rest({url:a+"/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='"+n+"'",metadata:!1}):sprLib.rest({url:a+"/SP.UserProfiles.PeopleManager/GetMyProperties",metadata:!1})}).then(function(n){var r={};if(n&&Array.isArray(n)&&0!=n.length||e({}),i&&1==i.length&&n[0].value?r[i[0]]=n[0].value||"`"+i[0]+"` property does not exist in SP.UserProfiles.PeopleManager.UserProfileProperties":i&&1<i.length?i.forEach(function(t){var e=n.filter(function(e){return e.Key==t})[0];e&&e.Value?r[t]=e.Value:r[t]="`"+t+"` property does not exist in SP.UserProfiles.PeopleManager or SP.UserProfiles.PeopleManager.UserProfileProperties"}):n[0]?r=n[0]:d.debug&&console.log("??? `arrProfileProps[0]` does not exist!"),r.UserProfileProperties){var t={};r.UserProfileProperties.forEach(function(e){t[e.Key]=e.Value}),r.UserProfileProperties=t}e(0==Object.keys(r).length?{}:r)}).catch(function(e){t(e)})})},e}}(),"undefined"!=typeof window&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(var n=0;n<this.length;n++)e.call(t,this[n],n,this)}),"undefined"!=typeof module&&module.exports&&(module.exports=sprLib),function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(_,e){"use strict";var t=[],C=_.document,r=Object.getPrototypeOf,s=t.slice,m=t.concat,l=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,u=a.call(Object),g={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},b=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,noModule:!0};function x(e,t,n){var r,i=(t=t||C).createElement("script");if(i.text=e,n)for(r in c)n[r]&&(i[r]=n[r]);t.head.appendChild(i).parentNode.removeChild(i)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var E=function(e,t){return new E.fn.init(e,t)},d=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function f(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!v(e)&&!b(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}E.fn=E.prototype={jquery:"3.3.1",constructor:E,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=E.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return E.each(this,e)},map:function(n){return this.pushStack(E.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:l,sort:t.sort,splice:t.splice},E.extend=E.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(u&&r&&(E.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&E.isPlainObject(n)?n:{},a[t]=E.extend(u,o,r)):void 0!==r&&(a[t]=r));return a},E.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e)||(t=r(e))&&("function"!=typeof(n=y.call(t,"constructor")&&t.constructor)||a.call(n)!==u))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){x(e)},each:function(e,t){var n,r=0;if(f(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(d,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(f(Object(e))?E.merge(n,"string"==typeof e?[e]:e):l.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(f(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return m.apply([],a)},guid:1,support:g}),"function"==typeof Symbol&&(E.fn[Symbol.iterator]=t[Symbol.iterator]),E.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var p=function(n){var e,p,x,o,i,h,d,m,w,l,u,T,_,a,C,y,s,c,g,E="sizzle"+1*new Date,v=n.document,S=0,r=0,f=ae(),b=ae(),P=ae(),O=function(e,t){return e===t&&(u=!0),0},D={}.hasOwnProperty,t=[],I=t.pop,N=t.push,L=t.push,A=t.slice,j=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},k="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",q="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",U=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+q+")*)|.*)\\)|)",F=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),B=new RegExp("^"+M+"*,"+M+"*"),H=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),G=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),W=new RegExp(U),V=new RegExp("^"+R+"$"),X={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+U),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+k+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,z=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){T()},ie=ve(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(t=A.call(v.childNodes),v.childNodes),t[v.childNodes.length].nodeType}catch(n){L={apply:t.length?function(e,t){N.apply(e,A.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function oe(e,t,n,r){var i,o,a,s,l,u,c,d=t&&t.ownerDocument,f=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==f&&9!==f&&11!==f)return n;if(!r&&((t?t.ownerDocument||t:v)!==_&&T(t),t=t||_,C)){if(11!==f&&(l=J.exec(e)))if(i=l[1]){if(9===f){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(d&&(a=d.getElementById(i))&&g(t,a)&&a.id===i)return n.push(a),n}else{if(l[2])return L.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&p.getElementsByClassName&&t.getElementsByClassName)return L.apply(n,t.getElementsByClassName(i)),n}if(p.qsa&&!P[e+" "]&&(!y||!y.test(e))){if(1!==f)d=t,c=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(te,ne):t.setAttribute("id",s=E),o=(u=h(e)).length;o--;)u[o]="#"+s+" "+ge(u[o]);c=u.join(","),d=K.test(e)&&me(t.parentNode)||t}if(c)try{return L.apply(n,d.querySelectorAll(c)),n}catch(e){}finally{s===E&&t.removeAttribute("id")}}}return m(e.replace($,"$1"),t,n,r)}function ae(){var r=[];return function e(t,n){return r.push(t+" ")>x.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function se(e){return e[E]=!0,e}function le(e){var t=_.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var n=e.split("|"),r=n.length;r--;)x.attrHandle[n[r]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function fe(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function pe(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ie(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function he(a){return se(function(o){return o=+o,se(function(e,t){for(var n,r=a([],e.length,o),i=r.length;i--;)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function me(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in p=oe.support={},i=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},T=oe.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:v;return r!==_&&9===r.nodeType&&r.documentElement&&(a=(_=r).documentElement,C=!i(_),v!==_&&(n=_.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",re,!1):n.attachEvent&&n.attachEvent("onunload",re)),p.attributes=le(function(e){return e.className="i",!e.getAttribute("className")}),p.getElementsByTagName=le(function(e){return e.appendChild(_.createComment("")),!e.getElementsByTagName("*").length}),p.getElementsByClassName=Q.test(_.getElementsByClassName),p.getById=le(function(e){return a.appendChild(e).id=E,!_.getElementsByName||!_.getElementsByName(E).length}),p.getById?(x.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},x.find.ID=function(e,t){if(void 0!==t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(x.filter.ID=function(e){var n=e.replace(Z,ee);return function(e){var t=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},x.find.ID=function(e,t){if(void 0!==t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),x.find.TAG=p.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):p.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"!==e)return o;for(;n=o[i++];)1===n.nodeType&&r.push(n);return r},x.find.CLASS=p.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&C)return t.getElementsByClassName(e)},s=[],y=[],(p.qsa=Q.test(_.querySelectorAll))&&(le(function(e){a.appendChild(e).innerHTML="<a id='"+E+"'></a><select id='"+E+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+k+")"),e.querySelectorAll("[id~="+E+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+E+"+*").length||y.push(".#.+[+~]")}),le(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=_.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(p.matchesSelector=Q.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&le(function(e){p.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",U)}),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=Q.test(a.compareDocumentPosition),g=t||Q.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},O=t?function(e,t){if(e===t)return u=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!p.sortDetached&&t.compareDocumentPosition(e)===n?e===_||e.ownerDocument===v&&g(v,e)?-1:t===_||t.ownerDocument===v&&g(v,t)?1:l?j(l,e)-j(l,t):0:4&n?-1:1)}:function(e,t){if(e===t)return u=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===_?-1:t===_?1:i?-1:o?1:l?j(l,e)-j(l,t):0;if(i===o)return ce(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ce(a[r],s[r]):a[r]===v?-1:s[r]===v?1:0}),_},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==_&&T(e),t=t.replace(G,"='$1']"),p.matchesSelector&&C&&!P[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||p.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0<oe(t,_,null,[e]).length},oe.contains=function(e,t){return(e.ownerDocument||e)!==_&&T(e),g(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==_&&T(e);var n=x.attrHandle[t.toLowerCase()],r=n&&D.call(x.attrHandle,t.toLowerCase())?n(e,t,!C):void 0;return void 0!==r?r:p.attributes||!C?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,n=[],r=0,i=0;if(u=!p.detectDuplicates,l=!p.sortStable&&e.slice(0),e.sort(O),u){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return l=null,e},o=oe.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},(x=oe.selectors={cacheLength:50,createPseudo:se,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&W.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=f[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&f(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=oe.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(F," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,m,y){var g="nth"!==h.slice(0,3),v="last"!==h.slice(-4),b="of-type"===e;return 1===m&&0===y?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,l,u=g!==v?"nextSibling":"previousSibling",c=e.parentNode,d=b&&e.nodeName.toLowerCase(),f=!n&&!b,p=!1;if(c){if(g){for(;u;){for(a=e;a=a[u];)if(b?a.nodeName.toLowerCase()===d:1===a.nodeType)return!1;l=u="only"===h&&!l&&"nextSibling"}return!0}if(l=[v?c.firstChild:c.lastChild],v&&f){for(p=(s=(r=(i=(o=(a=c)[E]||(a[E]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1])&&r[2],a=s&&c.childNodes[s];a=++s&&a&&a[u]||(p=s=0)||l.pop();)if(1===a.nodeType&&++p&&a===e){i[h]=[S,s,p];break}}else if(f&&(p=s=(r=(i=(o=(a=e)[E]||(a[E]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1]),!1===p)for(;(a=++s&&a&&a[u]||(p=s=0)||l.pop())&&((b?a.nodeName.toLowerCase()!==d:1!==a.nodeType)||!++p||(f&&((i=(o=a[E]||(a[E]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[S,p]),a!==e)););return(p-=y)===m||p%m==0&&0<=p/m}}},PSEUDO:function(e,o){var t,a=x.pseudos[e]||x.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return a[E]?a(o):1<a.length?(t=[e,e,"",o],x.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,t){for(var n,r=a(e,o),i=r.length;i--;)e[n=j(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:se(function(e){var r=[],i=[],s=d(e.replace($,"$1"));return s[E]?se(function(e,t,n,r){for(var i,o=s(e,null,r,[]),a=e.length;a--;)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:se(function(t){return function(e){return 0<oe(t,e).length}}),contains:se(function(t){return t=t.replace(Z,ee),function(e){return-1<(e.textContent||e.innerText||o(e)).indexOf(t)}}),lang:se(function(n){return V.test(n||"")||oe.error("unsupported lang: "+n),n=n.replace(Z,ee).toLowerCase(),function(e){var t;do{if(t=C?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===_.activeElement&&(!_.hasFocus||_.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!x.pseudos.empty(e)},header:function(e){return z.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=x.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})x.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})x.pseudos[e]=fe(e);function ye(){}function ge(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ve(s,e,t){var l=e.dir,u=e.next,c=u||l,d=t&&"parentNode"===c,f=r++;return e.first?function(e,t,n){for(;e=e[l];)if(1===e.nodeType||d)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[S,f];if(n){for(;e=e[l];)if((1===e.nodeType||d)&&s(e,t,n))return!0}else for(;e=e[l];)if(1===e.nodeType||d)if(i=(o=e[E]||(e[E]={}))[e.uniqueID]||(o[e.uniqueID]={}),u&&u===e.nodeName.toLowerCase())e=e[l]||e;else{if((r=i[c])&&r[0]===S&&r[1]===f)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function be(i){return 1<i.length?function(e,t,n){for(var r=i.length;r--;)if(!i[r](e,t,n))return!1;return!0}:i[0]}function xe(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),u&&t.push(s)));return a}function we(p,h,m,y,g,e){return y&&!y[E]&&(y=we(y)),g&&!g[E]&&(g=we(g,e)),se(function(e,t,n,r){var i,o,a,s=[],l=[],u=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),d=!p||!e&&h?c:xe(c,s,p,n,r),f=m?g||(e?p:u||y)?[]:t:d;if(m&&m(d,f,n,r),y)for(i=xe(f,l),y(i,[],n,r),o=i.length;o--;)(a=i[o])&&(f[l[o]]=!(d[l[o]]=a));if(e){if(g||p){if(g){for(i=[],o=f.length;o--;)(a=f[o])&&i.push(d[o]=a);g(null,f=[],i,r)}for(o=f.length;o--;)(a=f[o])&&-1<(i=g?j(e,a):s[o])&&(e[i]=!(t[i]=a))}}else f=xe(f===t?f.splice(u,f.length):f),g?g(null,t,f,r):L.apply(t,f)})}function Te(e){for(var i,t,n,r=e.length,o=x.relative[e[0].type],a=o||x.relative[" "],s=o?1:0,l=ve(function(e){return e===i},a,!0),u=ve(function(e){return-1<j(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?l(e,t,n):u(e,t,n));return i=null,r}];s<r;s++)if(t=x.relative[e[s].type])c=[ve(be(c),t)];else{if((t=x.filter[e[s].type].apply(null,e[s].matches))[E]){for(n=++s;n<r&&!x.relative[e[n].type];n++);return we(1<s&&be(c),1<s&&ge(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Te(e.slice(s,n)),n<r&&Te(e=e.slice(n)),n<r&&ge(e))}c.push(t)}return be(c)}return ye.prototype=x.filters=x.pseudos,x.setFilters=new ye,h=oe.tokenize=function(e,t){var n,r,i,o,a,s,l,u=b[e+" "];if(u)return t?0:u.slice(0);for(a=e,s=[],l=x.preFilter;a;){for(o in n&&!(r=B.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=H.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),x.filter)!(r=X[o].exec(a))||l[o]&&!(r=l[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?oe.error(e):b(e,s).slice(0)},d=oe.compile=function(e,t){var n,y,g,v,b,r,i=[],o=[],a=P[e+" "];if(!a){for(t||(t=h(e)),n=t.length;n--;)(a=Te(t[n]))[E]?i.push(a):o.push(a);(a=P(e,(y=o,g=i,v=0<g.length,b=0<y.length,r=function(e,t,n,r,i){var o,a,s,l=0,u="0",c=e&&[],d=[],f=w,p=e||b&&x.find.TAG("*",i),h=S+=null==f?1:Math.random()||.1,m=p.length;for(i&&(w=t===_||t||i);u!==m&&null!=(o=p[u]);u++){if(b&&o){for(a=0,t||o.ownerDocument===_||(T(o),n=!C);s=y[a++];)if(s(o,t||_,n)){r.push(o);break}i&&(S=h)}v&&((o=!s&&o)&&l--,e&&c.push(o))}if(l+=u,v&&u!==l){for(a=0;s=g[a++];)s(c,d,t,n);if(e){if(0<l)for(;u--;)c[u]||d[u]||(d[u]=I.call(r));d=xe(d)}L.apply(r,d),i&&!e&&0<d.length&&1<l+g.length&&oe.uniqueSort(r)}return i&&(S=h,w=f),c},v?se(r):r))).selector=e}return a},m=oe.select=function(e,t,n,r){var i,o,a,s,l,u="function"==typeof e&&e,c=!r&&h(e=u.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&C&&x.relative[o[1].type]){if(!(t=(x.find.ID(a.matches[0].replace(Z,ee),t)||[])[0]))return n;u&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=X.needsContext.test(e)?0:o.length;i--&&(a=o[i],!x.relative[s=a.type]);)if((l=x.find[s])&&(r=l(a.matches[0].replace(Z,ee),K.test(o[0].type)&&me(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&ge(o)))return L.apply(n,r),n;break}}return(u||d(e,c))(r,t,!C,n,!t||K.test(e)&&me(t.parentNode)||t),n},p.sortStable=E.split("").sort(O).join("")===E,p.detectDuplicates=!!u,T(),p.sortDetached=le(function(e){return 1&e.compareDocumentPosition(_.createElement("fieldset"))}),le(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ue("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),p.attributes&&le(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ue("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),le(function(e){return null==e.getAttribute("disabled")})||ue(k,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(_);E.find=p,E.expr=p.selectors,E.expr[":"]=E.expr.pseudos,E.uniqueSort=E.unique=p.uniqueSort,E.text=p.getText,E.isXMLDoc=p.isXML,E.contains=p.contains,E.escapeSelector=p.escape;var h=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&E(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},S=E.expr.match.needsContext;function P(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var O=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return v(n)?E.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?E.grep(e,function(e){return e===n!==r}):"string"!=typeof n?E.grep(e,function(e){return-1<i.call(n,e)!==r}):E.filter(n,e,r)}E.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?E.find.matchesSelector(r,e)?[r]:[]:E.find.matches(e,E.grep(t,function(e){return 1===e.nodeType}))},E.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(E(e).filter(function(){for(t=0;t<r;t++)if(E.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)E.find(e,i[t],n);return 1<r?E.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&S.test(e)?E(e):e||[],!1).length}});var I,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(E.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||I,"string"!=typeof e)return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(E):E.makeArray(e,this);if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:N.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof E?t[0]:t,E.merge(this,E.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),O.test(r[1])&&E.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}).prototype=E.fn,I=E(C);var L=/^(?:parents|prev(?:Until|All))/,A={children:!0,contents:!0,next:!0,prev:!0};function j(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}E.fn.extend({has:function(e){var t=E(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(E.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&E(e);if(!S.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&E.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?E.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(E(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(E.uniqueSort(E.merge(this.get(),E(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),E.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return j(e,"nextSibling")},prev:function(e){return j(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return P(e,"iframe")?e.contentDocument:(P(e,"template")&&(e=e.content||e),E.merge([],e.childNodes))}},function(r,i){E.fn[r]=function(e,t){var n=E.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=E.filter(t,n)),1<this.length&&(A[r]||E.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var k=/[^\x20\t\r\n\f]+/g;function M(e){return e}function R(e){throw e}function q(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}E.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},E.each(e.match(k)||[],function(e,t){n[t]=!0}),n):E.extend({},r);var i,t,o,a,s=[],l=[],u=-1,c=function(){for(a=a||r.once,o=i=!0;l.length;u=-1)for(t=l.shift();++u<s.length;)!1===s[u].apply(t[0],t[1])&&r.stopOnFalse&&(u=s.length,t=!1);r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},d={add:function(){return s&&(t&&!i&&(u=s.length-1,l.push(t)),function n(e){E.each(e,function(e,t){v(t)?r.unique&&d.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return E.each(arguments,function(e,t){for(var n;-1<(n=E.inArray(t,s,n));)s.splice(n,1),n<=u&&u--}),this},has:function(e){return e?-1<E.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=l=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=l=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],l.push(t),i||c()),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!o}};return d},E.extend({Deferred:function(e){var o=[["notify","progress",E.Callbacks("memory"),E.Callbacks("memory"),2],["resolve","done",E.Callbacks("once memory"),E.Callbacks("once memory"),0,"resolved"],["reject","fail",E.Callbacks("once memory"),E.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},catch:function(e){return a.then(null,e)},pipe:function(){var i=arguments;return E.Deferred(function(r){E.each(o,function(e,t){var n=v(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var l=0;function u(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<l)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,v(t)?s?t.call(e,u(l,o,M,s),u(l,o,R,s)):(l++,t.call(e,u(l,o,M,s),u(l,o,R,s),u(l,o,M,o.notifyWith))):(a!==M&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){E.Deferred.exceptionHook&&E.Deferred.exceptionHook(e,t.stackTrace),l<=i+1&&(a!==R&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(E.Deferred.getStackHook&&(t.stackTrace=E.Deferred.getStackHook()),_.setTimeout(t))}}return E.Deferred(function(e){o[0][3].add(u(0,e,v(r)?r:M,e.notifyWith)),o[1][3].add(u(0,e,v(t)?t:M)),o[2][3].add(u(0,e,v(n)?n:R))}).promise()},promise:function(e){return null!=e?E.extend(e,a):a}},s={};return E.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=E.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(q(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||v(i[t]&&i[t].then)))return o.then();for(;t--;)q(i[t],a(t),o.reject);return o.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;E.Deferred.exceptionHook=function(e,t){_.console&&_.console.warn&&e&&U.test(e.name)&&_.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},E.readyException=function(e){_.setTimeout(function(){throw e})};var F=E.Deferred();function $(){C.removeEventListener("DOMContentLoaded",$),_.removeEventListener("load",$),E.ready()}E.fn.ready=function(e){return F.then(e).catch(function(e){E.readyException(e)}),this},E.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--E.readyWait:E.isReady)||((E.isReady=!0)!==e&&0<--E.readyWait||F.resolveWith(C,[E]))}}),E.ready.then=F.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?_.setTimeout(E.ready):(C.addEventListener("DOMContentLoaded",$),_.addEventListener("load",$));var B=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===w(n))for(s in i=!0,n)B(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(E(e),n)})),t))for(;s<l;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},H=/^-ms-/,G=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function V(e){return e.replace(H,"ms-").replace(G,W)}var X=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Y(){this.expando=E.expando+Y.uid++}Y.uid=1,Y.prototype={cache:function(e){var t=e[this.expando];return t||(t={},X(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(r in t)i[V(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(k)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||E.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!E.isEmptyObject(t)}};var z=new Y,Q=new Y,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}E.extend({hasData:function(e){return Q.hasData(e)||z.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return z.access(e,t,n)},_removeData:function(e,t){z.remove(e,t)}}),E.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0!==n)return"object"==typeof n?this.each(function(){Q.set(this,n)}):B(this,function(e){var t;if(o&&void 0===e){if(void 0!==(t=Q.get(o,n)))return t;if(void 0!==(t=Z(o,n)))return t}else this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0);if(this.length&&(i=Q.get(o),1===o.nodeType&&!z.get(o,"hasDataAttrs"))){for(t=a.length;t--;)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=V(r.slice(5)),Z(o,r,i[r]));z.set(o,"hasDataAttrs",!0)}return i},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),E.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=z.get(e,t),n&&(!r||Array.isArray(n)?r=z.access(e,t,E.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=E.queue(e,t),r=n.length,i=n.shift(),o=E._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){E.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return z.get(e,n)||z.access(e,n,{empty:E.Callbacks("once memory").add(function(){z.remove(e,[t+"queue",n])})})}}),E.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?E.queue(this[0],t):void 0===n?this:this.each(function(){var e=E.queue(this,t,n);E._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&E.dequeue(this,t)})},dequeue:function(e){return this.each(function(){E.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=E.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=z.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&E.contains(e.ownerDocument,e)&&"none"===E.css(e,"display")},ie=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};function oe(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return E.css(e,t,"")},l=s(),u=n&&n[3]||(E.cssNumber[t]?"":"px"),c=(E.cssNumber[t]||"px"!==u&&+l)&&te.exec(E.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)E.style(e,t,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,E.style(e,t,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var ae={};function se(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=z.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&re(r)&&(i[o]=(d=u=l=void 0,u=(s=r).ownerDocument,c=s.nodeName,(d=ae[c])||(l=u.body.appendChild(u.createElement(c)),d=E.css(l,"display"),l.parentNode.removeChild(l),"none"===d&&(d="block"),ae[c]=d)))):"none"!==n&&(i[o]="none",z.set(r,"display",n)));var s,l,u,c,d;for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}E.fn.extend({show:function(){return se(this,!0)},hide:function(){return se(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){re(this)?E(this).show():E(this).hide()})}});var le=/^(?:checkbox|radio)$/i,ue=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ce=/^$|^module$|\/(?:java|ecma)script/i,de={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function fe(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&P(e,t)?E.merge([e],n):n}function pe(e,t){for(var n=0,r=e.length;n<r;n++)z.set(e[n],"globalEval",!t||z.get(t[n],"globalEval"))}de.optgroup=de.option,de.tbody=de.tfoot=de.colgroup=de.caption=de.thead,de.th=de.td;var he,me,ye=/<|&#?\w+;/;function ge(e,t,n,r,i){for(var o,a,s,l,u,c,d=t.createDocumentFragment(),f=[],p=0,h=e.length;p<h;p++)if((o=e[p])||0===o)if("object"===w(o))E.merge(f,o.nodeType?[o]:o);else if(ye.test(o)){for(a=a||d.appendChild(t.createElement("div")),s=(ue.exec(o)||["",""])[1].toLowerCase(),l=de[s]||de._default,a.innerHTML=l[1]+E.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;E.merge(f,a.childNodes),(a=d.firstChild).textContent=""}else f.push(t.createTextNode(o));for(d.textContent="",p=0;o=f[p++];)if(r&&-1<E.inArray(o,r))i&&i.push(o);else if(u=E.contains(o.ownerDocument,o),a=fe(d.appendChild(o),"script"),u&&pe(a),n)for(c=0;o=a[c++];)ce.test(o.type||"")&&n.push(o);return d}he=C.createDocumentFragment().appendChild(C.createElement("div")),(me=C.createElement("input")).setAttribute("type","radio"),me.setAttribute("checked","checked"),me.setAttribute("name","t"),he.appendChild(me),g.checkClone=he.cloneNode(!0).cloneNode(!0).lastChild.checked,he.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!he.cloneNode(!0).lastChild.defaultValue;var ve=C.documentElement,be=/^key/,xe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,we=/^([^.]*)(?:\.(.+)|)/;function Te(){return!0}function _e(){return!1}function Ce(){try{return C.activeElement}catch(e){}}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=_e;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return E().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=E.guid++)),e.each(function(){E.event.add(this,t,i,r,n)})}E.event={global:{},add:function(t,e,n,r,i){var o,a,s,l,u,c,d,f,p,h,m,y=z.get(t);if(y)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&E.find.matchesSelector(ve,i),n.guid||(n.guid=E.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(e){return void 0!==E&&E.event.triggered!==e.type?E.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(k)||[""]).length;u--;)p=m=(s=we.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),p&&(d=E.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=E.event.special[p]||{},c=E.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&E.expr.match.needsContext.test(i),namespace:h.join(".")},o),(f=l[p])||((f=l[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(p,a)),d.add&&(d.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,c):f.push(c),E.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,d,f,p,h,m,y=z.hasData(e)&&z.get(e);if(y&&(l=y.events)){for(u=(t=(t||"").match(k)||[""]).length;u--;)if(p=m=(s=we.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),p){for(d=E.event.special[p]||{},f=l[p=(r?d.delegateType:d.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)c=f[o],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,d.remove&&d.remove.call(e,c));a&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,h,y.handle)||E.removeEvent(e,p,y.handle),delete l[p])}else for(p in l)E.event.remove(e,p+t[u],n,r,!0);E.isEmptyObject(l)&&z.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=E.event.fix(e),l=new Array(arguments.length),u=(z.get(this,"events")||{})[s.type]||[],c=E.event.special[s.type]||{};for(l[0]=s,t=1;t<arguments.length;t++)l[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(a=E.event.handlers.call(this,s,u),t=0;(i=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((E.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,l))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a,s=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&1<=e.button))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},n=0;n<l;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<E(i,this).index(u):E.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l<t.length&&s.push({elem:u,handlers:t.slice(l)}),s},addProp:function(t,e){Object.defineProperty(E.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[E.expando]?e:new E.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Ce()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Ce()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&P(this,"input"))return this.click(),!1},_default:function(e){return P(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},E.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},E.Event=function(e,t){if(!(this instanceof E.Event))return new E.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Te:_e,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&E.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[E.expando]=!0},E.Event.prototype={constructor:E.Event,isDefaultPrevented:_e,isPropagationStopped:_e,isImmediatePropagationStopped:_e,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Te,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Te,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Te,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},E.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&xe.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},E.event.addProp),E.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){E.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||E.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),E.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,E(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"!=typeof e)return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=_e),this.each(function(){E.event.remove(this,e,n,t)});for(i in e)this.off(i,t,e[i]);return this}});var Se=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Pe=/<script|<style|<link/i,Oe=/checked\s*(?:[^=]|=\s*.checked.)/i,De=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ie(e,t){return P(e,"table")&&P(11!==t.nodeType?t:t.firstChild,"tr")&&E(e).children("tbody")[0]||e}function Ne(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ae(e,t){var n,r,i,o,a,s,l,u;if(1===t.nodeType){if(z.hasData(e)&&(o=z.access(e),a=z.set(t,o),u=o.events))for(i in delete a.handle,a.events={},u)for(n=0,r=u[i].length;n<r;n++)E.event.add(t,i,u[i][n]);Q.hasData(e)&&(s=Q.access(e),l=E.extend({},s),Q.set(t,l))}}function je(n,r,i,o){r=m.apply([],r);var e,t,a,s,l,u,c=0,d=n.length,f=d-1,p=r[0],h=v(p);if(h||1<d&&"string"==typeof p&&!g.checkClone&&Oe.test(p))return n.each(function(e){var t=n.eq(e);h&&(r[0]=p.call(this,e,t.html())),je(t,r,i,o)});if(d&&(t=(e=ge(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=E.map(fe(e,"script"),Ne)).length;c<d;c++)l=e,c!==f&&(l=E.clone(l,!0,!0),s&&E.merge(a,fe(l,"script"))),i.call(n[c],l,c);if(s)for(u=a[a.length-1].ownerDocument,E.map(a,Le),c=0;c<s;c++)l=a[c],ce.test(l.type||"")&&!z.access(l,"globalEval")&&E.contains(u,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?E._evalUrl&&E._evalUrl(l.src):x(l.textContent.replace(De,""),u,l))}return n}function ke(e,t,n){for(var r,i=t?E.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||E.cleanData(fe(r)),r.parentNode&&(n&&E.contains(r.ownerDocument,r)&&pe(fe(r,"script")),r.parentNode.removeChild(r));return e}E.extend({htmlPrefilter:function(e){return e.replace(Se,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s,l,u,c=e.cloneNode(!0),d=E.contains(e.ownerDocument,e);if(!(g.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||E.isXMLDoc(e)))for(a=fe(c),r=0,i=(o=fe(e)).length;r<i;r++)s=o[r],l=a[r],void 0,"input"===(u=l.nodeName.toLowerCase())&&le.test(s.type)?l.checked=s.checked:"input"!==u&&"textarea"!==u||(l.defaultValue=s.defaultValue);if(t)if(n)for(o=o||fe(e),a=a||fe(c),r=0,i=o.length;r<i;r++)Ae(o[r],a[r]);else Ae(e,c);return 0<(a=fe(c,"script")).length&&pe(a,!d&&fe(e,"script")),c},cleanData:function(e){for(var t,n,r,i=E.event.special,o=0;void 0!==(n=e[o]);o++)if(X(n)){if(t=n[z.expando]){if(t.events)for(r in t.events)i[r]?E.event.remove(n,r):E.removeEvent(n,r,t.handle);n[z.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),E.fn.extend({detach:function(e){return ke(this,e,!0)},remove:function(e){return ke(this,e)},text:function(e){return B(this,function(e){return void 0===e?E.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return je(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ie(this,e).appendChild(e)})},prepend:function(){return je(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ie(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return je(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return je(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(E.cleanData(fe(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return E.clone(this,e,t)})},html:function(e){return B(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Pe.test(e)&&!de[(ue.exec(e)||["",""])[1].toLowerCase()]){e=E.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(E.cleanData(fe(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return je(this,arguments,function(e){var t=this.parentNode;E.inArray(this,n)<0&&(E.cleanData(fe(this)),t&&t.replaceChild(e,this))},n)}}),E.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){E.fn[e]=function(e){for(var t,n=[],r=E(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),E(r[o])[a](t),l.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=_),t.getComputedStyle(e)},qe=new RegExp(ne.join("|"),"i");function Ue(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||E.contains(e.ownerDocument,e)||(a=E.style(e,t)),!g.pixelBoxStyles()&&Me.test(a)&&qe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ve.appendChild(s).appendChild(l);var e=_.getComputedStyle(l);n="1%"!==e.top,a=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=36===l.offsetWidth||"absolute",ve.removeChild(s),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s=C.createElement("div"),l=C.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===l.style.backgroundClip,E.extend(g,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),a},scrollboxSize:function(){return e(),i}}))}();var $e=/^(none|table(?!-c[ea]).+)/,Be=/^--/,He={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"},We=["Webkit","Moz","ms"],Ve=C.createElement("div").style;function Xe(e){var t=E.cssProps[e];return t||(t=E.cssProps[e]=function(e){if(e in Ve)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in Ve)return e}(e)||e),t}function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function ze(e,t,n,r,i,o){var a="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=E.css(e,n+ne[a],!0,i)),r?("content"===n&&(l-=E.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(l-=E.css(e,"border"+ne[a]+"Width",!0,i))):(l+=E.css(e,"padding"+ne[a],!0,i),"padding"!==n?l+=E.css(e,"border"+ne[a]+"Width",!0,i):s+=E.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))),l}function Qe(e,t,n){var r=Re(e),i=Ue(e,t,r),o="border-box"===E.css(e,"boxSizing",!1,r),a=o;if(Me.test(i)){if(!n)return i;i="auto"}return a=a&&(g.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===E.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}function Je(e,t,n,r,i){return new Je.prototype.init(e,t,n,r,i)}E.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ue(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=V(t),l=Be.test(t),u=e.style;if(l||(t=Xe(s)),a=E.cssHooks[t]||E.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];"string"==(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=oe(e,t,i),o="number"),null!=n&&n==n&&("number"===o&&(n+=i&&i[3]||(E.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,o,a,s=V(t);return Be.test(t)||(t=Xe(s)),(a=E.cssHooks[t]||E.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ue(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),E.each(["height","width"],function(e,s){E.cssHooks[s]={get:function(e,t,n){if(t)return!$e.test(E.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Qe(e,s,n):ie(e,He,function(){return Qe(e,s,n)})},set:function(e,t,n){var r,i=Re(e),o="border-box"===E.css(e,"boxSizing",!1,i),a=n&&ze(e,s,n,o,i);return o&&g.scrollboxSize()===i.position&&(a-=Math.ceil(e["offset"+s[0].toUpperCase()+s.slice(1)]-parseFloat(i[s])-ze(e,s,"border",!1,i)-.5)),a&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[s]=t,t=E.css(e,s)),Ye(0,t,a)}}}),E.cssHooks.marginLeft=Fe(g.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ue(e,"marginLeft"))||e.getBoundingClientRect().left-ie(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),E.each({margin:"",padding:"",border:"Width"},function(i,o){E.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(E.cssHooks[i+o].set=Ye)}),E.fn.extend({css:function(e,t){return B(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(e),i=t.length;a<i;a++)o[t[a]]=E.css(e,t[a],!1,r);return o}return void 0!==n?E.style(e,t,n):E.css(e,t)},e,t,1<arguments.length)}}),((E.Tween=Je).prototype={constructor:Je,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||E.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(E.cssNumber[n]?"":"px")},cur:function(){var e=Je.propHooks[this.prop];return e&&e.get?e.get(this):Je.propHooks._default.get(this)},run:function(e){var t,n=Je.propHooks[this.prop];return this.options.duration?this.pos=t=E.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Je.propHooks._default.set(this),this}}).init.prototype=Je.prototype,(Je.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=E.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){E.fx.step[e.prop]?E.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[E.cssProps[e.prop]]&&!E.cssHooks[e.prop]?e.elem[e.prop]=e.now:E.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Je.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},E.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},E.fx=Je.prototype.init,E.fx.step={};var Ke,Ze,et,tt,nt=/^(?:toggle|show|hide)$/,rt=/queueHooks$/;function it(){Ze&&(!1===C.hidden&&_.requestAnimationFrame?_.requestAnimationFrame(it):_.setTimeout(it,E.fx.interval),E.fx.tick())}function ot(){return _.setTimeout(function(){Ke=void 0}),Ke=Date.now()}function at(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function st(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=E.Deferred().always(function(){delete l.elem}),l=function(){if(a)return!1;for(var e=Ke||ot(),t=Math.max(0,u.startTime+u.duration-e),n=1-(t/u.duration||0),r=0,i=u.tweens.length;r<i;r++)u.tweens[r].run(n);return s.notifyWith(o,[u,n,t]),n<1&&i?t:(i||s.notifyWith(o,[u,1,0]),s.resolveWith(o,[u]),!1)},u=s.promise({elem:o,props:E.extend({},e),opts:E.extend(!0,{specialEasing:{},easing:E.easing._default},t),originalProperties:e,originalOptions:t,startTime:Ke||ot(),duration:t.duration,tweens:[],createTween:function(e,t){var n=E.Tween(o,u.opts,e,t,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(n),n},stop:function(e){var t=0,n=e?u.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)u.tweens[t].run(1);return e?(s.notifyWith(o,[u,1,0]),s.resolveWith(o,[u,e])):s.rejectWith(o,[u,e]),this}}),c=u.props;for(function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=E.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);r<i;r++)if(n=lt.prefilters[r].call(u,o,c,u.opts))return v(n.stop)&&(E._queueHooks(u.elem,u.opts.queue).stop=n.stop.bind(n)),n;return E.map(c,st,u),v(u.opts.start)&&u.opts.start.call(o,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),E.fx.timer(E.extend(l,{elem:o,anim:u,queue:u.opts.queue})),u}E.Animation=E.extend(lt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return oe(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(k);for(var n,r=0,i=e.length;r<i;r++)n=e[r],lt.tweeners[n]=lt.tweeners[n]||[],lt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,l,u,c,d="width"in t||"height"in t,f=this,p={},h=e.style,m=e.nodeType&&re(e),y=z.get(e,"fxshow");for(r in n.queue||(null==(a=E._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,f.always(function(){f.always(function(){a.unqueued--,E.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],nt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;m=!0}p[r]=y&&y[r]||E.style(e,r)}if((l=!E.isEmptyObject(t))||!E.isEmptyObject(p))for(r in d&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(u=y&&y.display)&&(u=z.get(e,"display")),"none"===(c=E.css(e,"display"))&&(u?c=u:(se([e],!0),u=e.style.display||u,c=E.css(e,"display"),se([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===E.css(e,"float")&&(l||(f.done(function(){h.display=u}),null==u&&(c=h.display,u="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",f.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),l=!1,p)l||(y?"hidden"in y&&(m=y.hidden):y=z.access(e,"fxshow",{display:u}),o&&(y.hidden=!m),m&&se([e],!0),f.done(function(){for(r in m||se([e]),z.remove(e,"fxshow"),p)E.style(e,r,p[r])})),l=st(m?y[r]:0,r,f),r in y||(y[r]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?lt.prefilters.unshift(e):lt.prefilters.push(e)}}),E.speed=function(e,t,n){var r=e&&"object"==typeof e?E.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return E.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in E.fx.speeds?r.duration=E.fx.speeds[r.duration]:r.duration=E.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&E.dequeue(this,r.queue)},r},E.fn.extend({fadeTo:function(e,t,n,r){return this.filter(re).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=E.isEmptyObject(t),o=E.speed(e,n,r),a=function(){var e=lt(this,E.extend({},t),o);(i||z.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&!1!==i&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=E.timers,r=z.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&rt.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||E.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=z.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=E.timers,o=n?n.length:0;for(t.finish=!0,E.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),E.each(["toggle","show","hide"],function(e,r){var i=E.fn[r];E.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(at(r,!0),e,t,n)}}),E.each({slideDown:at("show"),slideUp:at("hide"),slideToggle:at("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){E.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),E.timers=[],E.fx.tick=function(){var e,t=0,n=E.timers;for(Ke=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||E.fx.stop(),Ke=void 0},E.fx.timer=function(e){E.timers.push(e),E.fx.start()},E.fx.interval=13,E.fx.start=function(){Ze||(Ze=!0,it())},E.fx.stop=function(){Ze=null},E.fx.speeds={slow:600,fast:200,_default:400},E.fn.delay=function(r,e){return r=E.fx&&E.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=_.setTimeout(e,r);t.stop=function(){_.clearTimeout(n)}})},et=C.createElement("input"),tt=C.createElement("select").appendChild(C.createElement("option")),et.type="checkbox",g.checkOn=""!==et.value,g.optSelected=tt.selected,(et=C.createElement("input")).value="t",et.type="radio",g.radioValue="t"===et.value;var ut,ct=E.expr.attrHandle;E.fn.extend({attr:function(e,t){return B(this,E.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){E.removeAttr(this,e)})}}),E.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?E.prop(e,t,n):(1===o&&E.isXMLDoc(e)||(i=E.attrHooks[t.toLowerCase()]||(E.expr.match.bool.test(t)?ut:void 0)),void 0!==n?null===n?void E.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=E.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&P(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(k);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),ut={set:function(e,t,n){return!1===t?E.removeAttr(e,n):e.setAttribute(n,n),n}},E.each(E.expr.match.bool.source.match(/\w+/g),function(e,t){var a=ct[t]||E.find.attr;ct[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=ct[o],ct[o]=r,r=null!=a(e,t,n)?o:null,ct[o]=i),r}});var dt=/^(?:input|select|textarea|button)$/i,ft=/^(?:a|area)$/i;function pt(e){return(e.match(k)||[]).join(" ")}function ht(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(k)||[]}E.fn.extend({prop:function(e,t){return B(this,E.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[E.propFix[e]||e]})}}),E.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&E.isXMLDoc(e)||(t=E.propFix[t]||t,i=E.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=E.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||ft.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(E.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),E.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){E.propFix[this.toLowerCase()]=this}),E.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,l=0;if(v(t))return this.each(function(e){E(this).addClass(t.call(this,e,ht(this)))});if((e=mt(t)).length)for(;n=this[l++];)if(i=ht(n),r=1===n.nodeType&&" "+pt(i)+" "){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,l=0;if(v(t))return this.each(function(e){E(this).removeClass(t.call(this,e,ht(this)))});if(!arguments.length)return this.attr("class","");if((e=mt(t)).length)for(;n=this[l++];)if(i=ht(n),r=1===n.nodeType&&" "+pt(i)+" "){for(a=0;o=e[a++];)for(;-1<r.indexOf(" "+o+" ");)r=r.replace(" "+o+" "," ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):v(i)?this.each(function(e){E(this).toggleClass(i.call(this,e,ht(this),t),t)}):this.each(function(){var e,t,n,r;if(a)for(t=0,n=E(this),r=mt(i);e=r[t++];)n.hasClass(e)?n.removeClass(e):n.addClass(e);else void 0!==i&&"boolean"!==o||((e=ht(this))&&z.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":z.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&-1<(" "+pt(ht(n))+" ").indexOf(t))return!0;return!1}});var yt=/\r/g;E.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=v(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,E(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=E.map(t,function(e){return null==e?"":e+""})),(r=E.valHooks[this.type]||E.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=E.valHooks[t.type]||E.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(yt,""):null==e?"":e:void 0}}),E.extend({valHooks:{option:{get:function(e){var t=E.find.attr(e,"value");return null!=t?t:pt(E.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!P(n.parentNode,"optgroup"))){if(t=E(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=E.makeArray(t),a=i.length;a--;)((r=i[a]).selected=-1<E.inArray(E.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),E.each(["radio","checkbox"],function(){E.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<E.inArray(E(e).val(),t)}},g.checkOn||(E.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),g.focusin="onfocusin"in _;var gt=/^(?:focusinfocus|focusoutblur)$/,vt=function(e){e.stopPropagation()};E.extend(E.event,{trigger:function(e,t,n,r){var i,o,a,s,l,u,c,d,f=[n||C],p=y.call(e,"type")?e.type:e,h=y.call(e,"namespace")?e.namespace.split("."):[];if(o=d=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!gt.test(p+E.event.triggered)&&(-1<p.indexOf(".")&&(p=(h=p.split(".")).shift(),h.sort()),l=p.indexOf(":")<0&&"on"+p,(e=e[E.expando]?e:new E.Event(p,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:E.makeArray(t,[e]),c=E.event.special[p]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!b(n)){for(s=c.delegateType||p,gt.test(s+p)||(o=o.parentNode);o;o=o.parentNode)f.push(o),a=o;a===(n.ownerDocument||C)&&f.push(a.defaultView||a.parentWindow||_)}for(i=0;(o=f[i++])&&!e.isPropagationStopped();)d=o,e.type=1<i?s:c.bindType||p,(u=(z.get(o,"events")||{})[e.type]&&z.get(o,"handle"))&&u.apply(o,t),(u=l&&o[l])&&u.apply&&X(o)&&(e.result=u.apply(o,t),!1===e.result&&e.preventDefault());return e.type=p,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(f.pop(),t)||!X(n)||l&&v(n[p])&&!b(n)&&((a=n[l])&&(n[l]=null),E.event.triggered=p,e.isPropagationStopped()&&d.addEventListener(p,vt),n[p](),e.isPropagationStopped()&&d.removeEventListener(p,vt),E.event.triggered=void 0,a&&(n[l]=a)),e.result}},simulate:function(e,t,n){var r=E.extend(new E.Event,n,{type:e,isSimulated:!0});E.event.trigger(r,null,t)}}),E.fn.extend({trigger:function(e,t){return this.each(function(){E.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return E.event.trigger(e,t,n,!0)}}),g.focusin||E.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){E.event.simulate(r,e.target,E.event.fix(e))};E.event.special[r]={setup:function(){var e=this.ownerDocument||this,t=z.access(e,r);t||e.addEventListener(n,i,!0),z.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this,t=z.access(e,r)-1;t?z.access(e,r,t):(e.removeEventListener(n,i,!0),z.remove(e,r))}}});var bt=_.location,xt=Date.now(),wt=/\?/;E.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new _.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||E.error("Invalid XML: "+e),t};var Tt=/\[\]$/,_t=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function St(n,e,r,i){var t;if(Array.isArray(e))E.each(e,function(e,t){r||Tt.test(n)?i(n,t):St(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)St(n+"["+t+"]",e[t],r,i)}E.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!E.isPlainObject(e))E.each(e,function(){i(this.name,this.value)});else for(n in e)St(n,e[n],t,i);return r.join("&")},E.fn.extend({serialize:function(){return E.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=E.prop(this,"elements");return e?E.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!E(this).is(":disabled")&&Et.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!le.test(e))}).map(function(e,t){var n=E(this).val();return null==n?null:Array.isArray(n)?E.map(n,function(e){return{name:t.name,value:e.replace(_t,"\r\n")}}):{name:t.name,value:n.replace(_t,"\r\n")}}).get()}});var Pt=/%20/g,Ot=/#.*$/,Dt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Nt=/^(?:GET|HEAD)$/,Lt=/^\/\//,At={},jt={},kt="*/".concat("*"),Mt=C.createElement("a");function Rt(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(k)||[];if(v(t))for(;n=i[r++];)"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function qt(t,i,o,a){var s={},l=t===jt;function u(e){var r;return s[e]=!0,E.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||l||s[n]?l?!(r=n):void 0:(i.dataTypes.unshift(n),u(n),!1)}),r}return u(i.dataTypes[0])||!s["*"]&&u("*")}function Ut(e,t){var n,r,i=E.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&E.extend(!0,e,r),e}Mt.href=bt.href,E.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":kt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":E.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,E.ajaxSettings),t):Ut(E.ajaxSettings,e)},ajaxPrefilter:Rt(At),ajaxTransport:Rt(jt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,d,f,n,p,r,h,m,i,o,y=E.ajaxSetup({},t),g=y.context||y,v=y.context&&(g.nodeType||g.jquery)?E(g):E.event,b=E.Deferred(),x=E.Callbacks("once memory"),w=y.statusCode||{},a={},s={},l="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n)for(n={};t=It.exec(f);)n[t[1].toLowerCase()]=t[2];t=n[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return h?f:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(y.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||l;return c&&c.abort(t),u(0,t),this}};if(b.promise(T),y.url=((e||y.url||bt.href)+"").replace(Lt,bt.protocol+"//"),y.type=t.method||t.type||y.method||y.type,y.dataTypes=(y.dataType||"*").toLowerCase().match(k)||[""],null==y.crossDomain){r=C.createElement("a");try{r.href=y.url,r.href=r.href,y.crossDomain=Mt.protocol+"//"+Mt.host!=r.protocol+"//"+r.host}catch(e){y.crossDomain=!0}}if(y.data&&y.processData&&"string"!=typeof y.data&&(y.data=E.param(y.data,y.traditional)),qt(At,y,t,T),h)return T;for(i in(m=E.event&&y.global)&&0==E.active++&&E.event.trigger("ajaxStart"),y.type=y.type.toUpperCase(),y.hasContent=!Nt.test(y.type),d=y.url.replace(Ot,""),y.hasContent?y.data&&y.processData&&0===(y.contentType||"").indexOf("application/x-www-form-urlencoded")&&(y.data=y.data.replace(Pt,"+")):(o=y.url.slice(d.length),y.data&&(y.processData||"string"==typeof y.data)&&(d+=(wt.test(d)?"&":"?")+y.data,delete y.data),!1===y.cache&&(d=d.replace(Dt,"$1"),o=(wt.test(d)?"&":"?")+"_="+xt+++o),y.url=d+o),y.ifModified&&(E.lastModified[d]&&T.setRequestHeader("If-Modified-Since",E.lastModified[d]),E.etag[d]&&T.setRequestHeader("If-None-Match",E.etag[d])),(y.data&&y.hasContent&&!1!==y.contentType||t.contentType)&&T.setRequestHeader("Content-Type",y.contentType),T.setRequestHeader("Accept",y.dataTypes[0]&&y.accepts[y.dataTypes[0]]?y.accepts[y.dataTypes[0]]+("*"!==y.dataTypes[0]?", "+kt+"; q=0.01":""):y.accepts["*"]),y.headers)T.setRequestHeader(i,y.headers[i]);if(y.beforeSend&&(!1===y.beforeSend.call(g,T,y)||h))return T.abort();if(l="abort",x.add(y.complete),T.done(y.success),T.fail(y.error),c=qt(jt,y,t,T)){if(T.readyState=1,m&&v.trigger("ajaxSend",[T,y]),h)return T;y.async&&0<y.timeout&&(p=_.setTimeout(function(){T.abort("timeout")},y.timeout));try{h=!1,c.send(a,u)}catch(e){if(h)throw e;u(-1,e)}}else u(-1,"No Transport");function u(e,t,n,r){var i,o,a,s,l,u=t;h||(h=!0,p&&_.clearTimeout(p),c=void 0,f=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(y,T,n)),s=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(y,s,T,i),i?(y.ifModified&&((l=T.getResponseHeader("Last-Modified"))&&(E.lastModified[d]=l),(l=T.getResponseHeader("etag"))&&(E.etag[d]=l)),204===e||"HEAD"===y.type?u="nocontent":304===e?u="notmodified":(u=s.state,o=s.data,i=!(a=s.error))):(a=u,!e&&u||(u="error",e<0&&(e=0))),T.status=e,T.statusText=(t||u)+"",i?b.resolveWith(g,[o,u,T]):b.rejectWith(g,[T,u,a]),T.statusCode(w),w=void 0,m&&v.trigger(i?"ajaxSuccess":"ajaxError",[T,y,i?o:a]),x.fireWith(g,[T,u]),m&&(v.trigger("ajaxComplete",[T,y]),--E.active||E.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return E.get(e,t,n,"json")},getScript:function(e,t){return E.get(e,void 0,t,"script")}}),E.each(["get","post"],function(e,i){E[i]=function(e,t,n,r){return v(t)&&(r=r||n,n=t,t=void 0),E.ajax(E.extend({url:e,type:i,dataType:r,data:t,success:n},E.isPlainObject(e)&&e))}}),E._evalUrl=function(e){return E.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},E.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=E(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return v(n)?this.each(function(e){E(this).wrapInner(n.call(this,e))}):this.each(function(){var e=E(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=v(t);return this.each(function(e){E(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){E(this).replaceWith(this.childNodes)}),this}}),E.expr.pseudos.hidden=function(e){return!E.expr.pseudos.visible(e)},E.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},E.ajaxSettings.xhr=function(){try{return new _.XMLHttpRequest}catch(e){}};var Ft={0:200,1223:204},$t=E.ajaxSettings.xhr();g.cors=!!$t&&"withCredentials"in $t,g.ajax=$t=!!$t,E.ajaxTransport(function(i){var o,a;if(g.cors||$t&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Ft[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&_.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),E.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),E.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return E.globalEval(e),e}}}),E.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),E.ajaxTransport("script",function(n){var r,i;if(n.crossDomain)return{send:function(e,t){r=E("<script>").prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Bt,Ht=[],Gt=/(=)\?(?=&|$)|\?\?/;E.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ht.pop()||E.expando+"_"+xt++;return this[e]=!0,e}}),E.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Gt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Gt,"$1"+r):!1!==e.jsonp&&(e.url+=(wt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||E.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=_[r],_[r]=function(){o=arguments},n.always(function(){void 0===i?E(_).removeProp(r):_[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Ht.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),g.createHTMLDocument=((Bt=C.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Bt.childNodes.length),E.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(g.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=O.exec(e))?[t.createElement(i[1])]:(i=ge([e],t,o),o&&o.length&&E(o).remove(),E.merge([],i.childNodes)));var r,i,o},E.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=pt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&E.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?E("<div>").append(E.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},E.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){E.fn[t]=function(e){return this.on(t,e)}}),E.expr.pseudos.animated=function(t){return E.grep(E.timers,function(e){return t===e.elem}).length},E.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=E.css(e,"position"),c=E(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=E.css(e,"top"),l=E.css(e,"left"),("absolute"===u||"fixed"===u)&&-1<(o+l).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),v(t)&&(t=t.call(e,n,E.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):c.css(d)}},E.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){E.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===E.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===E.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=E(e).offset()).top+=E.css(e,"borderTopWidth",!0),i.left+=E.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-E.css(r,"marginTop",!0),left:t.left-i.left-E.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===E.css(e,"position");)e=e.offsetParent;return e||ve})}}),E.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;E.fn[t]=function(e){return B(this,function(e,t,n){var r;if(b(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),E.each(["top","left"],function(e,n){E.cssHooks[n]=Fe(g.pixelPosition,function(e,t){if(t)return t=Ue(e,n),Me.test(t)?E(e).position()[n]+"px":t})}),E.each({Height:"height",Width:"width"},function(a,s){E.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){E.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return b(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?E.css(e,t,i):E.style(e,t,n,i)},s,n?e:void 0,n)}})}),E.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){E.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),E.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),E.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),E.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||E.guid++,i},E.holdReady=function(e){e?E.readyWait++:E.ready(!0)},E.isArray=Array.isArray,E.parseJSON=JSON.parse,E.nodeName=P,E.isFunction=v,E.isWindow=b,E.camelCase=V,E.type=w,E.now=Date.now,E.isNumeric=function(e){var t=E.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return E});var Wt=_.jQuery,Vt=_.$;return E.noConflict=function(e){return _.$===E&&(_.$=Vt),e&&_.jQuery===E&&(_.jQuery=Wt),E},e||(_.jQuery=_.$=E),E}),function(){var t={de:{false:"Nein",noRows:"(Keine zeilen)",true:"Ja"},en:{false:"No",noRows:"(No rows)",true:"Yes"},es:{false:"No",noRows:"(No hay filas)",true:"Sí"},fr:{false:"Non",noRows:"(Aucune ligne)",true:"Oui"},in:{false:"नहीं",noRows:"(कोई पंक्तियाँ)",true:"हाँ"},jp:{false:"偽",noRows:"(行がありません)",true:"真実"}},l={US:"Ex: 02/14/2018 09:15:01",DATE:"",TIME:"",YYYYMMDD:"",INTLTIME:"",INTL:"",ISO:""};function u(e,t){var n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];if(!e)return"";var r=new Date(e);return dateMM=r.getMonth()+1,dateDD=r.getDate(),dateYY=r.getFullYear(),h=r.getHours(),m=r.getMinutes(),s=r.getSeconds(),"US"==t?strFinalDate=(dateMM<=9?"0"+dateMM:dateMM)+"/"+(dateDD<=9?"0"+dateDD:dateDD)+"/"+dateYY+" "+(h<=9?"0"+h:h)+":"+(m<=9?"0"+m:m)+":"+(s<=9?"0"+s:s):"DATE"==t?strFinalDate=(dateMM<=9?"0"+dateMM:dateMM)+"/"+(dateDD<=9?"0"+dateDD:dateDD)+"/"+dateYY:"TIME"==t?strFinalDate=(h<=9?"0"+h:h)+":"+(m<=9?"0"+m:m)+":"+(s<=9?"0"+s:s):"YYYYMMDD"==t?strFinalDate=dateYY+"-"+(dateMM<=9?"0"+dateMM:dateMM)+"-"+(dateDD<=9?"0"+dateDD:dateDD)+" "+(h<=9?"0"+h:h)+":"+(m<=9?"0"+m:m)+":"+(s<=9?"0"+s:s):"INTLTIME"==t?strFinalDate=n[r.getMonth()]+" "+(dateDD<=9?"0"+dateDD:dateDD)+", "+dateYY+" "+(h<=9?"0"+h:h)+":"+(m<=9?"0"+m:m)+":"+(s<=9?"0"+s:s):"INTL"==t?strFinalDate=n[r.getMonth()]+" "+(dateDD<=9?"0"+dateDD:dateDD)+", "+dateYY:"ISO"==t&&(strFinalDate=dateYY+"-"+(dateMM<=9?"0"+dateMM:dateMM)+"-"+(dateDD<=9?"0"+dateDD:dateDD)+"T"+(h<=9?"0"+h:h)+":"+(m<=9?"0"+m:m)+":"+(s<=9?"0"+s:s)+".000Z"),strFinalDate&&(-1<strFinalDate.indexOf("NaN")||-1<strFinalDate.indexOf("undefined"))?"":strFinalDate}function e(){var a={},s=null;$("[data-sprlib]").each(function(e,r){var n=[],o={};try{if("object"!=typeof(o=$(r).data("sprlib"))||!o.list)return console.log("**Warning** this tag has `data-sprlib` but is defective: its data is not an object, or it lacks the `list` prop"),console.log(o),console.log(typeof o),void console.log(o.list?o.list:"!objTagData.list does not exist!")}catch(e){return console.log("Unable to ingest data-sprlib!\n"),console.log("tag.: "+$(r)[0].outerHTML+"\n"),console.log("data: "),void console.log($(r).data("sprlib"))}if(o.cols&&Array.isArray(o.cols)&&o.cols.forEach(function(e,t){"string"==typeof e?n.push(e):"object"==typeof e&&(e.hasOwnProperty("name")?n.push(e.name):(console.error("Error: column object lacks `name` property. Ex:`cols: [{name:'HireDate'}]`"),console.error(e)))}),o.text&&n.push(o.text),o.value&&n.push(o.value),o.filter){if(!$(r).filter.col||!$(r).filter.op||void 0===$(r).filter.val)return void console.error("FILTER ERROR:\n\nYour filter:\n"+$(r).context.outerHTML.replace(/\"\;/gi,'"')+'\n\nShould look like this:\n"filter":{"col":"name", "op":"eq", "val":"bill"}\'>');if(!APP_FILTEROPS[$(r).filter.op])return void console.error("FILTER ERROR:\n\nOperation Unknown:\n"+$(r).filter.op+">")}sprLib.list(o.list).getItems({listCols:n,queryFilter:o.filter||null,queryLimit:o.limit||null,queryOrderby:o.order||null,metadata:!1}).then(function(e){if(o.data=e,$(r).find(".sprlibuiTemp").remove(),$(r).is("select")||$(r).is("table")||$(r).is("tbody")){if($(r).is("select"))o.text||o.value||reject('<select> requires `text` and `value`.\nEx: <select data-sprlib=\'{ "list":"Employees", "value":"Title", "text":"Id" }\'></select>'),$.each(o.data,function(e,t){$(r).append('<option value="'+t[o.value]+'">'+t[o.text]+"</option>")});else if($(r).is("table")||$(r).is("tbody")){if($(r).is("table")){o.tableSorter&&$.tablesorter&&$(r).trigger("destroy"),0==$(r).find("> thead").length?$(r).prepend("<thead/>"):$(r).find("> thead").empty();var n=$("<tr/>");$.each(o.cols,function(e,t){t.hidden||n.append("<th>"+(t.label||t.name||t)+"</th>")}),$(r).find("> thead").append(n),0==$(r).find("> tbody").length?$(r).append("<tbody/>"):$(r).find("> tbody").empty(),s=$(r)}else $(r).is("tbody")&&($(r).empty(),s=$(r).parent("table"));o.data.forEach(function(e,t){isFilterPassed=!1;var i=$("<tr/>");$.each(e,function(t,n){var r=$("<td/>");(!a.col||a.col==t&&"eq"==a.op&&a.val==n)&&(isFilterPassed=!0),o.cols.forEach(function(e){"string"==typeof e?-1<e.indexOf("/")&&2==e.split("/").length?t==e.split("/")[0]&&n&&n[e.split("/")[1]]&&r.text(n[e.split("/")[1]]):-1<o.cols.indexOf(t)&&r.text(n):e.hasOwnProperty("name")&&e.name==t&&("boolean"==typeof n&&(n=n.toString().replace("true","Yes").replace("false","No")),n&&e.isNumPct&&!isNaN(n)?r.text(Math.round(100*n)+"%"):n&&"Currency"==e.dataType&&!isNaN(n)?r.text(function(e,t,n,r){t=isNaN(t=Math.abs(t))?2:t,n=null==n?".":n,r=null==r?",":r;var i=e<0?"-":"",o=parseInt(e=Math.abs(+e||0).toFixed(t))+"",a=3<(a=o.length)?a%3:0;return APP_OPTS.currencyChar+i+(a?o.substr(0,a)+r:"")+o.substr(a).replace(/(\d{3})(?=\d)/g,"$1"+r)+(t?n+Math.abs(e-o).toFixed(t).slice(2):"")}(n)):n&&"DateTime"==e.dataType?r.text(u(n,e.dateFormat||"INTL")):n&&-1<Object.keys(l).indexOf(e.format)?r.text(u(n,e.format||"INTL")):r.text(n||""),e.class&&r.addClass(e.class),e.style&&e.style.split(";").forEach(function(e){e.indexOf(":")&&2==e.split(":").length&&r.css(e.split(":")[0].toString().trim(),e.split(":")[1].toString().trim())}))}),-1==t.indexOf("__")&&i.append(r)}),isFilterPassed&&$(s).find("> tbody").append(i)}),o.tableSorter&&$.tablesorter&&(o.tablesorter({sortList:o.tableSorter.sortList}),o.tableSorter.htmlEle=$(s)),0==$(s).find("tbody tr").length&&$(s).find("tbody").append('<tr><td colspan="'+$(s).find("thead th").length+'" style="color:#ccc; text-align:center;">'+t[APP_OPTS.language].noRows+"</td></tr>")}}else $(r).is('input[type="text"]')?$(r).val(o.data[0][o.value]):$(r).not("input")&&$(r).text(o.data[0][o.value])}).catch(function(e){($(r).is("table")||$(r).is("tbody"))&&(0==$(r).find("tbody").length&&$(r).append("<tbody/>"),$(r).find("tbody").append('<tr><td style="padding:10px; color:white; background:lightcoral;" colspan="'+(0<$(r).find("thead th").length?n.length||$(r).find("thead th").length:1)+'">'+e+"</td></tr>")),console.error(e)})})}sprLib.ui={},sprLib.ui.version="1.0.0-20180828",$&&$(document)&&$(document).ready(function(){sprLib?($("table[data-bind]").each(function(e,t){$(this).data("bind").options&&$(this).data("bind").options.showBusySpinner&&$(this).append('<tbody class="sprlibuiTemp"><tr><td style="text-align:center">'+APP_OPTS.busySpinnerHtml+"</td></tr></tbody>")}),$("tbody[data-bind]").each(function(e,t){$(this).data("bind").options&&$(this).data("bind").options.showBusySpinner&&$(this).append('<tr class="sprlibuiTemp"><td colspan="'+($(this).parents("table").find("thead th").length||1)+'" style="text-align:center">'+APP_OPTS.busySpinnerHtml+"</td></tr>")}),e()):console.error("Error: `sprLib` not found! sprestlib-ui.js requires sprestlib.js\n(TIP: use `sprestlib-ui.bundle.js` it has everything!)")})}();
//# sourceMappingURL=sprestlib-ui.bundle.js.map