]+)?><\/span>/gi,"").replace(/^<\/p>$/,"");t.innerHTML=e}return e!==undefined?this:null});break;case"SPFieldUser":case"SPFieldUserMulti":obj._type="people"+("SPFieldUserMulti"===infoFromComments.SPType?" multiple":""),tmp=td.querySelector('div[contenteditable="true"]'),tmp?(obj._elements.push(tmp),obj._elements.push(td.querySelector("textarea")),!function(){for(var e=td.querySelectorAll("a"),t=0;t',SPArrayForEach(e,function(e){t+=''}),t+="",EntityEditorCallback(t,r,!1),e=getUplevel(r),WebForm_DoCallback(r.replace(/(ctl\d+)(\_)/g,"$1$").replace(/(^ctl\d+\$m)(\_)/,"$1$").replace(/\_ctl/,"$ctl"),e,EntityEditorHandleCheckNameResult,r,EntityEditorHandleCheckNameError,!0);else{if("function"!=typeof SPClientPeoplePicker)throw new Error("$SP().formfields().val() failed with a People Picker, because EntityEditorCallback and SPClientPeoplePicker are not available!");if(i=SPClientPeoplePicker.SPClientPeoplePickerDict[r],!i)throw new Error("$SP().formfields().val() failed with a People Picker, because SPClientPeoplePicker.SPClientPeoplePickerDict['"+r+"'] returned an unexpected value");if(t=document.getElementById(i.ResolvedListElementId))for(t=t.querySelectorAll("span"),r=t.length;r--;)i.DeleteProcessedUser();SPIsArray(e)&&(e=e.join(";")),i.AddUserKeys(e,!1)}return this};break;case"SPFieldChoice":case"SPFieldMultiChoice":obj._type="choices",tmp=td.querySelector("table"),tmp?(tmp=td.querySelector("select"),tmp?(obj._type="choices plus",obj._elements=td.querySelectorAll("input,select")):(tmp=td.querySelector('input[type="checkbox"]'),tmp?obj._type="choices checkbox":obj._type="choices radio",tmp=td.querySelector('input[type="text"]'),tmp&&(obj._type+=" plus"),obj._elements=td.querySelectorAll("input"))):obj._elements=td.querySelector("select"),obj.val=function(e){var t,r,i,n=this.elem(!1),o=this.type();if("undefined"==typeof e)switch(o){case"choices":return getSelectedOption(n,"text");case"choices plus":return n[0].checked?getSelectedOption(n[1],"text"):n[3].value;case"choices radio":for(t=0;tt;t++)n[t].checked&&e.push(r&&t+1===i?n[i].value:getText(n[t].nextSibling));return e}else switch(o){case"choices":setSelectedOption(n,e,"text");break;case"choices plus":n[0].checked=!0,setSelectedOption(n[1],e,"text"),getSelectedOption(n[1],"text")!==e?(n[2].checked=!0,n[3].value=e):n[3].value="";break;case"choices checkbox":case"choices checkbox plus":for(SPIsArray(e)||(e=[e]),i=n.length,"choices checkbox plus"===o&&(i-=2),t=0;i>t;t++)idx=SPArrayIndexOf(e,getText(n[t].nextSibling)),idx>-1?(n[t].checked=!0,e.splice(idx,1)):n[t].checked=!1;"choices checkbox plus"===o&&(e.length>0?(n[n.length-2].checked=!0,n[n.length-1].value=e[0]):(n[n.length-2].checked=!1,n[n.length-1].value=""));break;case"choices radio":case"choices radio plus":for(r=!1,i=n.length,"choices radio plus"===o&&(i-=2),t=0;i>t;t++)if(getText(n[t].nextSibling)==e){n[t].checked=!0,r=!0;break}"choices radio plus"===o&&(r?n[t+1].value="":(n[t].checked=!0,n[t+1].value=e))}return this};break;case"SPFieldDateTime":obj._type="date",tmp=td.querySelectorAll("input,select,a"),tmp.length>2&&(obj._type+=" time"),obj._elements=obj._elements.concat(tmp),obj.val=function(e){var t=this.elem();return"undefined"!=typeof e?(SPIsArray(e)||(e=[e]),t[0].value=e[0],4===t.length&&(e.length>1&&setSelectedOption(t[2],e[1]),e.length>2&&setSelectedOption(t[3],e[2])),this):4===t.length?[t[0].value,getSelectedOption(t[2],"text"),t[3].value]:t[0].value};break;case"SPFieldLookup":case"SPFieldLookupMulti":obj._type="lookup",obj._elements=td.querySelectorAll('select,input[id$="Button"],button'),"SPFieldLookupMulti"===infoFromComments.SPType?obj._type+=" multiple":obj._elements=obj._elements[0],obj.val=function(v){var params="text";"object"!=typeof v||SPIsArray(v)||(params=v.selectReturn||"text",v=void 0);var type=this.type(),e=this.elem(!1),val=[],o;if("undefined"==typeof v){if("lookup multiple"===type){for(e=e[3].querySelectorAll("option"),v=[],o=0;ot;t++)e.call(this.data[t]);return this},val:function(e){var t=!1,r=!1;if("object"!=typeof e||SPIsArray(e)||(t=e.identity===!0,r=e.extend===!0,e=void 0),"undefined"==typeof e){var i=[];return this.each(function(){t===!0?i[this.name()]=this.val():r===!0&&"people"===this.type().slice(0,6)?i.push(this.val({extend:r})):i.push(this.val())}),0===i.length?"":1===i.length?i[0]:i}if("object"!=typeof e)this.each(function(){this.val(e)});else{var n=0;if(this.length>1){if(e.length!==this.length)throw new Error("$SP.formfields.val: the array passed for val() must have the same size as the number of fields in formfields()");this.each(function(){this.val(e[n++])})}else this.each(function(){this.val(e)})}return this},elem:function(e){e=e!==!1;var t=[],r="function"==typeof jQuery&&e===!0;switch(this.each(function(){var e=this.elem(!1);e instanceof NodeList&&(e=[].slice.call(e)),t=t.concat(e)}),t.length){case 0:return r?jQuery():null;case 1:return r?jQuery(t[0]):t[0];default:return r?jQuery(t):t}},row:function(){var e=[],t="function"==typeof jQuery;switch(this.each(function(){var t=this.row();t instanceof jQuery==!0&&(t=t[0]),e.push(t)}),e.length){case 0:return t?jQuery():null;case 1:return t?jQuery(e[0]):e[0];default:return t?jQuery(e):e}},type:function(){var e=[];switch(this.each(function(){e.push(this.type())}),e.length){case 0:return"";case 1:return e[0];default:return e}},description:function(){var e=[];switch(this.each(function(){e.push(this.description())}),e.length){case 0:return"";case 1:return e[0];default:return e}},isMandatory:function(){var e=[];switch(this.each(function(){e.push(this.isMandatory())}),e.length){case 0:return!1;case 1:return e[0];default:return e}},name:function(){var e=[];switch(this.each(function(){e.push(this.name())}),e.length){case 0:return"";case 1:return e[0];default:return e}},internalname:function(){var e=[];switch(this.each(function(){e.push(this.internalname())}),e.length){case 0:return"";case 1:return e[0];default:return e}},notify:function(e,t){if(e===undefined)throw"Error 'notify': you must provide the message to show.";if("string"!=typeof e)throw"Error 'notify': you must provide a string for the message to show.";if(t=t||{},t.timeout=isNaN(t.timeout)?5:t.timeout,t.override=t.override===!0,t.overrideAll=t.overrideAll===!0,t.overrideSticky=t.overrideSticky!==!1,t.sticky=t.sticky===!0,t.name=t.name||(new Date).getTime(),t.after=t.after||function(){},t.fake=t.fake===!0,t.ignoreQueue=t.ignoreQueue===!0,_SP_NOTIFY_READY===!1)return _SP_NOTIFY_QUEUE.push({message:e,options:t}),$(document).ready(function(){ExecuteOrDelayUntilScriptLoaded(function(){ExecuteOrDelayUntilScriptLoaded(function(){_SP_NOTIFY_READY=!0,$SP().notify("fake",{fake:!0})},"core.js")},"sp.js")}),this;if(t.ignoreQueue!==!0)for(;_SP_NOTIFY_QUEUE.length>0;){var r=_SP_NOTIFY_QUEUE.shift();r.options.ignoreQueue=!0,$SP().notify(r.message,r.options)}if(t.fake!==!0){if(_SP_NOTIFY.length>0&&(t.overrideAll?$SP().removeNotify({all:!0,includeSticky:t.overrideSticky}):t.override&&$SP().removeNotify(_SP_NOTIFY[_SP_NOTIFY.length-1].name)),_SP_NOTIFY.push({name:t.name,id:SP.UI.Notify.addNotification(e,!0),options:t}),!t.sticky){setTimeout(function(){$SP().removeNotify(t.name,{timeout:!0})},1e3*t.timeout)}return this}},removeNotify:function(e,t){switch(arguments.length){case 0:throw"Error 'removeNotify': you must provide 'name' or 'options'.";case 2:if("object"!=typeof t)throw"Error 'removeNotify': you must provide an object for 'options'."}if(1===arguments.length&&"object"==typeof e&&(t=e,e=undefined),t=t||{all:!1},t.timeout=t.timeout===!0,_SP_NOTIFY_READY===!1&&_SP_NOTIFY_QUEUE.length>0)return setTimeout(function(){$SP().removeNotify(e,t)},150),this;var r,i=this;if(t.all===!0){for(var n=[];_SP_NOTIFY.length>0;)r=_SP_NOTIFY.shift(),t.includeSticky===!1&&r.options.sticky===!0?n.push(r):(SP.UI.Notify.removeNotification(r.id),setTimeout(function(){r.options.after.call(i,r.name,!1)},150));_SP_NOTIFY=n.slice(0)}else if(e!==undefined)for(var o=0,a=_SP_NOTIFY.length;a>o;o++)if(_SP_NOTIFY[o].name==e)return r=_SP_NOTIFY.splice(o,1)[0],SP.UI.Notify.removeNotification(r.id),setTimeout(function(){r.options.after.call(i,r.name,t.timeout)},150),this;return this},_getPageSize:function(e){var t={width:0,height:0},r={width:0,height:0},i=e||window,n=i.document,o=n.documentElement,a=n.getElementsByTagName("body")[0];return t.width=i.innerWidth||o.clientWidth||a.clientWidth,t.height=i.innerHeight||o.clientHeight||a.clientHeight,r.width=Math.max(a.scrollWidth,o.scrollWidth,a.offsetWidth,o.offsetWidth,a.clientWidth,o.clientWidth),r.height=Math.max(a.scrollHeight,o.scrollHeight,a.offsetHeight,o.offsetHeight,a.clientHeight,o.clientHeight),document.all&&document.querySelector&&!document.addEventListener&&t.width+4==r.width&&t.height+4==r.height&&(t.width=r.width,t.height=r.height),{vw:t,doc:r}},showModalDialog:function(e){function t(e,t){function r(){s||(s=!0,clearTimeout(a),t.call(this))}function i(){"complete"===this.readyState&&r.call(this)}function n(e,t,r){return e.addEventListener?e.addEventListener(t,r):e.attachEvent("on"+t,function(){return r.call(e,window.event)})}function o(){var t=e.contentDocument||e.contentWindow.document;0!==t.URL.indexOf("about:")?"complete"===t.readyState?r.call(t):(n(t,"DOMContentLoaded",r),n(t,"readystatechange",i)):a=setTimeout(o,1)}var a,s=!1;n(e,"load",function(){var t=e.contentDocument;t||(t=e.contentWindow,t&&(t=t.document)),t&&r.call(t)}),o()}if(!_SP_MODALDIALOG_LOADED&&(_SP_MODALDIALOG_LOADED="object"==typeof SP&&"object"==typeof SP.UI&&"function"==typeof SP.UI.ModalDialog&&"function"==typeof SP.UI.ModalDialog.showModalDialog,!_SP_MODALDIALOG_LOADED))return LoadSodByKey("sp.ui.dialog.js",function(){_SP_MODALDIALOG_LOADED=!0,$SP().showModalDialog(e)}),this;var r,i,n=this;e.id=(e.id||"").replace(/\W+/g,""),e.id=e.id||(new Date).getTime();var o="sp_frame_"+e.id;e.html&&"string"==typeof e.html&&(i=document.createElement("div"),i.style.padding="10px",i.style.display="inline-block",i.className="sp-showModalDialog",i.id="content_"+o,i.innerHTML=e.html,e.html=i),"calculated"!==e.width&&"calculated"!==e.height||(r=n._getPageSize(),"calculated"===e.width&&(e.width=r.vw.width,e.width>768&&(e.width=2*e.width/3)),"calculated"===e.height&&(e.height=r.vw.height,e.height>576&&(e.height=90*e.height/100))),"full"!==e.width&&"full"!==e.height||(r=n._getPageSize(),"full"===e.width&&(e.width=r.vw.width),"full"===e.height&&(e.height=r.vw.height)),e.wait=e.wait===!0,e.closePrevious=e.closePrevious===!0,e.previousClose===!0&&(e.closePrevious=!0),e.closePrevious&&n.closeModalDialog(),e.showClose===!1&&(e.dialogReturnValueCallback||e.callback)&&(e.showClose=!0,e.hideClose=!0);var a=e.dialogReturnValueCallback||e.callback||function(){};e.dialogReturnValueCallback=function(e,t){var r,i;if("object"==typeof e&&"undefined"!=typeof e.type&&"closeModalDialog"===e.type){var n=e;e=n.dialogResult,t=n.returnValue,r=n.id}if(r)for(var o=0;o iframe"),s=a[a.length-1],l=0;i.document.querySelectorAll('style[id^="style_sp_frame"]');if(s.setAttribute("id",n),"undefined"==typeof i._SP_MODALDIALOG&&(i._SP_MODALDIALOG=[]),i._SP_MODALDIALOG.push({id:n,modal:r,zIndex:s.style.zIndex,options:e,type:"modalDialog"}),SPArrayForEach(i._SP_MODALDIALOG,function(e){e.zIndex>l&&(l=e.zIndex)}),l--,i.document.body.insertAdjacentHTML("beforeend",'"),e.hideClose===!0){var u=s.nextSibling.querySelector(".ms-dlgCloseBtn");u.parentNode.removeChild(u)}if("function"==typeof e.onload&&e.onload(),e.url&&e.onurlload&&"function"==typeof e.onurlload){var c=i.document.getElementById(n);c&&(c=c.nextSibling),c&&(c=c.querySelector("iframe")),c&&t(c,e.onurlload)}};SP.SOD.executeOrDelayUntilScriptLoaded(s,"sp.ui.dialog.js")},closeModalDialog:function(e,t){var r=function(){var r;if("object"==typeof e&&"undefined"!=typeof e.type&&"modalDialog"===e.type)r={id:e.id,dialogResult:t,returnValue:undefined,type:"closeModalDialog"},e.modal.close(r),e.options.wait&&e.options.dialogReturnValueCallback(r,t);else{if("undefined"!=typeof window.top._SP_MODALDIALOG&&(r=window.top._SP_MODALDIALOG,r.length>0))return r=r[r.length-1],r.modal.close({id:r.id,dialogResult:e,returnValue:t,type:"closeModalDialog"}),r.options.wait&&r.options.dialogReturnValueCallback(e,t),!1;SP.UI.ModalDialog.commonModalDialogClose(e,t)}};return SP.SOD.executeOrDelayUntilScriptLoaded(r,"sp.ui.dialog.js"),!1},getModalDialog:function(e){if("undefined"!=typeof window.top._SP_MODALDIALOG)for(var t=window.top._SP_MODALDIALOG,e=e.replace(/\W+/g,""),r=0;r