diff --git a/route.go b/route.go
index c03e3f77..0a633e17 100644
--- a/route.go
+++ b/route.go
@@ -10,9 +10,12 @@ import (
"strings"
"time"
+ "fmt"
+
"github.com/qor/qor"
"github.com/qor/qor/utils"
"github.com/qor/roles"
+ "net"
)
// Middleware is a way to filter a request and response coming into your application
@@ -31,6 +34,20 @@ type Middleware struct {
next *Middleware
}
+type AdminResponseWriter struct {
+ http.ResponseWriter
+ statusCode int
+}
+
+func NewLoggingResponseWrite(w http.ResponseWriter) *AdminResponseWriter {
+ return &AdminResponseWriter{w, http.StatusOK}
+}
+
+func (lrw *AdminResponseWriter) WriteHeader(code int) {
+ lrw.statusCode = code
+ lrw.ResponseWriter.WriteHeader(code)
+}
+
// Next will call the next middleware
func (middleware Middleware) Next(context *Context) {
if next := middleware.next; next != nil {
@@ -162,7 +179,6 @@ func (admin *Admin) NewServeMux(prefix string) http.Handler {
return
}
}
-
middleware.Next(context)
},
})
@@ -179,7 +195,6 @@ func (admin *Admin) NewServeMux(prefix string) http.Handler {
http.NotFound(context.Writer, context.Request)
},
})
-
return &serveMux{admin: admin}
}
@@ -193,8 +208,10 @@ func (serveMux *serveMux) ServeHTTP(w http.ResponseWriter, req *http.Request) {
admin = serveMux.admin
RelativePath = "/" + strings.Trim(strings.TrimPrefix(req.URL.Path, admin.router.Prefix), "/")
context = admin.NewContext(w, req)
+ params string
)
+
// Parse Request Form
req.ParseMultipartForm(2 * 1024 * 1024)
defer func() {
@@ -216,7 +233,41 @@ func (serveMux *serveMux) ServeHTTP(w http.ResponseWriter, req *http.Request) {
defer func() func() {
begin := time.Now()
return func() {
- log.Printf("Finish [%s] %s Took %.2fms\n", req.Method, req.RequestURI, time.Now().Sub(begin).Seconds()*1000)
+ realIP := ""
+ log.Printf("%v",req,"Request Real IP")
+ ips := strings.Split(req.Header.Get("HTTP_X_FORWARDED_FOR"), ",")
+ if len(ips) == 0 {
+ ips = strings.Split(req.Header.Get("REMOTE_ADDR"), ",")
+ }
+ log.Printf("headers ips:%v",ips)
+ if len(ips)==1{
+ addrs, _ := net.InterfaceAddrs()
+ log.Printf("net interfaceAddrs:%v",addrs)
+ for _, address := range addrs {
+ if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
+ if ipnet.IP.To4() != nil {
+ realIP=ipnet.IP.String()
+ }
+
+ }
+ }
+ }else{
+ for _, ip := range ips {
+ r := regexp.MustCompile(`10\.|172\.1[6-9]\.|172\.3[0-1]\.|192\.168\.|172\.2[0-9]\.`)
+ if r.Match([]byte(ip)) {
+ continue
+ }
+ realIP = ip
+ break
+ }
+ }
+ code := context.Writer.(*AdminResponseWriter).statusCode
+ log.SetFlags(0)
+ userID:=context.CurrentUser.GetId()
+ if userID==""{
+ userID=""
+ }
+ log.Printf("ip=%v user=%v date=%v path=%v method=%v status=%v duration=%v params={%v}", realIP, userID, time.Now().Format("2006-01-02 15:03:04"), req.URL.Path, req.Method, code, time.Now().Sub(begin).Seconds()*1000, params)
}
}()()
@@ -236,12 +287,16 @@ func (serveMux *serveMux) ServeHTTP(w http.ResponseWriter, req *http.Request) {
switch req.Method {
case "GET":
permissionMode = roles.Read
+ params = getParameters(req)
case "PUT":
permissionMode = roles.Update
+ params = getParameters(req)
case "POST":
permissionMode = roles.Create
+ params = getParameters(req)
case "DELETE":
permissionMode = roles.Delete
+ params = getParameters(req)
}
handlers := admin.router.routers[strings.ToUpper(req.Method)]
@@ -262,6 +317,8 @@ func (serveMux *serveMux) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
}
+ context.Writer = NewLoggingResponseWrite(context.Writer)
+
// Call first middleware
for _, middleware := range admin.router.middlewares {
middleware.Handler(context, middleware)
@@ -362,3 +419,19 @@ func (res *Resource) RegisterRoute(method string, relativePath string, handler r
router.Delete(path.Join(prefix, relativePath), handler, config)
}
}
+
+// get body parameters
+func getParameters(req *http.Request) (params string) {
+ values, _ := url.ParseQuery(req.URL.RawQuery)
+ if values != nil {
+ for key, value := range values {
+ params += fmt.Sprintf(`"%s":"%s"`, key, value)
+ }
+ }
+ if req.PostForm != nil {
+ for key, value := range req.PostForm {
+ params += fmt.Sprintf(`"%s":"%s"`, key, value)
+ }
+ }
+ return
+}
diff --git a/views/assets/javascripts/qor/qor-action.js b/views/assets/javascripts/qor/qor-action.js
index ebf49065..2cc5c240 100644
--- a/views/assets/javascripts/qor/qor-action.js
+++ b/views/assets/javascripts/qor/qor-action.js
@@ -228,10 +228,13 @@
isUndo = $actionButton.hasClass(CLASS_IS_UNDO),
isInSlideout = $actionButton.closest(CLASS_SLIDEOUT).length,
needDisableButtons = $element.length && !isInSlideout;
-
if (isUndo) {
url = undoUrl; // notification has undo url
}
+ if (isInSlideout==0){
+ isInSlideout = $element.length;
+ needDisableButtons = $element.length && !isInSlideout;
+ }
$.ajax(url, {
method: properties.method,
diff --git a/views/assets/javascripts/qor_admin_default.js b/views/assets/javascripts/qor_admin_default.js
index 9ebfb4da..c9064539 100644
--- a/views/assets/javascripts/qor_admin_default.js
+++ b/views/assets/javascripts/qor_admin_default.js
@@ -1,2 +1,2 @@
"use strict";$.fn.qorSliderAfterShow=$.fn.qorSliderAfterShow||{},window.QOR={$formLoading:'
'},window.Mustache&&(window.Mustache.tags=["[[","]]"]),$(document).ajaxComplete(function(t,e,i){"POST"!=i.type&&"PUT"!=i.type||$.fn.qorSlideoutBeforeHide&&($.fn.qorSlideoutBeforeHide=null,window.onbeforeunload=null)}),$.fn.select2.ajaxCommonOptions=function(t){var n=t.remoteDataPrimaryKey;return{dataType:"json",cache:!0,delay:250,data:function(t){return{keyword:t.term,page:t.page,per_page:20}},processResults:function(t,e){e.page=e.page||1;var i=$.map(t,function(t){return t.id=t[n]||t.primaryKey||t.Id||t.ID,t});return{results:i,pagination:{more:20<=i.length}}}}},$.fn.select2.ajaxFormatResult=function(t,e){var i="";return i=0|<\/.+>)/.test(i)?$(i):i};var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};$(function(){var r=window._,o=window.QOR,s=$('\n
\n
\n
\n
\n \n \n
\n
\n
').appendTo("body");$(document).on("keyup.qor.confirm",function(t){s.is(":visible")&&(27===t.which&&setTimeout(function(){s.hide(),o.qorConfirmCallback=void 0},100),13===t.which&&setTimeout(function(){$('.dialog-button[data-type="confirm"]').click()},100))}).on("click.qor.confirm",".dialog-button",function(){var t=$(this).data("type"),e=o.qorConfirmCallback;return $.isFunction(e)&&e(t),s.hide(),o.qorConfirmCallback=void 0,!1}),o.qorConfirm=function(t,e){var i=s.find(".dialog-ok"),n=s.find(".dialog-cancel");return r.isString(t)?(s.find(".dialog-message").text(t),i.text("ok"),n.text("cancel")):r.isObject(t)&&(t.confirmOk&&t.confirmCancel?(i.text(t.confirmOk),n.text(t.confirmCancel)):(i.text("ok"),n.text("cancel")),s.find(".dialog-message").text(t.confirm)),s.show(),o.qorConfirmCallback=e,!1};o.qorAjaxHandleFile=function(t,n,o,e){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.open("POST",t,!0),i.onload=function(){if(200===this.status){var t=new Blob([this.response],{type:n}),e=window.URL.createObjectURL(t),i=document.createElement("a");document.body.appendChild(i),i.href=e,i.download=o||"download-"+$.now(),i.click()}else window.alert("server error, please try again!")},r.isObject(e)&&("[object FormData]"!=Object.prototype.toString.call(e)&&(e=function t(e,i){var n=i||new FormData,o=void 0;for(var r in e)e.hasOwnProperty(r)&&e[r]&&(o=r),e[r]instanceof Date?n.append(o,e[r].toISOString()):"object"!==_typeof(e[r])||e[r]instanceof File?n.append(o,e[r]):t(e[r],n);return n}(e)),i.send(e))};var t=function(){var t=$(".qor-linkify-object"),e=/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.\-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/gi;t.length&&t.each(function(){var t=$(this).data("video-link");t.match(e)&&$(this).html('')})};($.fn.qorSliderAfterShow.converVideoLinks=t)(),o.handleAjaxError=function(t){var e=$("body"),i=t.responseJSON,n=t.responseText,o=$('');if(e.find(".qor-alert").remove(),422===t.status)if(i){for(var r=i.errors,s="",a=0;a\n error\n '+r[a]+"\n ";o.append(s)}else o=$(n).find(".qor-error");else o.append('\n error\n '+t.statusText+"\n ");o.prependTo(e),setTimeout(function(){o.addClass("qor-alert__active")},50),setTimeout(function(){$('.qor-alert[data-dismissible="true"]').removeClass("qor-alert__active"),$("#qor-submit-loading").remove()},6e3)}});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define("datepicker",["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(T){var t=T(window),o=window.document,p=T(o),r=window.Number,a="datepicker",i="click."+a,n="keyup."+a,s="focus."+a,e="resize."+a,l="show."+a,d="hide."+a,c="pick."+a,u=/(y|m|d)+/g,h=/\d+/g,f=/^\d{2,4}$/,m=a+"-top-left",y=a+"-bottom-left",g=[m,a+"-top-right",y,a+"-bottom-right"].join(" "),b=a+"-hide",v=Math.min,_=Object.prototype.toString;function q(t){return"string"==typeof t}function w(t){return"number"==typeof t&&!isNaN(t)}function S(t){return void 0===t}function $(t){return"date"===(e=t,_.call(e).slice(8,-1).toLowerCase());var e}function k(t,e){var i=[];return Array.from?Array.from(t).slice(e||0):(w(e)&&i.push(e),i.slice.apply(t,i))}function x(t,e){var i=k(arguments,2);return function(){return t.apply(e,i.concat(k(arguments)))}}function j(t,e){return[31,(i=t,i%4==0&&i%100!=0||i%400==0?29:28),31,30,31,30,31,31,30,31,30,31][e];var i}function D(t,e){(e=T.isPlainObject(e)?e:{}).language&&(e=T.extend({},D.LANGUAGES[e.language],e)),this.$element=T(t),this.options=T.extend({},D.DEFAULTS,e),this.isBuilt=!1,this.isShown=!1,this.isInput=!1,this.isInline=!1,this.initialValue="",this.initialDate=null,this.startDate=null,this.endDate=null,this.init()}D.prototype={constructor:D,init:function(){var t=this.options,e=this.$element,i=t.startDate,n=t.endDate,o=t.date;this.$trigger=T(t.trigger||e),this.isInput=e.is("input")||e.is("textarea"),this.isInline=t.inline&&(t.container||!this.isInput),this.format=function(t){var e,i,n=String(t).toLowerCase(),o=n.match(u);if(!o||0===o.length)throw new Error("Invalid date format.");for(t={source:n,parts:o},e=o.length,i=0;in.getTime()&&(o=new Date(n)),this.endDate=n),this.date=o,this.viewDate=new Date(o),this.initialDate=new Date(this.date),this.bind(),(t.autoshow||this.isInline)&&this.show(),t.autopick&&this.pick()},build:function(){var t,e=this.options,i=this.$element;this.isBuilt||(this.isBuilt=!0,this.$picker=t=T(e.template),this.$week=t.find('[data-view="week"]'),this.$yearsPicker=t.find('[data-view="years picker"]'),this.$yearsPrev=t.find('[data-view="years prev"]'),this.$yearsNext=t.find('[data-view="years next"]'),this.$yearsCurrent=t.find('[data-view="years current"]'),this.$years=t.find('[data-view="years"]'),this.$monthsPicker=t.find('[data-view="months picker"]'),this.$yearPrev=t.find('[data-view="year prev"]'),this.$yearNext=t.find('[data-view="year next"]'),this.$yearCurrent=t.find('[data-view="year current"]'),this.$months=t.find('[data-view="months"]'),this.$daysPicker=t.find('[data-view="days picker"]'),this.$monthPrev=t.find('[data-view="month prev"]'),this.$monthNext=t.find('[data-view="month next"]'),this.$monthCurrent=t.find('[data-view="month current"]'),this.$days=t.find('[data-view="days"]'),this.isInline?T(e.container||i).append(t.addClass("datepicker-inline")):(T(o.body).append(t.addClass("datepicker-dropdown")),t.addClass(b)),this.fillWeek())},unbuild:function(){this.isBuilt&&(this.isBuilt=!1,this.$picker.remove())},bind:function(){var t=this.options,e=this.$element;T.isFunction(t.show)&&e.on(l,t.show),T.isFunction(t.hide)&&e.on(d,t.hide),T.isFunction(t.pick)&&e.on(c,t.pick),this.isInput&&(e.on(n,T.proxy(this.keyup,this)),t.trigger||e.on(s,T.proxy(this.show,this))),this.$trigger.on(i,T.proxy(this.show,this))},unbind:function(){var t=this.options,e=this.$element;T.isFunction(t.show)&&e.off(l,t.show),T.isFunction(t.hide)&&e.off(d,t.hide),T.isFunction(t.pick)&&e.off(c,t.pick),this.isInput&&(e.off(n,this.keyup),t.trigger||e.off(s,this.show)),this.$trigger.off(i,this.show)},showView:function(t){var e=this.$yearsPicker,i=this.$monthsPicker,n=this.$daysPicker,o=this.format;if(o.hasYear||o.hasMonth||o.hasDay)switch(r(t)){case 2:case"years":i.addClass(b),n.addClass(b),o.hasYear?(this.fillYears(),e.removeClass(b)):this.showView(0);break;case 1:case"months":e.addClass(b),n.addClass(b),o.hasMonth?(this.fillMonths(),i.removeClass(b)):this.showView(2);break;default:e.addClass(b),i.addClass(b),o.hasDay?(this.fillDays(),n.removeClass(b)):this.showView(1)}},hideView:function(){this.options.autohide&&this.hide()},place:function(){var t=this.options,e=this.$element,i=this.$picker,n=p.outerWidth(),o=p.outerHeight(),r=e.outerWidth(),s=e.outerHeight(),a=i.width(),l=i.height(),d=e.offset(),c=d.left,u=d.top,h=parseFloat(t.offset)||10,f=m;l"+n.text+""+i+">"},fillAll:function(){this.fillYears(),this.fillMonths(),this.fillDays()},fillWeek:function(){var t,e=this.options,i=parseInt(e.weekStart,10)%7,n=e.daysMin,o="";for(n=T.merge(n.slice(i),n.slice(0,i)),t=0;t<=6;t++)o+=this.createItem({text:n[t]});this.$week.html(o)},fillYears:function(){var t,e=this.options,i=e.disabledClass||"",n=e.yearSuffix||"",o=T.isFunction(e.filter)&&e.filter,r=this.startDate,s=this.endDate,a=this.viewDate,l=a.getFullYear(),d=a.getMonth(),c=a.getDate(),u=this.date,h=u.getFullYear(),f=!1,p=!1,m=!1,y=!1,g=!1,b="";for(t=-5;t<=6;t++)u=new Date(l+t,d,c),g=-5===t||6===t,y=l+t===h,m=!1,r&&(m=u.getFullYear()s.getFullYear(),6===t&&(p=m)),!m&&o&&(m=!1===o.call(this.$element,u)),b+=this.createItem({text:l+t,view:m?"year disabled":y?"year picked":"year",muted:g,picked:y,disabled:m});this.$yearsPrev.toggleClass(i,f),this.$yearsNext.toggleClass(i,p),this.$yearsCurrent.toggleClass(i,!0).html(l+-5+n+" - "+(l+6)+n),this.$years.html(b)},fillMonths:function(){var t,e=this.options,i=e.disabledClass||"",n=e.monthsShort,o=T.isFunction(e.filter)&&e.filter,r=this.startDate,s=this.endDate,a=this.viewDate,l=a.getFullYear(),d=a.getDate(),c=this.date,u=c.getFullYear(),h=c.getMonth(),f=!1,p=!1,m=!1,y=!1,g="";for(t=0;t<=11;t++)c=new Date(l,t,d),y=l===u&&t===h,m=!1,r&&(m=(f=c.getFullYear()===r.getFullYear())&&c.getMonth()s.getMonth()),!m&&o&&(m=!1===o.call(this.$element,c)),g+=this.createItem({index:t,text:n[t],view:m?"month disabled":y?"month picked":"month",picked:y,disabled:m});this.$yearPrev.toggleClass(i,f),this.$yearNext.toggleClass(i,p),this.$yearCurrent.toggleClass(i,f&&p).html(l+e.yearSuffix||""),this.$months.html(g)},fillDays:function(){var t,e,i,n=this.options,o=n.disabledClass||"",r=n.yearSuffix||"",s=n.monthsShort,a=parseInt(n.weekStart,10)%7,l=T.isFunction(n.filter)&&n.filter,d=this.startDate,c=this.endDate,u=this.viewDate,h=u.getFullYear(),f=u.getMonth(),p=h,m=f,y=h,g=f,b=this.date,v=b.getFullYear(),_=b.getMonth(),q=b.getDate(),w=!1,S=!1,$=!1,k=!1,x=[],D=[],C=[];for(0===f?(p-=1,m=11):m-=1,t=j(p,m),(i=(b=new Date(h,f,1)).getDay()-a)<=0&&(i+=7),d&&(w=b.getTime()<=d.getTime()),e=t-(i-1);e<=t;e++)b=new Date(p,m,e),$=!1,d&&($=b.getTime()=c.getTime()),e=1;e<=i;e++)b=new Date(y,g,e),$=!1,c&&($=b.getTime()>c.getTime()),!$&&l&&($=!1===l.call(this.$element,b)),D.push(this.createItem({text:e,view:"day next",muted:!0,disabled:$}));for(e=1;e<=t;e++)b=new Date(h,f,e),k=h===v&&f===_&&e===q,$=!1,d&&($=b.getTime()c.getTime()),!$&&l&&($=!1===l.call(this.$element,b)),C.push(this.createItem({text:e,view:$?"day disabled":k?"day picked":"day",picked:k,disabled:$}));this.$monthPrev.toggleClass(o,w),this.$monthNext.toggleClass(o,S),this.$monthCurrent.toggleClass(o,w&&S).html(n.yearFirst?h+r+" "+s[f]:s[f]+" "+h+r),this.$days.html(x.join("")+C.join(" ")+D.join(""))},click:function(t){var e,i,n,o,r,s,a=T(t.target),l=this.viewDate;if(t.stopPropagation(),t.preventDefault(),!a.hasClass("disabled"))switch(e=l.getFullYear(),i=l.getMonth(),n=l.getDate(),s=a.data("view")){case"years prev":case"years next":e="years prev"===s?e-10:e+10,r=a.text(),(o=f.test(r))&&(e=parseInt(r,10),this.date=new Date(e,i,v(n,28))),this.viewDate=new Date(e,i,v(n,28)),this.fillYears(),o&&(this.showView(1),this.pick("year"));break;case"year prev":case"year next":e="year prev"===s?e-1:e+1,this.viewDate=new Date(e,i,v(n,28)),this.fillMonths();break;case"year current":this.format.hasYear&&this.showView(2);break;case"year picked":this.format.hasMonth?this.showView(1):this.hideView();break;case"year":e=parseInt(a.text(),10),this.date=new Date(e,i,v(n,28)),this.viewDate=new Date(e,i,v(n,28)),this.format.hasMonth?this.showView(1):this.hideView(),this.pick("year");break;case"month prev":case"month next":i="month prev"===s?i-1:"month next"===s?i+1:i,this.viewDate=new Date(e,i,v(n,28)),this.fillDays();break;case"month current":this.format.hasMonth&&this.showView(1);break;case"month picked":this.format.hasDay?this.showView(0):this.hideView();break;case"month":i=T.inArray(a.text(),this.options.monthsShort),this.date=new Date(e,i,v(n,28)),this.viewDate=new Date(e,i,v(n,28)),this.format.hasDay?this.showView(0):this.hideView(),this.pick("month");break;case"day prev":case"day next":case"day":i="day prev"===s?i-1:"day next"===s?i+1:i,n=parseInt(a.text(),10),this.date=new Date(e,i,n),this.viewDate=new Date(e,i,n),this.fillDays(),"day"===s&&this.hideView(),this.pick("day");break;case"day picked":this.hideView(),this.pick("day")}},clickDoc:function(t){for(var e,i=t.target,n=this.$trigger[0];i!==o;){if(i===n){e=!0;break}i=i.parentNode}e||this.hide()},keyup:function(){this.update()},getValue:function(){var t=this.$element,e="";return this.isInput?e=t.val():this.isInline?this.options.container&&(e=t.text()):e=t.text(),e},setValue:function(t){var e=this.$element;t=q(t)?t:"",this.isInput?e.val(t):this.isInline?this.options.container&&e.text(t):e.text(t)},show:function(){this.isBuilt||this.build(),this.isShown||this.trigger(l).isDefaultPrevented()||(this.isShown=!0,this.$picker.removeClass(b).on(i,T.proxy(this.click,this)),this.showView(this.options.startView),this.isInline||(t.on(e,this._place=x(this.place,this)),p.on(i,this._clickDoc=x(this.clickDoc,this)),this.place()))},hide:function(){this.isShown&&(this.trigger(d).isDefaultPrevented()||(this.isShown=!1,this.$picker.addClass(b).off(i,this.click),this.isInline||(t.off(e,this._place),p.off(i,this._clickDoc))))},update:function(){this.setDate(this.getValue(),!0)},pick:function(t){var e=this.$element,i=this.date;this.trigger(c,{view:t||"",date:i}).isDefaultPrevented()||(this.setValue(i=this.formatDate(this.date)),this.isInput&&e.trigger("change"))},reset:function(){this.setDate(this.initialDate,!0),this.setValue(this.initialValue),this.isShown&&this.showView(this.options.startView)},getMonthName:function(t,e){var i=this.options,n=i.months;return T.isNumeric(t)?t=r(t):S(e)&&(e=t),!0===e&&(n=i.monthsShort),n[w(t)?t:this.date.getMonth()]},getDayName:function(t,e,i){var n=this.options,o=n.days;return T.isNumeric(t)?t=r(t):(S(i)&&(i=e),S(e)&&(e=t)),(o=!0===i?n.daysMin:!0===e?n.daysShort:o)[w(t)?t:this.date.getDay()]},getDate:function(t){var e=this.date;return t?this.formatDate(e):new Date(e)},setDate:function(t,e){var i=this.options.filter;if($(t)||q(t)){if(t=this.parseDate(t),T.isFunction(i)&&!1===i.call(this.$element,t))return;this.date=t,this.viewDate=new Date(t),e||this.pick(),this.isBuilt&&this.fillAll()}},setStartDate:function(t){($(t)||q(t))&&(this.startDate=this.parseDate(t),this.isBuilt&&this.fillAll())},setEndDate:function(t){($(t)||q(t))&&(this.endDate=this.parseDate(t),this.isBuilt&&this.fillAll())},parseDate:function(t){var e,i,n,o,r,s,a=this.format,l=[];if($(t))return new Date(t.getFullYear(),t.getMonth(),t.getDate());if(q(t)&&(l=t.match(h)||[]),i=(t=new Date).getFullYear(),n=t.getDate(),o=t.getMonth(),e=a.parts.length,l.length===e)for(s=0;s',offset:10,zIndex:1e3,filter:null,show:null,hide:null,pick:null},D.setDefaults=function(t){T.extend(D.DEFAULTS,T.isPlainObject(t)&&t)},D.other=T.fn.qorDatepicker,T.fn.qorDatepicker=function(o){var r,s=k(arguments,1);return this.each(function(){var t,e,i=T(this),n=i.data(a);if(!n){if(/destroy/.test(o))return;t=T.extend({},i.data(),T.isPlainObject(o)&&o),i.data(a,n=new D(this,t))}q(o)&&T.isFunction(e=n[o])&&(r=e.apply(n,s))}),S(r)?this:r},T.fn.qorDatepicker.Constructor=D,T.fn.qorDatepicker.languages=D.LANGUAGES,T.fn.qorDatepicker.setDefaults=D.setDefaults,T.fn.qorDatepicker.noConflict=function(){return T.fn.qorDatepicker=D.other,this}});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(f){var i=window.Mustache,p=window.QOR,o="qor.action",t="enable."+o,n="click."+o,r='[data-ajax-form="true"][data-method]',e=".qor-action-bulk-buttons",s=".qor-page .qor-table-container",a=".qor-table--bulking",l=".qor-table--bulking tbody tr",m="is_undo",d="mdl-data-table--selectable",c="primary_values[]";function u(t,e){this.$element=f(t),this.options=f.extend({},u.DEFAULTS,f.isPlainObject(e)&&e),this.ajaxForm={},this.init()}return u.prototype={constructor:u,init:function(){this.bind(),this.initActions()},bind:function(){this.$element.on(n,".qor-action--bulk",this.renderBulkTable.bind(this)).on(n,".qor-action--exit-bulk",this.removeBulkTable.bind(this)),f(document).on(n,l,this.handleBulkTableClick.bind(this)).on(n,r,this.clickAjaxButton.bind(this))},unbind:function(){this.$element.off(n),f(document).off(n,l,this.handleBulkTableClick).off(n,r,this.clickAjaxButton)},initActions:function(){f(s).find("table").length||(f(e).hide(),f(".qor-page__header a.qor-action--button").hide())},collectFormData:function(){var t=f(a).find(".mdl-checkbox__input:checked"),e=[],i=[],n=void 0;return t.length&&t.each(function(){var t=f(this).closest("tr").data("primary-key");n={},t&&(e.push({name:c,value:t.toString()}),n[c]=t.toString(),i.push(n))}),this.ajaxForm.formData=e,this.ajaxForm.normalFormData=i,this.ajaxForm},actionSubmit:function(t){return this.submit(t),!1},handleBulkTableClick:function(t){var e=f(t.target).closest("tr"),i=e.find("td").first(),n=i.find(".mdl-js-checkbox");return n.toggleClass("is-checked"),e.toggleClass("is-selected"),i.find("input").prop("checked",n.hasClass("is-checked")),!1},adjustPageBodyStyle:function(t){var e=f(".qor-page > .qor-page__header"),i=f(".qor-page > .qor-page__body"),n=e.find(".qor-page-subnav__header").length?96:48;t?e.height()>n&&i.css("padding-top",e.height()):parseInt(i.css("padding-top"))>n&&i.css("padding-top","")},renderBulkTable:function(){var t=f("body");t.hasClass("qor-slideout-open")&&t.data("qor.slideout").hide(),f(".qor-table__inner-list").remove(),this.toggleBulkButtons(),this.enableTableMDL(),this.adjustPageBodyStyle(!0)},removeBulkTable:function(){this.toggleBulkButtons(),this.disableTableMDL(),this.adjustPageBodyStyle()},enableTableMDL:function(){f(s).find("table").removeAttr("data-upgraded").addClass(d).trigger("enable")},disableTableMDL:function(){f(s).find("table").removeClass(d).find("tr").removeClass("is-selected").find("td:first,th:first").remove()},toggleBulkButtons:function(){this.$element.find(".qor-action-forms").toggle(),f(e).find("button").toggleClass("hidden"),f(s).toggleClass("qor-table--bulking").find(".qor-table__actions").toggle(),f(".qor-page__header .qor-actions, .qor-page__header .qor-search-container").toggle()},clickAjaxButton:function(t){var e=f(t.target);return this.collectFormData(),this.ajaxForm.properties=e.data(),this.submit(e),!1},renderFlashMessage:function(t){var e=u.FLASHMESSAGETMPL;return i.parse(e),i.render(e,t)},submit:function(e){var i=this,n=this.ajaxForm||{},t=n.properties||e.data();!t.fromIndex||n.formData&&n.formData.length?t.confirm?p.qorConfirm(t,function(t){t&&i.handleAjaxSubmit(n,e)}):this.handleAjaxSubmit(n,e):p.qorConfirm(n.properties.errorNoItem)},handleAjaxSubmit:function(s,a){var l=this,d=this.$element,c=s.properties||a.data(),u=c.url,h=c.undoUrl,e=a.hasClass(m),t=a.closest(".qor-slideout").length,i=d.length&&!t;e&&(u=h),f.ajax(u,{method:c.method,data:s.formData,dataType:c.datatype||"json",beforeSend:function(){h?a.prop("disabled",!0):i&&l.switchButtons(d,1)},success:function(t){if(h)return d.trigger("undo.qor.action",[a,e,t]),e?a.removeClass(m):a.addClass(m),void a.prop("disabled",!1);window.location.reload()},error:function(t){200!=t.status&&(h?a.prop("disabled",!1):i&&l.switchButtons(d),p.handleAjaxError(t))},complete:function(t){var e=t.getResponseHeader("content-type"),i=t.getResponseHeader("Content-Disposition");if(i&&-1!==i.indexOf("attachment")){var n=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(i),o={},r="";null!=n&&n[1]&&(r=n[1].replace(/['"]/g,"")),c.method&&(o=f.extend({},s.normalFormData,{_method:c.method})),p.qorAjaxHandleFile(u,e,r,o),h?a.prop("disabled",!1):l.switchButtons(d)}}})},switchButtons:function(t,e){var i=!!e;t.find(".qor-action-button").prop("disabled",i)},destroy:function(){this.unbind(),this.$element.removeData(o)}},u.DEFAULTS={},f.fn.qorSliderAfterShow.qorInsertActionData=function(t,e){var i=f(e).find('[data-toggle="qor-action-slideout"]'),n=i.find("form"),o=f(a).find(".mdl-checkbox__input:checked");i.length&&o.length&&o.each(function(){var t=f(this).closest("tr").data("primary-key");t&&n.prepend('')})},u.plugin=function(n){return this.each(function(){var t=f(this),e=t.data(o),i=void 0;e||t.data(o,e=new u(this,n)),"string"==typeof n&&f.isFunction(i=e[n])&&i.call(e)})},f(function(){var e={},i='[data-toggle="qor.action.bulk"]';f(i).length||f(document).on(n,r,function(t){return(new u).actionSubmit(f(t.target)),!1}),f(document).on("disable.qor.action",function(t){u.plugin.call(f(i,t.target),"destroy")}).on(t,function(t){u.plugin.call(f(i,t.target),e)}).triggerHandler(t)}),u});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(r){var s=window.location,a=window.QOR,o="qor.advancedsearch",t="enable."+o,e="click."+o;function l(t,e){this.$element=r(t),this.options=r.extend({},l.DEFAULTS,r.isPlainObject(e)&&e),this.init()}return l.prototype={constructor:l,init:function(){this.$form=this.$element.find("form"),this.$modal=r(l.MODAL).appendTo("body"),this.bind()},bind:function(){this.$element.on("submit.qor.advancedsearch","form",this.submit.bind(this)).on(e,".qor-advanced-filter__save",this.showSaveFilter.bind(this)).on(e,".qor-advanced-filter__toggle",this.toggleFilterContent).on(e,".qor-advanced-filter__close",this.closeFilter).on(e,".qor-advanced-filter__delete",this.deleteSavedFilter),this.$modal.on("shown.qor.modal",this.start.bind(this))},closeFilter:function(){r(".qor-advanced-filter__dropdown").hide()},toggleFilterContent:function(t){r(t.target).closest(".qor-advanced-filter__toggle").parent().find(">[advanced-search-toggle]").toggle()},showSaveFilter:function(){this.$modal.qorModal("show")},deleteSavedFilter:function(t){var e=r(t.target).closest(".qor-advanced-filter__delete"),i=e.closest(".qor-advanced-filter__savedfilter"),n=e.data("filter-name"),o=s.pathname;return a.qorConfirm({confirm:"Are you sure you want to delete this saved filter?"},function(t){t&&r.get(o,r.param({delete_saved_filter:n})).done(function(){e.closest("li").remove(),0===i.find("li").length&&i.remove()}).fail(function(){a.qorConfirm("Server error, please try again!")})}),!1},start:function(){this.$modal.trigger("enable.qor.material").on(e,".qor-advanced-filter__savefilter",this.saveFilter.bind(this))},saveFilter:function(){var t=this.$modal.find("#qor-advanced-filter__savename").val();t&&this.$form.prepend('\n \n
\n
Save advanced filter
\n \n
\n \n
\n \n \n
\n\n
\n
\n \n
\n ',l.plugin=function(n){return this.each(function(){var t=r(this),e=t.data(o),i=void 0;if(!e){if(/destroy/.test(n))return;t.data(o,e=new l(this,n))}"string"==typeof n&&r.isFunction(i=e[n])&&i.apply(e)})},r(function(){var e='[data-toggle="qor.advancedsearch"]';r(document).on("disable.qor.advancedsearch",function(t){l.plugin.call(r(e,t.target),"destroy")}).on(t,function(t){l.plugin.call(r(e,t.target),void 0)}).triggerHandler(t)}),l});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(o){var r="qor.autoheight",t="enable."+r;function s(t,e){this.$element=o(t),this.options=o.extend({},s.DEFAULTS,o.isPlainObject(e)&&e),this.init()}return s.prototype={constructor:s,init:function(){var t=this.$element;this.overflow=t.css("overflow"),this.paddingTop=parseInt(t.css("padding-top"),10),this.paddingBottom=parseInt(t.css("padding-bottom"),10),t.css("overflow","hidden"),this.resize(),this.bind()},bind:function(){this.$element.on("input",o.proxy(this.resize,this))},unbind:function(){this.$element.off("input",this.resize)},resize:function(){var t=this.$element;t.is(":hidden")||t.height("auto").height(t.prop("scrollHeight")-this.paddingTop-this.paddingBottom)},destroy:function(){this.unbind(),this.$element.css("overflow",this.overflow).removeData(r)}},s.DEFAULTS={},s.plugin=function(n){return this.each(function(){var t,e=o(this),i=e.data(r);if(!i){if(/destroy/.test(n))return;e.data(r,i=new s(this,n))}"string"==typeof n&&o.isFunction(t=i[n])&&t.apply(i)})},o(function(){var e="textarea.qor-js-autoheight";o(document).on("disable.qor.autoheight",function(t){s.plugin.call(o(e,t.target),"destroy")}).on(t,function(t){s.plugin.call(o(e,t.target))}).triggerHandler(t)}),s});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(v){var u=window._,n=window.FormData,o="qor.bottomsheets",t="click."+o,e="submit."+o,r="qor-bottomsheets-open",_=".mdl-layout__content.qor-page",a=".qor-page__body",q=".qor-page__header",i=".qor-bottomsheets__search-input";function h(t,e){var i=[],n="href";return e&&(n="src"),t.each(function(){i.push(v(this).attr(n))}),u.uniq(i)}function f(t,e){var i=v.fn.qorSliderAfterShow;for(var n in i)i.hasOwnProperty(n)&&!i[n].isLoadedInBottomSheet&&(i[n].isLoadedInBottomSheet=!0,i[n].call(this,t,e))}function w(t,e){this.$element=v(t),this.options=v.extend({},w.DEFAULTS,v.isPlainObject(e)&&e),this.resourseData={},this.init()}return w.prototype={constructor:w,init:function(){this.build(),this.bind()},build:function(){var t=void 0;this.$bottomsheets=t=v(w.TEMPLATE).appendTo("body"),this.$body=t.find(".qor-bottomsheets__body"),this.$title=t.find(".qor-bottomsheets__title"),this.$header=t.find(".qor-bottomsheets__header"),this.$bodyClass=v("body").prop("class"),this.filterURL="",this.searchParams=""},bind:function(){this.$bottomsheets.on(e,"form",this.submit.bind(this)).on(t,'[data-dismiss="bottomsheets"]',this.hide.bind(this)).on(t,".qor-pagination a",this.pagination.bind(this)).on(t,".qor-bottomsheets__search-button",this.search.bind(this)).on("keyup.qor.bottomsheets",this.keyup.bind(this)).on("selectorChanged.qor.selector",this.selectorChanged.bind(this)).on("filterChanged.qor.filter",this.filterChanged.bind(this))},unbind:function(){this.$bottomsheets.off(e,"form").off(t).off("selectorChanged.qor.selector").off("filterChanged.qor.filter")},bindActionData:function(t){for(var e=this.$body.find('[data-toggle="qor-action-slideout"]').find("form"),i=t.length-1;0<=i;i--)e.prepend('')},filterChanged:function(t,e,i){var n;return(n=this.constructloadURL(e,i))&&this.reload(n),!1},selectorChanged:function(t,e,i){var n;return(n=this.constructloadURL(e,i))&&this.reload(n),!1},keyup:function(t){var e=this.$bottomsheets.find(i);13===t.which&&e.length&&e.is(":focus")&&this.search()},search:function(){var t=this.$bottomsheets,e=t.data().url+"?keyword="+v.trim(t.find(i).val());this.reload(e)},pagination:function(t){var e=v(t.target).prop("href");return e&&this.reload(e),!1},reload:function(t){var e=this.$bottomsheets.find(a);this.addLoading(e),this.fetchPage(t)},fetchPage:function(o){var r=this.$bottomsheets,s=this;v.get(o,function(t){var e=v(t).find(_),i=e.find(q),n=e.find(a);n.length?(r.find(a).html(n.html()),i.length&&(s.$body.find(q).html(i.html()).trigger("enable"),s.addHeaderClass()),r.trigger("reload.qor.bottomsheets")):s.reload(o)}).fail(function(){window.alert("server error, please try again later!")})},constructloadURL:function(t,e){var i,n,o,r,s,a,l,d=this.filterURL,c=this.$bottomsheets.data().url;if(!d){if(!c)return;d=c}return i=function(t,e){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+t+"=([^]*)").exec(e);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))}(e,new URL("http://www.getqor.com/"+t).search),d=this.filterURL=(n=e,o=i,r=d,s=String(n).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&"),a=new RegExp("([?&])"+s+"=.*?(&|$)","i"),l=-1!==r.indexOf("?")?"&":"?",r.match(a)?o?r.replace(a,"$1"+n+"="+o+"$2"):"?"===RegExp.$1||RegExp.$1===RegExp.$2?r.replace(a,"$1"):r.replace(a,""):o?r+l+n+"="+o:void 0)},addHeaderClass:function(){this.$body.find(q).hide(),this.$bottomsheets.find(q).children(".qor-bottomsheet__filter").length&&this.$body.addClass("has-header").find(q).show()},addLoading:function(t){t.html(""),v(w.TEMPLATE_LOADING).appendTo(t).trigger("enable.qor.material")},loadExtraResource:function(t){var e,i,n,o,r,s,a,l,d=(r=t.$links,s=v("link"),a=h(r),l=h(s),u.difference(a,l)),c=(e=t.$scripts,i=v("script"),n=h(e,!0),o=h(i,!0),u.difference(n,o));d.length&&function t(e){var i=document.createElement("link"),n=e.shift();i.type="text/css",i.rel="stylesheet",i.onload=function(){e.length&&t(e)},i.href=n,document.getElementsByTagName("head")[0].appendChild(i)}(d),c.length&&function(t,e,i){for(var n=0,o=0,r=t.length;o[\s\S]*<\s*\/body\s*>/gi);if(i=e.find(_),s&&(s=s.join("").replace(/<\s*body/gi,"',d.ALERT='\n \n
',d.CANVAS='',d.LIST="",d.FILE_LIST='',d.MODAL='\n
\n
\n
$[title]
\n \n
\n
\n
\n
Sync cropping result to:
\n
\n
\n
\n \n
\n
',d.plugin=function(o){return this.each(function(){var t=v(this),e=t.data(s),i=void 0,n=void 0;if(!e){if(!v.fn.cropper)return;if(/destroy/.test(o))return;i=v.extend(!0,{},t.data(),"object"===(void 0===o?"undefined":_typeof(o))&&o),t.data(s,e=new d(this,i))}"string"==typeof o&&v.isFunction(n=e[o])&&n.apply(e)})},v(function(){var e=".qor-file__input",i={parent:".qor-file",output:".qor-file__options",list:".qor-file__list",key:"CropOptions"};v(document).on(t,function(t){d.plugin.call(v(e,t.target),i)}).on("disable.qor.cropper",function(t){d.plugin.call(v(e,t.target),"destroy")}).triggerHandler(t)}),d});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(a){var r="qor.datepicker",t="enable."+r,l="pick."+r,d="click."+r,c=".qor-datepicker__embedded",u=".qor-datepicker__save",i="[data-picker-type]";function h(t,e){this.$element=a(t),this.options=a.extend(!0,{},h.DEFAULTS,a.isPlainObject(e)&&e),this.date=null,this.formatDate=null,this.built=!1,this.pickerData=this.$element.data(),this.$parent=this.$element.closest(i),this.isDateTimePicker="datetime"==this.$parent.data("picker-type"),this.$targetInput=this.$parent.find(this.pickerData.targetInput||(this.isDateTimePicker?".qor-datetimepicker__input":".qor-datepicker__input")),this.init()}return h.prototype={init:function(){this.$targetInput.is(":disabled")?this.$element.remove():this.bind()},bind:function(){this.$element.on(d,a.proxy(this.show,this))},unbind:function(){this.$element.off(d,this.show)},build:function(){var i,t,e=void 0,n=this.$element,o=this.$targetInput,r=o.val(),s={date:new Date,inline:!0};this.built||(n.is(":input")&&Date.parse(n.val())?s.date=new Date(n.val()):r&&Date.parse(r)&&(s.date=new Date(r)),this.$modal=e=a((i=h.TEMPLATE,t=this.options.text,"string"==typeof i&&"object"===(void 0===t?"undefined":_typeof(t))&&a.each(t,function(t,e){i=i.replace("$["+String(t).toLowerCase()+"]",e)}),i)).appendTo("body"),o.data("start-date")&&(s.startDate=new Date),e.find(c).on(l,a.proxy(this.change,this)).qorDatepicker(s).triggerHandler(l),e.find(u).on(d,a.proxy(this.pick,this)),this.built=!0)},unbuild:function(){this.built&&this.$modal.find(c).off(l,this.change).qorDatepicker("destroy").end().find(u).off(d,this.pick).end().remove()},change:function(t){var e,i=this.$modal,n=a(t.target);this.date=e=n.qorDatepicker("getDate"),this.formatDate=n.qorDatepicker("getDate",!0),i.find(".qor-datepicker__picked-year").text(e.getFullYear()),i.find(".qor-datepicker__picked-date").text([n.qorDatepicker("getDayName",e.getDay(),!0)+",",String(n.qorDatepicker("getMonthName",e.getMonth(),!0)),e.getDate()].join(" "))},show:function(){this.built||this.build(),this.$modal.qorModal("show")},pick:function(){var t=this.$targetInput,e=this.formatDate;if(this.isDateTimePicker){var i=/^\d{4}-\d{1,2}-\d{1,2}/,n=t.val();i.test(n)?e=n.replace(i,e):e+=" 00:00"}t.val(e).trigger("change"),this.$modal.qorModal("hide")},destroy:function(){this.unbind(),this.unbuild(),this.$element.removeData(r)}},h.DEFAULTS={text:{title:"Pick a date",ok:"OK",cancel:"Cancel"}},h.TEMPLATE='\n
\n
\n
$[title]
\n \n
\n
\n
\n
',h.plugin=function(o){return this.each(function(){var t,e,i=a(this),n=i.data(r);if(!n){if(!a.fn.qorDatepicker)return;if(/destroy/.test(o))return;t=a.extend(!0,{},i.data(),"object"===(void 0===o?"undefined":_typeof(o))&&o),i.data(r,n=new h(this,t))}"string"==typeof o&&a.isFunction(e=n[o])&&e.apply(n)})},a(function(){var e='[data-toggle="qor.datepicker"]';a(document).on("disable.qor.datepicker",function(t){h.plugin.call(a(e,t.target),"destroy")}).on(t,function(t){h.plugin.call(a(e,t.target))}).triggerHandler(t)}),h});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(c){c.fn.extend({dirtyForm:function a(t,l){var d=!1;return this instanceof jQuery?(l=t,t=this):t instanceof jQuery||(t=c(t)),t.each(function(t,e){var i=c(e);if(i.is("form")){if(i.hasClass("ignore-dirtyform"))return!1;if(d=a(i.find('input:not([type="hidden"]):not(".search-field input"):not(".chosen-search input"):not(".ignore-dirtyform"), textarea, select'),l))return!1}else if(i.is(":checkbox")||i.is(":radio")){if(i.hasClass("ignore-dirtyform"))return!1;if(e.checked!=e.defaultChecked)return!(d=!0)}else if(i.is("input")||i.is("textarea")){if(i.hasClass("ignore-dirtyform"))return!1;if(e.value!=e.defaultValue)return!(d=!0)}else if(i.is("select")){if(i.hasClass("ignore-dirtyform"))return!1;for(var n,o=0,r=e.options.length,s=0;sclear'))},show:function(){this.$element.find(c).toggle()},close:function(t){var e=l(t.target),i=l(c),n=i.is(":visible"),o=e.closest(c).length,r=e.closest(".qor-filter-toggle").length,s=e.closest(".qor-modal").length,a=e.closest(".ui-timepicker-wrapper").length;n&&(o||r||s||a)||i.hide()},setFilterTime:function(t){var e,i,n=l(t.target),o=n.data(),r=o.filterRange,s=void 0,a=void 0;if(!r)return!1;if(l(this.options.label).removeClass(u),n.addClass(u),"events"==r)return this.$timeStart.val(o.scheduleStartAt||""),this.$timeEnd.val(o.scheduleEndAt||""),this.$searchButton.click(),!1;switch(r){case"today":s=a=new Date;break;case"week":s=this.startWeekDate,a=this.endWeekDate;break;case"month":s=this.startMonthDate,a=this.endMonthDate}if(!s||!a)return!1;e=this.getTime(s)+" 00:00",i=this.getTime(a)+" 23:59",this.$timeStart.val(e),this.$timeEnd.val(i),this.$searchButton.click()},getTime:function(t){var e=t.getMonth()+1,i=t.getDate();return e=e<8?"0"+e:e,i=i<10?"0"+i:i,t.getFullYear()+"-"+e+"-"+i},clear:function(){var t=l(this.options.trigger),e=t.find(".qor-selector-label");return t.removeClass("active clearable"),e.html(e.data("label")),this.$timeStart.val(""),this.$timeEnd.val(""),this.$searchButton.click(),!1},getUrlParameter:function(t){var e=d.search,i=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),n=new RegExp("[\\?&]"+i+"=([^]*)").exec(e);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))},updateQueryStringParameter:function(t,e,i){var n=i||d.href,o=n.match(/#\S*$/)||"",r=String(t).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&"),s=new RegExp("([?&])"+r+"=.*?(&|$)","i"),a=-1!==n.indexOf("?")?"&":"?";return o&&(o=o[0],n=n.replace(o,"")),n.match(s)?n=e?n.replace(s,"$1"+t+"="+e+"$2"):"?"===RegExp.$1||RegExp.$1===RegExp.$2?n.replace(s,"$1"):n.replace(s,""):e&&(n=n+a+t+"="+e),n+o},search:function(){var t=this.$searchParam,n=d.href,o=this;t.length&&(t.each(function(){var t=l(this),e=t.data().searchParam,i=t.val();n=o.updateQueryStringParameter(e,i,n)}),this.$element.closest(r).length?l(r).trigger("filterChanged.qor.filter",[n,"qor.filter.time"]):d.href=n)},destroy:function(){this.unbind(),this.$element.removeData(o)}},s.DEFAULTS={label:!1,trigger:!1,button:!1,clear:!1},s.plugin=function(n){return this.each(function(){var t,e=l(this),i=e.data(o);if(!i){if(/destroy/.test(n))return;e.data(o,i=new s(this,n))}"string"==typeof n&&l.isFunction(t=i[n])&&t.apply(i)})},l(function(){var e='[data-toggle="qor.filter.time"]',i={label:".qor-filter__block-buttons button",trigger:"a.qor-filter-toggle",button:".qor-filter__button-search",clear:".qor-selector-clear"};l(document).on("disable.qor.filter",function(t){s.plugin.call(l(e,t.target),"destroy")}).on(t,function(t){s.plugin.call(l(e,t.target),i)}).triggerHandler(t)}),s});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(c){var u=window.location,o="qor.filter",t="enable."+o,e="click."+o,i="change."+o,h=".qor-bottomsheets";function f(t,i){var n,e=decodeURI(u.search);return c.isArray(t)&&(n=p(e),c.each(t,function(t,e){-1===(t=c.inArray(e,n))?n.push(e):i&&n.splice(t,1)}),e="?"+n.join("&")),e}function p(t){var e=[];return t&&-1 thead"),this.$tbody=e.find("> tbody"),this.$header=s(t.header),this.$subHeader=s(t.subHeader),this.$content=s(t.content),this.marginBottomPX=parseInt(this.$subHeader.css("marginBottom")),this.paddingHeight=t.paddingHeight,this.resize(),this.bind())},bind:function(){this.$content.on(i,this.toggle.bind(this)),t.on(e,this.resize.bind(this))},unbind:function(){this.$content.off(i,this.toggle).off(e,this.resize)},isNeedBuild:function(){var t=this.$element;return!!(1 tr:visible").length<=1)},build:function(){var e=[];this.$tbody.find("> tr:first").children().each(function(){var t=s(this).outerWidth();s(this).outerWidth(t),e.push(t)}),this.$thead.find(">tr").children().each(function(t){s(this).outerWidth(e[t])})},toggle:function(){if(this.$content.length){var t=this.$element,e=this.$thead,i=this.$content.scrollTop(),n=this.$subHeader.outerHeight()+this.paddingHeight+this.marginBottomPX,o=s(".qor-page__header").outerHeight(),r=this.$content.offset().top+s(".qor-page__header").height();n-o\n \n \n ",this.bind()},bind:function(){this.$element.on(i,d,this.showEditButton).on(n,d,this.hideEditButton).on(e,".qor-inlineedit__cancel",this.hideEdit).on(e,".qor-inlineedit__save",this.saveEdit).on(e,r,this.showEdit.bind(this))},unbind:function(){this.$element.off(i).off(n).off(e)},showEditButton:function(t){var e=a(s.TEMPLATE_EDIT);if(a(t.target).closest(l).find("input:disabled, textarea:disabled,select:disabled").length)return!1;e.appendTo(a(this))},hideEditButton:function(){a(".qor-inlineedit__edit").remove()},showEdit:function(t){var e=a(t.target).closest(r).hide().closest(l).addClass(u);a(this.TEMPLATE_SAVE).appendTo(e)},hideEdit:function(){a(this).closest(l).removeClass(u).find(c).remove()},saveEdit:function(){var o=a(this),r=o.closest(l),t=o.closest("form"),e=r.closest(".qor-fieldset").find('input.qor-hidden__primary_key[type="hidden"]'),i=r.find('input[name*="QorResource"],textarea[name*="QorResource"],select[name*="QorResource"]'),s=i.length&&i.prop("name").match(/\.\w+/g),n=i.serialize();e.length&&(n=n+"&"+e.serialize()),s.length&&a.ajax(t.prop("action"),{method:t.prop("method"),data:n,dataType:"json",beforeSend:function(){o.prop("disabled",!0)},success:function(t){var e=function(t,e){var i=void 0,n=e[t[0].slice(1)];if(1mode_edit',s.plugin=function(n){return this.each(function(){var t,e=a(this),i=e.data(o);i||e.data(o,i=new s(this,n)),"string"==typeof n&&a.isFunction(t=i[n])&&t.call(i)})},a(function(){var e='[data-toggle="qor.inlineEdit"]',i={};a(document).on("disable.qor.inlineEdit",function(t){s.plugin.call(a(e,t.target),"destroy")}).on(t,function(t){s.plugin.call(a(e,t.target),i)}).triggerHandler(t)}),s});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(e){var i=window.componentHandler,n='[class*="mdl-js"],[class*="mdl-tooltip"]';function o(t){i&&(e(t).is(n)?i.upgradeElements(t):i.upgradeElements(e(n,t).toArray()))}function r(t){i&&(e(t).is(n)?i.downgradeElements(t):i.downgradeElements(e(n,t).toArray()))}e(function(){e(document).on("enable.qor.material",function(t){o(t.target)}).on("disable.qor.material",function(t){r(t.target)}).on("update.qor.material",function(t){r(t.target),o(t.target)})})});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(o){var n=o(document),r="qor.modal",t="click."+r,e="keyup."+r,s="transitionend",a="qor-modal-open",l="in",i="aria-hidden";function d(t,e){this.$element=o(t),this.options=o.extend({},d.DEFAULTS,o.isPlainObject(e)&&e),this.transitioning=!1,this.fadable=!1,this.init()}return d.prototype={constructor:d,init:function(){this.fadable=this.$element.hasClass("fade"),this.options.show?this.show():this.toggle()},bind:function(){this.$element.on(t,o.proxy(this.click,this)),this.options.keyboard&&n.on(e,o.proxy(this.keyup,this))},unbind:function(){this.$element.off(t,this.click),this.options.keyboard&&n.off(e,this.keyup)},click:function(t){var e=this.$element[0],i=t.target;if(i===e&&this.options.backdrop)this.hide();else for(;i!==e;){if("modal"===o(i).data("dismiss")){this.hide();break}i=i.parentNode}},keyup:function(t){27===t.which&&this.hide()},show:function(t){var e,i=this.$element;if(!this.transitioning&&!i.hasClass(l)&&(e=o.Event("show.qor.modal"),i.trigger(e),!e.isDefaultPrevented())){if(n.find("body").addClass(a),i.addClass("shown").scrollTop(0).get(0).offsetHeight,this.transitioning=!0,t||!this.fadable)return i.addClass(l),void this.shown();i.one(s,o.proxy(this.shown,this)),i.addClass(l)}},shown:function(){this.transitioning=!1,this.bind(),this.$element.attr(i,!1).trigger("shown.qor.modal").focus()},hide:function(t){var e,i=this.$element;if(!this.transitioning&&i.hasClass(l)&&(e=o.Event("hide.qor.modal"),i.trigger(e),!e.isDefaultPrevented())){if(n.find("body").removeClass(a),this.transitioning=!0,t||!this.fadable)return i.removeClass(l),void this.hidden();i.one(s,o.proxy(this.hidden,this)),i.removeClass(l)}},hidden:function(){this.transitioning=!1,this.unbind(),this.$element.removeClass("shown").attr(i,!0).trigger("hidden.qor.modal")},toggle:function(){this.$element.hasClass(l)?this.hide():this.show()},destroy:function(){this.$element.removeData(r)}},d.DEFAULTS={backdrop:!1,keyboard:!0,show:!0},d.plugin=function(n){return this.each(function(){var t,e=o(this),i=e.data(r);if(!i){if(/destroy/.test(n))return;e.data(r,i=new d(this,n))}"string"==typeof n&&o.isFunction(t=i[n])&&t.apply(i)})},o.fn.qorModal=d.plugin,o(function(){var e=".qor-modal";o(document).on(t,'[data-toggle="qor.modal"]',function(){var t=o(this),e=t.data(),i=o(e.target||t.attr("href"));d.plugin.call(i,i.data(r)?"toggle":e)}).on("disable.qor.modal",function(t){d.plugin.call(o(e,t.target),"destroy")}).on("enable.qor.modal",function(t){d.plugin.call(o(e,t.target))})}),d});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(s){var o="qor.tabbar.radio",t="enable."+o,e="click."+o,a="[data-tab-target]",l="is-active";function r(t,e){this.$element=s(t),this.options=s.extend({},r.DEFAULTS,s.isPlainObject(e)&&e),this.init()}return r.prototype={constructor:r,init:function(){this.bind()},bind:function(){this.$element.on(e,a,this.switchTab.bind(this))},unbind:function(){this.$element.off(e,a,this.switchTab)},switchTab:function(t){var e=s(t.target),i=this.$element,n=i.find(a),o=i.find("[data-tab-source]"),r=e.data().tabTarget;e.hasClass(l)||(n.removeClass(l),e.addClass(l),o.hide().filter('[data-tab-source="'+r+'"]').show(),i.trigger("switched.qor.tabbar.radio",[i,r]))},destroy:function(){this.unbind()}},r.DEFAULTS={},r.plugin=function(n){return this.each(function(){var t,e=s(this),i=e.data(o);if(!i){if(/destroy/.test(n))return;e.data(o,i=new r(this,n))}"string"==typeof n&&s.isFunction(t=i[n])&&t.apply(i)})},s(function(){var e='[data-toggle="qor.tab.radio"]';s(document).on("disable.qor.tabbar.radio",function(t){r.plugin.call(s(e,t.target),"destroy")}).on(t,function(t){r.plugin.call(s(e,t.target))}).triggerHandler(t)}),r});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(d){var s="qor.redactor",t="enable."+s,l="click."+s,a="keyup."+s,e="addCrop."+s,i="removeCrop."+s,c="scroll."+s,n=".qor-cropper__toggle--redactor",u="#redactor-link-title",h="#redactor-link-url-text";function f(t){return t.replace(/&/g," ").replace(//g," ").replace(/\"/g," ").replace(/\'/g," ").replace(/\`/g," ")}function p(t,e){this.$element=d(t),this.options=d.extend(!0,{},p.DEFAULTS,d.isPlainObject(e)&&e),this.init()}return p.prototype={constructor:p,init:function(){var i,t,e=this.options,n=this.$element,o=n.closest(e.parent);o.length||(o=n.parent()),this.$parent=o,this.$button=d(p.BUTTON),this.$modal=d((i=p.MODAL,t=e.text,"string"==typeof i&&"object"===(void 0===t?"undefined":_typeof(t))&&d.each(t,function(t,e){i=i.replace("$["+String(t).toLowerCase()+"]",e)}),i)).appendTo("body"),this.bind()},bind:function(){this.$element.on(e,d.proxy(this.addButton,this)).on(i,d.proxy(this.removeButton,this))},unbind:function(){this.$element.off(e).off(i).off(c)},addButton:function(t,e){var i=d(e);this.$button.css("left",d(e).width()/2).prependTo(i.parent()).find(n).one(l,d.proxy(this.crop,this,i))},removeButton:function(){this.$button.find(n).off(l),this.$button.detach()},crop:function(o){var r=this.options,i=o.attr("src"),t=i,s=void 0,a=this.$modal;d.isFunction(r.replace)&&(t=r.replace(t)),s=d("
"),a.one("shown.qor.modal",function(){var t,e;s.cropper({data:(t=o.attr("data-crop-options"),e=t&&t.split(","),t=null,e&&4===e.length&&(t={x:Number(e[0]),y:Number(e[1]),width:Number(e[2]),height:Number(e[3])}),t),background:!1,movable:!1,zoomable:!1,scalable:!1,rotatable:!1,checkImageOrigin:!1,ready:function(){a.find(".qor-cropper__save").one(l,function(){var n=s.cropper("getData",!0);d.ajax(r.remote,{type:"POST",contentType:"application/json",data:JSON.stringify({Url:i,CropOptions:{original:function(t){var e,i,n={};if(d.isPlainObject(t))for(e in t)t.hasOwnProperty(e)&&(n[(i=e,"string"==typeof i&&(i=i.charAt(0).toUpperCase()+i.substr(1)),i)]=t[e]);return n}(n)},Crop:!0}),dataType:"json",success:function(t){var e,i;d.isPlainObject(t)&&t.url&&(o.attr("src",t.url).attr("data-crop-options",(e=n,i=[],d.isPlainObject(e)&&d.each(e,function(){i.push(arguments[1])}),i.join())).removeAttr("style").removeAttr("rel"),d.isFunction(r.complete)&&r.complete(),a.qorModal("hide"))}})})}})}).one("hidden.qor.modal",function(){s.cropper("destroy").remove()}).qorModal("show").find(".qor-cropper__wrapper").append(s)},destroy:function(){this.unbind(),this.$modal.qorModal("hide").remove(),this.$element.removeData(s)}},p.DEFAULTS={remote:!1,parent:!1,toggle:!1,replace:null,complete:null,text:{title:"Crop the image",ok:"OK",cancel:"Cancel"}},p.BUTTON='\n Edit\n Crop\n
',p.MODAL='\n
\n
\n
$[title]
\n \n
\n
\n \n
\n
',p.plugin=function(i){return this.each(function(){var n=d(this),o=n.data(s),t=void 0,e=void 0;if(o)/destroy/.test(i)&&n.redactor("core.destroy");else{if(!d.fn.redactor)return;if(/destroy/.test(i))return;n.data(s,o={});var r=["html","format","bold","italic","deleted","lists","image","file","link","table"];t={imageUpload:n.data("uploadUrl"),fileUpload:n.data("uploadUrl"),imageResizable:!0,toolbarFixed:!1,buttons:r,callbacks:{init:function(){var e=void 0,a=this.core.box(),t=d(".qor-slideout").is(":visible"),i=void 0,l=64;r.forEach(function(t){e=this.button.get(t),this.button.setIcon(e,'')},this),t?(i=".qor-slideout__body",l=d(".qor-slideout__header").height()):l+=d(i=".qor-layout main.qor-page").find(".qor-page__header").height(),d(i).on(c,function(){var t,e,i,n,o,r,s;e=l,i=(t=a).find(".redactor-toolbar"),n=t.offset().top,o=t.height(),r={position:"relative",top:"auto",width:"auto",boxShadow:"none"},s={position:"fixed",boxShadow:"0 2px 4px rgba(0,0,0,.1)",top:e,width:t.width()},"relative"===i.css("position")&&(o=t.height()-50),n'),this.link.linkUrlText=d(h).val(),this.link.description=d(u).val(),d("#redactor-modal-button-cancel").off(l).on(l,function(){i.link.clickCancel=!0}),d(u).off(a).on(a,function(){i.link.valueChanged=!0,i.link.description=f(d(this).val())}),d(h).off(a).on(a,function(){i.link.valueChanged=!0,i.link.linkUrlText=f(d(this).val())}))},modalClosed:function(t){var e=this.link.$linkHtml,i=this.link.description;"link"==t&&!this.link.insertedTriggered&&e&&e.length&&this.link.valueChanged&&!this.link.clickCancel&&(i?e.prop("title",i):e.prop("title",this.link.linkUrlText)),d("#redactor-image-displaymode").remove(),this.link.description="",this.link.linkUrlText="",this.link.insertedTriggered=!1,this.link.valueChanged=!1,this.link.clickCancel=!1},insertedLink:function(t){var e=d(t),i=this.link.description;e.prop("title",i||e.text()),this.link.description="",this.link.linkUrlText="",this.link.insertedTriggered=!0},fileUpload:function(t,e){d(t).prop("href",e.filelink).html(e.filename)}}},d.extend(t,n.data("redactorSettings")),n.redactor(t)}"string"==typeof i&&d.isFunction(e=o[i])&&e.apply(o)})},d(function(){var e='textarea[data-toggle="qor.redactor"]';d(document).on("disable.qor.redactor",function(t){p.plugin.call(d(e,t.target),"destroy")}).on(t,function(t){p.plugin.call(d(e,t.target))}).triggerHandler(t)}),p});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(h){var r=window._,o="qor.replicator",t="enable."+o,e="submit."+o,s="click."+o,i="slideoutBeforeSend.qor.slideout.replicator",n="selectcoreBeforeSend.qor.selectcore.replicator bottomsheetBeforeSend.qor.bottomsheets.replicator",a=".qor-fieldset-container";function l(t,e){this.$element=h(t),this.options=h.extend({},l.DEFAULTS,h.isPlainObject(e)&&e),this.index=0,this.init()}return l.prototype={constructor:l,init:function(){var i=this,t=this.$element,e=t.find("> .qor-field__block > .qor-fieldset--new"),n=void 0;this.singlePage=!(t.closest(".qor-slideout").length&&t.closest(".qor-bottomsheets").length),this.maxitems=t.data("maxItem"),this.isSortable=t.hasClass("qor-fieldset-sortable"),e.length&&!t.closest(".qor-fieldset--new").length&&(e.trigger("disable"),this.isMultipleTemplate=t.data("isMultiple"),this.isMultipleTemplate?(this.fieldsetName=[],this.template={},this.index=[],e.each(function(t,e){(n=h(e).data("fieldsetName"))&&(i.template[n]=h(e).prop("outerHTML"),i.fieldsetName.push(n))}),this.parseMultiple()):(this.template=e.prop("outerHTML"),this.parse()),e.hide(),this.bind(),this.resetButton(),this.resetPositionButton())},resetPositionButton:function(){var t=this.$element.find("> .qor-sortable__button");this.isSortable&&(1 .qor-field__block > .qor-fieldset").not(".qor-fieldset--new,.is-deleted").length},toggleButton:function(t){var e=this.$element.find("> .qor-field__block > .qor-fieldset__add");t?e.hide():e.show()},resetButton:function(){this.maxitems<=this.getCurrentItems()?this.toggleButton(!0):this.toggleButton()},parse:function(){var t;this.template&&(t=this.initTemplate(this.template),this.template=t.template,this.index=t.index)},parseMultiple:function(){for(var t=void 0,e=void 0,i=this.fieldsetName,n=0,o=i.length;n .qor-field__block > .qor-sortable__item").not(".qor-fieldset--new").length;t.attr("order-index",i).attr("order-item","item_"+i).css("order",i)}return t.data("itemIndex",this.index).removeClass("qor-fieldset--new"),t},del:function(t){var e=this.options,i=h(t.target).closest(e.itemClass),n=void 0;i.addClass("is-deleted").children(":visible").addClass("hidden").hide(),(n=h(e.alertTemplate.replace("{{name}}",this.parseName(i)))).find(e.undoClass).one(s,function(){if(this.maxitems<=this.getCurrentItems())return window.QOR.qorConfirm(this.$element.data("maxItemHint")),!1;i.find("> .qor-fieldset__alert").remove(),i.removeClass("is-deleted").children(".hidden").removeClass("hidden").show(),this.resetButton(),this.resetPositionButton()}.bind(this)),this.resetButton(),this.resetPositionButton(),i.append(n)},parseName:function(t){var e=t.find("input[name]").attr("name")||t.find("textarea[name]").attr("name");if(e)return e.replace(/[^\[\]]+$/,"")},destroy:function(){this.unbind(),this.$element.removeData(o)}},l.DEFAULTS={itemClass:".qor-fieldset",newClass:".qor-fieldset--new",addClass:".qor-fieldset__add",delClass:".qor-fieldset__delete",childrenClass:".qor-field__block",undoClass:".qor-fieldset__undo",alertTemplate:''},l.plugin=function(n){return this.each(function(){var t=h(this),e=t.data(o),i=void 0;e||t.data(o,e=new l(this,n)),"string"==typeof n&&h.isFunction(i=e[n])&&i.call(e)})},h(function(){var e=a,i={};h(document).on("disable.qor.replicator",function(t){l.plugin.call(h(e,t.target),"destroy")}).on(t,function(t){l.plugin.call(h(e,t.target),i)}).triggerHandler(t)}),l});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(d){var c=window.location,r=window.componentHandler,u=window.history,o="qor.globalSearch",t="enable."+o,e="click."+o,h=".qor-global-search--resource",s=".qor-global-search--results",a="is-active";function l(t,e){this.$element=d(t),this.options=d.extend({},l.DEFAULTS,d.isPlainObject(e)&&e),this.init()}return l.prototype={constructor:l,init:function(){this.bind(),this.initTab()},bind:function(){this.$element.on(e,d.proxy(this.click,this))},unbind:function(){this.$element.off(e,this.check)},initTab:function(){var t,e=c.search;/resource_name/.test(e)&&(t=e.match(/resource_name=\w+/g).toString().split("=")[1],d(h).removeClass(a),d('[data-resource="'+t+'"]').addClass(a))},click:function(t){var e=d(t.target),i=e.data();if(e.is(h)){var n,o=c.href.replace(/#/g,""),r=i.resource,s=/resource_name/.test(o),a="resource_name="+r,l=/keyword/.test(o)?"&":"?keyword=&";n=r?s?o.replace(/resource_name=\w+/g,a):o+l+a:o.replace(/&resource_name=\w+/g,""),u.pushState?this.fetchSearch(n,e):c.href=n}},fetchSearch:function(i,n){var o=document.title;d.ajax(i,{method:"GET",dataType:"html",beforeSend:function(){d(".mdl-spinner").remove(),d(s).prepend('').find(".qor-section").hide(),r.upgradeElement(document.querySelector(".mdl-spinner"))},success:function(t){var e=d(t).find(s).html();d(h).removeClass(a),n.addClass(a),u.pushState({Page:i,Title:o},o,i),d(".mdl-spinner").remove(),d(s).removeClass("loading").html(e),r.upgradeElements(document.querySelectorAll(".qor-table"))},error:function(t,e,i){d(s).find(".qor-section").show(),d(".mdl-spinner").remove(),window.alert([e,i].join(": "))}})},destroy:function(){this.unbind(),this.$element.removeData(o)}},l.DEFAULTS={},l.plugin=function(n){return this.each(function(){var t,e=d(this),i=e.data(o);i||e.data(o,i=new l(this,n)),"string"==typeof n&&d.isFunction(t=i[n])&&t.call(i)})},d(function(){var e='[data-toggle="qor.global.search"]',i={};d(document).on("disable.qor.globalSearch",function(t){l.plugin.call(d(e,t.target),"destroy")}).on(t,function(t){l.plugin.call(d(e,t.target),i)}).triggerHandler(t)}),l});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(l){var d=window.FormData,c=window.QOR,o="qor.selectcore",a="afterSelected."+o,t="click."+o,e="submit."+o,i="table tr";function r(t,e){this.$element=l(t),this.options=l.extend({},r.DEFAULTS,l.isPlainObject(e)&&e),this.init()}return r.prototype={constructor:r,init:function(){this.bind()},bind:function(){this.$element.on(t,i,this.processingData.bind(this)).on(e,"form",this.submit.bind(this))},unbind:function(){this.$element.off(t,i).off(e,"form")},processingData:function(e){var t,i=l(e.target).closest("tr"),n={},o=this.options,r=o.onSelect,s=o.loading;return(n=l.extend({},n,i.data())).$clickElement=i,t=n.mediaLibraryUrl||n.url,s&&l.isFunction(s)&&s(i.closest(".qor-bottomsheets")),t?l.getJSON(t,function(t){t.MediaOption&&(t.MediaOption=JSON.parse(t.MediaOption)),n=l.extend({},t,n),r&&l.isFunction(r)&&(r(n,e),l(document).trigger(a))}):r&&l.isFunction(r)&&(r(n,e),l(document).trigger(a)),!1},submit:function(e){var t=e.target,i=l(t),n=this,o=i.find(":submit"),r=void 0,s=l(c.$formLoading),a=this.options.onSubmit;l(document).trigger("selectcoreBeforeSend.qor.selectcore"),i.find(".qor-fieldset--new").remove(),d&&(e.preventDefault(),l.ajax(i.prop("action"),{method:i.prop("method"),data:new d(t),dataType:"json",processData:!1,contentType:!1,beforeSend:function(){l(".qor-submit-loading").remove(),s.appendTo(o.prop("disabled",!0).closest(".qor-form__actions")).trigger("enable.qor.material")},success:function(t){t.MediaOption&&(t.MediaOption=JSON.parse(t.MediaOption)),(r=t).primaryKey=r.ID,l(".qor-error").remove(),a&&l.isFunction(a)?(a(r,e),l(document).trigger("afterSubmitted.qor.selectcore")):n.refresh()},error:function(t){c.handleAjaxError(t)},complete:function(){o.prop("disabled",!1)}}))},refresh:function(){setTimeout(function(){window.location.reload()},350)},destroy:function(){this.unbind()}},r.plugin=function(n){return this.each(function(){var t=l(this),e=t.data(o),i=void 0;if(!e){if(/destroy/.test(n))return;t.data(o,e=new r(this,n))}"string"==typeof n&&l.isFunction(i=e[n])&&i.apply(e)})},l.fn.qorSelectCore=r.plugin,r});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(a){var n=a("body"),t=a(document),l=window.Mustache,o="qor.selectone",i="click."+o,r="enable."+o,e="reload.qor.bottomsheets",s=".qor-selected-many__remove",d=".qor-selected-many__undo",c="qor-selected-many__deleted",u=".qor-field__selectmany",h="is_selected",f="qor-bottomsheets__select-many";function p(t,e){this.$element=a(t),this.options=a.extend({},p.DEFAULTS,a.isPlainObject(e)&&e),this.init()}return p.prototype={constructor:p,init:function(){this.bind()},bind:function(){t.on(e,"."+f,this.reloadData.bind(this)),this.$element.on(i,s,this.clearSelect.bind(this)).on(i,'[data-select-modal="many"]',this.openBottomSheets.bind(this)).on(i,d,this.undoDelete.bind(this))},unbind:function(){t.off(i,'[data-select-modal="many"]').off(e,"."+f),this.$element.off(i,s).off(i,d)},clearSelect:function(t){var e=a(t.target),i=e.closest(u);return e.closest("[data-primary-key]").addClass(c),this.updateSelectInputData(i),!1},undoDelete:function(t){var e=a(t.target),i=e.closest(u);return e.closest("[data-primary-key]").removeClass(c),this.updateSelectInputData(i),!1},openBottomSheets:function(t){var e=a(t.target),i=e.data();this.BottomSheets=n.data("qor.bottomsheets"),this.bottomsheetsData=i,this.$selector=i.selectId?a(i.selectId):e.closest(u).find("select"),this.$selectFeild=this.$selector.closest(u).find(".qor-field__selected-many"),this.SELECT_MANY_SELECTED_ICON=a('[name="select-many-selected-icon"]').html(),this.SELECT_MANY_UNSELECTED_ICON=a('[name="select-many-unselected-icon"]').html(),this.SELECT_MANY_HINT=a('[name="select-many-hint"]').html(),this.SELECT_MANY_TEMPLATE=a('[name="select-many-template"]').html(),i.url=i.selectListingUrl,i.selectDefaultCreating&&(i.url=i.selectCreatingUrl),this.BottomSheets.open(i,this.handleSelectMany.bind(this))},reloadData:function(){this.initItems()},renderSelectMany:function(t){return l.render(this.SELECT_MANY_TEMPLATE,t)},renderHint:function(t){return l.render(this.SELECT_MANY_HINT,t)},initItems:function(){var i,t=this.$bottomsheets.find("tbody tr"),n=this.SELECT_MANY_SELECTED_ICON,o=this.SELECT_MANY_UNSELECTED_ICON,r=[];this.$selectFeild.find("[data-primary-key]").not("."+c).each(function(){r.push(a(this).data().primaryKey)}),t.each(function(){var t=a(this),e=t.find("td:first");i=t.data().primaryKey,"-1"!=r.indexOf(i)?(t.addClass(h),e.append(n)):e.append(o)}),this.updateHint(this.getSelectedItemData())},getSelectedItemData:function(){return{selectedNum:this.$selectFeild.find("[data-primary-key]").not("."+c).length}},updateHint:function(t){var e;a.extend(t,this.bottomsheetsData),e=this.renderHint(t),this.$bottomsheets.find(".qor-selectmany__hint").remove(),this.$bottomsheets.find(".qor-page__body").before(e)},updateSelectInputData:function(t){var e,i,n,o=(t||this.$selectFeild).find("[data-primary-key]").not("."+c),r=t?t.find(".qor-field__selectmany-input"):this.$selector,s=r.find("option");s.prop("selected",!1),o.each(function(){n=a(this).data().primaryKey,(e=s.filter('[value="'+n+'"]')).length||(i={primaryKey:n,displayName:""},e=a(l.render(p.SELECT_MANY_OPTION_TEMPLATE,i)),r.append(e)),e.prop("selected",!0)})},changeIcon:function(t,e){t.find(".qor-select__select-icon").remove(),t.find("td:first").prepend(e)},removeItem:function(t){var e=t.primaryKey;this.$selectFeild.find('[data-primary-key="'+e+'"]').find(s).click(),this.changeIcon(t.$clickElement,this.SELECT_MANY_UNSELECTED_ICON)},addItem:function(t,e){var i,n=this.renderSelectMany(t),o=this.$selectFeild.find('[data-primary-key="'+t.primaryKey+'"]');return o.length?o.hasClass(c)?(o.removeClass(c),this.updateSelectInputData(),void this.changeIcon(t.$clickElement,this.SELECT_MANY_SELECTED_ICON)):void 0:(this.$selectFeild.append(n),e?((i=a(l.render(p.SELECT_MANY_OPTION_TEMPLATE,t))).appendTo(this.$selector),i.prop("selected",!0),this.$bottomsheets.remove(),void(a(".qor-bottomsheets").is(":visible")||a("body").removeClass("qor-bottomsheets-open"))):void this.changeIcon(t.$clickElement,this.SELECT_MANY_SELECTED_ICON))},handleSelectMany:function(t){var e={onSelect:this.onSelectResults.bind(this),onSubmit:this.onSubmitResults.bind(this)};t.qorSelectCore(e).addClass(f),t.on(i,".qor-selectmany__selectall",this.handleSelectAll.bind(this)),this.$bottomsheets=t,this.initItems()},handleSelectAll:function(){var t=this.$bottomsheets.find(".qor-table tbody tr"),e=t.not(".is_selected");e.length?e.click():t.click()},onSelectResults:function(t){this.handleResults(t)},onSubmitResults:function(t){this.handleResults(t,!0)},handleResults:function(t,e){if(t.displayName=t.Text||t.Name||t.Title||t.Code||t[Object.keys(t)[0]],e)this.addItem(t,!0);else{var i=t.$clickElement;i.toggleClass(h),i.hasClass(h)?this.addItem(t):this.removeItem(t),this.updateHint(this.getSelectedItemData()),this.updateSelectInputData()}},destroy:function(){this.unbind(),this.$element.removeData(o)}},p.SELECT_MANY_OPTION_TEMPLATE='',p.plugin=function(n){return this.each(function(){var t,e=a(this),i=e.data(o);if(!i){if(/destroy/.test(n))return;e.data(o,i=new p(this,n))}"string"==typeof n&&a.isFunction(t=i[n])&&t.apply(i)})},a(function(){var e='[data-toggle="qor.selectmany"]';a(document).on("disable.qor.selectone",function(t){p.plugin.call(a(e,t.target),"destroy")}).on(r,function(t){p.plugin.call(a(e,t.target))}).triggerHandler(r)}),p});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(r){var n=r("body"),t=r(document),s=window.Mustache,o="qor.selectone",e="click."+o,i="enable."+o,a="reload.qor.bottomsheets",l=".qor-selected__remove",d=".qor-selected__change",c=".qor-field__selected",u=".qor-field__selectone-input",h=".qor-field__selectone-trigger",f=".qor-field__selectone",p="qor-bottomsheets__select-one";function m(t,e){this.$element=r(t),this.options=r.extend({},m.DEFAULTS,r.isPlainObject(e)&&e),this.init()}return m.prototype={constructor:m,init:function(){this.bind()},bind:function(){t.on(a,"."+p,this.reloadData.bind(this)),this.$element.on(e,l,this.clearSelect.bind(this)).on(e,"[data-selectone-url]",this.openBottomSheets.bind(this)).on(e,d,this.changeSelect)},unbind:function(){t.off(e,"[data-selectone-url]").off(a,"."+p),this.$element.off(e,l).off(e,d)},clearSelect:function(t){var e=r(t.target).closest(f);return e.find(c).remove(),e.find(u).html(""),e.find(u)[0].value="",e.find(h).show(),e.trigger("qor.selectone.unselected"),!1},changeSelect:function(){r(this).closest(f).find(h).trigger("click")},openBottomSheets:function(t){var e=r(t.target),i=e.data();this.BottomSheets=n.data("qor.bottomsheets"),this.$parent=e.closest(f),i.url=i.selectoneUrl,this.SELECT_ONE_SELECTED_ICON=r('[name="select-one-selected-icon"]').html(),this.BottomSheets.open(i,this.handleSelectOne.bind(this))},initItem:function(){var t,e=this.$parent.find(c);e.length&&(t=e.data().primaryKey)&&this.$bottomsheets.find('tr[data-primary-key="'+t+'"]').addClass("is_selected").find("td:first").append(this.SELECT_ONE_SELECTED_ICON)},reloadData:function(){this.initItem()},renderSelectOne:function(t){return s.render(r('[name="select-one-selected-template"]').html(),t)},handleSelectOne:function(t){var e={onSelect:this.onSelectResults.bind(this),onSubmit:this.onSubmitResults.bind(this)};t.qorSelectCore(e).addClass(p),this.$bottomsheets=t,this.initItem()},onSelectResults:function(t){this.handleResults(t)},onSubmitResults:function(t){this.handleResults(t,!0)},handleResults:function(t){var e,i=this.$parent,n=i.find("select"),o=i.find(c);t.displayName=t.Text||t.Name||t.Title||t.Code||t[Object.keys(t)[0]],t.selectoneValue=t.primaryKey||t.ID,n.length&&(e=this.renderSelectOne(t),o.length&&o.remove(),i.prepend(e),i.find(h).hide(),n.html(s.render(m.SELECT_ONE_OPTION_TEMPLATE,t)),n[0].value=t.primaryKey||t.ID,i.trigger("qor.selectone.selected",[t]),this.$bottomsheets.qorSelectCore("destroy").remove(),r(".qor-bottomsheets").is(":visible")||r("body").removeClass("qor-bottomsheets-open"))},destroy:function(){this.unbind(),this.$element.removeData(o)}},m.SELECT_ONE_OPTION_TEMPLATE='',m.plugin=function(n){return this.each(function(){var t,e=r(this),i=e.data(o);if(!i){if(/destroy/.test(n))return;e.data(o,i=new m(this,n))}"string"==typeof n&&r.isFunction(t=i[n])&&t.apply(i)})},r(function(){var e='[data-toggle="qor.selectone"]';r(document).on("disable.qor.selectone",function(t){m.plugin.call(r(e,t.target),"destroy")}).on(i,function(t){m.plugin.call(r(e,t.target))}).triggerHandler(i)}),m});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(d){var t=d(document),r="qor.selector",i="enable."+r,e="click."+r,c="selected",u="disabled",s="clearable",a="."+c,h=".qor-selector-toggle",l=".qor-selector-label",f=".qor-selector-menu",p=".qor-bottomsheets";function m(t,e){this.options=e,this.$element=d(t),this.init()}return m.prototype={constructor:m,init:function(){var t=this.$element;this.placeholder=t.attr("placeholder")||t.attr("name")||"Select",this.build()},build:function(){var t=this.$element,e=d(m.TEMPLATE),i=this.options.aligned+"-aligned",a={},n=t.data(),o=n.hover,l=t.attr("name");this.isBottom="bottom"==n.position,o&&e.addClass("hover"),e.addClass(i).find(f).html(function(){var s=[];return t.children().each(function(){var t=d(this),e=t.attr("selected"),i=t.attr("disabled"),n=t.attr("value"),o=t.text(),r=[];e&&(r.push(c),a.value=n,a.label=o,a.paramName=l),i&&r.push(u),s.push("'+o+"")}),s.join("")}),this.$selector=e,t.hide().after(e),e.find(h).data("paramName",l),this.pick(a,!0),this.bind()},unbuild:function(){this.unbind(),this.$selector.remove(),this.$element.show()},bind:function(){this.$selector.on(e,d.proxy(this.click,this)),t.on(e,d.proxy(this.close,this))},unbind:function(){this.$selector.off(e,this.click)},click:function(t){var e=d(t.target);t.stopPropagation(),e.is(".qor-selector-clear")?this.clear():e.is("li")?(e.hasClass(c)||e.hasClass(u)||this.pick(e.data()),this.close()):e.closest(h).length&&this.open()},pick:function(t,e){var i=this.$selector,n=!!t.value,o=this.$element;i.find(h).toggleClass("active",n).toggleClass(s,n&&this.options.clearable).find(l).text(t.label||this.placeholder),e||(i.find(f).children('[data-value="'+t.value+'"]').addClass(c).siblings(a).removeClass(c),o.val(t.value),o.closest(p).length&&!o.closest('[data-toggle="qor.filter"]').length?d(p).trigger("selectorChanged.qor.selector",[t.value,t.paramName]):o.trigger("change"))},clear:function(){var t=this.$element;this.$selector.find(h).removeClass("active").removeClass(s).find(l).text(this.placeholder).end().end().find(f).children(a).removeClass(c),t.val("").trigger("change")},open:function(){t.triggerHandler(e),d(".qor-filter__dropdown").hide(),this.$selector.addClass("open"),this.isBottom&&this.$selector.addClass("bottom")},close:function(){this.$selector.removeClass("open"),this.isBottom&&this.$selector.removeClass("bottom")},destroy:function(){this.unbuild(),this.$element.removeData(r)}},m.DEFAULTS={aligned:"left",clearable:!1},m.TEMPLATE='',m.plugin=function(o){return this.each(function(){var t,e,i=d(this),n=i.data(r);if(!n){if(/destroy/.test(o))return;t=d.extend({},m.DEFAULTS,i.data(),"object"===(void 0===o?"undefined":_typeof(o))&&o),i.data(r,n=new m(this,t))}"string"==typeof o&&d.isFunction(e=n[o])&&e.apply(n)})},d(function(){var e='[data-toggle="qor.selector"]';d(document).on("disable.qor.selector",function(t){m.plugin.call(d(e,t.target),"destroy")}).on(i,function(t){m.plugin.call(d(e,t.target))}).triggerHandler(i)}),m});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(q){var t=q(document),a=window.FormData,o=window._,l=window.QOR,r="qor.slideout",e="keyup."+r,i="click."+r,n="submit."+r,w="shown."+r,S="hidden."+r,s="transitionend",d="qor-slideout-open",c="qor-slideout-mini",u="is-shown",h="is-slided",$=".qor-body__loading";function f(t,e){var i=[],n="href";return e&&(n="src"),t.each(function(){i.push(q(this).attr(n))}),o.uniq(i)}function p(t,e){var i=q.fn.qorSliderAfterShow;for(var n in i)i.hasOwnProperty(n)&&!i[n].isLoaded&&(i[n].isLoaded=!0,i[n].call(this,t,e))}function k(t,e,i){for(var n=0,o=0,r=t.length;o[\s\S]*<\s*\/body\s*>/gi);if(u){u=u.join("").replace(/<\s*body/gi,"',m.TEMPLATE_LOADING='',m.plugin=function(n){return this.each(function(){var t,e=q(this),i=e.data(r);if(!i){if(/destroy/.test(n))return;e.data(r,i=new m(this,n))}"string"==typeof n&&q.isFunction(t=i[n])&&t.apply(i)})},q.fn.qorSlideout=m.plugin,m});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(o){var r=window.location,s="qor.sorter",t="enable."+s,e="click."+s,i="is-sortable";function a(t,e){this.$element=o(t),this.options=o.extend({},a.DEFAULTS,o.isPlainObject(e)&&e),this.init()}return a.prototype={constructor:a,init:function(){this.$element.addClass(i),this.bind()},bind:function(){this.$element.on(e,"> thead > tr > th",o.proxy(this.sort,this))},unbind:function(){this.$element.off(e,this.sort)},sort:function(t){var e=o(t.currentTarget).data("orderBy"),i=r.search,n="order_by="+e;e&&(/order_by/.test(i)?i=i.replace(/order_by(=\w+)?/,function(){return n}):i+=-1this.slideoutWidth&&this.$element.find(d).append(f.ARROW_RIGHT)},scrollTabLeft:function(t){t.stopPropagation();var e=s(d),i=e.scrollLeft(),n=i-this.slideoutWidth;0=n&&s(c).hide()}),!s(u).length&&this.$element.find(d).prepend(f.ARROW_LEFT))},switchTab:function(t){var i=s(t.target),e=this.$element,n=i.data(),o=r.data().tabScopeActive;if(s(".qor-slideout").is(":visible"))return i.hasClass(h)||(e.find(a).removeClass(h),i.addClass(h),s.ajax(n.tabUrl,{method:"GET",dataType:"html",processData:!1,contentType:!1,beforeSend:function(){s(".qor-layout__tab-spinner").remove();s(l).hide().before(''),window.componentHandler.upgradeElement(s(".qor-layout__tab-spinner")[0])},success:function(t){s(".qor-layout__tab-spinner").remove(),r.data("tabScopeActive",i.data("name"));var e=s(t).find(l).html();s(l).show().html(e).trigger("enable")},error:function(){s(".qor-layout__tab-spinner").remove(),r.data("tabScopeActive",o)}})),!1},destroy:function(){this.unbind(),r.removeData("tabScopeActive")}},f.ARROW_RIGHT='',f.ARROW_LEFT='',f.DEFAULTS={},f.plugin=function(n){return this.each(function(){var t,e=s(this),i=e.data(o);if(!i){if(/destroy/.test(n))return;e.data(o,i=new f(this,n))}"string"==typeof n&&s.isFunction(t=i[n])&&t.apply(i)})},s(function(){var e='[data-toggle="qor.tab"]';s(document).on("disable.qor.tabbar",function(t){f.plugin.call(s(e,t.target),"destroy")}).on(t,function(t){f.plugin.call(s(e,t.target))}).triggerHandler(t)}),f});_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?t(require("jquery")):t(jQuery)}(function(r){var s="qor.timepicker",t="enable."+s,e="click."+s,i="focus."+s,n="keydown."+s,o="blur."+s,a="selectTime."+s,l="[data-picker-type]";function d(t,e){this.$element=r(t),this.options=r.extend(!0,{},d.DEFAULTS,r.isPlainObject(e)&&e),this.formatDate=null,this.pickerData=this.$element.data(),this.parent=this.$element.closest(l),this.isDateTimePicker="datetime"==this.parent.data("picker-type"),this.$targetInput=this.parent.find(this.pickerData.targetInput||(this.isDateTimePicker?".qor-datetimepicker__input":".qor-datepicker__input")),this.init()}return d.prototype={init:function(){if(this.$targetInput.is(":disabled"))this.$element.remove();else{this.bind(),this.oldValue=this.$targetInput.val();var t=new Date,e=t.getMonth()+1,i=t.getDate();e=e<8?"0"+e:e,i=i<10?"0"+i:i,this.dateValueNow=t.getFullYear()+"-"+e+"-"+i}},bind:function(){this.isDateTimePicker&&this.$targetInput.qorTimepicker({timeFormat:"H:i",showOn:null,wrapHours:!1,scrollDefault:"now"}).on(a,r.proxy(this.changeTime,this)).on(o,r.proxy(this.blur,this)).on(i,r.proxy(this.focus,this)).on(n,r.proxy(this.keydown,this)),this.$element.on(e,r.proxy(this.show,this))},unbind:function(){this.$element.off(e,this.show),this.isDateTimePicker&&this.$targetInput.off(a,this.changeTime).off(o,this.blur).off(i,this.focus).off(n,this.keydown)},focus:function(){},blur:function(){var t,e,i,n,o,r,s=this.$targetInput.val(),a=s.split(" "),l=a.length,d=/\d{1,2}:\d{1,2}/,c=/^\d{4}-\d{1,2}-\d{1,2}/;if(s){if(1==l)c.test(a[0])&&(e=a[0],i="00:00"),d.test(a[0])&&(e=this.dateValueNow,i=a[0]);else for(var u=0;u',a);$("body").append(o),window.componentHandler.upgradeElement(document.getElementById("global-search-textfield")),$("#globalSearch").focus()})}),$(function(){var l=[],s="qoradmin_menu_status",e=localStorage.getItem(s);e&&e.length&&(l=e.split(",")),$(".qor-menu-container").on("click","> ul > li > a",function(){var e=$(this),a=e.parent(),o=e.next("ul"),t=a.attr("qor-icon-name");o.length&&(o.hasClass("in")?(l.push(t),a.removeClass("is-expanded"),o.one("transitionend",function(){o.removeClass("collapsing in")}).addClass("collapsing").height(0)):(l=_.without(l,t),a.addClass("is-expanded"),o.one("transitionend",function(){o.removeClass("collapsing")}).addClass("collapsing in").height(o.prop("scrollHeight"))),localStorage.setItem(s,l))}).find("> ul > li > a").each(function(){var e=$(this),a=e.parent(),o=e.next("ul"),t=a.attr("qor-icon-name");o.length&&(o.addClass("collapse"),a.addClass("has-menu"),-1!=l.indexOf(t)?o.height(0):(a.addClass("is-expanded"),o.addClass("in").height(o.prop("scrollHeight"))))});var a=$(".qor-page > .qor-page__header"),o=$(".qor-page > .qor-page__body"),t=a.find(".qor-page-subnav__header").length?96:48;a.length&&(a.height()>t&&o.css("padding-top",a.height()),$(".qor-page").addClass("has-header"),$("header.mdl-layout__header").addClass("has-action"))}),$(function(){$(".qor-mobile--show-actions").on("click",function(){$(".qor-page__header").toggleClass("actions-show")})}),$(function(){var p=$("body"),m=void 0,q=void 0,f="is-selected",b=function(){return p.hasClass("qor-bottomsheets-open")};function v(e){$("[data-url]").removeClass(f),e&&e.length&&e.addClass(f)}p.qorBottomSheets(),p.qorSlideout(),m=p.data("qor.slideout"),q=p.data("qor.bottomsheets"),$(document).on("click.qor.openUrl","[data-url]",function(e){var a,o,t=$(this),l=$(e.target),s=t.hasClass("qor-button--new"),n=t.hasClass("qor-button--edit"),r=(t.is(".qor-table tr[data-url]")||t.closest(".qor-js-table").length)&&!t.closest(".qor-slideout").length,i=t.data(),d=void 0,c=i.openType,h=t.parents(".qor-theme-slideout").length,u=t.closest(".qor-slideout").length,g=t.hasClass("qor-action-button")||t.hasClass("qor-action--button");if(e.stopPropagation(),"window"!=c){if(!(t.data("ajax-form")||l.closest(".qor-table--bulking").length||l.closest(".qor-button--actions").length||!l.data("url")&&l.is("a")||r&&b()))return g&&(a=$(".qor-js-table tbody").find(".mdl-checkbox__input:checked"),o=[],(d=!!a.length&&(a.each(function(){o.push($(this).closest("tr").data("primary-key"))}),o))&&(i=$.extend({},i,{actionData:d}))),i.$target=l,i.method&&"GET"!=i.method.toUpperCase()?void 0:("bottomsheet"!=c&&!g||"slideout"==c?"slideout"==c||r||s&&!b()||n?"slideout"==c||h?t.hasClass(f)?(m.hide(),v()):(m.open(i),v(t)):window.location.href=i.url:p.hasClass("qor-slideout-open")||s&&b()?q.open(i):h?m.open(i):q.open(i):g&&!d&&t.closest('[data-toggle="qor.action.bulk"]').length&&!u?window.QOR.qorConfirm(i.errorNoItem):q.open(i),!1)}else window.location.href=i.url})}),$(function(){var l=window.location;$(".qor-search").each(function(){var e=$(this),a=e.find(".qor-search__input"),o=e.find(".qor-search__clear"),t=!!a.val();e.closest(".qor-page__header").addClass("has-search"),$("header.mdl-layout__header").addClass("has-search"),o.on("click",function(){a.val()||t?"?"==l.search.replace(new RegExp(a.attr("name")+"\\=?\\w*"),"")?l.href=l.href.split("?")[0]:l.search=l.search.replace(new RegExp(a.attr("name")+"\\=?\\w*"),""):e.removeClass("is-dirty")})})});
\ No newline at end of file
+"use strict";$(function(){$(document).on("click.qor.alert",'[data-dismiss="alert"]',function(){$(this).closest(".qor-alert").removeClass("qor-alert__active")}),setTimeout(function(){$('.qor-alert[data-dismissible="true"]').removeClass("qor-alert__active")},5e3)}),$(function(){$(document).on("click",".qor-dialog--global-search",function(e){e.stopPropagation(),$(e.target).parents(".qor-dialog-content").length||$(e.target).is(".qor-dialog-content")||$(".qor-dialog--global-search").remove()}),$(document).on("click",".qor-global-search--show",function(e){e.preventDefault();var a=$(this).data(),o=window.Mustache.render('',a);$("body").append(o),window.componentHandler.upgradeElement(document.getElementById("global-search-textfield")),$("#globalSearch").focus()})}),$(function(){var l=[],s="qoradmin_menu_status",e=localStorage.getItem(s);e&&e.length&&(l=e.split(",")),$(".qor-menu-container").on("click","> ul > li > a",function(){var e=$(this),a=e.parent(),o=e.next("ul"),t=a.attr("qor-icon-name");o.length&&(o.hasClass("in")?(l.push(t),a.removeClass("is-expanded"),o.one("transitionend",function(){o.removeClass("collapsing in")}).addClass("collapsing").height(0)):(l=_.without(l,t),a.addClass("is-expanded"),o.one("transitionend",function(){o.removeClass("collapsing")}).addClass("collapsing in").height(o.prop("scrollHeight"))),localStorage.setItem(s,l))}).find("> ul > li > a").each(function(){var e=$(this),a=e.parent(),o=e.next("ul"),t=a.attr("qor-icon-name");o.length&&(o.addClass("collapse"),a.addClass("has-menu"),-1!=l.indexOf(t)?o.height(0):(a.addClass("is-expanded"),o.addClass("in").height(o.prop("scrollHeight"))))});var a=$(".qor-page > .qor-page__header"),o=$(".qor-page > .qor-page__body"),t=a.find(".qor-page-subnav__header").length?96:48;a.length&&(a.height()>t&&o.css("padding-top",a.height()),$(".qor-page").addClass("has-header"),$("header.mdl-layout__header").addClass("has-action"))}),$(function(){$(".qor-mobile--show-actions").on("click",function(){$(".qor-page__header").toggleClass("actions-show")})}),$(function(){var p=$("body"),m=void 0,q=void 0,f="is-selected",b=function(){return p.hasClass("qor-bottomsheets-open")};function v(e){$("[data-url]").removeClass(f),e&&e.length&&e.addClass(f)}p.qorBottomSheets(),p.qorSlideout(),m=p.data("qor.slideout"),q=p.data("qor.bottomsheets"),$(document).on("click.qor.openUrl","[data-url]",function(e){var a,o,t=$(this),l=$(e.target),s=t.hasClass("qor-button--new"),n=t.hasClass("qor-button--edit"),r=(t.is(".qor-table tr[data-url]")||t.closest(".qor-js-table").length)&&!t.closest(".qor-slideout").length,i=t.data(),d=void 0,c=i.openType,h=t.parents(".qor-theme-slideout").length,u=t.closest(".qor-slideout").length,g=t.hasClass("qor-action-button")||t.hasClass("qor-action--button");if(f==0){f=i.length};if(e.stopPropagation(),"window"!=c){if(!(t.data("ajax-form")||l.closest(".qor-table--bulking").length||l.closest(".qor-button--actions").length||!l.data("url")&&l.is("a")||r&&b()))return g&&(a=$(".qor-js-table tbody").find(".mdl-checkbox__input:checked"),o=[],(d=!!a.length&&(a.each(function(){o.push($(this).closest("tr").data("primary-key"))}),o))&&(i=$.extend({},i,{actionData:d}))),i.$target=l,i.method&&"GET"!=i.method.toUpperCase()?void 0:("bottomsheet"!=c&&!g||"slideout"==c?"slideout"==c||r||s&&!b()||n?"slideout"==c||h?t.hasClass(f)?(m.hide(),v()):(m.open(i),v(t)):window.location.href=i.url:p.hasClass("qor-slideout-open")||s&&b()?q.open(i):h?m.open(i):q.open(i):g&&!d&&t.closest('[data-toggle="qor.action.bulk"]').length&&!u?window.QOR.qorConfirm(i.errorNoItem):q.open(i),!1)}else window.location.href=i.url})}),$(function(){var l=window.location;$(".qor-search").each(function(){var e=$(this),a=e.find(".qor-search__input"),o=e.find(".qor-search__clear"),t=!!a.val();e.closest(".qor-page__header").addClass("has-search"),$("header.mdl-layout__header").addClass("has-search"),o.on("click",function(){a.val()||t?"?"==l.search.replace(new RegExp(a.attr("name")+"\\=?\\w*"),"")?l.href=l.href.split("?")[0]:l.search=l.search.replace(new RegExp(a.attr("name")+"\\=?\\w*"),""):e.removeClass("is-dirty")})})});
\ No newline at end of file