zoneminder/web/skins/classic/js/bootstrap-table-auto-refres...

11 lines
15 KiB
JavaScript

/**
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
*
* @version v1.18.1
* @homepage https://bootstrap-table.com
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
* @license MIT
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=function(t){return t&&t.Math==Math&&t},u=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r&&r)||Function("return this")(),c=function(t){try{return!!t()}catch(t){return!0}},f=!c((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,l={f:s&&!a.call({1:2},1)?function(t){var e=s(this,t);return!!e&&e.enumerable}:a},p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h={}.toString,y=function(t){return h.call(t).slice(8,-1)},b="".split,d=c((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==y(t)?b.call(t,""):Object(t)}:Object,v=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=function(t){return d(v(t))},m=function(t){return"object"==typeof t?null!==t:"function"==typeof t},O=function(t,e){if(!m(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!m(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},w={}.hasOwnProperty,j=function(t,e){return w.call(t,e)},S=u.document,R=m(S)&&m(S.createElement),T=function(t){return R?S.createElement(t):{}},P=!f&&!c((function(){return 7!=Object.defineProperty(T("div"),"a",{get:function(){return 7}}).a})),A=Object.getOwnPropertyDescriptor,E={f:f?A:function(t,e){if(t=g(t),e=O(e,!0),P)try{return A(t,e)}catch(t){}if(j(t,e))return p(!l.f.call(t,e),t[e])}},x=function(t){if(!m(t))throw TypeError(String(t)+" is not an object");return t},_=Object.defineProperty,I={f:f?_:function(t,e,n){if(x(t),e=O(e,!0),x(n),P)try{return _(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},k=f?function(t,e,n){return I.f(t,e,p(1,n))}:function(t,e,n){return t[e]=n,t},C=function(t,e){try{k(u,t,e)}catch(n){u[t]=e}return e},F="__core-js_shared__",M=u[F]||C(F,{}),D=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return D.call(t)});var q,B,L,N=M.inspectSource,z=u.WeakMap,W="function"==typeof z&&/native code/.test(N(z)),G=o((function(t){(t.exports=function(t,e){return M[t]||(M[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),$=0,K=Math.random(),Q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++$+K).toString(36)},V=G("keys"),X=function(t){return V[t]||(V[t]=Q(t))},Y={},H=u.WeakMap;if(W){var J=new H,U=J.get,Z=J.has,tt=J.set;q=function(t,e){return tt.call(J,t,e),e},B=function(t){return U.call(J,t)||{}},L=function(t){return Z.call(J,t)}}else{var et=X("state");Y[et]=!0,q=function(t,e){return k(t,et,e),e},B=function(t){return j(t,et)?t[et]:{}},L=function(t){return j(t,et)}}var nt,rt,ot={set:q,get:B,has:L,enforce:function(t){return L(t)?B(t):q(t,{})},getterFor:function(t){return function(e){var n;if(!m(e)||(n=B(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},it=o((function(t){var e=ot.get,n=ot.enforce,r=String(String).split("String");(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,f=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||j(o,"name")||k(o,"name",e),n(o).source=r.join("string"==typeof e?e:"")),t!==u?(c?!a&&t[e]&&(f=!0):delete t[e],f?t[e]=o:k(t,e,o)):f?t[e]=o:C(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||N(this)}))})),ut=u,ct=function(t){return"function"==typeof t?t:void 0},ft=function(t,e){return arguments.length<2?ct(ut[t])||ct(u[t]):ut[t]&&ut[t][e]||u[t]&&u[t][e]},at=Math.ceil,st=Math.floor,lt=function(t){return isNaN(t=+t)?0:(t>0?st:at)(t)},pt=Math.min,ht=function(t){return t>0?pt(lt(t),9007199254740991):0},yt=Math.max,bt=Math.min,dt=function(t){return function(e,n,r){var o,i=g(e),u=ht(i.length),c=function(t,e){var n=lt(t);return n<0?yt(n+e,0):bt(n,e)}(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},vt={includes:dt(!0),indexOf:dt(!1)}.indexOf,gt=function(t,e){var n,r=g(t),o=0,i=[];for(n in r)!j(Y,n)&&j(r,n)&&i.push(n);for(;e.length>o;)j(r,n=e[o++])&&(~vt(i,n)||i.push(n));return i},mt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ot=mt.concat("length","prototype"),wt={f:Object.getOwnPropertyNames||function(t){return gt(t,Ot)}},jt={f:Object.getOwnPropertySymbols},St=ft("Reflect","ownKeys")||function(t){var e=wt.f(x(t)),n=jt.f;return n?e.concat(n(t)):e},Rt=function(t,e){for(var n=St(e),r=I.f,o=E.f,i=0;i<n.length;i++){var u=n[i];j(t,u)||r(t,u,o(e,u))}},Tt=/#|\.prototype\./,Pt=function(t,e){var n=Et[At(t)];return n==_t||n!=xt&&("function"==typeof e?c(e):!!e)},At=Pt.normalize=function(t){return String(t).replace(Tt,".").toLowerCase()},Et=Pt.data={},xt=Pt.NATIVE="N",_t=Pt.POLYFILL="P",It=Pt,kt=E.f,Ct=function(t,e){var n,r,o,i,c,f=t.target,a=t.global,s=t.stat;if(n=a?u:s?u[f]||C(f,{}):(u[f]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(c=kt(n,r))&&c.value:n[r],!It(a?r:f+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Rt(i,o)}(t.sham||o&&o.sham)&&k(i,"sham",!0),it(n,r,i,t)}},Ft=Array.isArray||function(t){return"Array"==y(t)},Mt=function(t){return Object(v(t))},Dt=function(t,e,n){var r=O(e);r in t?I.f(t,r,p(0,n)):t[r]=n},qt=!!Object.getOwnPropertySymbols&&!c((function(){return!String(Symbol())})),Bt=qt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Lt=G("wks"),Nt=u.Symbol,zt=Bt?Nt:Nt&&Nt.withoutSetter||Q,Wt=function(t){return j(Lt,t)||(qt&&j(Nt,t)?Lt[t]=Nt[t]:Lt[t]=zt("Symbol."+t)),Lt[t]},Gt=Wt("species"),$t=function(t,e){var n;return Ft(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Ft(n.prototype)?m(n)&&null===(n=n[Gt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Kt=ft("navigator","userAgent")||"",Qt=u.process,Vt=Qt&&Qt.versions,Xt=Vt&&Vt.v8;Xt?rt=(nt=Xt.split("."))[0]+nt[1]:Kt&&(!(nt=Kt.match(/Edge\/(\d+)/))||nt[1]>=74)&&(nt=Kt.match(/Chrome\/(\d+)/))&&(rt=nt[1]);var Yt,Ht=rt&&+rt,Jt=Wt("species"),Ut=Wt("isConcatSpreadable"),Zt=9007199254740991,te="Maximum allowed index exceeded",ee=Ht>=51||!c((function(){var t=[];return t[Ut]=!1,t.concat()[0]!==t})),ne=(Yt="concat",Ht>=51||!c((function(){var t=[];return(t.constructor={})[Jt]=function(){return{foo:1}},1!==t[Yt](Boolean).foo}))),re=function(t){if(!m(t))return!1;var e=t[Ut];return void 0!==e?!!e:Ft(t)};Ct({target:"Array",proto:!0,forced:!ee||!ne},{concat:function(t){var e,n,r,o,i,u=Mt(this),c=$t(u,0),f=0;for(e=-1,r=arguments.length;e<r;e++)if(re(i=-1===e?u:arguments[e])){if(f+(o=ht(i.length))>Zt)throw TypeError(te);for(n=0;n<o;n++,f++)n in i&&Dt(c,f,i[n])}else{if(f>=Zt)throw TypeError(te);Dt(c,f++,i)}return c.length=f,c}});var oe,ie=function(t,e,n){if(function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function")}(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},ue=[].push,ce=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,u=5==t||i;return function(c,f,a,s){for(var l,p,h=Mt(c),y=d(h),b=ie(f,a,3),v=ht(y.length),g=0,m=s||$t,O=e?m(c,v):n?m(c,0):void 0;v>g;g++)if((u||g in y)&&(p=b(l=y[g],g,h),t))if(e)O[g]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return g;case 2:ue.call(O,l)}else if(o)return!1;return i?-1:r||o?o:O}},fe={forEach:ce(0),map:ce(1),filter:ce(2),some:ce(3),every:ce(4),find:ce(5),findIndex:ce(6)},ae=Object.keys||function(t){return gt(t,mt)},se=f?Object.defineProperties:function(t,e){x(t);for(var n,r=ae(e),o=r.length,i=0;o>i;)I.f(t,n=r[i++],e[n]);return t},le=ft("document","documentElement"),pe=X("IE_PROTO"),he=function(){},ye=function(t){return"<script>"+t+"</"+"script>"},be=function(){try{oe=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;be=oe?function(t){t.write(ye("")),t.close();var e=t.parentWindow.Object;return t=null,e}(oe):((e=T("iframe")).style.display="none",le.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(ye("document.F=Object")),t.close(),t.F);for(var n=mt.length;n--;)delete be.prototype[mt[n]];return be()};Y[pe]=!0;var de=Object.create||function(t,e){var n;return null!==t?(he.prototype=x(t),n=new he,he.prototype=null,n[pe]=t):n=be(),void 0===e?n:se(n,e)},ve=Wt("unscopables"),ge=Array.prototype;null==ge[ve]&&I.f(ge,ve,{configurable:!0,value:de(null)});var me,Oe=Object.defineProperty,we={},je=function(t){throw t},Se=fe.find,Re="find",Te=!0,Pe=function(t,e){if(j(we,t))return we[t];e||(e={});var n=[][t],r=!!j(e,"ACCESSORS")&&e.ACCESSORS,o=j(e,0)?e[0]:je,i=j(e,1)?e[1]:void 0;return we[t]=!!n&&!c((function(){if(r&&!f)return!0;var t={length:-1};r?Oe(t,1,{enumerable:!0,get:je}):t[1]=1,n.call(t,o,i)}))}(Re);Re in[]&&Array(1).find((function(){Te=!1})),Ct({target:"Array",proto:!0,forced:Te||!Pe},{find:function(t){return Se(this,t,arguments.length>1?arguments[1]:void 0)}}),me=Re,ge[ve][me]=!0;var Ae=Object.assign,Ee=Object.defineProperty,xe=!Ae||c((function(){if(f&&1!==Ae({b:1},Ae(Ee({},"a",{enumerable:!0,get:function(){Ee(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=Ae({},t)[n]||ae(Ae({},e)).join("")!=r}))?function(t,e){for(var n=Mt(t),r=arguments.length,o=1,i=jt.f,u=l.f;r>o;)for(var c,a=d(arguments[o++]),s=i?ae(a).concat(i(a)):ae(a),p=s.length,h=0;p>h;)c=s[h++],f&&!u.call(a,c)||(n[c]=a[c]);return n}:Ae;function _e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ie(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ke(t){return(ke=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ce(t,e){return(Ce=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Fe(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Me(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ke(t);if(e){var o=ke(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fe(this,n)}}function De(t,e,n){return(De="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ke(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}Ct({target:"Object",stat:!0,forced:Object.assign!==xe},{assign:xe});var qe=n.default.fn.bootstrapTable.utils;n.default.extend(n.default.fn.bootstrapTable.defaults,{autoRefresh:!1,autoRefreshInterval:60,autoRefreshSilent:!0,autoRefreshStatus:!0,autoRefreshFunction:null}),n.default.extend(n.default.fn.bootstrapTable.defaults.icons,{autoRefresh:{bootstrap3:"glyphicon-time icon-time",materialize:"access_time","bootstrap-table":"icon-clock"}[n.default.fn.bootstrapTable.theme]||"fa-clock"}),n.default.extend(n.default.fn.bootstrapTable.locales,{formatAutoRefresh:function(){return"Auto Refresh"}}),n.default.extend(n.default.fn.bootstrapTable.defaults,n.default.fn.bootstrapTable.locales),n.default.BootstrapTable=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ce(t,e)}(i,t);var e,n,r,o=Me(i);function i(){return _e(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"init",value:function(){for(var t,e=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];(t=De(ke(i.prototype),"init",this)).call.apply(t,[this].concat(r)),this.options.autoRefresh&&this.options.autoRefreshStatus&&(this.options.autoRefreshFunction=setInterval((function(){e.refresh({silent:e.options.autoRefreshSilent})}),1e3*this.options.autoRefreshInterval))}},{key:"initToolbar",value:function(){var t;this.options.autoRefresh&&(this.buttons=Object.assign(this.buttons,{autoRefresh:{html:'\n <button class="auto-refresh '.concat(this.constants.buttonsClass,"\n ").concat(this.options.autoRefreshStatus?" ".concat(this.constants.classes.buttonActive):"",'"\n type="button" name="autoRefresh" title="').concat(this.options.formatAutoRefresh(),'">\n ').concat(this.options.showButtonIcons?qe.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.autoRefresh):"","\n ").concat(this.options.showButtonText?this.options.formatAutoRefresh():"","\n </button>\n "),event:this.toggleAutoRefresh}}));for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=De(ke(i.prototype),"initToolbar",this)).call.apply(t,[this].concat(n))}},{key:"toggleAutoRefresh",value:function(){var t=this;this.options.autoRefresh&&(this.options.autoRefreshStatus?(clearInterval(this.options.autoRefreshFunction),this.$toolbar.find(">.columns .auto-refresh").removeClass(this.constants.classes.buttonActive)):(this.options.autoRefreshFunction=setInterval((function(){t.refresh({silent:t.options.autoRefreshSilent})}),1e3*this.options.autoRefreshInterval),this.$toolbar.find(">.columns .auto-refresh").addClass(this.constants.classes.buttonActive)),this.options.autoRefreshStatus=!this.options.autoRefreshStatus)}}])&&Ie(e.prototype,n),r&&Ie(e,r),i}(n.default.BootstrapTable)}));