| @@ -1,2 +1,4 @@ | ||
| 1 | -/*! For license information please see 7837.js.LICENSE.txt */ | |
| 2 | -"use strict";(globalThis.webpackChunkb_blocks=globalThis.webpackChunkb_blocks||[]).push([[7837],{7837(t,n,e){e.r(n),e.d(n,{default:()=>w});var o=e(428),i=e(5668);let s=o;var a=0,r=0,l=i.default.ext.buttons,u=null;function c(t,n,e){s.fn.animate?t.stop().fadeIn(n,e):(t.css("display","block"),e&&e.call(t))}function d(t,n,e){s.fn.animate?t.stop().fadeOut(n,e):(t.css("display","none"),e&&e.call(t))}var f,p=function(t,n){if(!i.default.versionCheck("2"))throw"Warning: Buttons requires DataTables 2 or newer";if(!(this instanceof p))return function(n){return new p(n,t).container()};void 0===n&&(n={}),!0===n&&(n={}),Array.isArray(n)&&(n={buttons:n}),this.c=s.extend(!0,{},p.defaults,n),n.buttons&&(this.c.buttons=n.buttons),this.s={dt:new i.default.Api(t),buttons:[],listenKeys:"",namespace:"dtb"+a++},this.dom={container:s("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)},this._constructor()};s.extend(p.prototype,{action:function(t,n){var e=this._nodeToButton(t);return void 0===n?e.conf.action:(e.conf.action=n,this)},active:function(t,n){var e=this._nodeToButton(t),o=this.c.dom.button.active,i=s(e.node);return e.inCollection&&this.c.dom.collection.button&&void 0!==this.c.dom.collection.button.active&&(o=this.c.dom.collection.button.active),void 0===n?i.hasClass(o):(i.toggleClass(o,void 0===n||n),this)},add:function(t,n,e){var o=this.s.buttons;if("string"==typeof n){for(var i=n.split("-"),s=this.s,a=0,r=i.length-1;a<r;a++)s=s.buttons[1*i[a]];o=s.buttons,n=1*i[i.length-1]}let l=this._expandButton(o,t,void 0!==t?t.split:void 0,(void 0===t||void 0===t.split||0===t.split.length)&&void 0!==s,!1,n);return void 0!==e&&!0!==e||this._draw(),l},collectionRebuild:function(t,n){var e=this._nodeToButton(t);if(void 0!==n){var o;for(o=e.buttons.length-1;o>=0;o--)this.remove(e.buttons[o].node);for(e.conf.prefixButtons&&n.unshift.apply(n,e.conf.prefixButtons),e.conf.postfixButtons&&n.push.apply(n,e.conf.postfixButtons),o=0;o<n.length;o++){var i=n[o];this._expandButton(e.buttons,i,void 0!==i&&void 0!==i.config&&void 0!==i.config.split,!0,void 0!==i.parentConf&&void 0!==i.parentConf.split,null,i.parentConf)}}this._draw(e.collection,e.buttons)},container:function(){return this.dom.container},disable:function(t){var n=this._nodeToButton(t);return n.isSplit?s(n.node.childNodes[0]).addClass(this.c.dom.button.disabled).prop("disabled",!0):s(n.node).addClass(this.c.dom.button.disabled).prop("disabled",!0),n.disabled=!0,this._checkSplitEnable(),this},destroy:function(){s("body").off("keyup."+this.s.namespace);var t,n,e=this.s.buttons.slice();for(t=0,n=e.length;t<n;t++)this.remove(e[t].node);this.dom.container.remove();var o=this.s.dt.settings()[0];for(t=0,n=o.length;t<n;t++)if(o.inst===this){o.splice(t,1);break}return this},enable:function(t,n){if(!1===n)return this.disable(t);var e=this._nodeToButton(t);return e.isSplit?s(e.node.childNodes[0]).removeClass(this.c.dom.button.disabled).prop("disabled",!1):s(e.node).removeClass(this.c.dom.button.disabled).prop("disabled",!1),e.disabled=!1,this._checkSplitEnable(),this},index:function(t,n,e){n||(n="",e=this.s.buttons);for(var o=0,i=e.length;o<i;o++){var s=e[o].buttons;if(e[o].node===t)return n+o;if(s&&s.length){var a=this.index(t,o+"-",s);if(null!==a)return a}}return null},name:function(){return this.c.name},node:function(t){if(!t)return this.dom.container;var n=this._nodeToButton(t);return s(n.node)},processing:function(t,n){var e=this.s.dt,o=this._nodeToButton(t);return void 0===n?s(o.node).hasClass("processing"):(s(o.node).toggleClass("processing",n),s(e.table().node()).triggerHandler("buttons-processing.dt",[n,e.button(t),e,s(t),o.conf]),this)},remove:function(t){var n=this._nodeToButton(t),e=this._nodeToHost(t),o=this.s.dt;if(n.buttons.length)for(var i=n.buttons.length-1;i>=0;i--)this.remove(n.buttons[i].node);n.conf.destroying=!0,n.conf.destroy&&n.conf.destroy.call(o.button(t),o,s(t),n.conf),this._removeKey(n.conf),s(n.node).remove(),n.inserter&&s(n.inserter).remove();var a=s.inArray(n,e);return e.splice(a,1),this},text:function(t,n){var e=this._nodeToButton(t),o=e.textNode,i=this.s.dt,a=s(e.node),r=function(t){return"function"==typeof t?t(i,a,e.conf):t};return void 0===n?r(e.conf.text):(e.conf.text=n,o.html(r(n)),this)},_constructor:function(){var t=this,n=this.s.dt,e=n.settings()[0],o=this.c.buttons;e._buttons||(e._buttons=[]),e._buttons.push({inst:this,name:this.c.name});for(var i=0,a=o.length;i<a;i++)this.add(o[i]);n.on("destroy",(function(n,o){o===e&&t.destroy()})),s("body").on("keyup."+this.s.namespace,(function(n){if(!document.activeElement||document.activeElement===document.body){var e=String.fromCharCode(n.keyCode).toLowerCase();-1!==t.s.listenKeys.toLowerCase().indexOf(e)&&t._keypress(e,n)}}))},_addKey:function(t){t.key&&(this.s.listenKeys+=s.isPlainObject(t.key)?t.key.key:t.key)},_draw:function(t,n){t||(t=this.dom.container,n=this.s.buttons),t.children().detach();for(var e=0,o=n.length;e<o;e++)t.append(n[e].inserter),t.append(" "),n[e].buttons&&n[e].buttons.length&&this._draw(n[e].collection,n[e].buttons)},_expandButton:function(t,n,e,o,i,a,r){var l,u=this.s.dt,c=!1,d=this.c.dom.collection,f=Array.isArray(n)?n:[n];void 0===n&&(f=Array.isArray(e)?e:[e]);for(var p=0,h=f.length;p<h;p++){var b=this._resolveExtends(f[p]);if(b)if(c=!(!b.config||!b.config.split),Array.isArray(b))this._expandButton(t,b,void 0!==g&&void 0!==g.conf?g.conf.split:void 0,o,void 0!==r&&void 0!==r.split,a,r);else{var g=this._buildButton(b,o,void 0!==b.split||void 0!==b.config&&void 0!==b.config.split,i);if(g){if(null!=a?(t.splice(a,0,g),a++):t.push(g),g.conf.dropIcon&&!g.conf.split&&s(g.node).addClass(this.c.dom.button.dropClass).append(this.c.dom.button.dropHtml),g.conf.buttons&&(g.collection=s("<"+d.container.content.tag+"/>"),g.conf._collection=g.collection,this._expandButton(g.buttons,g.conf.buttons,g.conf.split,!c,c,a,g.conf)),g.conf.split){g.collection=s("<"+d.container.tag+"/>"),g.conf._collection=g.collection;for(var m=0;m<g.conf.split.length;m++){var v=g.conf.split[m];"object"==typeof v&&(v.parent=r,void 0===v.collectionLayout&&(v.collectionLayout=g.conf.collectionLayout),void 0===v.dropup&&(v.dropup=g.conf.dropup),void 0===v.fade&&(v.fade=g.conf.fade))}this._expandButton(g.buttons,g.conf.buttons,g.conf.split,!c,c,a,g.conf)}g.conf.parent=r,b.init&&b.init.call(u.button(g.node),u,s(g.node),b),l=g.node}}}return l},_buildButton:function(t,n,e,o){var i,a,u=this,c=this.c.dom,d=this.s.dt,f=!1,p=function(n){return"function"==typeof n?n(d,a,t):n},h=s.extend(!0,{},c.button);if(n&&e&&c.collection.split?s.extend(!0,h,c.collection.split.action):o||n?s.extend(!0,h,c.collection.button):e&&s.extend(!0,h,c.split.button),t.spacer){var b=s("<"+h.spacer.tag+"/>").addClass("dt-button-spacer "+t.style+" "+h.spacer.className).html(p(t.text));return{conf:t,node:b,nodeChild:null,inserter:b,buttons:[],inCollection:n,isSplit:e,collection:null,textNode:b}}if(t.available&&!t.available(d,t)&&!t.html)return!1;if(t.html)a=s(t.html);else{var g=function(t,n,e,o,i){o.action.call(n.button(e),t,n,e,o,i),s(n.table().node()).triggerHandler("buttons-action.dt",[n.button(e),n,e,o])},m=function(t,n,e,o){o.async?(u.processing(e[0],!0),setTimeout((function(){g(t,n,e,o,(function(){u.processing(e[0],!1)}))}),o.async)):g(t,n,e,o,(function(){}))},v=t.tag||h.tag,y=void 0===t.clickBlurs||t.clickBlurs;if(a=s("<"+v+"/>").addClass(h.className).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",(function(n){n.preventDefault(),!a.hasClass(h.disabled)&&t.action&&m(n,d,a,t),y&&a.trigger("blur")})).on("keypress.dtb",(function(n){13===n.keyCode&&(n.preventDefault(),!a.hasClass(h.disabled)&&t.action&&m(n,d,a,t))})),"a"===v.toLowerCase()&&a.attr("href","#"),"button"===v.toLowerCase()&&a.attr("type","button"),h.liner.tag){var x=h.liner.tag.toLowerCase(),C=s("<"+x+"/>").html(p(t.text)).addClass(h.liner.className);"a"===x&&C.attr("href","#"),"a"!==x&&"button"!==x||(C.attr("tabindex",this.s.dt.settings()[0].iTabIndex),f=!0),a.append(C),i=C}else a.html(p(t.text)),i=a;f||a.attr("tabindex",this.s.dt.settings()[0].iTabIndex),!1===t.enabled&&a.addClass(h.disabled),t.className&&a.addClass(t.className),t.titleAttr&&a.attr("title",p(t.titleAttr)),t.attr&&a.attr(t.attr),t.namespace||(t.namespace=".dt-button-"+r++),void 0!==t.config&&t.config.split&&(t.split=t.config.split)}var w,_,k=this.c.dom.buttonContainer;if(w=k&&k.tag?s("<"+k.tag+"/>").addClass(k.className).append(a):a,this._addKey(t),this.c.buttonCreated&&(w=this.c.buttonCreated(t,w)),e){var A=n?s.extend(!0,this.c.dom.split,this.c.dom.collection.split):this.c.dom.split,N=A.wrapper;_=s("<"+N.tag+"/>").addClass(N.className).append(a);var T=s.extend(t,{autoClose:!0,align:A.dropdown.align,attr:{"aria-haspopup":"dialog","aria-expanded":!1},className:A.dropdown.className,closeButton:!1,splitAlignClass:A.dropdown.splitAlignClass,text:A.dropdown.text});this._addKey(T);var B=function(t,n,e,o){l.split.action.call(n.button(_),t,n,e,o),s(n.table().node()).triggerHandler("buttons-action.dt",[n.button(e),n,e,o]),e.attr("aria-expanded",!0)},H=s('<button class="'+A.dropdown.className+' dt-button"></button>').html(this.c.dom.button.dropHtml).addClass(this.c.dom.button.dropClass).on("click.dtb",(function(t){t.preventDefault(),t.stopPropagation(),H.hasClass(h.disabled)||B(t,d,H,T),y&&H.trigger("blur")})).on("keypress.dtb",(function(t){13===t.keyCode&&(t.preventDefault(),H.hasClass(h.disabled)||B(t,d,H,T))}));0===t.split.length&&H.addClass("dtb-hide-drop"),_.append(H).attr(T.attr)}var S=e?_.get(0):a.get(0);return{conf:t,node:S,nodeChild:S&&S.children&&S.children.length?S.children[0]:null,inserter:e?_:w,buttons:[],inCollection:n,isSplit:e,inSplit:o,collection:null,textNode:i}},_checkSplitEnable:function(t){t||(t=this.s.buttons);for(var n=0;n<t.length;n++){var e=t[n];if(e.isSplit){var o=e.node.childNodes[1];this._checkAnyEnabled(e.buttons)?s(o).removeClass(this.c.dom.button.disabled).prop("disabled",!1):s(o).addClass(this.c.dom.button.disabled).prop("disabled",!1)}else e.isCollection&&this._checkSplitEnable(e.buttons)}},_checkAnyEnabled:function(t){for(var n=0;n<t.length;n++)if(!t[n].disabled)return!0;return!1},_nodeToButton:function(t,n){n||(n=this.s.buttons);for(var e=0,o=n.length;e<o;e++){if(n[e].node===t||n[e].nodeChild===t)return n[e];if(n[e].buttons.length){var i=this._nodeToButton(t,n[e].buttons);if(i)return i}}},_nodeToHost:function(t,n){n||(n=this.s.buttons);for(var e=0,o=n.length;e<o;e++){if(n[e].node===t)return n;if(n[e].buttons.length){var i=this._nodeToHost(t,n[e].buttons);if(i)return i}}},_keypress:function(t,n){if(!n._buttonsHandled){var e=function(e,o){if(e.key)if(e.key===t)n._buttonsHandled=!0,s(o).click();else if(s.isPlainObject(e.key)){if(e.key.key!==t)return;if(e.key.shiftKey&&!n.shiftKey)return;if(e.key.altKey&&!n.altKey)return;if(e.key.ctrlKey&&!n.ctrlKey)return;if(e.key.metaKey&&!n.metaKey)return;n._buttonsHandled=!0,s(o).click()}},o=function(t){for(var n=0,i=t.length;n<i;n++)e(t[n].conf,t[n].node),t[n].buttons.length&&o(t[n].buttons)};o(this.s.buttons)}},_removeKey:function(t){if(t.key){var n=s.isPlainObject(t.key)?t.key.key:t.key,e=this.s.listenKeys.split(""),o=s.inArray(n,e);e.splice(o,1),this.s.listenKeys=e.join("")}},_resolveExtends:function(t){var n,e,o=this,i=this.s.dt,a=function(n){for(var e=0;!s.isPlainObject(n)&&!Array.isArray(n);){if(void 0===n)return;if("function"==typeof n){if(!(n=n.call(o,i,t)))return!1}else if("string"==typeof n){if(!l[n])return{html:n};n=l[n]}if(++e>30)throw"Buttons: Too many iterations"}return Array.isArray(n)?n:s.extend({},n)};for(t=a(t);t&&t.extend;){if(!l[t.extend])throw"Cannot extend unknown button type: "+t.extend;var r=a(l[t.extend]);if(Array.isArray(r))return r;if(!r)return!1;var u=r.className;void 0!==t.config&&void 0!==r.config&&(t.config=s.extend({},r.config,t.config)),t=s.extend({},r,t),u&&t.className!==u&&(t.className=u+" "+t.className),t.extend=r.extend}var c=t.postfixButtons;if(c)for(t.buttons||(t.buttons=[]),n=0,e=c.length;n<e;n++)t.buttons.push(c[n]);var d=t.prefixButtons;if(d)for(t.buttons||(t.buttons=[]),n=0,e=d.length;n<e;n++)t.buttons.splice(n,0,d[n]);return t},_popover:function(t,n,e){var o=n,i=this.c,a=!1,r=s.extend({align:"button-left",autoClose:!1,background:!0,backgroundClassName:"dt-button-background",closeButton:!0,containerClassName:i.dom.collection.container.className,contentClassName:i.dom.collection.container.content.className,collectionLayout:"",collectionTitle:"",dropup:!1,fade:400,popoverTitle:"",rightAlignClassName:"dt-button-right",tag:i.dom.collection.container.tag},e),l=r.tag+"."+r.containerClassName.replace(/ /g,"."),u=n.node(),f=r.collectionLayout.includes("fixed")?s("body"):n.node(),h=function(){a=!0,d(s(l),r.fade,(function(){s(this).detach()})),s(o.buttons('[aria-haspopup="dialog"][aria-expanded="true"]').nodes()).attr("aria-expanded","false"),s("div.dt-button-background").off("click.dtb-collection"),p.background(!1,r.backgroundClassName,r.fade,f),s(window).off("resize.resize.dtb-collection"),s("body").off(".dtb-collection"),o.off("buttons-action.b-internal"),o.off("destroy.dtb-popover"),s("body").trigger("buttons-popover-hide.dt")};if(!1!==t){var b=s(o.buttons('[aria-haspopup="dialog"][aria-expanded="true"]').nodes());if(b.length&&(f.closest(l).length&&(f=b.eq(0)),h()),r.sort){var g=s("button",t).map((function(t,n){return{text:s(n).text(),el:n}})).toArray();g.sort((function(t,n){return t.text.localeCompare(n.text)})),s(t).append(g.map((function(t){return t.el})))}var m=s(".dt-button",t).length,v="";3===m?v="dtb-b3":2===m?v="dtb-b2":1===m&&(v="dtb-b1");var y=s("<"+r.tag+"/>").addClass(r.containerClassName).addClass(r.collectionLayout).addClass(r.splitAlignClass).addClass(v).css("display","none").attr({"aria-modal":!0,role:"dialog"});t=s(t).addClass(r.contentClassName).attr("role","menu").appendTo(y),u.attr("aria-expanded","true"),f.parents("body")[0]!==document.body&&(f=s(document.body).children("div, section, p").last()),r.popoverTitle?y.prepend('<div class="dt-button-collection-title">'+r.popoverTitle+"</div>"):r.collectionTitle&&y.prepend('<div class="dt-button-collection-title">'+r.collectionTitle+"</div>"),r.closeButton&&y.prepend('<div class="dtb-popover-close">×</div>').addClass("dtb-collection-closeable"),c(y.insertAfter(f),r.fade);var x=s(n.table().container()),C=y.css("position");if("container"!==r.span&&"dt-container"!==r.align||(f=f.parent(),y.css("width",x.width())),"absolute"===C){var w=s(f[0].offsetParent),_=f.position(),k=f.offset(),A=w.offset(),N=w.position(),T=window.getComputedStyle(w[0]);A.height=w.outerHeight(),A.width=w.width()+parseFloat(T.paddingLeft),A.right=A.left+A.width,A.bottom=A.top+A.height;var B=_.top+f.outerHeight(),H=_.left;y.css({top:B,left:H}),T=window.getComputedStyle(y[0]);var S=y.offset();S.height=y.outerHeight(),S.width=y.outerWidth(),S.right=S.left+S.width,S.bottom=S.top+S.height,S.marginTop=parseFloat(T.marginTop),S.marginBottom=parseFloat(T.marginBottom),r.dropup&&(B=_.top-S.height-S.marginTop-S.marginBottom),("button-right"===r.align||y.hasClass(r.rightAlignClassName))&&(H=_.left-S.width+f.outerWidth()),"dt-container"!==r.align&&"container"!==r.align||H<_.left&&(H=-_.left),N.left+H+S.width>s(window).width()&&(H=s(window).width()-S.width-N.left),k.left+H<0&&(H=-k.left),N.top+B+S.height>s(window).height()+s(window).scrollTop()&&(B=_.top-S.height-S.marginTop-S.marginBottom),w.offset().top+B<s(window).scrollTop()&&(B=_.top+f.outerHeight()),y.css({top:B,left:H})}else{var K=function(){var t=s(window).height()/2,n=y.height()/2;n>t&&(n=t),y.css("marginTop",-1*n)};K(),s(window).on("resize.dtb-collection",(function(){K()}))}r.background&&p.background(!0,r.backgroundClassName,r.fade,r.backgroundHost||f),s("div.dt-button-background").on("click.dtb-collection",(function(){})),r.autoClose&&setTimeout((function(){o.on("buttons-action.b-internal",(function(t,n,e,o){o[0]!==f[0]&&h()}))}),0),s(y).trigger("buttons-popover.dt"),o.on("destroy.dtb-popover",h),setTimeout((function(){a=!1,s("body").on("click.dtb-collection",(function(n){if(!a){var e=s.fn.addBack?"addBack":"andSelf",o=s(n.target).parent()[0];(!s(n.target).parents()[e]().filter(t).length&&!s(o).hasClass("dt-buttons")||s(n.target).hasClass("dt-button-background"))&&h()}})).on("keyup.dtb-collection",(function(t){27===t.keyCode&&h()})).on("keydown.dtb-collection",(function(n){var e=s("a, button",t),o=document.activeElement;9===n.keyCode&&(-1===e.index(o)?(e.first().focus(),n.preventDefault()):n.shiftKey?o===e[0]&&(e.last().focus(),n.preventDefault()):o===e.last()[0]&&(e.first().focus(),n.preventDefault()))}))}),0)}else h()}}),p.background=function(t,n,e,o){void 0===e&&(e=400),o||(o=document.body),t?c(s("<div/>").addClass(n).css("display","none").insertAfter(o),e):d(s("div."+n),e,(function(){s(this).removeClass(n).remove()}))},p.instanceSelector=function(t,n){if(null==t)return s.map(n,(function(t){return t.inst}));var e=[],o=s.map(n,(function(t){return t.name})),i=function(t){if(Array.isArray(t))for(var a=0,r=t.length;a<r;a++)i(t[a]);else if("string"==typeof t)if(-1!==t.indexOf(","))i(t.split(","));else{var l=s.inArray(t.trim(),o);-1!==l&&e.push(n[l].inst)}else if("number"==typeof t)e.push(n[t].inst);else if("object"==typeof t&&t.nodeName)for(var u=0;u<n.length;u++)n[u].inst.dom.container[0]===t&&e.push(n[u].inst);else"object"==typeof t&&e.push(t)};return i(t),e},p.buttonSelector=function(t,n){for(var e=[],o=function(t,n,e){for(var i,s,a=0,r=n.length;a<r;a++)(i=n[a])&&(s=void 0!==e?e+a:a+"",t.push({node:i.node,name:i.conf.name,idx:s}),i.buttons&&o(t,i.buttons,s+"-"))},i=function(t,n){var a,r,l=[];o(l,n.s.buttons);var u=s.map(l,(function(t){return t.node}));if(Array.isArray(t)||t instanceof s)for(a=0,r=t.length;a<r;a++)i(t[a],n);else if(null==t||"*"===t)for(a=0,r=l.length;a<r;a++)e.push({inst:n,node:l[a].node});else if("number"==typeof t)n.s.buttons[t]&&e.push({inst:n,node:n.s.buttons[t].node});else if("string"==typeof t)if(-1!==t.indexOf(",")){var c=t.split(",");for(a=0,r=c.length;a<r;a++)i(c[a].trim(),n)}else if(t.match(/^\d+(\-\d+)*$/)){var d=s.map(l,(function(t){return t.idx}));e.push({inst:n,node:l[s.inArray(t,d)].node})}else if(-1!==t.indexOf(":name")){var f=t.replace(":name","");for(a=0,r=l.length;a<r;a++)l[a].name===f&&e.push({inst:n,node:l[a].node})}else s(u).filter(t).each((function(){e.push({inst:n,node:this})}));else if("object"==typeof t&&t.nodeName){var p=s.inArray(t,u);-1!==p&&e.push({inst:n,node:u[p]})}},a=0,r=t.length;a<r;a++){var l=t[a];i(n,l)}return e},p.stripData=function(t,n){return null!==t&&"object"==typeof t&&t.nodeName&&t.nodeType&&(t=t.innerHTML),"string"!=typeof t||(t=p.stripHtmlScript(t),t=p.stripHtmlComments(t),n&&!n.stripHtml||(t=i.default.util.stripHtml(t)),n&&!n.trim||(t=t.trim()),n&&!n.stripNewlines||(t=t.replace(/\n/g," ")),n&&!n.decodeEntities||(u?t=u(t):(v.innerHTML=t,t=v.value)),n&&!n.escapeExcelFormula||t.match(/^[=@\t\r]/)&&(t="'"+t)),t},p.entityDecoder=function(t){u=t},p.stripHtmlComments=function(t){var n;do{n=t,t=t.replace(/(<!--.*?--!?>)|(<!--[\S\s]+?--!?>)|(<!--[\S\s]*?$)/g,"")}while(t!==n);return t},p.stripHtmlScript=function(t){var n;do{n=t,t=t.replace(/<script\b[^<]*(?:(?!<\/script[^>]*>)<[^<]*)*<\/script[^>]*>/gi,"")}while(t!==n);return t},p.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{container:{className:"dt-button-collection",content:{className:"",tag:"div"},tag:"div"}},button:{tag:"button",className:"dt-button",active:"dt-button-active",disabled:"disabled",spacer:{className:"dt-button-spacer",tag:"span"},liner:{tag:"span",className:""},dropClass:"",dropHtml:'<span class="dt-button-down-arrow">▼</span>'},split:{action:{className:"dt-button-split-drop-button dt-button",tag:"button"},dropdown:{align:"split-right",className:"dt-button-split-drop",splitAlignClass:"dt-button-split-left",tag:"button"},wrapper:{className:"dt-button-split",tag:"div"}}}},p.version="3.2.6",s.extend(l,{collection:{text:function(t){return t.i18n("buttons.collection","Collection")},className:"buttons-collection",closeButton:!1,dropIcon:!0,init:function(t,n){n.attr("aria-expanded",!1)},action:function(t,n,e,o){o._collection.parents("body").length?this.popover(!1,o):this.popover(o._collection,o),"keypress"===t.type&&s("a, button",o._collection).eq(0).focus()},attr:{"aria-haspopup":"dialog"}},split:{text:function(t){return t.i18n("buttons.split","Split")},className:"buttons-split",closeButton:!1,init:function(t,n){return n.attr("aria-expanded",!1)},action:function(t,n,e,o){this.popover(o._collection,o)},attr:{"aria-haspopup":"dialog"}},copy:function(){if(l.copyHtml5)return"copyHtml5"},csv:function(t,n){if(l.csvHtml5&&l.csvHtml5.available(t,n))return"csvHtml5"},excel:function(t,n){if(l.excelHtml5&&l.excelHtml5.available(t,n))return"excelHtml5"},pdf:function(t,n){if(l.pdfHtml5&&l.pdfHtml5.available(t,n))return"pdfHtml5"},pageLength:function(t){var n=t.settings()[0].aLengthMenu,e=[],o=[];if(Array.isArray(n[0]))e=n[0],o=n[1];else for(var i=0;i<n.length;i++){var a=n[i];s.isPlainObject(a)?(e.push(a.value),o.push(a.label)):(e.push(a),o.push(a))}return{extend:"collection",text:function(t){return t.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},t.page.len())},className:"buttons-page-length",autoClose:!0,buttons:s.map(e,(function(t,n){return{text:o[n],className:"button-page-length",action:function(n,e){e.page.len(t).draw()},init:function(n,e,o){var i=this,s=function(){i.active(n.page.len()===t)};n.on("length.dt"+o.namespace,s),s()},destroy:function(t,n,e){t.off("length.dt"+e.namespace)}}})),init:function(t,n,e){var o=this;t.on("length.dt"+e.namespace,(function(){o.text(e.text)}))},destroy:function(t,n,e){t.off("length.dt"+e.namespace)}}},spacer:{style:"empty",spacer:!0,text:function(t){return t.i18n("buttons.spacer","")}}}),i.default.Api.register("buttons()",(function(t,n){void 0===n&&(n=t,t=void 0),this.selector.buttonGroup=t;var e=this.iterator(!0,"table",(function(e){if(e._buttons)return p.buttonSelector(p.instanceSelector(t,e._buttons),n)}),!0);return e._groupSelector=t,e})),i.default.Api.register("button()",(function(t,n){var e=this.buttons(t,n);return e.length>1&&e.splice(1,e.length),e})),i.default.Api.registerPlural("buttons().active()","button().active()",(function(t){return void 0===t?this.map((function(t){return t.inst.active(t.node)})):this.each((function(n){n.inst.active(n.node,t)}))})),i.default.Api.registerPlural("buttons().action()","button().action()",(function(t){return void 0===t?this.map((function(t){return t.inst.action(t.node)})):this.each((function(n){n.inst.action(n.node,t)}))})),i.default.Api.registerPlural("buttons().collectionRebuild()","button().collectionRebuild()",(function(t){return this.each((function(n){for(var e=0;e<t.length;e++)"object"==typeof t[e]&&(t[e].parentConf=n);n.inst.collectionRebuild(n.node,t)}))})),i.default.Api.register(["buttons().enable()","button().enable()"],(function(t){return this.each((function(n){n.inst.enable(n.node,t)}))})),i.default.Api.register(["buttons().disable()","button().disable()"],(function(){return this.each((function(t){t.inst.disable(t.node)}))})),i.default.Api.register("button().index()",(function(){var t=null;return this.each((function(n){var e=n.inst.index(n.node);null!==e&&(t=e)})),t})),i.default.Api.registerPlural("buttons().nodes()","button().node()",(function(){var t=s();return s(this.each((function(n){t=t.add(n.inst.node(n.node))}))),t})),i.default.Api.registerPlural("buttons().processing()","button().processing()",(function(t){return void 0===t?this.map((function(t){return t.inst.processing(t.node)})):this.each((function(n){n.inst.processing(n.node,t)}))})),i.default.Api.registerPlural("buttons().text()","button().text()",(function(t){return void 0===t?this.map((function(t){return t.inst.text(t.node)})):this.each((function(n){n.inst.text(n.node,t)}))})),i.default.Api.registerPlural("buttons().trigger()","button().trigger()",(function(){return this.each((function(t){t.inst.node(t.node).trigger("click")}))})),i.default.Api.register("button().popover()",(function(t,n){return this.map((function(e){return e.inst._popover(t,this.button(this[0].node),n)}))})),i.default.Api.register("buttons().containers()",(function(){var t=s(),n=this._groupSelector;return this.iterator(!0,"table",(function(e){if(e._buttons)for(var o=p.instanceSelector(n,e._buttons),i=0,s=o.length;i<s;i++)t=t.add(o[i].container())})),t})),i.default.Api.register("buttons().container()",(function(){return this.containers().eq(0)})),i.default.Api.register("button().add()",(function(t,n,e){var o,i=this.context;if(i.length){var s=p.instanceSelector(this._groupSelector,i[0]._buttons);s.length&&(o=s[0].add(n,t,e))}return o?this.button(this._groupSelector,o):this})),i.default.Api.register("buttons().destroy()",(function(){return this.pluck("inst").unique().each((function(t){t.destroy()})),this})),i.default.Api.registerPlural("buttons().remove()","buttons().remove()",(function(){return this.each((function(t){t.inst.remove(t.node)})),this})),i.default.Api.register("buttons.info()",(function(t,n,e){var o=this;return!1===t?(this.off("destroy.btn-info"),d(s("#datatables_buttons_info"),400,(function(){s(this).remove()})),clearTimeout(f),f=null,this):(f&&clearTimeout(f),s("#datatables_buttons_info").length&&s("#datatables_buttons_info").remove(),t=t?"<h2>"+t+"</h2>":"",c(s('<div id="datatables_buttons_info" class="dt-button-info"/>').html(t).append(s("<div/>")["string"==typeof n?"html":"append"](n)).css("display","none").appendTo("body")),void 0!==e&&0!==e&&(f=setTimeout((function(){o.buttons.info(!1)}),e)),this.on("destroy.btn-info",(function(){o.buttons.info(!1)})),this)})),i.default.Api.register("buttons.exportData()",(function(t){if(this.context.length)return y(new i.default.Api(this.context[0]),t)})),i.default.Api.register("buttons.exportInfo()",(function(t){return t||(t={}),{filename:h(t,this),title:g(t,this),messageTop:m(this,t,t.message||t.messageTop,"top"),messageBottom:m(this,t,t.messageBottom,"bottom")}}));var h=function(t,n){var e="*"===t.filename&&"*"!==t.title&&void 0!==t.title&&null!==t.title&&""!==t.title?t.title:t.filename;if("function"==typeof e&&(e=e(t,n)),null==e)return null;-1!==e.indexOf("*")&&(e=e.replace(/\*/g,s("head > title").text()).trim()),e=e.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,"");var o=b(t.extension,t,n);return o||(o=""),e+o},b=function(t,n,e){return null==t?null:"function"==typeof t?t(n,e):t},g=function(t,n){var e=b(t.title,t,n);return null===e?null:-1!==e.indexOf("*")?e.replace(/\*/g,s("head > title").text()||"Exported data"):e},m=function(t,n,e,o){var i=b(e,n,t);if(null===i)return null;var a=s("caption",t.table().container()).eq(0);return"*"===i?a.css("caption-side")!==o?null:a.length?a.text():"":i},v=s("<textarea/>")[0],y=function(t,n){var e=s.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,escapeExcelFormula:!1,trim:!0,format:{header:function(t){return p.stripData(t,e)},footer:function(t){return p.stripData(t,e)},body:function(t){return p.stripData(t,e)}},customizeData:null,customizeZip:null},n),o=t.columns(e.columns).indexes().map((function(n){var o=t.column(n);return e.format.header(o.title(),n,o.header())})).toArray(),i=t.table().footer()?t.columns(e.columns).indexes().map((function(n){var o=t.column(n).footer(),i="";if(o){var a=s(".dt-column-title",o);i=a.length?a.html():s(o).html()}return e.format.footer(i,n,o)})).toArray():null,a=s.extend({},e.modifier);t.select&&"function"==typeof t.select.info&&void 0===a.selected&&t.rows(e.rows,s.extend({selected:!0},a)).any()&&s.extend(a,{selected:!0});for(var r=t.rows(e.rows,a).indexes().toArray(),l=t.cells(r,e.columns,{order:a.order}),u=l.render(e.orthogonal).toArray(),c=l.nodes().toArray(),d=l.indexes().toArray(),f=t.columns(e.columns).count(),h=[],b=0,g=0,m=f>0?u.length/f:0;g<m;g++){for(var v=[f],y=0;y<f;y++)v[y]=e.format.body(u[b],d[b].row,d[b].column,c[b]),b++;h[g]=v}var C={header:o,headerStructure:x(e.format.header,t.table().header.structure(e.columns)),footer:i,footerStructure:x(e.format.footer,t.table().footer.structure(e.columns)),body:h};return e.customizeData&&e.customizeData(C),C};function x(t,n){for(var e=0;e<n.length;e++)for(var o=0;o<n[e].length;o++){var i=n[e][o];i&&(i.title=t(i.title,o,i.cell))}return n}function C(t,n){var e=new i.default.Api(t),o=n||e.init().buttons||i.default.defaults.buttons;return new p(e,o).container()}s.fn.dataTable.Buttons=p,s.fn.DataTable.Buttons=p,s(document).on("init.dt plugin-init.dt",(function(t,n){if("dt"===t.namespace){var e=n.oInit.buttons||i.default.defaults.buttons;e&&!n._buttons&&new p(n,e).container()}})),i.default.ext.feature.push({fnInit:C,cFeature:"B"}),i.default.feature&&i.default.feature.register("buttons",C);const w=i.default}}]); | |
| 1 | +"use strict";(globalThis.webpackChunkb_blocks=globalThis.webpackChunkb_blocks||[]).push([[7837],{7837(t,n,e){e.r(n),e.d(n,{default:()=>w});var o=e(428),i=e(5668);let s=o;var a=0,r=0,l=i.default.ext.buttons,u=null;function c(t,n,e){s.fn.animate?t.stop().fadeIn(n,e):(t.css("display","block"),e&&e.call(t))}function d(t,n,e){s.fn.animate?t.stop().fadeOut(n,e):(t.css("display","none"),e&&e.call(t))}var f,p=function(t,n){if(!i.default.versionCheck("2"))throw"Warning: Buttons requires DataTables 2 or newer";if(!(this instanceof p))return function(n){return new p(n,t).container()};void 0===n&&(n={}),!0===n&&(n={}),Array.isArray(n)&&(n={buttons:n}),this.c=s.extend(!0,{},p.defaults,n),n.buttons&&(this.c.buttons=n.buttons),this.s={dt:new i.default.Api(t),buttons:[],listenKeys:"",namespace:"dtb"+a++},this.dom={container:s("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)},this._constructor()};s.extend(p.prototype,{action:function(t,n){var e=this._nodeToButton(t);return void 0===n?e.conf.action:(e.conf.action=n,this)},active:function(t,n){var e=this._nodeToButton(t),o=this.c.dom.button.active,i=s(e.node);return e.inCollection&&this.c.dom.collection.button&&void 0!==this.c.dom.collection.button.active&&(o=this.c.dom.collection.button.active),void 0===n?i.hasClass(o):(i.toggleClass(o,void 0===n||n),this)},add:function(t,n,e){var o=this.s.buttons;if("string"==typeof n){for(var i=n.split("-"),s=this.s,a=0,r=i.length-1;a<r;a++)s=s.buttons[1*i[a]];o=s.buttons,n=1*i[i.length-1]}let l=this._expandButton(o,t,void 0!==t?t.split:void 0,(void 0===t||void 0===t.split||0===t.split.length)&&void 0!==s,!1,n);return void 0!==e&&!0!==e||this._draw(),l},collectionRebuild:function(t,n){var e=this._nodeToButton(t);if(void 0!==n){var o;for(o=e.buttons.length-1;o>=0;o--)this.remove(e.buttons[o].node);for(e.conf.prefixButtons&&n.unshift.apply(n,e.conf.prefixButtons),e.conf.postfixButtons&&n.push.apply(n,e.conf.postfixButtons),o=0;o<n.length;o++){var i=n[o];this._expandButton(e.buttons,i,void 0!==i&&void 0!==i.config&&void 0!==i.config.split,!0,void 0!==i.parentConf&&void 0!==i.parentConf.split,null,i.parentConf)}}this._draw(e.collection,e.buttons)},container:function(){return this.dom.container},disable:function(t){var n=this._nodeToButton(t);return n.isSplit?s(n.node.childNodes[0]).addClass(this.c.dom.button.disabled).prop("disabled",!0):s(n.node).addClass(this.c.dom.button.disabled).prop("disabled",!0),n.disabled=!0,this._checkSplitEnable(),this},destroy:function(){s("body").off("keyup."+this.s.namespace);var t,n,e=this.s.buttons.slice();for(t=0,n=e.length;t<n;t++)this.remove(e[t].node);this.dom.container.remove();var o=this.s.dt.settings()[0];for(t=0,n=o.length;t<n;t++)if(o.inst===this){o.splice(t,1);break}return this},enable:function(t,n){if(!1===n)return this.disable(t);var e=this._nodeToButton(t);return e.isSplit?s(e.node.childNodes[0]).removeClass(this.c.dom.button.disabled).prop("disabled",!1):s(e.node).removeClass(this.c.dom.button.disabled).prop("disabled",!1),e.disabled=!1,this._checkSplitEnable(),this},index:function(t,n,e){n||(n="",e=this.s.buttons);for(var o=0,i=e.length;o<i;o++){var s=e[o].buttons;if(e[o].node===t)return n+o;if(s&&s.length){var a=this.index(t,o+"-",s);if(null!==a)return a}}return null},name:function(){return this.c.name},node:function(t){if(!t)return this.dom.container;var n=this._nodeToButton(t);return s(n.node)},processing:function(t,n){var e=this.s.dt,o=this._nodeToButton(t);return void 0===n?s(o.node).hasClass("processing"):(s(o.node).toggleClass("processing",n),s(e.table().node()).triggerHandler("buttons-processing.dt",[n,e.button(t),e,s(t),o.conf]),this)},remove:function(t){var n=this._nodeToButton(t),e=this._nodeToHost(t),o=this.s.dt;if(n.buttons.length)for(var i=n.buttons.length-1;i>=0;i--)this.remove(n.buttons[i].node);n.conf.destroying=!0,n.conf.destroy&&n.conf.destroy.call(o.button(t),o,s(t),n.conf),this._removeKey(n.conf),s(n.node).remove(),n.inserter&&s(n.inserter).remove();var a=s.inArray(n,e);return e.splice(a,1),this},text:function(t,n){var e=this._nodeToButton(t),o=e.textNode,i=this.s.dt,a=s(e.node),r=function(t){return"function"==typeof t?t(i,a,e.conf):t};return void 0===n?r(e.conf.text):(e.conf.text=n,o.html(r(n)),this)},_constructor:function(){var t=this,n=this.s.dt,e=n.settings()[0],o=this.c.buttons;e._buttons||(e._buttons=[]),e._buttons.push({inst:this,name:this.c.name});for(var i=0,a=o.length;i<a;i++)this.add(o[i]);n.on("destroy",(function(n,o){o===e&&t.destroy()})),s("body").on("keyup."+this.s.namespace,(function(n){if(!document.activeElement||document.activeElement===document.body){var e=String.fromCharCode(n.keyCode).toLowerCase();-1!==t.s.listenKeys.toLowerCase().indexOf(e)&&t._keypress(e,n)}}))},_addKey:function(t){t.key&&(this.s.listenKeys+=s.isPlainObject(t.key)?t.key.key:t.key)},_draw:function(t,n){t||(t=this.dom.container,n=this.s.buttons),t.children().detach();for(var e=0,o=n.length;e<o;e++)t.append(n[e].inserter),t.append(" "),n[e].buttons&&n[e].buttons.length&&this._draw(n[e].collection,n[e].buttons)},_expandButton:function(t,n,e,o,i,a,r){var l,u=this.s.dt,c=!1,d=this.c.dom.collection,f=Array.isArray(n)?n:[n];void 0===n&&(f=Array.isArray(e)?e:[e]);for(var p=0,h=f.length;p<h;p++){var b=this._resolveExtends(f[p]);if(b)if(c=!(!b.config||!b.config.split),Array.isArray(b))this._expandButton(t,b,void 0!==g&&void 0!==g.conf?g.conf.split:void 0,o,void 0!==r&&void 0!==r.split,a,r);else{var g=this._buildButton(b,o,void 0!==b.split||void 0!==b.config&&void 0!==b.config.split,i);if(g){if(null!=a?(t.splice(a,0,g),a++):t.push(g),g.conf.dropIcon&&!g.conf.split&&s(g.node).addClass(this.c.dom.button.dropClass).append(this.c.dom.button.dropHtml),g.conf.buttons&&(g.collection=s("<"+d.container.content.tag+"/>"),g.conf._collection=g.collection,this._expandButton(g.buttons,g.conf.buttons,g.conf.split,!c,c,a,g.conf)),g.conf.split){g.collection=s("<"+d.container.tag+"/>"),g.conf._collection=g.collection;for(var m=0;m<g.conf.split.length;m++){var v=g.conf.split[m];"object"==typeof v&&(v.parent=r,void 0===v.collectionLayout&&(v.collectionLayout=g.conf.collectionLayout),void 0===v.dropup&&(v.dropup=g.conf.dropup),void 0===v.fade&&(v.fade=g.conf.fade))}this._expandButton(g.buttons,g.conf.buttons,g.conf.split,!c,c,a,g.conf)}g.conf.parent=r,b.init&&b.init.call(u.button(g.node),u,s(g.node),b),l=g.node}}}return l},_buildButton:function(t,n,e,o){var i,a,u=this,c=this.c.dom,d=this.s.dt,f=!1,p=function(n){return"function"==typeof n?n(d,a,t):n},h=s.extend(!0,{},c.button);if(n&&e&&c.collection.split?s.extend(!0,h,c.collection.split.action):o||n?s.extend(!0,h,c.collection.button):e&&s.extend(!0,h,c.split.button),t.spacer){var b=s("<"+h.spacer.tag+"/>").addClass("dt-button-spacer "+t.style+" "+h.spacer.className).html(p(t.text));return{conf:t,node:b,nodeChild:null,inserter:b,buttons:[],inCollection:n,isSplit:e,collection:null,textNode:b}}if(t.available&&!t.available(d,t)&&!t.html)return!1;if(t.html)a=s(t.html);else{var g=function(t,n,e,o,i){o.action.call(n.button(e),t,n,e,o,i),s(n.table().node()).triggerHandler("buttons-action.dt",[n.button(e),n,e,o])},m=function(t,n,e,o){o.async?(u.processing(e[0],!0),setTimeout((function(){g(t,n,e,o,(function(){u.processing(e[0],!1)}))}),o.async)):g(t,n,e,o,(function(){}))},v=t.tag||h.tag,y=void 0===t.clickBlurs||t.clickBlurs;if(a=s("<"+v+"/>").addClass(h.className).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",(function(n){n.preventDefault(),!a.hasClass(h.disabled)&&t.action&&m(n,d,a,t),y&&a.trigger("blur")})).on("keypress.dtb",(function(n){13===n.keyCode&&(n.preventDefault(),!a.hasClass(h.disabled)&&t.action&&m(n,d,a,t))})),"a"===v.toLowerCase()&&a.attr("href","#"),"button"===v.toLowerCase()&&a.attr("type","button"),h.liner.tag){var x=h.liner.tag.toLowerCase(),C=s("<"+x+"/>").html(p(t.text)).addClass(h.liner.className);"a"===x&&C.attr("href","#"),"a"!==x&&"button"!==x||(C.attr("tabindex",this.s.dt.settings()[0].iTabIndex),f=!0),a.append(C),i=C}else a.html(p(t.text)),i=a | |
| 2 | +;f||a.attr("tabindex",this.s.dt.settings()[0].iTabIndex),!1===t.enabled&&a.addClass(h.disabled),t.className&&a.addClass(t.className),t.titleAttr&&a.attr("title",p(t.titleAttr)),t.attr&&a.attr(t.attr),t.namespace||(t.namespace=".dt-button-"+r++),void 0!==t.config&&t.config.split&&(t.split=t.config.split)}var w,_,k=this.c.dom.buttonContainer;if(w=k&&k.tag?s("<"+k.tag+"/>").addClass(k.className).append(a):a,this._addKey(t),this.c.buttonCreated&&(w=this.c.buttonCreated(t,w)),e){var A=n?s.extend(!0,this.c.dom.split,this.c.dom.collection.split):this.c.dom.split,N=A.wrapper;_=s("<"+N.tag+"/>").addClass(N.className).append(a);var T=s.extend(t,{autoClose:!0,align:A.dropdown.align,attr:{"aria-haspopup":"dialog","aria-expanded":!1},className:A.dropdown.className,closeButton:!1,splitAlignClass:A.dropdown.splitAlignClass,text:A.dropdown.text});this._addKey(T);var B=function(t,n,e,o){l.split.action.call(n.button(_),t,n,e,o),s(n.table().node()).triggerHandler("buttons-action.dt",[n.button(e),n,e,o]),e.attr("aria-expanded",!0)},H=s('<button class="'+A.dropdown.className+' dt-button"></button>').html(this.c.dom.button.dropHtml).addClass(this.c.dom.button.dropClass).on("click.dtb",(function(t){t.preventDefault(),t.stopPropagation(),H.hasClass(h.disabled)||B(t,d,H,T),y&&H.trigger("blur")})).on("keypress.dtb",(function(t){13===t.keyCode&&(t.preventDefault(),H.hasClass(h.disabled)||B(t,d,H,T))}));0===t.split.length&&H.addClass("dtb-hide-drop"),_.append(H).attr(T.attr)}var S=e?_.get(0):a.get(0);return{conf:t,node:S,nodeChild:S&&S.children&&S.children.length?S.children[0]:null,inserter:e?_:w,buttons:[],inCollection:n,isSplit:e,inSplit:o,collection:null,textNode:i}},_checkSplitEnable:function(t){t||(t=this.s.buttons);for(var n=0;n<t.length;n++){var e=t[n];if(e.isSplit){var o=e.node.childNodes[1];this._checkAnyEnabled(e.buttons)?s(o).removeClass(this.c.dom.button.disabled).prop("disabled",!1):s(o).addClass(this.c.dom.button.disabled).prop("disabled",!1)}else e.isCollection&&this._checkSplitEnable(e.buttons)}},_checkAnyEnabled:function(t){for(var n=0;n<t.length;n++)if(!t[n].disabled)return!0;return!1},_nodeToButton:function(t,n){n||(n=this.s.buttons);for(var e=0,o=n.length;e<o;e++){if(n[e].node===t||n[e].nodeChild===t)return n[e];if(n[e].buttons.length){var i=this._nodeToButton(t,n[e].buttons);if(i)return i}}},_nodeToHost:function(t,n){n||(n=this.s.buttons);for(var e=0,o=n.length;e<o;e++){if(n[e].node===t)return n;if(n[e].buttons.length){var i=this._nodeToHost(t,n[e].buttons);if(i)return i}}},_keypress:function(t,n){if(!n._buttonsHandled){var e=function(e,o){if(e.key)if(e.key===t)n._buttonsHandled=!0,s(o).click();else if(s.isPlainObject(e.key)){if(e.key.key!==t)return;if(e.key.shiftKey&&!n.shiftKey)return;if(e.key.altKey&&!n.altKey)return;if(e.key.ctrlKey&&!n.ctrlKey)return;if(e.key.metaKey&&!n.metaKey)return;n._buttonsHandled=!0,s(o).click()}},o=function(t){for(var n=0,i=t.length;n<i;n++)e(t[n].conf,t[n].node),t[n].buttons.length&&o(t[n].buttons)};o(this.s.buttons)}},_removeKey:function(t){if(t.key){var n=s.isPlainObject(t.key)?t.key.key:t.key,e=this.s.listenKeys.split(""),o=s.inArray(n,e);e.splice(o,1),this.s.listenKeys=e.join("")}},_resolveExtends:function(t){var n,e,o=this,i=this.s.dt,a=function(n){for(var e=0;!s.isPlainObject(n)&&!Array.isArray(n);){if(void 0===n)return;if("function"==typeof n){if(!(n=n.call(o,i,t)))return!1}else if("string"==typeof n){if(!l[n])return{html:n};n=l[n]}if(++e>30)throw"Buttons: Too many iterations"}return Array.isArray(n)?n:s.extend({},n)};for(t=a(t);t&&t.extend;){if(!l[t.extend])throw"Cannot extend unknown button type: "+t.extend;var r=a(l[t.extend]);if(Array.isArray(r))return r;if(!r)return!1;var u=r.className;void 0!==t.config&&void 0!==r.config&&(t.config=s.extend({},r.config,t.config)),t=s.extend({},r,t),u&&t.className!==u&&(t.className=u+" "+t.className),t.extend=r.extend}var c=t.postfixButtons;if(c)for(t.buttons||(t.buttons=[]),n=0,e=c.length;n<e;n++)t.buttons.push(c[n]);var d=t.prefixButtons;if(d)for(t.buttons||(t.buttons=[]),n=0,e=d.length;n<e;n++)t.buttons.splice(n,0,d[n]);return t},_popover:function(t,n,e){var o=n,i=this.c,a=!1,r=s.extend({align:"button-left",autoClose:!1,background:!0,backgroundClassName:"dt-button-background",closeButton:!0,containerClassName:i.dom.collection.container.className,contentClassName:i.dom.collection.container.content.className,collectionLayout:"",collectionTitle:"",dropup:!1,fade:400,popoverTitle:"",rightAlignClassName:"dt-button-right",tag:i.dom.collection.container.tag},e),l=r.tag+"."+r.containerClassName.replace(/ /g,"."),u=n.node(),f=r.collectionLayout.includes("fixed")?s("body"):n.node(),h=function(){a=!0,d(s(l),r.fade,(function(){s(this).detach()})),s(o.buttons('[aria-haspopup="dialog"][aria-expanded="true"]').nodes()).attr("aria-expanded","false"),s("div.dt-button-background").off("click.dtb-collection"),p.background(!1,r.backgroundClassName,r.fade,f),s(window).off("resize.resize.dtb-collection"),s("body").off(".dtb-collection"),o.off("buttons-action.b-internal"),o.off("destroy.dtb-popover"),s("body").trigger("buttons-popover-hide.dt")};if(!1!==t){var b=s(o.buttons('[aria-haspopup="dialog"][aria-expanded="true"]').nodes());if(b.length&&(f.closest(l).length&&(f=b.eq(0)),h()),r.sort){var g=s("button",t).map((function(t,n){return{text:s(n).text(),el:n}})).toArray();g.sort((function(t,n){return t.text.localeCompare(n.text)})),s(t).append(g.map((function(t){return t.el})))}var m=s(".dt-button",t).length,v="";3===m?v="dtb-b3":2===m?v="dtb-b2":1===m&&(v="dtb-b1");var y=s("<"+r.tag+"/>").addClass(r.containerClassName).addClass(r.collectionLayout).addClass(r.splitAlignClass).addClass(v).css("display","none").attr({"aria-modal":!0,role:"dialog"});t=s(t).addClass(r.contentClassName).attr("role","menu").appendTo(y),u.attr("aria-expanded","true"),f.parents("body")[0]!==document.body&&(f=s(document.body).children("div, section, p").last()),r.popoverTitle?y.prepend('<div class="dt-button-collection-title">'+r.popoverTitle+"</div>"):r.collectionTitle&&y.prepend('<div class="dt-button-collection-title">'+r.collectionTitle+"</div>"),r.closeButton&&y.prepend('<div class="dtb-popover-close">×</div>').addClass("dtb-collection-closeable"),c(y.insertAfter(f),r.fade);var x=s(n.table().container()),C=y.css("position");if("container"!==r.span&&"dt-container"!==r.align||(f=f.parent(),y.css("width",x.width())),"absolute"===C){var w=s(f[0].offsetParent),_=f.position(),k=f.offset(),A=w.offset(),N=w.position(),T=window.getComputedStyle(w[0]);A.height=w.outerHeight(),A.width=w.width()+parseFloat(T.paddingLeft),A.right=A.left+A.width,A.bottom=A.top+A.height;var B=_.top+f.outerHeight(),H=_.left;y.css({top:B,left:H}),T=window.getComputedStyle(y[0]);var S=y.offset();S.height=y.outerHeight(),S.width=y.outerWidth(),S.right=S.left+S.width,S.bottom=S.top+S.height,S.marginTop=parseFloat(T.marginTop),S.marginBottom=parseFloat(T.marginBottom),r.dropup&&(B=_.top-S.height-S.marginTop-S.marginBottom),("button-right"===r.align||y.hasClass(r.rightAlignClassName))&&(H=_.left-S.width+f.outerWidth()),"dt-container"!==r.align&&"container"!==r.align||H<_.left&&(H=-_.left),N.left+H+S.width>s(window).width()&&(H=s(window).width()-S.width-N.left),k.left+H<0&&(H=-k.left),N.top+B+S.height>s(window).height()+s(window).scrollTop()&&(B=_.top-S.height-S.marginTop-S.marginBottom),w.offset().top+B<s(window).scrollTop()&&(B=_.top+f.outerHeight()),y.css({top:B,left:H})}else{var K=function(){var t=s(window).height()/2,n=y.height()/2;n>t&&(n=t),y.css("marginTop",-1*n)};K(),s(window).on("resize.dtb-collection",(function(){K()}))}r.background&&p.background(!0,r.backgroundClassName,r.fade,r.backgroundHost||f),s("div.dt-button-background").on("click.dtb-collection",(function(){})),r.autoClose&&setTimeout((function(){o.on("buttons-action.b-internal",(function(t,n,e,o){o[0]!==f[0]&&h()}))}),0),s(y).trigger("buttons-popover.dt"),o.on("destroy.dtb-popover",h),setTimeout((function(){a=!1,s("body").on("click.dtb-collection",(function(n){if(!a){ | |
| 3 | +var e=s.fn.addBack?"addBack":"andSelf",o=s(n.target).parent()[0];(!s(n.target).parents()[e]().filter(t).length&&!s(o).hasClass("dt-buttons")||s(n.target).hasClass("dt-button-background"))&&h()}})).on("keyup.dtb-collection",(function(t){27===t.keyCode&&h()})).on("keydown.dtb-collection",(function(n){var e=s("a, button",t),o=document.activeElement;9===n.keyCode&&(-1===e.index(o)?(e.first().focus(),n.preventDefault()):n.shiftKey?o===e[0]&&(e.last().focus(),n.preventDefault()):o===e.last()[0]&&(e.first().focus(),n.preventDefault()))}))}),0)}else h()}}),p.background=function(t,n,e,o){void 0===e&&(e=400),o||(o=document.body),t?c(s("<div/>").addClass(n).css("display","none").insertAfter(o),e):d(s("div."+n),e,(function(){s(this).removeClass(n).remove()}))},p.instanceSelector=function(t,n){if(null==t)return s.map(n,(function(t){return t.inst}));var e=[],o=s.map(n,(function(t){return t.name})),i=function(t){if(Array.isArray(t))for(var a=0,r=t.length;a<r;a++)i(t[a]);else if("string"==typeof t)if(-1!==t.indexOf(","))i(t.split(","));else{var l=s.inArray(t.trim(),o);-1!==l&&e.push(n[l].inst)}else if("number"==typeof t)e.push(n[t].inst);else if("object"==typeof t&&t.nodeName)for(var u=0;u<n.length;u++)n[u].inst.dom.container[0]===t&&e.push(n[u].inst);else"object"==typeof t&&e.push(t)};return i(t),e},p.buttonSelector=function(t,n){for(var e=[],o=function(t,n,e){for(var i,s,a=0,r=n.length;a<r;a++)(i=n[a])&&(s=void 0!==e?e+a:a+"",t.push({node:i.node,name:i.conf.name,idx:s}),i.buttons&&o(t,i.buttons,s+"-"))},i=function(t,n){var a,r,l=[];o(l,n.s.buttons);var u=s.map(l,(function(t){return t.node}));if(Array.isArray(t)||t instanceof s)for(a=0,r=t.length;a<r;a++)i(t[a],n);else if(null==t||"*"===t)for(a=0,r=l.length;a<r;a++)e.push({inst:n,node:l[a].node});else if("number"==typeof t)n.s.buttons[t]&&e.push({inst:n,node:n.s.buttons[t].node});else if("string"==typeof t)if(-1!==t.indexOf(",")){var c=t.split(",");for(a=0,r=c.length;a<r;a++)i(c[a].trim(),n)}else if(t.match(/^\d+(\-\d+)*$/)){var d=s.map(l,(function(t){return t.idx}));e.push({inst:n,node:l[s.inArray(t,d)].node})}else if(-1!==t.indexOf(":name")){var f=t.replace(":name","");for(a=0,r=l.length;a<r;a++)l[a].name===f&&e.push({inst:n,node:l[a].node})}else s(u).filter(t).each((function(){e.push({inst:n,node:this})}));else if("object"==typeof t&&t.nodeName){var p=s.inArray(t,u);-1!==p&&e.push({inst:n,node:u[p]})}},a=0,r=t.length;a<r;a++){var l=t[a];i(n,l)}return e},p.stripData=function(t,n){return null!==t&&"object"==typeof t&&t.nodeName&&t.nodeType&&(t=t.innerHTML),"string"!=typeof t||(t=p.stripHtmlScript(t),t=p.stripHtmlComments(t),n&&!n.stripHtml||(t=i.default.util.stripHtml(t)),n&&!n.trim||(t=t.trim()),n&&!n.stripNewlines||(t=t.replace(/\n/g," ")),n&&!n.decodeEntities||(u?t=u(t):(v.innerHTML=t,t=v.value)),n&&!n.escapeExcelFormula||t.match(/^[=@\t\r]/)&&(t="'"+t)),t},p.entityDecoder=function(t){u=t},p.stripHtmlComments=function(t){var n;do{n=t,t=t.replace(/(<!--.*?--!?>)|(<!--[\S\s]+?--!?>)|(<!--[\S\s]*?$)/g,"")}while(t!==n);return t},p.stripHtmlScript=function(t){var n;do{n=t,t=t.replace(/<script\b[^<]*(?:(?!<\/script[^>]*>)<[^<]*)*<\/script[^>]*>/gi,"")}while(t!==n);return t},p.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{container:{className:"dt-button-collection",content:{className:"",tag:"div"},tag:"div"}},button:{tag:"button",className:"dt-button",active:"dt-button-active",disabled:"disabled",spacer:{className:"dt-button-spacer",tag:"span"},liner:{tag:"span",className:""},dropClass:"",dropHtml:'<span class="dt-button-down-arrow">▼</span>'},split:{action:{className:"dt-button-split-drop-button dt-button",tag:"button"},dropdown:{align:"split-right",className:"dt-button-split-drop",splitAlignClass:"dt-button-split-left",tag:"button"},wrapper:{className:"dt-button-split",tag:"div"}}}},p.version="3.2.6",s.extend(l,{collection:{text:function(t){return t.i18n("buttons.collection","Collection")},className:"buttons-collection",closeButton:!1,dropIcon:!0,init:function(t,n){n.attr("aria-expanded",!1)},action:function(t,n,e,o){o._collection.parents("body").length?this.popover(!1,o):this.popover(o._collection,o),"keypress"===t.type&&s("a, button",o._collection).eq(0).focus()},attr:{"aria-haspopup":"dialog"}},split:{text:function(t){return t.i18n("buttons.split","Split")},className:"buttons-split",closeButton:!1,init:function(t,n){return n.attr("aria-expanded",!1)},action:function(t,n,e,o){this.popover(o._collection,o)},attr:{"aria-haspopup":"dialog"}},copy:function(){if(l.copyHtml5)return"copyHtml5"},csv:function(t,n){if(l.csvHtml5&&l.csvHtml5.available(t,n))return"csvHtml5"},excel:function(t,n){if(l.excelHtml5&&l.excelHtml5.available(t,n))return"excelHtml5"},pdf:function(t,n){if(l.pdfHtml5&&l.pdfHtml5.available(t,n))return"pdfHtml5"},pageLength:function(t){var n=t.settings()[0].aLengthMenu,e=[],o=[];if(Array.isArray(n[0]))e=n[0],o=n[1];else for(var i=0;i<n.length;i++){var a=n[i];s.isPlainObject(a)?(e.push(a.value),o.push(a.label)):(e.push(a),o.push(a))}return{extend:"collection",text:function(t){return t.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},t.page.len())},className:"buttons-page-length",autoClose:!0,buttons:s.map(e,(function(t,n){return{text:o[n],className:"button-page-length",action:function(n,e){e.page.len(t).draw()},init:function(n,e,o){var i=this,s=function(){i.active(n.page.len()===t)};n.on("length.dt"+o.namespace,s),s()},destroy:function(t,n,e){t.off("length.dt"+e.namespace)}}})),init:function(t,n,e){var o=this;t.on("length.dt"+e.namespace,(function(){o.text(e.text)}))},destroy:function(t,n,e){t.off("length.dt"+e.namespace)}}},spacer:{style:"empty",spacer:!0,text:function(t){return t.i18n("buttons.spacer","")}}}),i.default.Api.register("buttons()",(function(t,n){void 0===n&&(n=t,t=void 0),this.selector.buttonGroup=t;var e=this.iterator(!0,"table",(function(e){if(e._buttons)return p.buttonSelector(p.instanceSelector(t,e._buttons),n)}),!0);return e._groupSelector=t,e})),i.default.Api.register("button()",(function(t,n){var e=this.buttons(t,n);return e.length>1&&e.splice(1,e.length),e})),i.default.Api.registerPlural("buttons().active()","button().active()",(function(t){return void 0===t?this.map((function(t){return t.inst.active(t.node)})):this.each((function(n){n.inst.active(n.node,t)}))})),i.default.Api.registerPlural("buttons().action()","button().action()",(function(t){return void 0===t?this.map((function(t){return t.inst.action(t.node)})):this.each((function(n){n.inst.action(n.node,t)}))})),i.default.Api.registerPlural("buttons().collectionRebuild()","button().collectionRebuild()",(function(t){return this.each((function(n){for(var e=0;e<t.length;e++)"object"==typeof t[e]&&(t[e].parentConf=n);n.inst.collectionRebuild(n.node,t)}))})),i.default.Api.register(["buttons().enable()","button().enable()"],(function(t){return this.each((function(n){n.inst.enable(n.node,t)}))})),i.default.Api.register(["buttons().disable()","button().disable()"],(function(){return this.each((function(t){t.inst.disable(t.node)}))})),i.default.Api.register("button().index()",(function(){var t=null;return this.each((function(n){var e=n.inst.index(n.node);null!==e&&(t=e)})),t})),i.default.Api.registerPlural("buttons().nodes()","button().node()",(function(){var t=s();return s(this.each((function(n){t=t.add(n.inst.node(n.node))}))),t})),i.default.Api.registerPlural("buttons().processing()","button().processing()",(function(t){return void 0===t?this.map((function(t){return t.inst.processing(t.node)})):this.each((function(n){n.inst.processing(n.node,t)}))})),i.default.Api.registerPlural("buttons().text()","button().text()",(function(t){return void 0===t?this.map((function(t){return t.inst.text(t.node)})):this.each((function(n){n.inst.text(n.node,t)}))})),i.default.Api.registerPlural("buttons().trigger()","button().trigger()",(function(){return this.each((function(t){t.inst.node(t.node).trigger("click")}))})), | |
| 4 | +i.default.Api.register("button().popover()",(function(t,n){return this.map((function(e){return e.inst._popover(t,this.button(this[0].node),n)}))})),i.default.Api.register("buttons().containers()",(function(){var t=s(),n=this._groupSelector;return this.iterator(!0,"table",(function(e){if(e._buttons)for(var o=p.instanceSelector(n,e._buttons),i=0,s=o.length;i<s;i++)t=t.add(o[i].container())})),t})),i.default.Api.register("buttons().container()",(function(){return this.containers().eq(0)})),i.default.Api.register("button().add()",(function(t,n,e){var o,i=this.context;if(i.length){var s=p.instanceSelector(this._groupSelector,i[0]._buttons);s.length&&(o=s[0].add(n,t,e))}return o?this.button(this._groupSelector,o):this})),i.default.Api.register("buttons().destroy()",(function(){return this.pluck("inst").unique().each((function(t){t.destroy()})),this})),i.default.Api.registerPlural("buttons().remove()","buttons().remove()",(function(){return this.each((function(t){t.inst.remove(t.node)})),this})),i.default.Api.register("buttons.info()",(function(t,n,e){var o=this;return!1===t?(this.off("destroy.btn-info"),d(s("#datatables_buttons_info"),400,(function(){s(this).remove()})),clearTimeout(f),f=null,this):(f&&clearTimeout(f),s("#datatables_buttons_info").length&&s("#datatables_buttons_info").remove(),t=t?"<h2>"+t+"</h2>":"",c(s('<div id="datatables_buttons_info" class="dt-button-info"/>').html(t).append(s("<div/>")["string"==typeof n?"html":"append"](n)).css("display","none").appendTo("body")),void 0!==e&&0!==e&&(f=setTimeout((function(){o.buttons.info(!1)}),e)),this.on("destroy.btn-info",(function(){o.buttons.info(!1)})),this)})),i.default.Api.register("buttons.exportData()",(function(t){if(this.context.length)return y(new i.default.Api(this.context[0]),t)})),i.default.Api.register("buttons.exportInfo()",(function(t){return t||(t={}),{filename:h(t,this),title:g(t,this),messageTop:m(this,t,t.message||t.messageTop,"top"),messageBottom:m(this,t,t.messageBottom,"bottom")}}));var h=function(t,n){var e="*"===t.filename&&"*"!==t.title&&void 0!==t.title&&null!==t.title&&""!==t.title?t.title:t.filename;if("function"==typeof e&&(e=e(t,n)),null==e)return null;-1!==e.indexOf("*")&&(e=e.replace(/\*/g,s("head > title").text()).trim()),e=e.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,"");var o=b(t.extension,t,n);return o||(o=""),e+o},b=function(t,n,e){return null==t?null:"function"==typeof t?t(n,e):t},g=function(t,n){var e=b(t.title,t,n);return null===e?null:-1!==e.indexOf("*")?e.replace(/\*/g,s("head > title").text()||"Exported data"):e},m=function(t,n,e,o){var i=b(e,n,t);if(null===i)return null;var a=s("caption",t.table().container()).eq(0);return"*"===i?a.css("caption-side")!==o?null:a.length?a.text():"":i},v=s("<textarea/>")[0],y=function(t,n){var e=s.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,escapeExcelFormula:!1,trim:!0,format:{header:function(t){return p.stripData(t,e)},footer:function(t){return p.stripData(t,e)},body:function(t){return p.stripData(t,e)}},customizeData:null,customizeZip:null},n),o=t.columns(e.columns).indexes().map((function(n){var o=t.column(n);return e.format.header(o.title(),n,o.header())})).toArray(),i=t.table().footer()?t.columns(e.columns).indexes().map((function(n){var o=t.column(n).footer(),i="";if(o){var a=s(".dt-column-title",o);i=a.length?a.html():s(o).html()}return e.format.footer(i,n,o)})).toArray():null,a=s.extend({},e.modifier);t.select&&"function"==typeof t.select.info&&void 0===a.selected&&t.rows(e.rows,s.extend({selected:!0},a)).any()&&s.extend(a,{selected:!0});for(var r=t.rows(e.rows,a).indexes().toArray(),l=t.cells(r,e.columns,{order:a.order}),u=l.render(e.orthogonal).toArray(),c=l.nodes().toArray(),d=l.indexes().toArray(),f=t.columns(e.columns).count(),h=[],b=0,g=0,m=f>0?u.length/f:0;g<m;g++){for(var v=[f],y=0;y<f;y++)v[y]=e.format.body(u[b],d[b].row,d[b].column,c[b]),b++;h[g]=v}var C={header:o,headerStructure:x(e.format.header,t.table().header.structure(e.columns)),footer:i,footerStructure:x(e.format.footer,t.table().footer.structure(e.columns)),body:h};return e.customizeData&&e.customizeData(C),C};function x(t,n){for(var e=0;e<n.length;e++)for(var o=0;o<n[e].length;o++){var i=n[e][o];i&&(i.title=t(i.title,o,i.cell))}return n}function C(t,n){var e=new i.default.Api(t),o=n||e.init().buttons||i.default.defaults.buttons;return new p(e,o).container()}s.fn.dataTable.Buttons=p,s.fn.DataTable.Buttons=p,s(document).on("init.dt plugin-init.dt",(function(t,n){if("dt"===t.namespace){var e=n.oInit.buttons||i.default.defaults.buttons;e&&!n._buttons&&new p(n,e).container()}})),i.default.ext.feature.push({fnInit:C,cFeature:"B"}),i.default.feature&&i.default.feature.register("buttons",C);const w=i.default}}]); | |