UNPKG

ids-enterprise

Version:

Infor Design System (IDS) Enterprise Components for the web

31 lines (30 loc) 956 kB
/** * Soho XI Controls v4.7.0-dev * Date: 09/05/2018 11:57:58 AM * Revision: * License: * * The Soho Xi Component Library (the “Runtime”) is made available to you under this Runtime License. * Infor, Inc. grants you a nonexclusive, non-transferable, non-sublicenseable, and revocable license to use * the Runtime within the Application for the sole purpose of enabling the Runtime’s functionality within the * Application. You may not, and you may not permit anyone else to, copy, modify, combine with other software, * or redistribute the Runtime. You are prohibited from removing, altering, or obscuring the above copyright * notice or this Runtime License. * * Disclaimer. You assume all responsibility and risk of use of the Runtime. The Runtime is provided "AS IS" * without warranty or condition of any kind. INFOR DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, * INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT, * AND ANY WARRANTIES OR CONDITIONS ARISING OUT OF COURSE OF DEALING OR USAGE OF TRADE. Infor is not responsible * or liable (and makes no representation or warranty) for the accuracy, content, * completeness, legality, * reliability, or availability of the Runtime. * * Limitation of Liability. IN NO EVENT WILL INFOR BE LIABLE TO YOU FOR ANY SPECIAL, INCIDENTAL, EXEMPLARY, PUNITIVE OR * CONSEQUENTIAL DAMAGES (INCLUDING LOSS OF USE, DATA, BUSINESS OR PROFITS) ARISING OUT OF OR IN CONNECTION WITH * THIS RUNTIME LICENSE, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON CONTRACT, WARRANTY, * TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, AND WHETHER OR NOT INFOR HAS BEEN * ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE. THE FOREGOING LIMITATIONS * WILL SURVIVE AND * APPLY EVEN IF ANY LIMITED REMEDY SPECIFIED IN THIS AGREEMENT IS FOUND TO HAVE FAILED OF ITS ESSENTIAL PURPOSE. * IN NO EVENT WILL INFOR’S TOTAL LIABILITY ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT OR FROM THE USE OF * OR INABILITY TO USE THE RUNTIME EXCEED $100. */ var Soho=function(e){"use strict";var t=!1;function i(e){t&&console.time(e)}function s(e){t&&console.timeEnd(e)}var n=!1;function a(e,t){n&&console&&(t||"string"!=typeof e||(t=e,e="log"),"function"!=typeof!console[e]&&(e="log"),console[e](""+t))}var r=Object.freeze({enableTimeLogging:t,logTimeStart:i,logTimeEnd:s,enableConsoleLogging:n,log:a}),o={};function l(e){return this.init(e)}function d(e,t,i){var s=$.Deferred();if(!o.isElement(e))return s.reject();if(e instanceof $&&e.length&&(e=e[0]),null==t)return s.resolve();if(isNaN(i)&&(i=0),t=Math.round(t),(i=Math.round(i))<0)return s.fail();if(0===i)return e.scrollLeft+=t,s.resolve();var n=Date.now(),a=n+i,r=e.scrollLeft,l=t;var d=e.scrollLeft;return setTimeout(function t(){if(e.scrollLeft===d){var i=Date.now(),o=function(e,t,i){if(i<=e)return 0;if(i>=t)return 1;var s=(i-e)/(t-e);return s*s*(3-2*s)}(n,a,i),c=Math.round(r+l*o);e.scrollLeft=c,i>=a?s.resolve():e.scrollLeft!==d||e.scrollLeft===c?(d=e.scrollLeft,setTimeout(t,0)):s.resolve()}else s.reject()},0),s}function c(e,t){return(void 0!==window.requestAnimationFrame?window.requestAnimationFrame:setTimeout)(e,t)}o.getAttributes=function(e){return e&&(e instanceof HTMLElement||e instanceof SVGElement)?e.attributes:{}},o.classNameExists=function(e){var t=e.className;return t&&t.length>0},o.classNameHas=function(e,t){return e.indexOf(t)>-1},o.hasClass=function(e,t){return e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className)},o.addClass=function(e,t){e.classList?e.classList.add(t):o.hasClass(e,t)||(e.className+=" "+t)},o.isElement=function(e){return!!(e instanceof HTMLElement||e instanceof SVGElement||e instanceof $&&e.length)},o.getDimensions=function(e){if(!o.isElement(e))return{};if(e instanceof $){if(!e.length)return{};e=e[0]}var t=e.getBoundingClientRect(),i={};for(var s in t)isNaN(t[s])||(i[s]=t[s]);return i},l.prototype={init:function(e){!this.element&&(e instanceof HTMLElement||e instanceof SVGElement)&&(this.element=e);var t=$(e),i=!1,s=!1,n=!1;if(t.is(".checkbox, .radio, .switch")){var a=t.next();a.is('[type="hidden"]')&&(a=a.next()),this.label=a[0],t.addClass("hide-focus").on("focusin.hide-focus",function(e){i||s||n||(t.removeClass("hide-focus"),t.triggerHandler("hidefocusremove",[e])),i=!1,s=!0,n=!1}).on("focusout.hide-focus",function(e){t.addClass("hide-focus"),n=a.is(n),i=!1,s=!1,t.triggerHandler("hidefocusadd",[e])}),a.on("mousedown.hide-focus",function(e){n=this,i=!0,t.addClass("hide-focus"),t.triggerHandler("hidefocusadd",[e])})}else t.addClass("hide-focus").on("mousedown.hide-focus touchstart.hide-focus",function(e){i=!0,t.addClass("hide-focus"),t.triggerHandler("hidefocusadd",[e])}).on("focusin.hide-focus",function(e){i||s||(t.removeClass("hide-focus"),t.triggerHandler("hidefocusremove",[e])),i=!1,s=!0}).on("focusout.hide-focus",function(e){t.addClass("hide-focus"),i=!1,s=!1,t.triggerHandler("hidefocusadd",[e])});return this},updated:function(){return this.teardown().init()},teardown:function(){this.label&&$(this.label).off("mousedown.hide-focus");return $(this.element).off(["focusin.hide-focus","focusout.hide-focus","mousedown.hide-focus","touchstart.hide-focus"].join(" ")),this}},$.fn.hideFocus=function(){return this.each(function(){var e=$.data(this,"hidefocus");e?e.updated():(e=$.data(this,"hidefocus",new l(this))).destroy=function(){this.teardown(),$.removeData(this,"hidefocus")}})},$.fn.smoothScroll=function(e,t){return d(this,e,t)};var h=Object.freeze({HideFocus:l,smoothScrollTo:d,defer:c}),u={phone:320,slim:400,phablet:610,"phone-to-tablet":767,"wide-tablet":968,"tablet-to-desktop":1280,desktop:1024,"desktop-to-extralarge":1600};function p(e,t,i){var s=void 0;return function(){for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];var o=this;s?clearTimeout(s):i&&e.apply(o,a),s=setTimeout(function(){i||e.apply(o,a),s=null},t||250)}}u.current=function(){var e=!!window.getComputedStyle&&window.getComputedStyle(document.body,":after");return e?(e.getPropertyValue("content")||"").replace(/"/g,""):""},u.isAbove=function(e){var t=u[e];return!!t&&$(window).width()>t-1},u.isBelow=function(e){var t=u[e];return!!t&&$(window).width()<t},u.compare=function(){this.last||(this.last="");var e=this.current();this.last!==e&&($("body").triggerHandler("breakpoint-change",[{previous:this.last,current:e}]),this.last=e)},u.isHidden=function(e){if(!e||!o.isElement(e))return!1;var t=e.classList;if(!t.length)return!1;if(t.contains("hidden"))return!0;var i={phonedown:"xs",phone:"sm",tablet:"md",desktop:"lg",extralarge:"xl"}[this.current()],s="hidden-"+i,n="visible-"+i+"-";return!!t.contains(s)||(t.toString().indexOf(n),!1)},$.fn.isHiddenAtBreakpoint=function(){return!!this.length&&u.isHidden($(this).first()[0])};$.fn.debouncedResize=function(e){return e?this.bind("resize",p(e)):this.trigger("debouncedResize")};var f={browser:{},os:{},rtl:"rtl"===$("html").attr("dir"),set:function(){$("html").attr("data-sohoxi-version","4.7.0-dev"),this.addBrowserClasses(),this.addGlobalResize()},addBrowserClasses:function(){var e=navigator.userAgent||navigator.vendor||window.opera,t=$("html"),i="";if(-1!==e.indexOf("Safari")&&-1===e.indexOf("Chrome")&&-1===e.indexOf("Android")&&(i+="is-safari ",this.browser.name="safari"),-1!==e.indexOf("Chrome")&&(i+="is-chrome ",this.browser.name="chrome"),-1!==e.indexOf("Mac OS X")&&(i+="is-mac ",this.os.name="Mac OS X"),e.indexOf("Firefox")>0&&(i+="is-firefox ",this.browser.name="firefox"),e.match(/Edge\//)&&(i+="ie ie-edge ",this.browser.name="edge"),e.match(/Trident/)&&(i+="ie ",this.browser.name="ie"),(navigator.appVersion.indexOf("MSIE 8.0")>-1||e.indexOf("MSIE 8.0")>-1||8===document.documentMode)&&(i+="ie8 ",this.browser.version="8"),navigator.appVersion.indexOf("MSIE 9.0")>-1&&(i+="ie9 ",this.browser.version="9"),navigator.appVersion.indexOf("MSIE 10.0")>-1?(i+="ie10 ",this.browser.version="10"):e.match(/Trident\/7\./)&&(i+="ie11 ",this.browser.version="11"),/iPhone|iPod|iPad/.test(e)){i+="ios ",this.os.name="ios";for(var s=["iPod","iPad","iPhone"],n=0;n<s.length;n++)new RegExp(s[n]).test(e)&&(i+=s[n].toLowerCase()+" ",this.device=s[n])}/Android/.test(e)&&(i+="android ",this.os.name="android"),t.addClass(i)},addGlobalResize:function(){$(window).debouncedResize(function(){$("body").triggerHandler("resize",[window]),u.compare()}),$(window).on("orientationchange load",function(){return u.compare()})}};f.set();var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m=function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)};function v(e){return $.expr.filters.visible(e)&&!$(e).parents().addBack().filter(function(){return"hidden"===$.css(this,"visibility")}).length}$.fn.bindFirst=function(e,t){this.on(e,t),this.each(function(){var t=$._data(this,"events")[e.split(".")[0]],i=t.pop();t.splice(0,0,i)})},e.uniqueIdCount=0,$.fn.uniqueId=function(t,i,s){var n=$(this).attr("id");if(n&&$("#"+n).length<2)return n;s=s?"-"+s:"";var a=(i=i?i+"-":"")+(t=t||$(this).attr("class"))+e.uniqueIdCount+s;return e.uniqueIdCount+=1,a},$.fn.cssPropSupport=function(e){if(!e)return null;var t=$("<div></div>")[0],i=e.toString(),s=["Moz","Webkit","O","ms"],n=i.charAt(0).toUpperCase()+i.substr(1);if(e in t.style)return $(t).remove(),e;for(var a=0;a<s.length;a++){var r=s[a]+n;if(r in t.style)return $(t).remove(),r}return $(t).remove(),null},$.fn.transitionEndName=function(){return{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",MSTransition:"msTransitionEnd",OTransition:"oTransitionEnd",transition:"transitionend"}[$.fn.cssPropSupport("transition")]||null},$.extend($.expr[":"],{focusable:function(e){return function(e){var t=void 0,i=void 0,s=void 0,n=e.nodeName.toLowerCase(),a=!isNaN($.attr(e,"tabindex"));return"area"===n?(i=(t=e.parentNode).name,!(!e.href||!i||"map"!==t.nodeName.toLowerCase())&&!!(s=$("img[usemap=#"+i+"]")[0])&&v(s)):!!v(e)&&(/input|select|textarea|button|object/.test(n)?!e.disabled:"a"===n&&void 0!==e.href||a)}(e,isNaN($.attr(e,"tabindex")))}}),$.fn.listEvents=function(){var e={};return this.each(function(){e=$._data(this,"events")}),e};var b={};function y(e){return"object"===(void 0===e?"undefined":g(e))||"function"==typeof e}function w(e){return"function"==typeof e?e():e}b.parseSettings=function(e,t){var i={};if(!e||!(e instanceof HTMLElement)&&!(e instanceof $)||e instanceof $&&!e.length)return i;e instanceof $&&(e=e[0]),t=t||"data-options";var s,n,a=e.getAttribute(t);if(!a||"string"!=typeof a||-1===a.indexOf("{"))return i;function r(e){return e.replace(/'/g,'"')}try{i=JSON.parse(r(a))}catch(e){i=JSON.parse((n=/({|,)(?:\s*)(?:')?([A-Za-z_$\.][A-Za-z0-9_ \-\.$]*)(?:')?(?:\s*):/g,s=(s=a).replace(n,'$1"$2":'),n=/:(?:\s*)(?!(true|false|null|undefined))([A-Za-z_$\.#][A-Za-z0-9_ \-\.$]*)/g,s=r(s=s.replace(n,':"$2"'))))}return i},b.parseOptions=b.parseSettings,$.fn.parseOptions=function(e,t){var i=[],s=this;return e instanceof HTMLElement||e instanceof SVGElement||e instanceof $?s=$(e):(t=e,e=void 0),s.each(function(e,s){i.push({element:this,options:b.parseOptions(s,t)})}),1===i.length?i[0].options:i},$.fn.timer=function(e,t){var i=$(this),s=10,n=void 0,a=0;function r(){n=setInterval(function(){a+=s,i.triggerHandler("update",[{counter:a}]),a>t&&(i.triggerHandler("timeout"),e.apply(arguments),clearInterval(n),a=0)},s)}return r(),{event:this,cancel:function(){i.triggerHandler("cancel"),clearInterval(n),a=0},pause:function(){i.triggerHandler("pause"),clearInterval(n)},resume:function(){i.triggerHandler("resume"),r()}}},$.copyToClipboard=function(e){if(window.clipboardData&&window.clipboardData.setData)return window.clipboardData.setData("Text",e);if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var t=document.createElement("textarea");t.textContent=e,t.style.position="fixed",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}catch(e){return!1}finally{document.body.removeChild(t)}}},$.escapeHTML=function(e){var t=e;return"string"==typeof e&&(t=(t=t.replace(/&/g,"&amp;")).replace(/</g,"&lt;").replace(/>/g,"&gt;")),t},$.unescapeHTML=function(e){var t=e;return"string"==typeof e&&(t=(t=t.replace(/&lt;/g,"<").replace(/&gt;/g,">")).replace(/&amp;/g,"&")),t},$.sanitizeHTML=function(e){var t=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/g,"");return t=t.replace(/<[^>]+/g,function(e){return e.replace(/(\/|\s)on\w+=(\'|")?[^"]*(\'|")?/g,"")})},$.fn.clearable=function(){var e=this;this.element=$(this),this.xButton=$.createIconElement({classes:"close is-empty",icon:"close"}).icon(),this.checkContents=function(){var t=e.element.val();t&&t.length?this.xButton.removeClass("is-empty"):this.xButton.addClass("is-empty"),this.element.trigger("contents-checked")},this.xButton.insertAfter(e.element),this.xButton.off().on("click.clearable",function(){e.element.val("").trigger("change").focus().trigger("cleared"),e.checkContents()}),this.element.on("change.clearable, blur.clearable, keyup.clearable",function(){e.checkContents()}),this.checkContents()},b.actualChar=function(e){var t=e.which,i={188:"44",190:"46",191:"47",192:"96",220:"92",222:"39",221:"93",219:"91",173:"45",187:"61",186:"59",189:"45"},s={96:"~",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",48:")",45:"_",61:"+",91:"{",93:"}",92:"|",59:":",37:"%",38:"&",39:'"',44:"<",46:">",47:"?"};return Object.prototype.hasOwnProperty.call(i,t)&&(t=i[t]),t>=96&&t<=105&&(t-=48),!e.shiftKey&&t>=65&&t<=90?String.fromCharCode(t+32):e.shiftKey&&Object.prototype.hasOwnProperty.call(s,t)?s[t]:String.fromCharCode(t)},$.actualChar=function(e){return b.actualChar(e)},b.equals=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},o.convertToHTMLElement=function(e){return e instanceof HTMLElement?e:e instanceof $?e=e.length?e[0]:void 0:void 0},b.extend=$.extend,b.fixSVGIcons=function(e){if(("ie"===f.browser.name||"11"===f.browser.version)&&void 0!==e){if(e instanceof $){if(!e.length)return;e=e[0]}setTimeout(function(){for(var t=e.getElementsByTagName("use"),i=0;i<t.length;i++){var s=t[i].getAttribute("xlink:href");t[i].setAttribute("xlink:href","x"),t[i].setAttribute("xlink:href",s)}},1)}},b.getViewportSize=function(){return{width:Math.max(document.documentElement.clientWidth,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight,window.innerHeight||0)}},b.getContainerScrollDistance=function(e){if(!o.isElement(e))return[];var t=[];return $(e).parents([".scrollable",".scrollable-x",".scrollable-y",".modal",".card-content",".widget-content",".tab-panel",".datagrid-content"].join(", ")).each(function(){t.push({element:this,left:this.scrollLeft,top:this.scrollTop})}),document.body.classList.contains("no-scroll")||t.push({element:document.body,left:document.body.scrollLeft,top:document.body.scrollTop}),t},b.getHiddenSize=function(e,t){var i={dims:{width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},parentElement:void 0,includeMargin:!1};if(!o.isElement(e))return i.dims;e=$(e),t=$.extend({},i,t);var s=o.isElement(t.parentElement);s&&(e=e.clone().appendTo(t.parentElement));var n=t.dims,a=e.parents().add(e),r={transition:"none",webkitTransition:"none",mozTransition:"none",msTransition:"none",visibility:"hidden",display:"block"},l=[];return a.each(function(){var e=this,t={};Object.keys(r).forEach(function(i){e.style[i]&&(t[i]=e.style[i],e.style[i]=r[i])}),l.push(t)}),n.padding={bottom:e.css("padding-bottom"),left:e.css("padding-left"),right:e.css("padding-right"),top:e.css("padding-top")},n.width=e.width(),n.outerWidth=e.outerWidth(t.includeMargin),n.innerWidth=e.innerWidth(),n.scrollWidth=e[0].scrollWidth,n.height=e.height(),n.innerHeight=e.innerHeight(),n.outerHeight=e.outerHeight(t.includeMargin),n.scrollHeight=e[0].scrollHeight,a.each(function(e){var t=this,i=l[e];Object.keys(r).forEach(function(e){i[e]&&(t.style[e]=i[e])})}),s&&e.remove(),n},$.fn.getHiddenSize=function(e){return b.getHiddenSize(this,e)},b.isString=function(e){return"string"==typeof e||e instanceof String},b.isNumber=function(e){return"number"==typeof e&&void 0===e.length&&!isNaN(e)},b.safeSetSelection=function(e,t,i){t&&void 0===i&&(i=t),document.activeElement===e&&("android"===f.os.name?c(function(){e.setSelectionRange(t,i,"none")},0):e.setSelectionRange(t,i,"none"))},b.mergeSettings=function(e,t,i){return t&&y(t)||(t=y(i)?i:{}),b.extend(!0,{},w(i||{}),w(t),void 0!==e?b.parseSettings(e):{})},b.isHTML=function(e){return/(<([^>]+)>)/i.test(e)};var x={convertDelayToFPS:function(e){if(isNaN(e))throw new Error("provided delay value is not a number");return e/16.7},convertFPSToDelay:function(e){if(isNaN(e))throw new Error("provided delay value is not a number");return 16.7*e},isFinite:function(e){return"number"==typeof e&&(e==e&&e!==1/0&&e!==-1/0)}};b.forEach=function(e,t,i){for(var s=0;s<e.length;s++)t.call(i,e[s],s,e)};var C="";"object"===g(window.SohoConfig)&&"string"==typeof window.SohoConfig.culturesPath&&(C=window.SohoConfig.culturesPath);var k={currentLocale:{name:"",data:{}},cultures:{},culturesPath:C,updateLang:function(){var e=$("html");e.attr("lang",this.currentLocale.name),this.isRTL()?e.attr("dir","rtl"):e.removeAttr("dir")},getCulturesPath:function(){if(!this.culturesPath)for(var e=document.getElementsByTagName("script"),t=0;t<e.length;t++){var i=e[t].src,s=i.indexOf("?");if(""!==i&&s>-1&&(i=i.substr(0,s)),"sohoxi-script"===e[t].id)return i.substring(0,i.lastIndexOf("/"))+"/";i.indexOf("sohoxi.min.js")>-1&&(this.culturesPath=i.replace("sohoxi.min.js","")+"cultures/"),i.indexOf("sohoxi.js")>-1&&(this.culturesPath=i.replace("sohoxi.js","")+"cultures/")}return this.culturesPath},cultureInHead:function(){for(var e=!1,t=document.getElementsByTagName("script"),i=0;i<t.length;i++){t[i].src.indexOf("cultures")>-1&&(e=!0)}return e},defaultLocale:function(e){var t=e.split("-")[0];return-1===["af-ZA","ar-EG","ar-SA","bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-AU","en-GB","en-IN","en-NZ","en-US","en-ZA","es-AR","es-ES","es-MX","es-US","et-EE","fi-FI","fr-CA","fr-FR","he-IL","hi-IN","hr-HR","hu-HU","id-ID","it-IT","ja-JP","ko-KR","lt-LT","lv-LV","ms-bn","ms-my","nb-NO","nl-NL","no-NO","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sl-SI","sv-SE","th-TH","tr-TR","uk-UA","vi-VN","zh-CN","zh-TW"].indexOf(e)?(e=[{lang:"af",default:"af-ZA"},{lang:"ar",default:"af-EG"},{lang:"bg",default:"bg-BG"},{lang:"cs",default:"cs-CZ"},{lang:"de",default:"de-DE"},{lang:"el",default:"el-GR"},{lang:"en",default:"en-US"},{lang:"es",default:"es-ES"},{lang:"et",default:"et-ET"},{lang:"fi",default:"fi-FI"},{lang:"fr",default:"fr-FR"},{lang:"he",default:"he-IL"},{lang:"hi",default:"hi-IN"},{lang:"hr",default:"hr-HR"},{lang:"hu",default:"hu-HU"},{lang:"id",default:"id-ID"},{lang:"it",default:"it-IT"},{lang:"iw",default:"he-IL"},{lang:"ja",default:"ja-JP"},{lang:"ko",default:"ko-KR"},{lang:"lt",default:"lt-LT"},{lang:"ms",default:"ms-bn"},{lang:"nb",default:"nb-NO"},{lang:"nl",default:"nl-NL"},{lang:"no",default:"no-NO"},{lang:"pl",default:"pl-PL"},{lang:"pt",default:"pt-PT"},{lang:"ro",default:"ro-RO"},{lang:"ru",default:"ru-RU"},{lang:"sl",default:"sl-SI"},{lang:"sv",default:"sv-SE"},{lang:"th",default:"th-TH"},{lang:"tr",default:"tr-TR"},{lang:"uk",default:"uk-UA"},{lang:"vi",default:"vi-VN"},{lang:"zh",default:"zh-CN"}].filter(function(e){return e.lang===t}))&&e[0]?e[0].default:"":e},addCulture:function(e,t){this.cultures[e]=t},appendLocaleScript:function(e,t){var i=this,s=document.createElement("script");s.src=this.getCulturesPath()+e+".js",s.onload=function(){t&&i.setCurrentLocale(e,i.cultures[e]),i.addCulture(e,i.currentLocale.data),i.dff.resolve(i.currentLocale.name)},s.onerror=function(){i.dff.reject()},"object"===g(window.SohoConfig)&&"string"==typeof window.SohoConfig.nonce&&s.setAttribute("nonce",window.SohoConfig.nonce),document.head.appendChild(s)},set:function(e){var t=this;return this.dff=$.Deferred(),"in-ID"===e&&(e="id-ID"),"iw"===e.substr(0,2)&&(e="he-IL"),""===(e=this.defaultLocale(e))?(this.dff.resolve(),this.dff.promise()):(e&&!this.cultures[e]&&this.currentLocale.name!==e&&(this.setCurrentLocale(e),this.appendLocaleScript(e,!0)),setTimeout(function(){e&&"en-US"!==e&&!t.cultures["en-US"]&&t.appendLocaleScript("en-US",!1)},0),e&&this.currentLocale.data&&this.currentLocale.dataName===e&&this.dff.resolve(this.currentLocale.name),this.setCurrentLocale(e,this.cultures[e]),this.cultures[e]&&this.cultureInHead()&&this.dff.resolve(this.currentLocale.name),this.dff.promise())},setCurrentLocale:function(e,t){this.currentLocale.name=e,t&&(this.currentLocale.data=t,this.currentLocale.dataName=e,this.updateLang())},formatDate:function(e,t){if(t||(t={date:"short"}),e){if(!(e instanceof Date)&&"string"==typeof e&&e.indexOf("Z")>-1)e=new Date(e);if(!(e instanceof Date)&&"string"==typeof e&&e.indexOf("T")>-1)e=new Date(e);if(!(e instanceof Date)&&"string"==typeof e){var i=k.parseDate(e,t);isNaN(i)&&"datetime"===t.date&&"-"===e.substr(4,1)&&"-"===e.substr(7,1)&&(i=new Date(e.substr(0,4),e.substr(5,2)-1,e.substr(8,2),e.substr(11,2),e.substr(14,2),e.substr(17,2))),e=i}if(!(e instanceof Date)&&"number"==typeof e)e=new Date(e);var s=this.currentLocale.data,n=void 0,a="",r=s.calendars?s.calendars[0]:null;t.pattern&&(n=t.pattern),t.date&&(n=r.dateFormat[t.date]);var o=e.getDate(),l=e.getMonth(),d=e.getFullYear(),c=e.getMinutes(),h=e.getHours(),u=e.getSeconds();return(a=(a=(a=(a=(a=(n=(n=(n=n.replace("ngày","nnnn")).replace("tháng","t1áng")).replace("den","nnn")).replace("dd",this.pad(o,2))).replace("d",o)).replace("yyyy",d)).replace("yy",d.toString().substr(2))).replace("y",d)).indexOf(" a")>-1&&0===h&&(a=(a=a.replace("hh",12)).replace("h",12)),a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace("hh",h>12?this.pad(h-12,2):this.pad(h,2))).replace("h",h>12?h-12:h)).replace("HH",this.pad(h,2))).replace("H",h)).replace("mm",this.pad(c,2))).replace("ss",this.pad(u,2))).replace("SSS",this.pad(e.getMilliseconds(),0))).replace("MMMM",r?r.months.wide[l]:null)).replace("MMM",r?r.months.abbreviated[l]:null),-1===n.indexOf("MMM")&&(a=(a=a.replace("MM",this.pad(l+1,2))).replace("M",l+1)),r&&(a=(a=a.replace(" a"," "+(h>=12?r.dayPeriods[1]:r.dayPeriods[0]))).replace("EEEE",r.days.wide[e.getDay()])),r&&(a=a.replace("EEEE",r.days.wide[e.getDay()])),(a=(a=(a=a.replace("nnnn","ngày")).replace("t1áng","tháng")).replace("nnn","den")).trim()}},dateToUTC:function(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()))},isValidDate:function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},parseDate:function(e,t,i){var s=this.calendar(),n=e;if(e){t||(t=this.calendar().dateFormat.short),t.pattern&&(t=t.pattern),"object"===(void 0===t?"undefined":g(t))&&t.date&&(t=this.calendar().dateFormat[t.date]);var a=void 0,r=void 0,o={},l=t.toLowerCase().indexOf("h")>-1,d=e.toLowerCase().indexOf("z")>-1,c=void 0,h=void 0;if(l&&(t=t.replace(/[T\s:.-]/g,"/").replace(/z/i,""),e=e.replace(/[T\s:.-]/g,"/").replace(/z/i,"")),"Mdyyyy"!==t&&"dMyyyy"!==t||(e=(e=e.substr(0,e.length-4)+"/"+e.substr(e.length-4,e.length)).substr(0,e.indexOf("/")/2)+"/"+e.substr(e.indexOf("/")/2)),"Mdyyyy"===t&&(t="M/d/yyyy"),"dMyyyy"===t&&(t="d/M/yyyy"),-1!==t.indexOf(" ")&&(t=t.replace(/[\s:.]/g,"/"),e=e.replace(/[\s:.]/g,"/")),-1===t.indexOf(" ")&&-1===t.indexOf(".")&&-1===t.indexOf("/")&&-1===t.indexOf("-")){var u=t[0],p="",f="";for(c=0,h=t.length;c<h;c++)p+=t[c]!==u?"/"+t[c]:t[c],f+=t[c]!==u?"/"+e[c]:e[c],c>1&&(u=t[c]);e=f,t=p}a=t.split("/"),r=e.split("/"),1===a.length&&(a=t.split(".")),1===r.length&&(r=e.split(".")),1===a.length&&(a=t.split("-")),1===r.length&&(r=e.split("-")),1===a.length&&(a=t.split(" ")),1===r.length&&(r=e.split(" "));var m=this.getDatePart(a,r,"M","MM","MMM"),v=this.getDatePart(a,r,"yy","yyyy"),b=!1;for(c=0,h=r.length;c<h;c++){var y=""+a[c],w=r[c],x=parseInt(w,10);b||(b=y.toLowerCase().indexOf("d")>-1);var C=void 0,k=void 0,T=void 0;switch(y){case"d":if(C=new Date(v,m,0).getDate(),x<1||x>31||x>C)return;o.day=w;break;case"dd":if(x<1||x>31||x<10&&"0"!==w.substr(0,1))return;o.day=w;break;case"M":if(x<1||x>12)return;o.month=w-1;break;case"MM":if(x<1||x>12||x<10&&"0"!==w.substr(0,1))return;o.month=w-1;break;case"MMM":k=this.calendar().months.abbreviated;for(var S=0;S<k.length;S++)n.indexOf(k[S])>-1&&(o.month=S);break;case"MMMM":T=this.calendar().months.wide;for(var I=0;I<T.length;I++)n.indexOf(T[I])>-1&&(o.month=I);break;case"yy":o.year=this.twoToFourDigitYear(w);break;case"yyyy":o.year=2===w.length?this.twoToFourDigitYear(w):w;break;case"h":if(x<0||x>12)return;o.h=w;break;case"hh":if(x<0||x>12)return;o.h=1===w.length?"0"+w:w;break;case"H":if(x<0||x>24)return;o.h=w;break;case"HH":if(x<0||x>24)return;o.h=1===w.length?"0"+w:w;break;case"ss":if(x<0||x>60){o.ss=0;break}o.ss=w;break;case"SSS":o.ms=w;break;case"mm":if(x<0||x>60){o.mm=0;break}o.mm=w;break;case"a":w.toLowerCase()!==s.dayPeriods[0]&&w.toUpperCase()!==s.dayPeriods[0]||(o.a="AM",o.h&&(12!==o.h&&"12"!==o.h||(o.h=0))),w.toLowerCase()!==s.dayPeriods[1]&&w.toUpperCase()!==s.dayPeriods[1]||(o.a="PM",o.h&&o.h<12&&(o.h=parseInt(o.h,10)+12))}}if(o.return=void 0,o.leapYear=o.year%4==0&&o.year%100!=0||o.year%400==0,!l||o.h||o.mm){if(!o.year&&0!==o.year&&!i){for(o.isUndefindedYear=!0,c=0,h=a.length;c<h;c++)if(a[c].indexOf("y")>-1&&void 0!==r[c]){o.isUndefindedYear=!1;break}o.isUndefindedYear?o.year=(new Date).getFullYear():delete o.year}if(o.year&&2===o.year.length&&(o.year="20"+o.year),o.year=$.trim(o.year),o.day=$.trim(o.day),(""===o.year||o.year&&2!==(""+o.year).length&&4!==(""+o.year).length)&&delete o.year,!o.month&&0!==o.month&&!i){for(o.isUndefindedMonth=!0,c=0,h=a.length;c<h;c++)if(a[c].indexOf("M")>-1&&void 0!==r[c]){o.isUndefindedMonth=!1;break}o.isUndefindedMonth&&(o.month=(new Date).getMonth())}if(!(o.day||0===o.day||i&&b)){for(o.isUndefindedDay=!0,c=0,h=a.length;c<h;c++)if(a[c].indexOf("d")>-1&&void 0!==r[c]){o.isUndefindedDay=!1;break}o.isUndefindedDay?o.day=1:delete o.day}return l?d?(void 0!==o.h&&(o.return=new Date(Date.UTC(o.year,o.month,o.day,o.h,o.mm))),void 0!==o.ss&&(o.return=new Date(Date.UTC(o.year,o.month,o.day,o.h,o.mm,o.ss))),void 0!==o.ms&&(o.return=new Date(Date.UTC(o.year,o.month,o.day,o.h,o.mm,o.ss,o.ms)))):(void 0!==o.h&&(o.return=new Date(o.year,o.month,o.day,o.h,o.mm)),void 0!==o.ss&&(o.return=new Date(o.year,o.month,o.day,o.h,o.mm,o.ss)),void 0!==o.ms&&(o.return=new Date(o.year,o.month,o.day,o.h,o.mm,o.ss,o.ms))):o.return=new Date(o.year,o.month,o.day),this.isValidDate(o.return)?o.return:void 0}}},twoToFourDigitYear:function(e){return parseInt((e>39?"19":"20")+e,10)},getDatePart:function(e,t,i,s,n){var a=0;return $.each(t,function(r){i!==e[r]&&s!==e[r]&&n!==e[r]||(a=t[r])}),a},formatNumber:function(e,t){var i=void 0,s=void 0,n=void 0,a=t&&t.decimal?t.decimal:this.numbers().decimal,r=t&&void 0!==t.group?t.group:this.numbers().group,o=t&&void 0!==t.minimumFractionDigits?t.minimumFractionDigits:t&&t.style&&"currency"===t.style?2:t&&t.style&&"percent"===t.style?0:2,l=t&&void 0!==t.maximumFractionDigits?t.maximumFractionDigits:t&&t.style&&("currency"===t.style||"percent"===t.style)?2:t&&t.minimumFractionDigits?t.minimumFractionDigits:3;if(null!=e&&""!==e){if(t&&"integer"===t.style&&(l=0,o=0),t&&"currency"===t.style){var d=t&&t.currencySign?t.currencySign:this.currentLocale.data.currencySign;s=(t&&t.currencyFormat?t.currencyFormat:this.currentLocale.data.currencyFormat).replace("¤",d)}if(t&&"percent"===t.style){var c=this.currentLocale.data.numbers.percentSign;n=(n=this.currentLocale.data.numbers.percentFormat).replace("¤",c)}"string"==typeof e&&("."!==a&&(e=e.replace(a,".")),e=k.parseNumber(e)),t&&"percent"===t.style&&(e=(100*e).toFixed(o));var h=this.truncateDecimals(e,o,l,t&&t.round).split(".");h[0]=h[0].replace(/\B(?=(\d{3})+(?!\d))/g,r),i=h.join(a);var u=this.currentLocale.data&&this.currentLocale.data.numbers&&this.currentLocale.data.numbers.minusSign?this.currentLocale.data.numbers.minusSign:"-",p=i.indexOf(u)>-1;if(i=i.replace(u,""),0===o&&(i=(i=i.replace(/(\.[0-9]*?)0+$/,"$1")).replace(/\.$/,"")),0===o&&"."!==a&&(i=(i=i.replace(/(\,[0-9]*?)0+$/,"$1")).replace(/\,$/,"")),o>0){var f=new RegExp("(\\..{"+o+"}[0-9]*?)0+$");i=(i=i.replace(f,"$1")).replace(/\.$/,"")}return t&&"currency"===t.style&&(i=(i=s.replace("#,##0.00",i)).replace("#,##0.00",i)),t&&"percent"===t.style&&(i=(i=n.replace("#,##0",i)).replace("#.##0",i)),p&&(i=u+i),i}},decimalPlaces:function(e){var t=/^-?[0-9]+\.([0-9]+)$/.exec(e);return null===t?0:t[1].length},truncateDecimals:function(e,t,i,s){var n=Math.pow(10,i),a=e*n,r=void 0,o=this.decimalPlaces(e);return(e.toString().length-o-1>=10||o===t&&o===i||o<i)&&(a=e*(n=Math.pow(100,i))),r=Math[a<0?"ceil":"floor"](a),s&&o>=i&&a>0&&(r=Math.round(a)),s&&o<=i&&o>0&&(r=Math.round(a)),o<i&&o>0&&(r=Math.floor(a),i=Math.max(o,t)),(r/n).toFixed(i)},parseNumber:function(e){var t=this.currentLocale.data.numbers,i=void 0;if(!(i=e))return NaN;"number"==typeof e&&(i=i.toString());var s=t?t.group:",",n=t?t.decimal:".",a=t?t.percentSign:"%",r=this.currentLocale.data.currencySign||"$";return i=(i=(i=(i=(i=i.replace(new RegExp("\\"+s,"g"),"")).replace(n,".")).replace(a,"")).replace(r,"")).replace(" ",""),parseFloat(i)},translate:function(e,t){return void 0===this.currentLocale.data||void 0===this.currentLocale.data.messages?t?void 0:"["+e+"]":void 0===this.currentLocale.data.messages[e]?this.cultures["en-US"]&&void 0!==this.cultures["en-US"].messages[e]?this.cultures["en-US"].messages[e].value:t?void 0:"["+e+"]":this.currentLocale.data.messages[e].value},translateDayPeriod:function(e){return/am|pm|AM|PM/i.test(e)?k.calendar().dayPeriods[/AM|am/i.test(e)?0:1]:e},calendar:function(){return this.currentLocale.data.calendars?this.currentLocale.data.calendars[0]:{dateFormat:{separator:"/",timeSeparator:":",short:"M/d/yyyy",medium:"MMM d, yyyy",long:"MMMM d, yyyy",full:"EEEE, MMMM d, y",month:"MMMM d",year:"MMMM yyyy",timestamp:"h:mm:ss a",datetime:"M/d/yyyy h:mm a"},timeFormat:"HH:mm:ss"}},getCalendar:function(e){if(this.currentLocale.data.calendars)for(var t=0;t<this.currentLocale.data.calendars.length;t++){var i=this.currentLocale.data.calendars[t];if(i.name===e)return i}return[{dateFormat:"yyyy-MM-dd",timeFormat:"HH:mm:ss"}]},numbers:function(){return this.currentLocale.data.numbers?this.currentLocale.data.numbers:{percentSign:"%",percentFormat:"#,##0 %",minusSign:"-",decimal:".",group:","}},pad:function(e,t,i){return i=i||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(i)+e},isRTL:function(){return"right-to-left"===this.currentLocale.data.direction},toUpperCase:function(e){return"function"==typeof this.currentLocale.data.toUpperCase?this.currentLocale.data.toUpperCase(e):e.toLocaleUpperCase()},toLowerCase:function(e){return"function"==typeof this.currentLocale.data.toLowerCase?this.currentLocale.data.toLowerCase(e):e.toString().toLocaleLowerCase()},capitalize:function(e){return this.toUpperCase(e.charAt(0))+e.slice(1)},capitalizeWords:function(e){for(var t=e.split(" "),i=0;i<t.length;i++)t[i]=this.capitalize(t[i]);return t.join(" ")},flipIconsHorizontally:function(){var e=["attach","bottom-aligned","bullet-list","cancel","cart","collapse-app-tray","cut","document","drilldown","duplicate","expand-app-tray","export","first-page","folder","import","last-page","launch","left-align","left-text-align","left-arrow","new-document","next-page","number-list","paste","previous-page","quote","redo","refresh","right-align","right-arrow","right-text-align","save","search-folder","search-list","search","send","tack","tree-collapse","tree-expand","undo","unlocked","add-grid-record","add-grid-row","additional-help","bubble","cascade","change-font","clear-screen","script","clockwise-90","close-cancel","close-save","contacts","copy-from","copy-mail","copy-url","counter-clockwise-90","create-report","delete-grid-record","delete-grid-row","display","employee-directory","export-2","export-to-pdf","generate-key","get-more-rows","group-selection","headphones","help","helper-list-select","history","invoice-released","language","logout","key","lasso","line-bar-chart","line-chart","new-expense-report","new-payment-request","new-time-sheet","new-travel-plan","no-attachment","no-comment","no-filter","overlay-line","pdf-file","phone","payment-request","pie-chart","queries","quick-access","refresh-current","restore-user","run-quick-access","save-close","save-new","search-results-history","select","send-submit","show-last-x-days","special-item","stacked","timesheet","unsubscribe","update-preview","zoom-100","zoom-in","zoom-out","caret-left","caret-right"];$("svg").each(function(){var t=$(this).getIconName();t&&-1!==$.inArray(t,e)&&$(this).addClass("icon-rtl-rotate")})}};$(function(){setTimeout(function(){!k||k.cultureInHead()||k.currentLocale.name||k.set("en-US"),k&&k.isRTL()&&k.flipIconsHorizontally()},50)}),$.fn.highlight=function(e){var t=this;return this.length&&e&&e.length?this.each(function(){!function e(t,i){var s=0,n=void 0,a=void 0,r=void 0,o=void 0;if(3===t.nodeType)n=t.data.toUpperCase().indexOf(i),(n-=t.data.substr(0,n).toUpperCase().length-t.data.substr(0,n).length)>=0&&((a=document.createElement("mark")).className="highlight",o=(r=t.splitText(n)).cloneNode(!0),a.appendChild(o),r.parentNode.replaceChild(a,r),s=1);else if(1===t.nodeType&&t.childNodes&&!/(script|style)/i.test(t.tagName))for(var l=0;l<t.childNodes.length;++l)l+=e(t.childNodes[l],i);return s}(t,e.toUpperCase())}):this},$.fn.unhighlight=function(){var e=this;return this.find("mark.highlight").each(function(){var t=e.parentNode;t.replaceChild(e.firstChild,e),t.normalize()}).end()};var T="arrange",S={handle:null,itemsSelector:null,connectWith:!1,isVisualItems:!1,placeholder:null,placeholderCssClass:"arrange-placeholder"};function I(e,t){this.settings=b.mergeSettings(e,t,S),this.element=$(e),i(T),this.init(),s(T)}I.prototype={init:function(){this.isTouch=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.handleEvents()},getElementByTouchInList:function(e,t,i){for(var s=!1,n=$(e),a=0,r=n.length;a<r;a++){var o=$(n[a]),l=o.offset();t<=l.left||t>=l.left+o.outerWidth()||i<=l.top||i>=l.top+o.outerHeight()||(s=o)}return s},dragTouchElement:function(e,t){var i=e.originalEvent.changedTouches[0];t[0].style.top=i.pageY-this.offset.y+"px",t[0].style.left=i.pageX-this.offset.x+"px"},unbind:function(){return this.items.removeClass("draggable").removeAttr("draggable").off("selectstart.arrange "+this.dragStart+" "+this.dragEnd+" "+this.dragWhileDragging),$(this.handle,this.items).removeClass("draggable").off("mousedown.arrange mouseup.arrange touchstart.arrange touchend.arrange"),this},updated:function(e){return void 0!==e&&(this.settings=b.mergeSettings(this.element,e,S)),this.unbind().init()},destroy:function(){this.unbind(),$.removeData(this.element[0],T)},getVisualIndex:function(e){var t=this.settings,i=null;if(t.isVisualItems){var s=this.element.children().not('[data-arrange-exclude="true"]');t.itemsSelector&&(s=$(t.itemsSelector,this.element).not('[data-arrange-exclude="true"]')),i=s.index(e)}return i},handleEvents:function(){var e=this,t=this.settings,i=void 0,s=void 0,n={},a=this.element.children().not('[data-arrange-exclude="true"]'),r=$("<"+(/^(ul|ol)$/i.test(this.element[0].tagName)?"li":"div")+">");t.itemsSelector&&(a=$(t.itemsSelector,this.element).not('[data-arrange-exclude="true"]'),r=$("<"+a.first()[0].tagName+" />")),t.placeholder&&(r=$(t.placeholder)),this.dragStart="dragstart.arrange touchstart.arrange gesturestart.arrange",this.dragEnd="dragend.arrange touchend.arrange touchcancel.arrange gestureend.arrange",this.dragWhileDragging="dragover.arrange dragenter.arrange drop.arrange touchmove.arrange gesturechange.arrange",this.handle=t.handle||this.element.attr("data-arrange-handle"),this.connectWith=this.element.attr("data-arrange-connectWith"),this.placeholders=r,this.isTouch||this.placeholders.addClass(t.placeholderCssClass+" draggable"),$(this.handle,a).addClass("draggable").on("mousedown.arrange touchstart.arrange",function(){s=!0}).on("mouseup.arrange touchend.arrange",function(){s=!1}),this.connectWith&&(a=a.add($(this.connectWith).children().not('[data-arrange-exclude="true"]')).data("connectWith",this.connectWith)),this.items=a,this.items.attr("draggable",!0).addClass(this.handle?"":"draggable").add([this,r]).not("a[href], img").on("selectstart.arrange",function(){return this.dragDrop&&this.dragDrop(),!1}).end().each(function(){$(this).on(e.dragStart,function(a){if(e.handle&&!s){if(e.isTouch)return;return!1}s=!1,e.dragging=$(this),i=e.dragging.addClass("arrange-dragging").index();var r=t.isVisualItems?e.getVisualIndex(e.dragging):i;$.extend(n,{start:e.dragging,startIndex:r});var o=e.element.triggerHandler("beforearrange",n);if("boolean"==typeof o&&!o||"string"==typeof o&&"false"===o.toLowerCase())e.dragging=null;else if(e.isTouch){var l=e.dragging[0].getBoundingClientRect(),d=a.originalEvent.changedTouches[0];e.offset={x:d.pageX-l.left,y:d.pageY-l.top},e.placeholderTouch=e.dragging.clone().addClass("is-touch").attr("id","arrange-placeholder-touch").insertBefore(e.dragging),e.dragTouchElement(a,e.placeholderTouch)}else{var c=a.originalEvent.dataTransfer;c.effectAllowed="move",c.setData("Text","dummy")}}).on(e.dragEnd,function(){if(e.dragging){if(e.isTouch&&(e.dragging.css("opacity",1),e.placeholderTouch.remove()),e.placeholders.filter(":visible").after(e.dragging),e.dragging.removeClass("arrange-dragging").show(),e.placeholders.detach(),i!==e.dragging.index()){var s=t.isVisualItems?e.getVisualIndex(e.dragging):e.dragging.index();$.extend(n,{end:e.dragging,endIndex:s}),e.element.triggerHandler("arrangeupdate",n)}e.dragging=null,e.placeholderTouch=null}}).on(e.dragWhileDragging,function(i){if(e.dragging){var s=this,o=void 0;if(i.preventDefault(),"drop"===i.type)return i.stopPropagation(),e.dragging.trigger("dragend.arrange"),!1;if(e.isTouch){var l=i.originalEvent.touches[0];s=e.getElementByTouchInList(a,l.pageX,l.pageY)||s}if(s=$(s),e.isTouch||(i.originalEvent.dataTransfer.dropEffect="move"),a.is(s)&&r.index()!==s.index()){e.isTouch?e.dragging.css("opacity",0):e.dragging.hide();var d=void 0;r.index()<s.index()?(r.insertAfter(s),o=s.index(),d=t.isVisualItems?e.getVisualIndex(s):o):(r.insertBefore(s),o=r.index(),d=t.isVisualItems?e.getVisualIndex(r):o),$.extend(n,{over:s,overIndex:d}),e.element.triggerHandler("draggingarrange",n),b.fixSVGIcons(s),e.placeholders.not(r).detach()}else e.placeholders.is(this)||(e.placeholders.detach(),e.element.append(r));if(!e.isTouch)return!1;e.dragTouchElement(i,e.placeholderTouch)}})})}},$.fn.arrange=function(e){return this.each(function(){var t=$.data(this,T);t?t.updated(e):t=$.data(this,T,new I(this,e))})};var A="drag",D={axis:null,clone:!1,cloneCssClass:"is-clone",clonePosIsFixed:!1,cloneAppendTo:null,containment:!1,obstacle:!1,underElements:!1,containmentOffset:{left:0,top:0}};function E(e,t){this.element=$(e),this.settings=b.mergeSettings(this.element[0],t,D),i(A),this.init(),s(A)}E.prototype={init:function(){this.handleEvents()},finish:function(e,t){var i={top:t,left:e};this.element.off("mouseup.draggable"),$(document).off("mousemove.draggable mouseup.draggable"),this.settings.underElements&&(i.underElements=this.getElementsFromPoint(i.left,i.top)),this.element.trigger("dragend",i),this.element.removeClass("is-dragging"),this.clone&&("x"===this.settings.axis&&delete i.top,"y"===this.settings.axis&&delete i.left,this.clone.remove(),this.clone=null),this.obstacle&&(this.obstacle=null),this.upperYLimit&&(this.upperYLimit=null),this.upperXLimit&&(this.upperXLimit=null),$("body").removeClass("disable-select")},move:function(e,t){var i={left:e,top:t};if("x"===this.settings.axis&&delete i.top,"y"===this.settings.axis&&delete i.left,this.settings.containment&&("parent"===this.settings.containment?this.container=this.element.parent():"window"===this.settings.containment?this.container=$(window):"container"===this.settings.containment?this.container=this.element.closest(".page-container"):this.container=$(document),this.upperXLimit||(this.upperXLimit=this.container.width()-this.element.outerWidth()+this.settings.containmentOffset.left),this.upperYLimit||(this.upperYLimit=this.container.height()-this.element.outerHeight()+this.settings.containmentOffset.top),i.top>this.upperYLimit&&(i.top=this.upperYLimit),i.left>this.upperXLimit&&(i.left=this.upperXLimit),i.top<0&&(i.top=0),i.left<0&&(i.left=0),"container"===this.settings.containment&&i.left<=1&&(i.left=1)),this.settings.obstacle){var s=this.clone?this.clone.offset():this.element.offset(),n=this.clone?this.clone.outerWidth():this.element.outerWidth(),a=i.left>s.left;if(!this.obstacle){this.obstacle=$(this.settings.obstacle).not(this.element);var r=$(this.obstacle).offset();this.constraints={top:r.top,left:r.left,bottom:r.top+this.obstacle.outerHeight(),right:r.left+this.obstacle.outerWidth()}}!a&&this.originalPos.left>this.constraints.left&&i.left<=this.constraints.right&&(i.left=this.constraints.right),a&&this.originalPos.left+n<=this.constraints.left&&i.left+n>=this.constraints.left&&(i.left=this.constraints.left-this.obstacle.outerWidth())}var o=function(e,t,i){void 0!==t[i]&&(e[0].style[i]=t[i]+"px")};o(this.clone||this.element,i,"top"),o(this.clone||this.element,i,"left"),this.settings.underElements&&(i.underElements=this.getElementsFromPoint(i.left,i.top)),this.element.trigger("drag",i)},getElementsFromPoint:function(e,t){var i=[];if(document.elementsFromPoint)i=document.elementsFromPoint(e,t);else if(document.msElementsFromPoint)i=document.msElementsFromPoint(e,t);else{for(var s,n=void 0,a=void 0,r=void 0,o=999,l=[];(r=document.elementFromPoint(e,t))&&-1===i.indexOf(r)&&null!==r&&o>-1;)o--,i.push(r),l.push({value:r.style.getPropertyValue("pointer-events")||"",priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(n=0,s=i.length;n<s;n++)a=l[n],i[n].style.setProperty("pointer-events",a.value,a.priority)}return i},updated:function(e){e&&(this.settings=b.mergeSettings(this.element[0],e,this.settings))},destroy:function(){$.removeData(this.element[0],A),this.element.off("touchstart.draggable MSPointerDown.draggable pointerdown.draggable touchmove.draggable touchend.draggable touchcancel.draggable mousedown.draggable")},handleEvents:function(){var e=this;e.offset=null,e.element.attr("draggable",!1),"onpointerdown"in window||"onmspointerdown"in window||e.element.on("touchstart.draggable gesturestart.draggable",function(t){var i=$(this).position(),s=t.originalEvent;e.offset={x:s.changedTouches[0].pageX-i.left,y:s.changedTouches[0].pageY-i.top},e.originalPos=i,e.element.addClass("is-dragging"),e.element.trigger("dragstart",i)}).on("touchmove.draggable gesturechange.draggable",function(t){t.preventDefault();var i=t.originalEvent;if(!(i.targetTouches.length>1)){var s=i.changedTouches[0].pageX-e.offset.x,n=i.changedTouches[0].pageY-e.offset.y;e.move(s,n)}}).on("touchend.draggable gestureend.draggable touchcancel.draggable",function(t){t.preventDefault();var i=t.originalEvent.changedTouches[0];e.finish(i.pageX-e.offset.x,i.pageY-e.offset.y)}),e.element.on("mousedown.draggable",function(t){t.preventDefault();var i=e.settings.clonePosIsFixed?e.element[0].getBoundingClientRect():e.element.position();e.offset={x:t.pageX-i.left,y:t.pageY-i.top},e.originalPos=i,$("body").addClass("disable-select"),$(document).on("mousemove.draggable",function(t){t.preventDefault(),e.move(t.pageX-e.offset.x,t.pageY-e.offset.y)}),$(document).on("mouseup.draggable",function(i){i.preventDefault(),e.finish(t.pageX-e.offset.x,i.pageY-e.offset.y)}),e.element.on("mouseup.draggable",function(t){t.preventDefault(),e.finish(t.pageX-e.offset.x,t.pageY-e.offset.y)}),!e.clone&&e.settings.clone&&(e.clone=e.element.clone(!0),"parent"===e.settings.cloneAppendTo&&(e.settings.cloneAppendTo=e.element.parent()),e.clone.addClass(e.settings.cloneCssClass).appendTo(e.settings.cloneAppendTo||"body")),e.element.addClass("is-dragging"),e.element.trigger("dragstart",[i,e.clone])})}},$.fn.drag=function(e){return this.each(function(){var t=$.data(this,A);t?t.updated(e):t=$.data(this,A,new E(this,e))})};var L={bleedFromContainer:!1,callback:null,container:null,parent:null,parentXAlignment:"center",parentYAlignment:"center",placement:"bottom",strategies:["nudge"]},B=["nudge","clockwise","flip","shrink","shrink-x","shrink-y"],R=["top","left","right","bottom","center"],P=["left","center","right"],M=["top","center","bottom"],O=["x","y","container","containerOffsetX","containerOffsetY","callback","parent","parentXAlignment","parentYAlignment","useParentWidth","useParentHeight","placement","strategies"];function F(e){var t=this;return O.forEach(function(i){if(null!==e[i])return"x"===i||"y"===i?(t.setCoordinate(i,e[i]),void(t["original"+i]=e[i])):void(t[i]=e[i])}),this.modified=!1,this.sanitize()}function N(e,t){this.settings=b.mergeSettings(e,t,L),this.element=$(e),this.init()}F.prototype={isReasonableDefault:function(e,t){return $.inArray(e,t)>-1},sanitize:function(){var e=this;this.bleedFromContainer=!0===this.bleedFromContainer,this.callback="function"==typeof this.callback?this.callback:L.callback,this.container=this.container instanceof $&&this.container.length?this.container:L.container,this.containerOffsetX=isNaN(parseInt(this.containerOffsetX,10))?0:this.containerOffsetX,this.containerOffsetY=isNaN(parseInt(this.containerOffsetY,10))?0:this.containerOffsetY,this.parent=this.parent instanceof $&&this.parent.length?this.parent:L.parent,this.parentXAlignment=this.isReasonableDefault(this.parentXAlignment,P)?this.parentXAlignment:L.parentXAlignment,this.parentYAlignment=this.isReasonableDefault(this.parentYAlignment,M)?this.parentYAlignment:L.parentYAlignment,this.placement=this.isReasonableDefault(this.placement,R)?this.placement:L.placement,this.useParentHeight=!0===this.useParentHeight,this.useParentWidth=!0===this.useParentWidth,$.isArray(this.strategies)&&this.strategies.length||(this.strategies=["nudge"]),this.strategies.forEach(function(t,i){e.strategies[i]=e.isReasonableDefault(t,B)?t:e.strategies[i]})},setCoordinate:function(e,t){this.isReasonableDefault(e,["x","y"])&&(isNaN(t)&&(t=0),this[e]=Math.round(t))}},N.prototype={init:function(){return this.build().handleEvents()},build:function(){this.element.hasClass("placeable")||this.element.addClass("placeable"),this.originalStyles={};var e=this.element[0].style.height,t=this.element[0].style.width;return e&&(this.originalStyles.height=e),t&&(this.originalStyles.width=t),this},handleEvents:function(){var e=this;return this.element.on("place.place",function(t,i,s){e.place(new F({x:i,y:s}))}).on("updated.place",function(){e.updated()}),this},render:function(e){var t=/(px|%)/i;this.element.offset({left:e.x,top:e.y}),e.height&&(this.element[0].style.height=e.height+(t.test(""+e.height)?"":"px")),e.width&&(this.element[0].style.width=e.width+(t.test(""+e.width)?"":"px"))},place:function(e){var t=[this.element[0].style.left,this.element[0].style.top];return this.element.trigger("beforeplace",[t])?(e instanceof F||(e=new F(e)),null==e.x&&null==e.y?t:(this.clearOldStyles(),e.parent?this.placeWithParent(e):this.placeWithCoords(e))):t},placeWithParent:function(e){if(!e.parent||!e.parent.length)return[void 0,void 0];var t=this,i=o.getDimensions(e.parent[0]),s=o.getDimensions(this.element[0]),n=this.getContainer(e),a=n.length&&n[0]===document.body,r=a?$(window).scrollLeft():n.scrollLeft(),l=a?$(window).scrollTop():n.scrollTop();function d(e){var n=function(e){var t=e.placement,n=e.parentXAlignment,o=e.parentYAlignment,d=void 0,c=void 0;switch(t){case"top":c=i.top-s.height-e.y+(a?l:0);break;case"left":d=i.left-s.width-e.x+(a?r:0);break;case"right":d=i.right+e.x+(a?r:0);break;default:c=i.bottom+e.y+(a?l:0)}if("top"===t||"bottom"===t)switch(n){case"left":d=i.left-e.x+(a?r:0);break;case"right":d=i.right-s.width+e.x+(a?r:0);break;default:d=i.left+(i.width-s.width)/2+e.x+(a?r:0)}if("right"===t||"left"===t)switch(o){case"top":c=i.top-e.y+(a?l:0);break;case"bottom":c=i.bottom-s.height+e.y+(a?l:0);break;default:c=i.top+(i.height-s.height)/2+e.y+(a?l:0)}return[d,c]}(e);return e.setCoordinate("x",n[0]),e.setCoordinate("y",n[1]),t.render(e),e=t.handlePlacementCallback(e)}return e.useParentWidth&&(e.width=i.width),e.useParentHeight&&(e.height=i.height),(e=d(e)).strategies.forEach(function(i){(e=t.checkBleeds(e)).bleeds&&(e=function(){switch(i){case"nudge":return t.nudge(e);case"clockwise":return t.clockwise(e);case"flip":return(e=t.flip(e)).setCoordinate("x",e.originalx),e.setCoordinate("y",e.originaly),e=d(e);case"shrink":return t.shrink(e);case"shrink-x":return t.shrink(e,"x");case"shrink-y":return t.shrink(e,"y");default:return e}}(),t.render(e))}),this.element.trigger("afterplace",[e]),e},placeWithCoords:function(e){return this.render(e),e=this.handlePlacementCallback(e),this.render(e),(e=this.checkBleeds(e)).bleeds&&(e=this.nudge(e)),this.render(e),(e=this.checkBleeds(e)).bleeds&&(e=this.shrink(e)),this.render(e),this.element.trigger("afterplace",[e]),e},handlePlacementCallback:function(e){var t=e.callback||this.settings.callback;return t&&"function"==typeof t&&(e=t(e)),this.render(e),e},accountForScrolling:function(e){var t=e.container,i=window.getComputedStyle(this.element[0]).position;if("fixed"===i)return!1;if(t&&t.length||(t=this.element.parents().filter(function(){return"absolute"===window.getComputedStyle(this).position||"fixed"===i})),!t||!t.length)return!0;if(t[0]===document.body)return!1;var s=window.getComputedStyle(t[0]);return"fixed"!==(i=s.position)&&("absolute"!==i||"hidden"!==s.overflow)},getContainer:function(e){if(e.container instanceof $&&e.container.length)return e.container;var t=this.element.parents(".modal");return t.length?t:$(document.body)},checkBleeds:function(e){var t=this.settings.bleedFromContainer,i=this.getContainer(e),s=i.length&&i[0]===d